[Asterisk-Dev] extensions.conf limitations, and how to overcome them

asterisk at funkspiel.org asterisk at funkspiel.org
Mon Nov 7 18:44:02 MST 2005


On Mon, Nov 07, 2005 at 08:52:09AM -0800, Michael Anderson wrote:
> Well if you're running AGI, you can call manager commands.  For
> example with Perl:
> 
> my $ASTBIN = "/usr/sbin/asterisk";
> 
> `$ASTBIN -rx "add extension <exten>,<priority>,<app>,<app-data> into
> <context>"`;

Another excellent suggestion.  Thanks! :)

With this, I can change parts of the dialplan without reloading
extensions.conf, which is what I want.  I could also make changes from
a cron job, rather than having to do it within an AGI.

The performance is probably better than that of reloading
extensions.conf (although you do have to fork a process.)  On the other
hand, I could get around the forking penalty by using the Asterisk
Manager API (http://www.voip-info.org/wiki-Asterisk+manager+API).

Hmmnn.  Hmmnn!  Interesting.  This is a different way of doing things
from Steven's suggestion, which was to run a single AGI that presents
the "menus" and manipulates the dialplan as needed.  I will have to
mull over which is better for my needs.

I still think it would be cool to have a dialplan struct (or a
friendly dialplan object in your favorite language) that you could
hack till your heart's content.  However, I recognize this would be a
lot of work.  I guess the "add extension" code would be a good place
to start looking, should I want to go that route.

In the meantime, thanks to Steven and Michael for the suggestions.
You guys rock. :)



More information about the asterisk-dev mailing list