Sonny Rajagopalan
2016-Jan-29 00:34 UTC
[asterisk-users] Asterisk 13.6.0: Is there a way to create PJSIP users and dialplans programmatically using API
Hi, I am using Asterisk 13.6.0 and was wondering if I can programmatically add users (to pjsip.conf) and dialplan (to extensions.conf) to the Asterisk server using API of some sort. Please do let me know. Thanks, Sonny. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20160128/85404f6c/attachment.html>
George Joseph
2016-Jan-29 02:14 UTC
[asterisk-users] Asterisk 13.6.0: Is there a way to create PJSIP users and dialplans programmatically using API
On Thu, Jan 28, 2016 at 5:34 PM, Sonny Rajagopalan < sonny.rajagopalan at gmail.com> wrote:> Hi, > > I am using Asterisk 13.6.0 and was wondering if I can programmatically add > users (to pjsip.conf) and dialplan (to extensions.conf) to the Asterisk > server using API of some sort. > >?You can use the Asterisk Manager Interface to ?modify the config files and reload. https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=4817239 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20160128/1bf025a3/attachment.html>
Bryant Zimmerman
2016-Jan-29 12:15 UTC
[asterisk-users] Asterisk 13.6.0: Is there a way to create PJSIP users and dialplans programmatically using API
Sonny We use a real-time database for adding pjsip users. If you want to do it from the pjsip.conf you would have to write to the file from a script of some sort and then trigger a reload. There is a real-time implementation for the extensions.conf as well. I personally use scripts for most of my dialplan, but in some cases I write to files included in my dialplan from a script and force a reload. To directly answer you question I do not believe there is an API baked into asterisk to update the pjsip.conf and extensions.conf directly from the dialplan. Thanks Bryant ---------------------------------------- From: "Sonny Rajagopalan" <sonny.rajagopalan at gmail.com> Sent: Thursday, January 28, 2016 7:35 PM To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users at lists.digium.com> Subject: [asterisk-users] Asterisk 13.6.0: Is there a way to create PJSIP users and dialplans programmatically using API Hi, I am using Asterisk 13.6.0 and was wondering if I can programmatically add users (to pjsip.conf) and dialplan (to extensions.conf) to the Asterisk server using API of some sort. Please do let me know. Thanks, Sonny. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20160129/2ec15370/attachment.html>
Matthew Jordan
2016-Jan-29 14:47 UTC
[asterisk-users] Asterisk 13.6.0: Is there a way to create PJSIP users and dialplans programmatically using API
On Fri, Jan 29, 2016 at 6:15 AM, Bryant Zimmerman <BryantZ at zktech.com> wrote:> Sonny > > We use a real-time database for adding pjsip users. If you want to do it > from the pjsip.conf you would have to write to the file from a script of > some sort and then trigger a reload. There is a real-time implementation > for the extensions.conf as well. I personally use scripts for most of my > dialplan, but in some cases I write to files included in my dialplan from a > script and force a reload. > > To directly answer you question I do not believe there is an API baked > into asterisk to update the pjsip.conf and extensions.conf directly from > the dialplan. > > Thanks > > Bryant > > ------------------------------ > *From*: "Sonny Rajagopalan" <sonny.rajagopalan at gmail.com> > *Sent*: Thursday, January 28, 2016 7:35 PM > *To*: "Asterisk Users Mailing List - Non-Commercial Discussion" < > asterisk-users at lists.digium.com> > *Subject*: [asterisk-users] Asterisk 13.6.0: Is there a way to create > PJSIP users and dialplans programmatically using API > > Hi, > > I am using Asterisk 13.6.0 and was wondering if I can programmatically add > users (to pjsip.conf) and dialplan (to extensions.conf) to the Asterisk > server using API of some sort. > > Please do let me know. > > >With the right Sorcery configuration, you can also use ARI push configuration. Creating a PJSIP endpoint, for example, can be done with the following: $ curl -X PUT -H "Content-Type: application/json" -u asterisk:secret -d '{"fields": [ { "attribute": "from_user", "value": "alice" }, { "attribute": "allow", "value": "!all,g722,ulaw,alaw"}, {"attribute": "ice_support", "value": "yes"}, {"attribute": "force_rport", "value": "yes"}, {"attribute": "rewrite_contact", "value": "yes"}, {"attribute": "rtp_symmetric", "value": "yes"}, {"attribute": "context", "value": "default" }, {"attribute": "auth", "value": "alice" }, {"attribute": "aors", "value": "alice"} ] }' https://localhost:8088/ari/asterisk/config/dynamic/res_pjsip/endpoint/alice This wiki page describes how this works, as well as how to set it up: https://wiki.asterisk.org/wiki/display/AST/ARI+Push+Configuration -- Matthew Jordan Digium, Inc. | Director of Technology 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: http://digium.com & http://asterisk.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20160129/f9c0eb1b/attachment.html>
Reasonably Related Threads
- Asterisk 13.6.0/The simplest TCP configuration does not work
- Asterisk 13.6.0/The simplest TCP configuration does not work
- Asterisk 13.6.0/The simplest TCP configuration does not work
- Asterisk 13.6.0/The simplest TCP configuration does not work
- Asterisk 13.6.0/The simplest TCP configuration does not work