I&#39;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&#39;ve tried adding the SpeechDestroy into the asterisk dialplan after the agi call but it doesn&#39;t work. Dialplan is <br><br>exten =&gt; _35314877679, 1, Answer()<br>exten =&gt; _35314877679, 2, agi(agi://HOSTNAME:${RAGI_PORT}/dialin/lumenvox_test)
<br>exten =&gt; _35314877679, 3, SpeechDestroy()<br>exten =&gt; _35314877679, 4, hangup()<br><br>