VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
sonny.rajagopalan at g... Guest
|
Posted: Thu Jan 28, 2016 7:34 pm Post subject: [asterisk-users] Asterisk 13.6.0: Is there a way to create P |
|
|
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. |
|
Back to top |
|
|
george.joseph at fairv... Guest
|
Posted: Thu Jan 28, 2016 9:14 pm Post subject: [asterisk-users] Asterisk 13.6.0: Is there a way to create P |
|
|
On Thu, Jan 28, 2016 at 5:34 PM, Sonny Rajagopalan <sonny.rajagopalan@gmail.com (sonny.rajagopalan@gmail.com)> wrote:
Quote: | 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 |
|
Back to top |
|
|
BryantZ at zktech.com Guest
|
Posted: Fri Jan 29, 2016 7:16 am Post subject: [asterisk-users] Asterisk 13.6.0: Is there a way to create P |
|
|
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@gmail.com> Sent: Thursday, January 28, 2016 7:35 PM To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@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. |
|
Back to top |
|
|
mjordan at digium.com Guest
|
Posted: Fri Jan 29, 2016 9:47 am Post subject: [asterisk-users] Asterisk 13.6.0: Is there a way to create P |
|
|
On Fri, Jan 29, 2016 at 6:15 AM, Bryant Zimmerman <BryantZ@zktech.com (BryantZ@zktech.com)> wrote:
Quote: | 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@gmail.com (sonny.rajagopalan@gmail.com)>
Sent: Thursday, January 28, 2016 7:35 PM
To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@lists.digium.com (asterisk-users@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 |
|
Back to top |
|
|
sonny.rajagopalan at g... Guest
|
Posted: Wed Feb 03, 2016 2:57 pm Post subject: [asterisk-users] Asterisk 13.6.0: Is there a way to create P |
|
|
Thanks to everyone for your responses. I grappled with this the past few days, but I have to confess any amount of poking around AMI has not yielded any result. I find the ARI based method most convenient as I am familiar with that interface already. I did not discover this as the ARI method is not documented under ARI information at https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ARI (but instead under a different left-hand navigation tree in your wiki). But thanks, Matt.
At any rate, I would like to setup pjsip using a mysql, rather than an astdb based setup with uses a LOCAL db. Is there an online document for configuring the mysql database backend for asterisk. If res_config_mysql.conf is setup, does it mean automatically that it is used instead of astdb sqllite? That part is not clear. Any help or documentation is appreciated.
Thanks,
Sonny.
On Fri, Jan 29, 2016 at 9:47 AM, Matthew Jordan <mjordan@digium.com (mjordan@digium.com)> wrote:
Quote: |
On Fri, Jan 29, 2016 at 6:15 AM, Bryant Zimmerman <BryantZ@zktech.com (BryantZ@zktech.com)> wrote:
Quote: | 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@gmail.com (sonny.rajagopalan@gmail.com)>
Sent: Thursday, January 28, 2016 7:35 PM
To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@lists.digium.com (asterisk-users@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
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
|
|
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|