ARI Events : ChannelDestroyed And ChannelHangupRequest

Home » Asterisk Users » ARI Events : ChannelDestroyed And ChannelHangupRequest
Asterisk Users 3 Comments


I noticed that when a channel is destroyed, two different events can be raised : ChannelDestroyed and ChannelHangupRequest. These two events seem to be mutually exclusive : if I receive a ChannelHangupRequest, I
will never receive a ChannelDestroyed, and vice versa.

This behaviour does not look consistent with the documentation, which states : “ChannelDestroyed : Notification that a channel has been destroyed”. So I would expect a ChannelDestroyed event to be raised each time a channel is actually destroyed.

Is it a bug ?

Best regards

Jean Aunis

3 thoughts on - ARI Events : ChannelDestroyed And ChannelHangupRequest

  • Le 12/06/2017 à 15:46, Joshua Colp a écrit :
    Thank you Joshua, I was not aware of this mailing list. I will describe the precise scenario as soon as I have free time.

  • Le 12/06/2017 à 22:56, Jean Aunis a écrit :

    Just for information, I finally figured out the problem when trying to reproduce it, and I don’t think it is a bug.

    When a channel enters a Stasis application from the dialplan, the application is subscribed to this channel. But when the channel is hung up, Asterisk removes the channel from the application before emitting the ChannelDestroyed event, so the application is unsubscribed and does not receive this final event.

    The behaviour is different for channels originated with ARI : in this case Asterisk will subscribe the application to the channel, so it receives all the events until the channel is destroyed.

    I solved it by manually subscribing the application to the channel.