Play voice file and ask for DTMF when the call gets answered

Hello,

I want to generate a call by calling a URL. Once the call gets answered, there has to be a IVR message to be played which ask for DTMF input. I also want the dialstatus of all such calls to be stored some where. I fired call using .call file and I have used Dial command with M option i.e called macro when the call gets answered. Now, I want to play multiple files and based on the DTMF input, I have to route the call flow. But, when we use WaitExten inside the macro, on pressing any DTMF then the call gets hangup.

[quote][test-call]
exten => _X.,1,Dial(dahdi/g0/${PHONE_NO},30,tTM(CallTest^${LOCAL_CHANNEL}))

[macro-CallTest]
exten => s,1,Wait(1)
exten => s,n,Set(LOCAL_CHANNEL=${ARG1})
exten => s,n,SoftHangup(${LOCAL_CHANNEL})

exten => s,n,Background(vm-enter-num-to-call&vm-leavemsg&vm-pls-try-again&vm-sorry)
exten => s,n,Background(digits/1&digits/2)
exten => s,n,WaitExten(5)
;exten => _X.,n,Read(RESPONSE,beep,1,2,6)

exten => 1,1,NoOp(=========== ${EXTEN} ===============)
exten => 2,1,NoOp(=========== ${EXTEN} ===============)

exten => t,1,NoOp(timeout)
exten => i,1,NoOp(timeout)

[/quote]
Can we use Read command with multiple voice files ? If yes then will you please tell us how ?

any help ?

Try it in a different way and see. To have a better control, you can also use local channel.
Callfile:

Channel:dahdi/g0/XXXXXXXXXX
Context: CallTest
Extension:s
priority:1

And have following in dialplan

[CallTest]

exten => s,1,Wait(1)
exten => s,n,Background(vm-enter-num-to-call&vm-leavemsg&vm-pls-try-again&vm-sorry)
exten => s,n,Background(digits/1&digits/2)
exten => s,n,WaitExten(5)

exten => 1,1,NoOp(=========== ${EXTEN} ===============)
exten => 2,1,NoOp(=========== ${EXTEN} ===============)

exten => t,1,NoOp(timeout)
exten => i,1,NoOp(timeout)

–Satish Barot
satish4asterisk@gmail.com

Don’t get what you are trying to do here, but you the read command can play multiple files and take input from the user. You can use if conditions to route your call according to the input. Hope this helps.

exten => s,n,Read(RESPONSE,vm-enter-num-to-call&vm-leavemsg&vm-pls-try-again&vm-sorry&digits/1&digits/2,1,2,6)
exten => s,n,gotoif(["${RESPONSE}"=“1”]?one:two)
exten => s,n(one),NoOp(=========== ${RESPONSE} ===============)
exten => s,n,Hangup
exten => s,n(two),NoOp(=========== ${RESPONSE} ===============)
exten => s,n,Hangup

Thank you for your reply.

We are having asterisk - 1.4. In Asterisk 1.4: the “filename” field does not accept concatenation (file1&file2&file…). It does work in 1.8.4 and possibly earlier versions.

Any other way to accomplish this ?

There are two solutions that come to my mind if you cannot concatenate the file names.

  1. Use Background multiple times to play all the files, then use waitexten to get the input.

  2. Easier way would be to join all the audio files into one file, then play it. :wink: