Coming back from this topic Play a sound file to the callee before the actual call start - #8 by tomeko
Hope i can make things a bit clearer.
How can i play a greeting to the callee when it picks up the phone. Before the conversation starts.
- Caller dials a number
- Callee picks up the phone
- Play a greeting
- Continue with the call.
Just found out about the A option. Which does exactly what i need. One thing i don’t understand.
Not working
same => n,Dial(PJSIP/+${ctbEmployeeOutboundNumber}@${ctbSipProviderEndpoint}&PJSIP/${ctbEndPointEndpoint},${ctbDialTimeOut},b(ctbOutboundCallStartHeaders^addheader^1),A(/etc/asterisk/dialplans/chattabai/prompts/nl/welcome))
Working
same => n,Dial(PJSIP/+${ctbEmployeeOutboundNumber}@${ctbSipProviderEndpoint}&PJSIP/${ctbEndPointEndpoint},${ctbDialTimeOut},A(/etc/asterisk/dialplans/chattabai/prompts/nl/welcome),b(ctbOutboundCallStartHeaders^addheader^1))
The difference is the b option, in the first example its placed after the b option and in the second example its placed before the b option.
Why does this make any difference ?
Greeting Jerome
, delimits parameters, not options. The first example only has a b option, and the second only has an A one.
So how do i combine both the A and b option. They need to work both
Its not really clear to me what you mean with that reply. Looking at
https://docs.asterisk.org/Asterisk_20_Documentation/API_Documentation/Dialplan_Applications/Dial/
With the syntax
Dial(Technology/Resource&[Technology2/Resource2[&...]],[timeout,[options,[URL]]]])
Option A
A( x:y ) - Play an announcement to the called and/or calling parties, where x is the prompt to be played to the called party and y is the prompt to be played to the caller. The files may be different and will be played to each party simultaneously.
And option b
b( context^exten^priority ) - Before initiating an outgoing call, 'Gosub' to the specified location using the newly created channel. The 'Gosub' will be executed for each destination channel.
I want both option A and b to be executued.
- Play an announcement
- And a ‘GoSub’
How does the syntax look like like in this situation, cause you are right. The first one is executed, the second one is not
same => n,Dial(PJSIP/+${ctbEmployeeOutboundNumber}@${ctbSipProviderEndpoint}&PJSIP/${ctbEndPointEndpoint},${ctbDialTimeOut},A(${ctbPromptEmployeeAnnouncement}),b(ctbVariableOutboundCallStartHeaders^addheader^1))
Console output
-- Executing [1@ctbVariableOutboundCallStartSuccess:14] Dial("PJSIP/twilio-00000017", "PJSIP/+xxx@twilio&PJSIP/B92411F6-D7C1-4F0A-830D-32BCA1380B9B,30,A(/etc/asterisk/dialplans/chattabai/prompts/en/employeeAnnouncement),b(ctbVariableOutboundCallStartHeaders^addheader^1)") in new stack
Found the correct syntax. By just removing the ‘,’ its working
same => n,Dial(PJSIP/+${ctbEmployeeOutboundNumber}@${ctbSipProviderEndpoint}&PJSIP/${ctbEndPointEndpoint},${ctbDialTimeOut},b(ctbVariableOutboundCallStartHeaders^addheader^1)A(${ctbPromptEmployeeAnnouncement}))