[asterisk-users] [help] Realtime Swich any context dinamically

Atis Lezdins atis at iq-labs.net
Tue Oct 21 06:27:04 CDT 2008


On Tue, Oct 21, 2008 at 1:46 PM, morteza kashani <kashanii at yahoo.com> wrote:
> when i wnat to working with realtime and mysql
> for any context i have to insert (switch => Realtiem/context at extensions)
> statment into extensions.conf
>
> for example if i want to have 10 context, i have to insert these lines into
> extension.conf :
>
> [context1]
> switch => Realtiem/context1 at extensions
>
> [context2]
> switch => Realtiem/context2 at extensions
>
> [context3]
> switch => Realtiem/context3 at extensions
>
> ................
>
> ................
>
> i want to switch these 10 context whithout insert these 10 lines ....
>
> how can  i switch any context to real time dinamically ?
>

Hello,

short answer is - you can't.

If you really need lot of contexts added, you can place a #exec line
in your dialplan, write a script that would do "SELECT DISTINCT
context FROM extensions_table" and for each of results print out
"switch=>" lines. However you would need to issue "dialplan reload" or
AEL reload whenever you add a context.

Regards,
Atis

P.S.
try to not post twice :)

-- 
Atis Lezdins,
VoIP Project Manager / Developer,
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835



More information about the asterisk-users mailing list