[asterisk-users] Include and Realtime

Jonathan Thurman jonathan at thurmantech.com
Tue Aug 24 21:09:25 CDT 2010


On Tue, Aug 24, 2010 at 5:48 AM, Dan Journo
<dan at keshercommunications.com> wrote:
> Hi,
>
> I think I already know the answer to this question, but is there any way to
> do the following using realtime? Or do I have to create a full dialplan for
> each client without using includes?

One way that I know works, as I used it on 1.6.2 is to create the
contexts like you have listed below with all of the includes, then
create a dummy context for each one using Realtime.  For example,
expanding on your existing Client1_phones context you could add:

> [client1_phones]
> include => client1_internal
> include => client1_outgoing_calls
> include => test_calls
> include => parkedcalls

[client1_internal]
switch => Realtime

[client1_outgoing_calls]
switch => Realtime

You would have to create the base contexts for each client.  I put
each client/site/logical group in a different file and #include that
to keep the extensions.conf file short, and easy to remove a specific
section without impacting others.


Now this I have not tried, and have no idea if it would work.  Maybe
someone more familiar with the code can comment.  You can specify the
context in the switch statement, but can you have multiple switch
statements under a context?  It would be worth at least trying in a
test environment.  So to change client2_phones with an untested idea:

> [client2_phones]
> include => client2_internal
> include => client2_outgoing_calls
> include => test_calls
> include => parkedcalls

[client2_phones]
switch => Realtime/client2_internal
switch => Realtime/client2_outgoing_calls
include => test_calls
include => parkedcalls

If that doesn't work, maybe just having one switch and an include?
Again, I haven't tested any of that, but it seems like an interesting
way to do what I think you want.  Good luck!

-Jonathan



More information about the asterisk-users mailing list