[asterisk-users] how to add extensions and sip registrations dynamically
Tilghman Lesher
tilghman at mail.jeffandtilghman.com
Sun Sep 21 11:20:24 CDT 2008
On Saturday 20 September 2008 17:21:16 George Williams wrote:
> I have inherited some code that appears to implement a kluge-y way of
> adding and removing extensions, sip devices, and sip registrations
> dynamically.
>
> Yep, you guessed it - it modifies the extensions.conf and sip.conf files,
> and then execute script to ask Asterisk to reload the dialplan and the sip
> module.
>
> Is there a better way to do this?
For extensions.conf, I would suggest continuing the present method of keeping
the extensions.conf file up to date, but instead of reloading the file, use
the Command action of AMI to "dialplan add extension" and "dialplan remove
extension". This is, of course, much faster than a complete reload of the
dialplan.
For sip registrations, however, there is a much better way: dynamic realtime.
Add and remove from the database and use the 'sip prune peer' command, again
through AMI, to remove registrations, if they are in memory.
--
Tilghman
More information about the asterisk-users
mailing list