[asterisk-dev] ast_play_and_wait

info at magnussolution.com info at magnussolution.com
Tue Jan 28 08:25:45 CST 2020


Hi Joshua, thanks, it work perfectly.

One more question, what is the best method to play audio and get the DTMF?

I’m using 

dtmf[1] = '\0';
dtmf[0] = cmd = ast_play_and_wait(chan, audio);	



best regards



> On 28 Jan 2020, at 09:49, Joshua C. Colp <jcolp at sangoma.com> wrote:
> 
> On Tue, Jan 28, 2020 at 8:43 AM info at magnussolution.com <mailto:info at magnussolution.com> <info at magnussolution.com <mailto:info at magnussolution.com>> wrote:
> Hello,
> 
> 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.
> 
> Have another function to only execute the audio? or set a timeout on ast_play_and_wait()?
> 
> 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].
> 
> [1] https://github.com/asterisk/asterisk/blob/master/apps/app_playback.c#L490 <https://github.com/asterisk/asterisk/blob/master/apps/app_playback.c#L490>
> 
> -- 
> Joshua C. Colp
> Asterisk Technical Lead
> Sangoma Technologies
> Check us out at www.sangoma.com <http://www.sangoma.com/> and www.asterisk.org <http://www.asterisk.org/>
> -- 
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20200128/cab71dfa/attachment.html>


More information about the asterisk-dev mailing list