ARI JS Client Mute Error

Am is currently developing a mute function for an asterisk that I can launch from my web interface using ARI asterisks.

But every time I try to start / call the mute function, it causes the following error:

Error: { "message": "Channel not in Stasis application" } 

But this, as far as I know, transfers channel data directly to this function, but to no avail.

Any suggestions or used to work with the ARI JS client?

Client side

When the mute button is pressed, the information found in td on the server side is displayed.

  $(document).on('click', '.mute', function () { var mute = $(this).closest('td').siblings(':first-child').text(); socket.emit('muting', mute); if ($(this).hasClass('mute')) { $(this).removeClass('mute').addClass('unmute').find('span').text('Unmute'); } else { console.log("Error"); } }); 

Server side

Store the data received from the client side in var, and then call the stasis function.

  io.sockets.on('connection', function (socket) { updateSip(); socket.on('muting', function (data) { mute(data); console.log("Reached listener for muting") }); }); 

Function stasis

To disconnect the channel that you just transferred from the client side to the server using the ARI client commands, the user will be disconnected and will be displayed in the stagnation application.

 function mute(mutval) { console.log("Muting:" + mutval); client.channels.mute ({ channelId : mutval }, function (err) { if (err) { throw err; } }); } 

The channel is in the application and passed to the mute function, so I'm not sure how much it does not work at present.

EDIT: I have a hangup / kick function handled in the same way and it works fine. Below is my debugging.

Channel dump Channel dumper

Free PBX Magazines enter image description here Asterisk CLI Debug Level 5 enter image description here

Socket.io error enter image description here

I also tried to run it through socket.io and without it, and the result is the same, I have other functions, and they all work fine, it just turns off the function.

+7
javascript jquery express asterisk
source share
1 answer

It turns out that it does not start, because it needs a channel identifier, not a channel name, but functions will be launched with a channel name.

This is inconsistent with Asterisk ARI, because it must work with the channel name, and not just with the channel identifier, like other functions, such as freezing and launching functions.

+2
source share

All Articles