On Tue, Sep 30, 2014 at 10:33 AM, Chris Bestall <chris.bestall@xxxxxxxxx> wrote:
Why is there an ARI data model for this event if it cannot be received?On Tue, Sep 30, 2014 at 10:20 AM, Scott Griepentrog <sgriepentrog@xxxxxxxxxx> 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
_______________________________________________ asterisk-app-dev mailing list asterisk-app-dev@xxxxxxxxxxxxxxxx http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev