login | register
Fri 09 of Jan, 2009 [00:56 UTC]

voip-info.org

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

Created by: etamme,Last modification on Thu 04 of Oct, 2007 [16:41 UTC] by dmerel
P-Asserted-Identity and Remote Party ID SIP header

Some wholesale providers are now requiring that packets include P-Asserted-Identity or Remote Party ID in the header of SIP packets.

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!

Comments

Comments Filter
222

333Re: Duplicate fields - problem

by ibc, Sunday 20 of January, 2008 [13:08:12 UTC]
In case of PAI you can test if PAI header exists before adding the new one:
 GotoIf($["${SIP_HEADER(P-Asserted-Identity).....
222

333Duplicate fields - problem

by slakos, Tuesday 06 of November, 2007 [14:17:51 UTC]


222

333Duplicate fields - problem

by slakos, Tuesday 06 of November, 2007 [14:17:18 UTC]


222

333Duplicate fields - problem

by slakos, Monday 05 of November, 2007 [22:04:38 UTC]
If a sip device already sending Remote Party ID and/or P-Asserted-Identity. Below commands create duplicates. Is there a way to avoid double fields?