Get A SHAKEN Identity Token
Hi All. We have old Asterisk servers, 1,89, (we cannot upgrade because of several reasons) and we are now implementing SHAKEN via our provider. We place a SIP call to our provider and they return a 302 (information below). I am trying to get the X-Identity information below, but I do not seem to be able to do so. Can somebody help me with this? Any suggestions on how to get it?
Thank you, All. Very much appreciated!
<--- SIP read from UDP:XXX.XXX.XXX.XXX:5060 --->
SIP/2.0 302 STIR/SHAKEN
Via: SIP/2.0/UDP
XXX.XXX.XXX.XXX:5066;received=XXX.XXX.XXX.XXX;branch=z9hG4bK37b49c97;rport=5066
From: “12125551212”
To:
3 thoughts on - Get A SHAKEN Identity Token
The chan_sip module does not provide the ability to access this information, ‘nor does chan_pjsip in recent versions.
Am 07.01.2021 um 23:49 schrieb Alexander Perkins:
I use SIP_HEADER to extract information from inbound SIP packets and SIPAddHeader to copy that info to the outgoing call leg. Maybe this helps you?
Example:
exten => _+X.,1,NoOp(${CALLERID(num)})
)
)
exten => _+X.,n,Set(PAI=${SIP_HEADER(P-Asserted-Identity)})
exten => _+X.,n,Set(PAI=${CUT(PAI,:,2)})
exten => _+X.,n,Set(PAI=${CUT(PAI,@,1)})
exten => _+X.,n,GotoIf($[“${CALLERID(num)}” = “anonymous”]?anonymous:cli)
exten => _+X.,n(anonymous),SIPAddHeader(P-Asserted-Identity: “${PAI}”
exten => _+X.,n,SIPAddHeader(Privacy: user\;id)
exten => _+X.,n,Goto(dial)
exten => _+X.,n(cli),SIPAddHeader(P-Asserted-Identity: “${PAI}”
exten => _+X.,n,SIPAddHeader(Privacy: id)
exten => _+X.,n,Goto(dial)
—
Hi Markus. Thanks a bunch! I will try that out!