[asterisk-dev] ARI and simple Dial

Matthew Jordan mjordan at digium.com
Wed Aug 20 12:54:11 CDT 2014


On Wed, Aug 20, 2014 at 7:18 AM, Yuriy Gorlichenko <ovoshlook at gmail.com> wrote:
> Hello. We trying to develom app like queue with ARI.
>
> After call to extension we start Stasis from dialplan and call our app.
>
> Our app must create bridge with existing one channel (that calls Stasis from
> dialplan. ChannelId we send over statis parameters like:
>
> exten=>_X.,n,Stasis(CustomQueue,${CHANNEL},${EXTEN})
>
> So after calling CustonQueue we successfully creates bridge, and must send
> new channel (called party) to bridge
>
> We Used POST /channels to do this but we have a problem with Endpoint
> parameter. We do not need Call to Endpoint. We just need to call some
> extension (or device) from some context that creates new channel that will
> join to our already existing bridge.

An endpoint is simply a string that is interpreted by a channel driver
as the target for the channel. It is up to the channel technology to
make sense of the identifier for the endpoint.

If you want to dial a device, you can:

POST /channels?endpoint=PJSIP/alice&app=my_cool_app

If you want to dial an arbitrary SIP URI via the PJSIP channel driver,
you can do that to:

POST /channels?endpoint=PJSIP/alice/sip:alice at my_awesome_provider.net&app=my_cool_app

If you want to create a channel that goes to an extension (which is a
dialplan concept) but is also in your Stasis application, then use a
Local channel:

POST /channels?endpoint=Local/1000 at default&app=my_cool_app

If you want to just toss a channel into the dialplan and not mess with
it any more in your application, then you can create it directly in
the dialplan:

POST /channels?endpoint=PJSIP/alice&extension=1000&context=default&priority=1

>
> So as I know at develop state of RESTFull interface at ARI was application
> like channels/{channelid}/Dial that was removes:
>
> http://lists.digium.com/pipermail/asterisk-app-dev/2013-October/000002.html
>

It was removed because it was really just a combination of POST
/channels with POST /bridges. Combining things into chunk operations,
however, has a large drawback: it requires the operation itself to
contain all of the configuration of what occurs during that operation.
We were about to walk smack into the Dial application laundry list of
arguments; as such, we retreated.

As an FYI, there is a dedicated mailing list for discussing
application development using Asterisk, asterisk-app-dev. You may want
to direct further inquiries to that mailing list.

Matt

-- 
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



More information about the asterisk-dev mailing list