[asterisk-app-dev] ARI - ChannelCreated event
Matthew Jordan
mjordan at digium.com
Tue Sep 30 10:58:12 CDT 2014
On Tue, Sep 30, 2014 at 10:33 AM, Chris Bestall <chris.bestall at gmail.com>
wrote:
> Why is there an ARI data model for this event if it cannot be received?
>
>
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+REST+Data+Models#Asterisk12RESTDataModels-ChannelCreated
>
> On Tue, Sep 30, 2014 at 10:20 AM, Scott Griepentrog <
> sgriepentrog at digium.com> wrote:
>
>> The ChannelCreated event exists internally (and you can receive it with
>> AMI). However, the channel is created first, then it enters the stasis app
>> -- thus the stasis app does not receive the channel created event because
>> it's not associated with the channel yet.
>>
>>
>>
Well.... it can be received. It's just rare.
Generally, a StasisStart event indicates when a channel enters into your
application. When that occurs, you get a subscription to the channel. When
the channel leaves (indicated by StasisEnd), that subscription is
terminated.
If you persisted the subscription via the applications resource, then you'd
get the slightly less elusive ChannelDestroyed event.
So how do you get the ChannelCreated? And when?
By subscribing for an endpoint via the applications resource. Subscribing
to an endpoint also subscribes you to any channels created for that
endpoint. Likewise, subscripting to an endpoint's technology subscribes you
to all endpoints, which subscribes you to all channels for those endpoints.
(This is how you can make a 'show me the world via ARI' - albeit a more
specific slice of the world). If you do that, you'll get the ChannelCreated
events when a channel is made that is associated with an endpoint.
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20140930/37290fb6/attachment-0001.html>
More information about the asterisk-app-dev
mailing list