<div dir="ltr"><br><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 29, 2016 at 6:15 AM, Bryant Zimmerman <span dir="ltr"><<a href="mailto:BryantZ@zktech.com" target="_blank">BryantZ@zktech.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><div>Sonny</div>
<div> </div>
<div>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. </div>
<div> </div>
<div>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.</div>
<div> </div>
<div>Thanks<br>
<br>
Bryant</div>
<div> </div>
<hr width="100%" align="center" size="2">
<div><span style="font-family:tahoma,arial,sans-serif;font-size:10pt"><b>From</b>: "Sonny Rajagopalan" <<a href="mailto:sonny.rajagopalan@gmail.com" target="_blank">sonny.rajagopalan@gmail.com</a>><br>
<b>Sent</b>: Thursday, January 28, 2016 7:35 PM<br>
<b>To</b>: "Asterisk Users Mailing List - Non-Commercial Discussion" <<a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a>><br>
<b>Subject</b>: [asterisk-users] Asterisk 13.6.0: Is there a way to create PJSIP users and dialplans programmatically using API</span><div><div class="h5">
<div> </div>
<div dir="ltr">Hi,
<div> </div>
<div>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.</div>
<div> </div>
<div>Please do let me know.</div>
<div> </div><br clear="all"></div></div></div></div></span></blockquote></div><br><div>With the right Sorcery configuration, you can also use ARI push
configuration. Creating a PJSIP endpoint, for example, can be done with
the following:<br></div><div><br></div><div>$ 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"} ] }'
<a href="https://localhost:8088/ari/asterisk/config/dynamic/res_pjsip/endpoint/alice">https://localhost:8088/ari/asterisk/config/dynamic/res_pjsip/endpoint/alice</a><br><br></div>This wiki page describes how this works, as well as how to set it up:<br><br><a href="https://wiki.asterisk.org/wiki/display/AST/ARI+Push+Configuration">https://wiki.asterisk.org/wiki/display/AST/ARI+Push+Configuration</a><br><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Matthew Jordan<br></div><div>Digium, Inc. | Director of Technology<br></div><div>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA</div><div>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></div></div></div></div></div>
</div></div>