I'm doing the recognition in my agi script, its in ruby and the logic is such that it attempts to <span style="font-weight: bold;">ensure </span>SpeechDestroy is executed on exit but.... if the user hangs up before the agi script is finished it loses its connection with asterisk and then throws an error when attempting the SpeechDestroy.
<br>I've tried adding the SpeechDestroy into the asterisk dialplan after the agi call but it doesn't work. Dialplan is <br><br>exten => _35314877679, 1, Answer()<br>exten => _35314877679, 2, agi(agi://HOSTNAME:${RAGI_PORT}/dialin/lumenvox_test)
<br>exten => _35314877679, 3, SpeechDestroy()<br>exten => _35314877679, 4, hangup()<br><br>