[asterisk-users] re-writing the dial plan - some hints please

Ronald Wiplinger ronald at elmit.com
Tue Aug 22 05:02:47 MST 2006


My dialplan grew over the last months and I want to restructure it. What 
hints do you have for me?

There are some points I want to do, but none of my tests worked.

I use realtime, and have there a field called key, which can have 
several flags.
E.g. a flag if the user is allowed to use a conference room, can call 
long distance, can call overseas, can call local pstn, different 
tariffs, ....

I tried something like:
[test-key]
exten => _.,1,NoOp(variable key is ${key})
exten => _.,2,Set(flag_int =${CUT(key,,1)})
exten => _.,3,Set(tarif=${CUT(key,,2)})
exten => _.,4,NoOP(flag_int is ${flag_int} and tarif is ${tarif})

and wanted to use this variables in the next context, by using include 
statments, but it did not work.

[caller]
include => test-key
include => A
include => B
...



The idea was to set at each entrance point first all flags and 
variables. Than I can use a common dialplan.
If a flag is set, than I could include another context. Unfortunately 
there is no IF()include. I might be able to set a jump in each context 
to the end if the flag is not set.

Any idea how I can do that?
Any ideas of structuring the dialplan more efficiently?

bye

Ronald





More information about the asterisk-users mailing list