We are currently adding support for Asterisk 12 + 13, including PJSIP, to our AMI application. One of the requirements we have is to auto answer initial origination callbacks, and some calls that are transferred. With Asterisk 1.8, 10, and 11 we did this via the SIPADDHEADERxx variable. For originations these variables would be set in the origination action. For transfers these variables would be set via VarSet actions prior to sending the transfer Action.
I have determine that we can use the following origination action for PJSIP, which works without issue:
action: Originate
actionid: 1310932721_29#0.4266931641642656
variable: PJSIP_HEADER(add,Call-Info)=\;answer-after=0
variable: XMLNamespaceOrigDestExt=100
variable: PJSIP_HEADER(add,Alert-Info)=Ring Answer
variable: PJSIP_HEADER(add,Alert-Info)=ring-answer
variable: PJSIP_HEADER(add,Alert-Info)=<http://www.notused.com>\;info=alert-autoanswer\;delay=0
channel: PJSIP/300
priority: 1
exten: 100
timeout: 30000
async: true
context: from-internal
callerid: "300" <300>
Auto answer for transfer, on the other hand, does not work as expected. The following is a list of events I assumed would work based on my experience with the SIPADDHEADERxx variable, however none of the headers exist in the SIP invite after the Redirect action is initialized:
[code]action: SetVar
actionid: 1928204817_40#
variable: PJSIP_HEADER(add,Alert-Info)
channel: PJSIP/200-0000001a
value: Ring Answer
action: SetVar
actionid: 1928204817_41#
variable: PJSIP_HEADER(add,Alert-Info)
channel: PJSIP/200-0000001a
value: ring-answer
action: SetVar
actionid: 1928204817_42#
variable: PJSIP_HEADER(add,Alert-Info)
channel: PJSIP/200-0000001a
value: http://www.notused.com;info=alert-autoanswer;delay=0
action: SetVar
actionid: 1928204817_43#
variable: PJSIP_HEADER(add,Call-Info)
channel: PJSIP/200-0000001a
value: ;answer-after=0
action: Redirect
actionid: 1928204817_44#0.2539451841541377
context: from-internal
channel: PJSIP/200-0000001a
priority: 1
exten: 300[/code]
Could someone tell me if auto answer with PJSIP via the AMI is possible on a transfer, and if so what is the correct way to accomplish it.
Thank You,
Mike