Matt Riddell
2019-Jan-11 15:47 UTC
[asterisk-users] [asterisk-app-dev] Multiple ChannelDestroyed events for the same channel
Hiya, When I hang up on a call to my stasis app I’m getting multiple channelDestroyed events for the same channel: app.js:985:13) Channel was destroyed: 1547220509.77 app.js:1029:17) This was a customer app.js:1030:17) Checking if this was a customer talking to an agent app.js:1043:21) Customer was not talking to anyone app.js:1126:13) 2019-01-11 10:28:29 app.js:985:13) Channel was destroyed: 1547220509.77 app.js:1029:17) This was a customer app.js:1030:17) Checking if this was a customer talking to an agent app.js:1043:21) Customer was not talking to anyone app.js:1126:13) 2019-01-11 10:28:29 app.js:985:13) Channel was destroyed: 1547220509.77 app.js:1029:17) This was a customer app.js:1030:17) Checking if this was a customer talking to an agent app.js:1043:21) Customer was not talking to anyone I’m only registering once to the event: ari.on('ChannelDestroyed', channelDestroyed); Is this normal? I’m writing like a CDR on channel destroyed so don’t want to write it multiple times. Should I keep an array of channels and only write if I haven’t seen the event for that channel before? Cheers, Matt Riddell _______________________________________________ asterisk-app-dev mailing list asterisk-app-dev at lists.digium.com http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
Jean Aunis
2019-Jan-11 16:14 UTC
[asterisk-users] [asterisk-app-dev] Multiple ChannelDestroyed events for the same channel
Le 11/01/2019 à 16:47, Matt Riddell a écrit :> Hiya, > > When I hang up on a call to my stasis app I’m getting multiple channelDestroyed events for the same channel: > > app.js:985:13) Channel was destroyed: 1547220509.77 > app.js:1029:17) This was a customer > app.js:1030:17) Checking if this was a customer talking to an agent > app.js:1043:21) Customer was not talking to anyone > app.js:1126:13) 2019-01-11 10:28:29 > app.js:985:13) Channel was destroyed: 1547220509.77 > app.js:1029:17) This was a customer > app.js:1030:17) Checking if this was a customer talking to an agent > app.js:1043:21) Customer was not talking to anyone > app.js:1126:13) 2019-01-11 10:28:29 > app.js:985:13) Channel was destroyed: 1547220509.77 > app.js:1029:17) This was a customer > app.js:1030:17) Checking if this was a customer talking to an agent > app.js:1043:21) Customer was not talking to anyone > > I’m only registering once to the event: > > ari.on('ChannelDestroyed', channelDestroyed); > > Is this normal? > > I’m writing like a CDR on channel destroyed so don’t want to write it multiple times. > > Should I keep an array of channels and only write if I haven’t seen the event for that channel before? > > Cheers, > > Matt Riddell > _______________________________________________ > asterisk-app-dev mailing list > asterisk-app-dev at lists.digium.com > http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-devHello, It may happen if several applications subscribed to the channel. In this case you can discriminate the events on the basis of application name. Regards Jean Aunis _______________________________________________ asterisk-app-dev mailing list asterisk-app-dev at lists.digium.com http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
Matt Riddell
2019-Jan-11 16:22 UTC
[asterisk-users] [asterisk-app-dev] Multiple ChannelDestroyed events for the same channel
> On Jan 11, 2019, at 11:14, Jean Aunis <jean.aunis at prescom.fr> wrote: > > Le 11/01/2019 à 16:47, Matt Riddell a écrit : >> Hiya, >> >> When I hang up on a call to my stasis app I’m getting multiple channelDestroyed events for the same channel: > > It may happen if several applications subscribed to the channel. In this case you can discriminate the events on the basis of application name.Yeah you’re right - I was registering 3 applications so get three events - even though the channel was only in one application. Thanks, Matt Riddell _______________________________________________ asterisk-app-dev mailing list asterisk-app-dev at lists.digium.com http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
Reasonably Related Threads
- ARI events : ChannelDestroyed and ChannelHangupRequest
- Subscribe to events via ARI from node.js without sending to Stasis
- Listen to ARI events
- Need feedback on the use of AMI events generated by MESSAGE requests
- Need feedback on the use of AMI events generated by MESSAGE requests