asterisk / node-ari-client

Node.js client for ARI. This library is best effort with limited support.
Other
250 stars 98 forks source link

event for on mute and on unmute #94

Closed mpbanna closed 6 years ago

mpbanna commented 6 years ago

Hello, is there any event fire for 'channelMute' and 'chanelUnmute', like 'channelHold' , 'ChannelTalkingStarted' etc.

samuelg commented 6 years ago

If you listen for the ChannelStateChange[1] event, you'll also get a Channel instance along with the event. The state property of that instance should give you more information about the channel state[2].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+REST+Data+Models#Asterisk15RESTDataModels-ChannelStateChange [2] https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+REST+Data+Models#Asterisk15RESTDataModels-Channel

mpbanna commented 6 years ago

sorry for late response , on channel mute or unmute, 'ChannelStateChange' event not fire

samuelg commented 6 years ago

How are you muting the channel? Are you muting a phone or doing it via ARI with channel.mute()? I'm not sure muting via a phone would raise any events as Asterisk wouldn't necessarily know that a client was muting on their end.

mpbanna commented 6 years ago

I am using mute as :-

ari.channels.mute( {channelId: channel.id,direction:'both'}, function (err) { if (err) { logger.error('Mute error::', err); }

    }

);

i try direction parameter with all 3 value 'both', 'in', 'out' But ChannelStateChange event not fire

matt-jordan commented 6 years ago

Muting does not raise an event, as muting a channel is not a state change in Asterisk.

If you wanted an event for that, it would be a feature request against Asterisk, not the ARI client library.