[asterisk-users] Conditional include=> ?

Philipp Kempgen philipp.kempgen at amooma.de
Tue Apr 22 04:55:33 CDT 2008


Steve Davies schrieb:

> Does anyone have a clever method of doing a conditional "include =>"
> line in the dialplan?
> 
> I want to include a bunch of standard contexts, but in the middle of
> the bunch have one or more conditionally included, a bit like:
> 
> [default]
> include => start-here
> include => then-here
> if $[{COMPANY} = A]
>     include => company-A
> endif
> if $[{COMPANY} = B]
>     include => company-B
> endif
> if $[{COMPANY} = C]
>     include => company-C
> endif
> include => end-here
> 
> 
> The list of conditional variables, and of static includes is
> potentially large, so I do not want to create several separate sets of
> contexts with lots of repetition as it is likely to get out-of-control
> very quickly.

I suppose #ifdefs and a preprocessor like cpp is not what you're
looking for? You didn't make clear at what stage you want these
includes to be replaced / evaluated. I guess you want Asterisk to
do it.

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
    Let's use IT to solve problems and not to create new ones.
          Asterisk? -> http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998



More information about the asterisk-users mailing list