SIP_HEADER on P-Asserted-Identity value


I am trying to capture P-Asserted-Identity value using SIP_HEADER command but it does not work and I get empty string. My diaplan is exten => s,n,Set(RPID=${SIP_HEADER(P-Asserted-Identity)})

I can read other variables such as TO and FROM.

I am using Asterisk 11.16.0 and PAI from wireshark (just for confirmation):
P-Asserted-Identity: “Tester1” sip:7001@
SIP Display info: "Tester1"
SIP PAI Address: sip:7001@
SIP PAI User Part: 7001
SIP PAI Host Part:

CAll scenario is attended transfer.

Any ideas what am I missing?
Thank you in advance.


Why cant you use trustrpid=yes?

I have used both sendrpid=pai and trustrpid=yes

If you use trustrpid=yes, the information should be available using ${CALLERID(…)}

Thanks David.

I made a mistake by calling SIP_HEADER before Dial().

I use macro in Dial then calling SIP_HEADER. I want to capture original caller ID in attended transfer but the macro captures second last INVITE.

Can I detect attended transfer (last INVITE) in dial plan?

A SIP attended transfer is indistinguishable from a normal SIP call before Dial is called.

For a features.conf attended transfer, the SIP both SIP calls are outgoing, the transferror identity identity hasn’t changed, and there is nothing that would force there to be even any SIP signalling from the trasnferror.