Hello,
I am trying to build an interruptible voice capturing system. My test scenario is as follows:
(using the node-ari package)
Place channel into Stasis application
Play a sound file
Register events for ChannelTalkingStarted and ChannelTalkingFinished
Once ChannelTalkingStarted fires, stop the playback of the sound file
This flow functions perfectly fine while running the stasis application directly on my laptop, connected to a remote asterisk server via websocket. I’ve bundled this up (mainly for testing uploading/transcribing the recorded file which lives on the asterisk server) and I ran into an issue where the sound file I’m playing would be stopped immediately.
I placed console logs in and I was indeed receiving the ChannelTalkingStarted event prior to saying anything – even if my iPhone microphone was on mute prior to the call connecting. I tried adjusting the silence threshold to 15000ms to see if something interesting was happening there, but I still encountered the problem.
Here is a code snippet demonstrating what I’m doing
Alright, I’ll give that a shot. It might fix my issue, but I’m not sure since the expected behavior is happening when I’m running my ARI application locally vs on the server next to asterisk. Could there be a timing issue? With the messaging being too quick when it is on the same server? Which is why my setTimeout made the issue go away?
I’m guessing total_silence here starts out at zero or some really low number. Either way it is most likely less than the dsp_silence_threshold value. If so then it would trigger talking every time at start.
Anyhow, I was able to replicate the problem as well when watching for AMI events. Please create a bug report on our issue tracker. Describe the problem, and feel free to add a link to your post here.
Thank you for that – I might tinker around with it and see if I can determine anything.
That definitely aligns with what I’ve been seeing. I’m 99.9999% positive the setTimeout resolves something just based on network latency of connecting locally vs routing back to my laptop.