[asterisk-dev] [Code Review] 2910: ARI: Return snapshot of channel when originating and allow optional app subscription
Joshua Colp
reviewboard at asterisk.org
Tue Oct 15 10:53:56 CDT 2013
> On Oct. 15, 2013, 3:13 p.m., Paul Belanger wrote:
> > /branches/12/rest-api/api-docs/channels.json, line 76
> > <https://reviewboard.asterisk.org/r/2910/diff/1/?file=47074#file47074line76>
> >
> > I'm trying to wrap my head around this parameter. Do you mind explaining a little more? Are you saying, if you don't pass the application name the event will not be generated?
>
> Joshua Colp wrote:
> The existing functionality controls where your originated call ends up once answered (dialplan or stasis application). Before the call is answered you receive no events regarding it. Using the patch you can either:
>
> 1. Use the information returned in the snapshot to subscribe yourself (potentially losing events) or
> 2. Pass in a Stasis application to be subscribed which occurs immediately
>
>
> Paul Belanger wrote:
> Correct me if I am wrong, but won't this logic apply to all ARI functions / events? If you don't subscribe you application to /events fast enough, there is a chance of missing this events.
>
> Personally, I'd rather subscribe to the events before I invoked the function, versus passing the stasis application in the function. However, on the flip side, if this is the case then I believe all functions need to expose this parameter for consistency.
It won't because the channel will 1. Already exist or 2. Already be in your stasis application in the dialplan, which subscribes the app to the channel.
In the case of origination this isn't possible because no channel exists until the origination executes, that's why I added the ability to subscribe here. You can't subscribe to something that doesn't exist yet.
- Joshua
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2910/#review9914
-----------------------------------------------------------
On Oct. 15, 2013, 2:52 p.m., Joshua Colp wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2910/
> -----------------------------------------------------------
>
> (Updated Oct. 15, 2013, 2:52 p.m.)
>
>
> Review request for Asterisk Developers and David Lee.
>
>
> Bugs: ASTERISK-22485
> https://issues.asterisk.org/jira/browse/ASTERISK-22485
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> Currently when originating a call using ARI no feedback is provided. This makes it extremely difficult to know what channel you just originated.
>
> The attached patch tweaks functionality in two ways to help with this:
>
> 1. A snapshot of the newly originated channel is returned.
> 2. The originator may optionally subscribe a Stasis application to an originated channel.
>
> Using these an originator can know what channel it originated, and also follow it if it so chooses.
>
>
> Diffs
> -----
>
> /branches/12/rest-api/api-docs/channels.json 400957
> /branches/12/res/res_ari_channels.c 400957
> /branches/12/res/ari/resource_channels.c 400957
> /branches/12/res/ari/resource_channels.h 400957
> /branches/12/main/pbx.c 400957
>
> Diff: https://reviewboard.asterisk.org/r/2910/diff/
>
>
> Testing
> -------
>
> Did some originations and confirmed that the snapshot is returned, and that the Stasis application is subscribed.
>
>
> Thanks,
>
> Joshua Colp
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131015/bb018c08/attachment.html>
More information about the asterisk-dev
mailing list