Retaining P-Asserted Info
Hello Everyone,
Our switch is sending P-Asserted info to asterisk however the information is getting removed when asterisk forks the call. Is it possible to have asterisk retain the P-Asserted on the leg. This is quite important for valid functionality of our network.
Tried setting `sendrpid = yes` and still same problem. We really don’t want to have to `SipAddHeader` as it is already being formed by our switch.
Thanks in Advance,
Nick
8 thoughts on - Retaining P-Asserted Info
Am 16.02.2014 03:30, schrieb Nick Cameo:
From http://www.voip-info.org/wiki/view/Asterisk+SIP+trustrpid :
-snip-
P-Asserted-Identity Asterisk does nothing when it receives a P-Asserted-Identity header. It ignores it totally no matter what settings you use for “trustrpid” or
“sendrpid”. It does not copy it from an inbound call leg to an outbound call leg for a bridged SIP-to-SIP call.
-snip-
I use SIPAddHeader to achieve what you described.
For example, I have a DID provider who only sends P-Asserted-Identity, and at the same time a customer who needs that data as Remote-Party-ID, so I’m doing this to send it to him:
exten => _X.,n,Set(RPID=${SIP_HEADER(P-Asserted-Identity)})
\;privacy=off\;screen=no)
exten => _X.,n,Set(RPID=${CUT(RPID,\+,2-)})
exten => _X.,n,Set(RPID=${CUT(RPID,@,-1)})
exten => _X.,n,SIPAddHeader(Remote-Party-ID: “${RPID}”
Hello Markus,
Thank you so much for your response. Our switch is already generating the needed P-Asserted header:
P-Asserted-Identity: “John Doe”
; user=phone; nat=yes.
I really did not want to have to rebuild it using `SIPAddHeader`
however, if I have no choice, can someone please provide an extension rule that will include the exiting inbound leg line above in the outbound leg.
Kind Regards,
Nick.
HI
Have you tried:
sendrpid = pai ; Use the “P-Asserted-Identity” header
; to send the identity of the remote party
in the sip.conf?
Regards
Ish
Hello Ishfaq,
I just tried it and it did create a P-Asserted header however it contains the extension of the asterisk peer not what was passed by our switch. From the previous example:
P-Asserted-Identity: “222” (which is asterisk peer extension and not)
; user=phone; nat=yes. (which is being passed by the call leg)
P-Asserted-Identity: “John Doe”
Is there a flag that retains the rpid from the call leg?
Kind Regards,
Nick
No. Asterisk is a back to back user agent, not a proxy. Overriding the settings of a peer with the peer that it is bridged with is typically contrary to Asterisk’s nature. If you want to copy information from one SIP channel to another, you should do as Markus suggested.
Matt
Asterisk is a B2BUA — think of it as two calls, one inbound call from your switch to Asterisk and one for outbound call from Asterisk to the destination.
Using SIPAddHeader or similar is the proper way to copy headers from the inbound call to the outbound call in Asterisk.
—–Original Message—
Hey Guys, I really appreciate this and I apologize for asking however, we do not have any way to test in advance outside of our live environment. Can someone kindly provide a working extension rule that will retain the following P-Asserted info that is existent from the inbound-leg to the outbound-leg using `SIPAddHeader`:
P-Asserted-Identity: “John Doe”
; user=phone; nat=yes.
Forgive the noob,
Nick.
How about: SipAddHeader(${SIP_HEADER(P-Asserted-Identity)})
Might have some issues with the ; character being see as start of comment.
—–Original Message—