<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Joshua, thanks, it work perfectly.<div class=""><br class=""></div><div class="">One more question, what is the best method to play audio and get the DTMF?</div><div class=""><br class=""></div><div class="">I’m using </div><div class=""><br class=""></div><div class=""><div class="">dtmf[1] = '\0';</div><div class="">dtmf[0] = cmd = ast_play_and_wait(chan, audio);<span class="Apple-tab-span" style="white-space:pre"> </span></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">best regards</div><div class=""><br class=""></div><div class=""><br class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 28 Jan 2020, at 09:49, Joshua C. Colp <<a href="mailto:jcolp@sangoma.com" class="">jcolp@sangoma.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class="">On Tue, Jan 28, 2020 at 8:43 AM <a href="mailto:info@magnussolution.com" class="">info@magnussolution.com</a> <<a href="mailto:info@magnussolution.com" class="">info@magnussolution.com</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br class="">
<br class="">
I’m learning about Asterisk code, and to try developer a new application, in this application I nee to execute sounds, I’m using ast_play_and_wait(chan,audio), but this function, as the name suppose, play the and wait to user press any digits.<br class="">
<br class="">
Have another function to only execute the audio? or set a timeout on ast_play_and_wait()?<br class=""></blockquote></div><div class=""><br class=""></div>You would use ast_streamfile, ast_waitstream, and ast_stopstream. If you need an example of usage you can look at the implementation of the Playback dialplan application[1].<div class=""><br class=""></div><div class="">[1] <a href="https://github.com/asterisk/asterisk/blob/master/apps/app_playback.c#L490" class="">https://github.com/asterisk/asterisk/blob/master/apps/app_playback.c#L490</a><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div style="font-family:tahoma,sans-serif" class=""><font color="#073763" class="">Joshua C. Colp</font></div><div style="font-family:tahoma,sans-serif" class=""><font color="#073763" class="">Asterisk Technical Lead</font></div><div style="font-family:tahoma,sans-serif" class=""><font color="#073763" class="">Sangoma Technologies</font></div><div style="font-family:tahoma,sans-serif" class=""><font color="#073763" class="">Check us out at <a href="http://www.sangoma.com/" target="_blank" class="">www.sangoma.com</a> and <a href="http://www.asterisk.org/" target="_blank" class="">www.asterisk.org</a></font><br class=""></div></div></div></div></div></div></div></div></div></div></div></div>
-- <br class="">_____________________________________________________________________<br class="">-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" class="">http://www.api-digital.com</a> --<br class=""><br class="">asterisk-dev mailing list<br class="">To UNSUBSCRIBE or update options visit:<br class="">   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" class="">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></div></blockquote></div><br class=""></div></div></body></html>