[asterisk-app-dev] ARI - ChannelCreated event

Chris Bestall chris.bestall at gmail.com
Tue Sep 30 10:33:31 CDT 2014


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.
>
>
> On Tue, Sep 30, 2014 at 9:05 AM, Chris Bestall <chris.bestall at gmail.com>
> wrote:
>
>> I'm using the NodeJS ARI library with Asterisk 12.  In the examples I see
>> the use of "StasisStart" event for when a call is originated, but none for
>> "ChannelCreated"
>>
>> I have tried to create listeners for the "ChannelCreated" event
>> everywhere possible, but it seems this event is never fired.
>>
>> Here is my code:
>>
>> ari.start('hello');
>>
>> ari.on( "ChannelCreated", function ( event, channel ) {
>>   console.log("channel created");
>> });
>>
>> var channel = ari.Channel(  );
>>
>> channel.on( "StasisStart", function ( event, channel ) {
>>   console.log("stasis entered");
>> });
>>
>> channel.on( "ChannelCreated", function ( event, channel ) {
>>   console.log("channel created");
>> });
>>
>> channel.originate( { endpoint: "PJSIP/6001", app : "hello" }, function
>> (err, ch) {
>>
>> if( err ){ console.log( err );  process.exit(0); }
>>
>> ch.on( "ChannelCreated", function ( event, channel ) {
>>   console.log("channel created");
>> });
>>
>> });
>>
>>
>> Only the stasis entered gets logged and only on endpoint answer.
>>
>> Am I missing something?
>>
>> Thanks,
>> Chris
>>
>>
>> _______________________________________________
>> asterisk-app-dev mailing list
>> asterisk-app-dev at lists.digium.com
>> http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
>>
>>
>
>
> --
> [image: Digium logo]
> Scott Griepentrog
> Digium, Inc · Software Developer
> 445 Jan Davis Drive NW · Huntsville, AL 35806 · US
> direct/fax: +1 256 428 6239 · mobile: +1 317 507 4029
> 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/595b9ee2/attachment.html>


More information about the asterisk-app-dev mailing list