M4 PAI And RPID Header Generation
From Kolmisoft Wiki
Jump to navigationJump to search
M4 can generate P-Asserted-Identity (PAI) and Remote-Party-ID (RPID) headers
Usage
Go to Users -> Connection Points, click EDIT on Connection Point. PAI/RPID Transformations are located under Termination Point Signaling Settings.
Generation can happen under Generate if missing and Overwrite tabs.
Generation format
Generation string should be either:
- a static string (the value of the RPID/PAI header)
- a string mixed with Kamailio variables
Examples
<sip:3701234567@myhost.sip> - simple static generation. <sip:anonymous@anonymous.invalid> - simple static generation. <sip:$fU@myhost.sip> - using Kamailio variable $fU to generate a header with the original value from SIP FROM header
PAI Transformation field:
/^(.*<sip:[^@]+@)[^>;]+(.*)/\1myhost.com\2/
Test PAI:
echo '<sip:3701234567@192.168.1.165:5060;user=phone>' | sed -E 's/(.*<sip:[^@]+@)[^>;]+(.*)/\1myhost.com\2/'
Expected output:
<sip:3701234567@myhost.com;user=phone>
RPID Transformation field:
/^(.*<sip:[^@]+@)[^>;]+(.*)/\1ngnics.com\2/
Test RPID:
echo '<sip:3701234567@192.168.1.165:5060>;privacy=off;screen=yes' | sed -E 's/(.*<sip:[^@]+@)[^>;]+(.*)/\1myhost.com\2/'
Expected output:
<sip:3701234567@myhost.com>;privacy=off;screen=yes
See also
- M4 RPID/PAI Forwarding/Host changing
- M4 Origination Points
- M4 Termination Points
- M4 Transformations
