Playback message is not playing in outbound call after answer

After triggering an outbound call, it is initiating the call, and I’m receiving the call on phone, but after answering the call it is only playing the dial tone, not playing the message. My dialplan is as shown below. Can anyone please help

[outbound]
;exten => _9X.,1,SipAddHeader(P-Preferred-Identity:sip:+91XXXXXXX@provider)
exten => _9X.,1,Progress()
exten => _9X.,n,Dial(SIP/${EXTEN:1}@provider)
exten => _9X.,n,Playback(custom/sample)
exten => _9X.,n,Hangup()

I believe you want to use the “A()” option in the Dial app. For example:

Dial(SIP/${EXTEN:1}@provider,,A(custom/sample))

Instead of using the Playback app.

This is working, but after playing the message it is playing the dial tone again, is this regular way to do ? or is there any other way to do because, this is very basic dial plan In future I’ll have AGI integrated.

Try using Answer() instead of Progress().

Okay I understood, now it is not playing the dial tone, but problem is after Dial() line it is not executing or going to next lines in dial plan.

The Dial app is active until hangup, then the dial plan (or hangup handler) continues.
What do you have after the Dial app?

I want to call AGI application or call Goto application to continue the call flow

You can capture the hangup with this:
exten=h,1,Gosub…

No, How will it go into the flow? like for inbound it is continuing the flow

exten => _9X.,1,Answer()
exten => _9X.,n,NoOp(trunkinbound answered)
exten => _9X.,n,Playback(custom/sample)
exten => _9X.,n,Hangup()

But for outbound it is not continuing the flow, can you please help me in this to understand how to go into other flows after triggering an outbound call?

Maybe the ‘g’ option in Dial.
Here’s all the options: Asterisk 20 Application_Dial - Asterisk Project - Asterisk Project Wiki

Nope!! this is not working. What is genuine way to continue with the flow, I’m not able to sort it out.

This is working with G
but worried about the note mentioned in the documentation, do you have any idea on this?

  • G ( context^exten^priority ) - If the call is answered, transfer the calling party to the specified priority and the called party to the specified priority plus one.
    NOTE: You cannot use any additional action post answer options in conjunction with this option.
    • context
    • exten
    • priority

They actually said g, not G. However, more generally I think you need to provide quite a detailed description of the intended behaviour. You should also check on the meaning of dialtone, as I would not expect dialtone here. What you might get is ringback tone.

You seem to making a fairly common mistake and assuming that Dial only dials, and the dialplan continues after that, but what you are actually trying to do is not clear enough for me to suggest the right way of doing it.

Thank You david, let me try to explain
I’m trying to build a simple voice application where, we can trigger an outbound call to a number. After person answers the call it has to play an message and take input from DTMF based on that DTMF input it may change to switch the context.

Use Originate

The Dial app has the ‘t’ option to capture DTMF from the called party. You will need to enable the “blindxfer” in the “[featuremap]” in the features.conf file.

I still think this is a case for Originate. I think the OP has dug themselves into a hole based on a misunderstanding about what Dial does.

HI all, Can anyone tell me why call is not getting triggered? for below dial plan

[outbound]
exten => _9X.,1,SipAddHeader(P-Preferred-Identity:sip:+914043792233@ap.ims.airtel.in)
;same => n,Answer()
same => n,Set(DESTINATION_NUMBER=${FILTER(A-Za-z0-9,${EXTEN})})
same => n,NoOp(peer : ${DESTINATION_NUMBER})
;same => n,Set(CALLERID(all)=+914043792233)
same => n,NoOp(my callerid is ${CALLERID(num)} ${CALLERID(all)} AND ${CALLERID(name)} ${DIALSTATUS})
;same => n,Dial(SIP/${EXTEN:1}@airtel,50,G(trunkoutbound,${EXTEN},1))
;same => n,Originate(SIP/airtel/${DESTINATION_NUMBER},exten,trunkinbound,1001,50)
same => n,Originate(SIP/airtel/${DESTINATION_NUMBER},app,Playback,custom/opening,50)
same => n,Log(NOTICE, Alice call result: ${DIALSTATUS})
same => n,Hangup()

Below is asterisk logs

console dial 90XXXXXXXXXX@outbound
[Jun 30 06:58:23] WARNING[1747]: chan_oss.c:500 setformat: Unable to re-open DSP device /dev/dsp: No such file or directory
[Jun 30 06:58:23] NOTICE[1747]: console_video.c:137 console_video_start: voice only, console video support not present
– Executing [90XXXXXXXXXX@outbound:1] SIPAddHeader(“Console/dsp”, “P-Preferred-Identity:sip:+91XXXXXXXXXX@ap.ims.airtel.in”) in new stack
– Executing [90XXXXXXXXXX@outbound:2] Set(“Console/dsp”, “DESTINATION_NUMBER=90XXXXXXXXXX”) in new stack
– Executing [90XXXXXXXXXX@outbound:3] NoOp(“Console/dsp”, “peer : 90XXXXXXXXXX”) in new stack
– Executing [90XXXXXXXXXX@outbound:4] NoOp(“Console/dsp”, "my callerid is “” <> AND ") in new stack
– Executing [90XXXXXXXXXX@outbound:5] Originate(“Console/dsp”, “SIP/airtel/90XXXXXXXXXX,app,Playback,custom/opening,50”) in new stack
== Using SIP RTP CoS mark 5
– Called airtel/90XXXXXXXXXX
> 0x7f03fc008050 – Strict RTP learning after remote address set to: 10.5.64.99:6494
– SIP/airtel-00000000 is making progress
> 0x7f03fc008050 – Strict RTP switching to RTP target address 10.5.64.99:6494 as source

I’m not getting any call after 50 seconds (as mentioned in timeout) it is going to Hangup() application, more over Originate is not allowing me to trigger more than one call at a time

You set a timeout of 50 seconds and the call wasn’t answered in that time.

Note that chan_sip is deprecated, and SIPAddHeader probably won’t work here. If you need that, non-standard header, you will need to originate to a local channel.

If you are sending to lots of destinations, you should probably use call files. However, you could also use the async options on originate.

You set a timeout of 50 seconds and the call wasn’t answered in that time.
---- I did not get any call to answer, Originate is working now, issue was with the format for phone number, but again after finishing this timeout it is ending the call even after call is answered, it is not going to below lines, below is my dial plan

[outbound]
exten => _0X.,1,SipAddHeader(P-Preferred-Identity:<sip:+XXXXXXXXXXXX@ap.ims.airtel.in>)
    ;same => n,Answer()
    same => n,Set(DESTINATION_NUMBER=${FILTER(A-Za-z0-9,${EXTEN})})
    same => n,NoOp(peer : ${DESTINATION_NUMBER})
    same => n,NoOp(my callerid is ${CALLERID(num)} ${CALLERID(all)} AND ${CALLERID(name)} ${DIALSTATUS})
    same => n,Originate(SIP/airtel/${DESTINATION_NUMBER},app,Playback,custom/opening)
    same => n,Playback(custom,m1)
    same => n,Log(NOTICE, Alice call result: ${DIALSTATUS})
    same => n,Hangup()


Note that chan_sip is deprecated, and SIPAddHeader probably won’t work here. If you need that, non-standard header, you will need to originate to a local channel.

                         --- In asterisk 13 is it depricated?

Can you please give me a sample dial plan to trigger outbound call, play welcome message and take an keypad input? Can any one connect with me, I need help very badly.