Hi,<br><br>I'm migrating an application module from asterisk 1.2 to 1.8. So far it's been a fairly straightforward process, but I've run into one behavioral difference in Asterisk that I'm hoping someone here can either vet or make a suggestion for a better approach.<br>
<br>Our app is an IVR-type machine detection setup where the module plays a stream specified in the calling arguments while at the same time listening to the inbound channel audio for various ques. We want the module to clean up and exit either when it receives a que that it's looking for, or when the remote hangs up, or when the stream has finished playing out. The first two work fine, but a working method for detecting the end of the playing stream seems to have changed between 1.2.x and 1.8.x.<br>
<br>In 1.2 we basically had a big while {} loop and if (! chan->stream) we would break the loop. At the end of the stream, chan->stream would go null and this would break just fine. But in 1.8, chan->stream no longer goes null upon completion. i have been searching for a viable substitute, and so far what I have come up with is using ast_stream_tell() to watch for the advancing stream position and when it stops advancing, we have reached the end, at which point we can break.<br>
<br>Is there a better way? This feels kind of hack-y...<br><br>Thanks!<br>- Sean<br><br>