P-Asserted-Identity and Remote-Party-ID header

Remote-Party-Id


This header was defined in a failed RFC : http://tools.ietf.org/html/draft-ietf-sip-privacy-00 . Although this header is supported by SIP devices and SIP PBXs, this was never accepted as a standard. You should not be using this header.

Some SIP trunk providers only support Remote-Party-ID header.

P-Asserted-Identity and Privacy Headers


P-Asserted-Identity and Privacy headers are defined in RFC 3325. The P-Asserted-Identity contains the caller id information for the call on the INVITE SIP packet. The Privacy header contains information on which parts of the caller id are private.

This is the acceptable way to specify privacy information for calls.

SIP header Privacy: user,id is equivalent to *67 on the PSTN in North America.



Asterisk and Trixbox


I spent some time messing with this since there is little to no documentation on such things regarding Asterisk or Trixbox. Since I had such a hard time of it, I thought I would write a really short howto so that maybe others will have it bit easier.

Remote Party ID:

This was the easier of the two. In sip.conf you must set the two variables

sendrpid = yes
trustrpid = no



P-Asserted-Identity:

This was more difficult to figure out and had far less documentation. To add headers we use the SipAddHeader() function in the dial plan, extensions.conf, or for trixbox, extensions_custom.conf.

in our trixbox extensions_custom.conf we have set up the following... assuming you dial from the [from-internal] context

include extensions_trixbox.conf
include extensions_hud.conf

[from-internal-custom]
exten => _1NXXNXXXXXX,1,SipAddHeader(P-Asserted-Identity: <sip:${CALLERIDNUM}>)
exten => _NXXNXXXXXX,1,SipAddHeader(P-Asserted-Identity: <sip:${CALLERIDNUM}>)

include => from-internal-trixbox


You may substitute whatever you want in side the < > a provided ID number or whatever... we just set callerid for demonstration purposes.

Obviously you can also change, or add a dial pattern, or specific extension in place of the _NXX for example

exten => 2000,1,SipAddHeader(P-Asserted-Identity: <sip:${CALLERIDNUM}>)

would only add headers when extension 2000 dialed.

Testing:
To test that your headers are being added, start the asterisk console and make a call that would match the extension pattern. You should see some thing like the following on your cli

-- Executing SIPAddHeader("SIP/2001-0857e7b8", "P-Asserted-Identity: <sip:2001>") in new stack

To further test, you can run tshark (the new name for ethereals command line packet capture tethereal) on your asterisk server when you make the call and capture sip packets to a log file

  1. tshark port 5060 -w sip.cap

After you place the call hit ctrl+c to close tshark then open up sip.cap and look for the appropriate header entry in the packet.

Remote-Party-ID: "eric" <sip:2001@123.123.123.123>;privacy=off;screen=no


AND


P-Asserted-Identity: <sip:2001>


Thats it you have both P-asserted-id and Remote-party-id in your sip packet headers!

See also

  • changes to sendrpid in Asterisk 1.8 with the pai argument for P-Asserted-Identity
  • CONNECTEDLINE and REDIRECTING functions in Asterisk 1.8

Remote-Party-Id


This header was defined in a failed RFC : http://tools.ietf.org/html/draft-ietf-sip-privacy-00 . Although this header is supported by SIP devices and SIP PBXs, this was never accepted as a standard. You should not be using this header.

Some SIP trunk providers only support Remote-Party-ID header.

P-Asserted-Identity and Privacy Headers


P-Asserted-Identity and Privacy headers are defined in RFC 3325. The P-Asserted-Identity contains the caller id information for the call on the INVITE SIP packet. The Privacy header contains information on which parts of the caller id are private.

This is the acceptable way to specify privacy information for calls.

SIP header Privacy: user,id is equivalent to *67 on the PSTN in North America.



Asterisk and Trixbox


I spent some time messing with this since there is little to no documentation on such things regarding Asterisk or Trixbox. Since I had such a hard time of it, I thought I would write a really short howto so that maybe others will have it bit easier.

Remote Party ID:

This was the easier of the two. In sip.conf you must set the two variables

sendrpid = yes
trustrpid = no



P-Asserted-Identity:

This was more difficult to figure out and had far less documentation. To add headers we use the SipAddHeader() function in the dial plan, extensions.conf, or for trixbox, extensions_custom.conf.

in our trixbox extensions_custom.conf we have set up the following... assuming you dial from the [from-internal] context

include extensions_trixbox.conf
include extensions_hud.conf

[from-internal-custom]
exten => _1NXXNXXXXXX,1,SipAddHeader(P-Asserted-Identity: <sip:${CALLERIDNUM}>)
exten => _NXXNXXXXXX,1,SipAddHeader(P-Asserted-Identity: <sip:${CALLERIDNUM}>)

include => from-internal-trixbox


You may substitute whatever you want in side the < > a provided ID number or whatever... we just set callerid for demonstration purposes.

Obviously you can also change, or add a dial pattern, or specific extension in place of the _NXX for example

exten => 2000,1,SipAddHeader(P-Asserted-Identity: <sip:${CALLERIDNUM}>)

would only add headers when extension 2000 dialed.

Testing:
To test that your headers are being added, start the asterisk console and make a call that would match the extension pattern. You should see some thing like the following on your cli

-- Executing SIPAddHeader("SIP/2001-0857e7b8", "P-Asserted-Identity: <sip:2001>") in new stack

To further test, you can run tshark (the new name for ethereals command line packet capture tethereal) on your asterisk server when you make the call and capture sip packets to a log file

  1. tshark port 5060 -w sip.cap

After you place the call hit ctrl+c to close tshark then open up sip.cap and look for the appropriate header entry in the packet.

Remote-Party-ID: "eric" <sip:2001@123.123.123.123>;privacy=off;screen=no


AND


P-Asserted-Identity: <sip:2001>


Thats it you have both P-asserted-id and Remote-party-id in your sip packet headers!

See also

  • changes to sendrpid in Asterisk 1.8 with the pai argument for P-Asserted-Identity
  • CONNECTEDLINE and REDIRECTING functions in Asterisk 1.8
Created by: etamme, Last modification: Wed 07 of Aug, 2013 (16:02 UTC) by dlublink
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+