George Williams
2008-Sep-20 22:21 UTC
[asterisk-users] how to add extensions and sip registrations dynamically
Hi, 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? :) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080920/e3e28a8e/attachment.htm
Tilghman Lesher
2008-Sep-21 16:20 UTC
[asterisk-users] how to add extensions and sip registrations dynamically
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