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 
Free PBX Magazines
Asterisk CLI Debug Level 5 
Socket.io error 
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.