Add PJSIP_HEADER in call files?

Hi,

Is there any way to add a pjsip header using call files?
I need to add this line PJSIP_HEADER(add,Call-Info)=;answer-after=0") so the phone can auto answer and call another extension.
I know I can do it with AMI, but I need to do it with the originate command or a call file.

All I got so far is this call file:

Channel:PJSIP/UT_4472
Callerid:Jack
WaitTime:10
MaxRetries:0
RetryTime:300
Context:internal
Extension:audio_alim
Priority:1

As usual, the solution is to invoke a local channel, rather than to directly dial the number.

Also that application adds a SIP header, using PJSIP; it doesn’t add a “PJSIP Header”.

I cannot get local channel to work. Do you have any example? Asterisk would be calling the extension then?

https://wiki.asterisk.org/wiki/display/AST/Using+Callfiles+and+Local+Channels

You are not currently calling an extension in Asterisk terms.

Thank you for for your help.
Here’s what works for me using local channel:

My call files:

Channel:Local/2005@internal
Callerid:Jack
WaitTime:60
MaxRetries:0
RetryTime:300
Context:internal
Extension:2010
Priority:1

My dialplan:

exten => 2005,1,NoOp(Internal calls)
same => n,Dial(PJSIP/2005,20,b(paging_handler^addheader^1))
same => n,Hangup()

;Predial handler
[paging_handler]
exten => addheader,1,Set(PJSIP_HEADER(add,Call-Info)=\;answer-after=0)
same => n,Return()
1 Like