Closed danjenkins closed 4 years ago
Hi Dan, To work around this issue i use a try catch
try {
this._asteriskAudioStream.outWStream.write(packet.serialize());
} catch (error) {
this.log.error(error);
}
This is just a work around the issue.
I also tried to to enclose the full for loop in a setTimeout var and clear that at the close event. But for some reason not clear yet the error is still thrown. I am not sure if the loop is running seperatly and we can clear it this way. Otherwise i think we have to make a sure each time the Outstream is writen the bridge is checked if the stream is still open.
@JorgMuskens I just pushed a commit which should fix this. I thought about checking if the stream was writable every time but I'd still have to deal with cancelling all future timeouts so decided a try catch was better and would at least handle other bad situations instead of crashing out. let me know if it works for you
I have the issue back. It throws the error when you keep quite and say nothing. This happend to me when my speech was not recognized and looks like dialogflow then closes connecting which throws the error. Note that i am using singleUtterance: true to get the speech going in Dialogflow. I see you are using false but on my end Dialogflow doesn't reply back to me then.
Stop trying to send media if a hangup mqtt message comes through