[asterisk-app-dev] How create a dialplan (more exten in sequence) from ARI?

Matthew Jordan mjordan at digium.com
Wed Feb 11 07:58:08 CST 2015


On Wed, Feb 11, 2015 at 1:50 AM, Oscar <scriviaoscar at yahoo.it> wrote:

> How create a dialplan (more exten in sequence) from ARI?
>
>
ARI is not dialplan execution. ARI allows you to build an application that
the dialplan executes.

See the overview article on the Asterisk wiki for more explanation [1].


> My goal is:
>
> in automatic asterisk launch a call (cron php curl), when the caller
> answer then start one or more exten...
>
> I would to create one or more exten from ARI in sequence (not one exten
> alone, like a simple command from curl "http://...
> /channels/{channel_id}/play/").
>
>
I'm not sure what you mean by "create exten", as that's not a concept in
Asterisk. An extension is a location in the dialplan that a channel can
execute; you typically don't create them dynamically.

It sounds like you want to create outbound channels and play media to them.
That is achievable using ARI. Through ARI, you can:
* Create channels using the POST /channels operation, and place them in
your Stasis application [2]
* Control the channels in your Stasis application, including playing media
to them using POST /channels/{channel_id}/play [3]
* Release channels back to the dialplan using POST
/channels/{channel_id}/continue [4], or hang them up using DELETE
/channels/{channel_id} [5]


> ps. where is more ARI documents?
>
>
Documentation for ARI is on the Asterisk wiki. Several walk through
tutorials have been written that cover basic usage of ARI and a Stasis
application; manipulation of channels, bridges, and media; and more [1].
Code examples for those tutorials are on Github [6], and are available in a
variety of languages, including Python, JavaScript, and C#.


> thanks a lot
>
>

[1] https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573
[2]
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Channels+REST+API#Asterisk13ChannelsRESTAPI-originate
[3]
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Channels+REST+API#Asterisk13ChannelsRESTAPI-play
[4]
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Channels+REST+API#Asterisk13ChannelsRESTAPI-continueInDialplan
[5]
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Channels+REST+API#Asterisk13ChannelsRESTAPI-hangup
[6] https://github.com/asterisk/ari-examples

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
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-app-dev/attachments/20150211/e69e2e2d/attachment.html>


More information about the asterisk-app-dev mailing list