当前位置: 动力学知识库 > 问答 > 编程问答 >

asterisk play music while waiting for DTMF

问题描述:

i am setting up a DISA in asterisk .

what i would like to do is play a music to the caller while asterisk is receiving the DTMF.

the DTMF would stop playing when it receives DTMF for "#"

i have tried using background() and playback() command , but they do not serve the purpose!

any ideas?

khan

网友答案:

You can try using phpagi. There is a function called fastpass_get_data, where you can get dtmf input while playing a sound.

http://phpagi.sourceforge.net/phpagi22/api-docs/phpAGI/AGI.html#fastpass_get_data

网友答案:

I'm assuming just using the builtin DISA application doesn't meet your needs. If it does, just use that.

There are different ways to program asterisk. You can use normal dialplan, ael dialplan, AGI, AMI, even write your own modules in C.

You can do more things in dialplan, but often using a real language through AGI results in more readable code.

Using the dialplan applications StartMusicOnHold, StopMusicOnHold, and either Read or WaitExten, you should be able to do what you want. Run asterisk -rx 'core show application StartMusicOnHold', etc, to read about each of those.

You basically want to run StartMusicOnHold, then gather digits using Read or WaitExten until you're done (perhaps collecting them into a channel variable), then run StopMusicOnHold.

分享给朋友:
您可能感兴趣的文章:
随机阅读: