How can I add PAI on outgoing invites?

Hi

I have a follow up question regarding my last thread: FreePBX changing "FROM" field

Today I want to add the P-asserted-identity header into my outgoing SIP Invite to German Telekom. And maybe I need to edit the PAI somewhere to provide the number it needs to contain to allow the call to be accepted by the provider.
Can someone explain me how this can be done with Freepbx?
My Version is FreePBX 13.0.192.8, and I am using chan sip.

Thanks
Cheers

Enabling this setting in your pjsip trunk:

Testing and confirmed working:

  │P-Asserted-Identity: "My_Name" <sip:[email protected]>
  │Remote-Party-ID: "My_Name" <sip:[email protected]>;privacy=off;screen=no

Hi Igaetz

I don’t have this setting available in my trunk…

Sorry, I misread your question, the above setting is for pjsip.

Add these lines to your peer details:

trustrpid=yes
sendrpid=pai

Thanks, Igaetz

Will try that out once I am back at home this afternoon :slight_smile:

It does not want to work for me…
It is adding PAI, but not as I was expecting.

Fom an incoming invite:

P-AV-Message-Id: 2_1
Route: >sip:192.168.1.89;lr;phase=terminating;m-type=audio>
History-Info: >sip:[email protected]>;index=1, “Sascha SLT Wohnzimmer” >sip:[email protected]?Reason=SIP%3Bcause%3D302%3Btext%3D%22Moved%20Temporarily%22&Reason=Redirection%3bcause%3dCFI>;index=1.1, >sip:[email protected]>;index=2.1
P-Asserted-Identity: “Sascha 1692” >sip:[email protected]>
Max-Breadth: 60
P-Charging-Vector: icid-value="AAS:3347-acf53dc9e741e05fc00fb84e3fdb829"
Session-Expires: 1200;refresher=uac
Record-Route: >sip:[email protected];transport=udp;lr>
Record-Route: >sip:192.168.1.67:15060;transport=udp;ibmsid=local.1495200556906_2063446_2064241;lr;ibmdrr>
Record-Route: >sip:192.168.1.67:15061;transport=tls;ibmsid=local.1495200556906_2063446_2064241;lr;ibmdrr>
Record-Route: >sip:[email protected];transport=tls;lr>
Record-Route: >sip:192.168.1.60:5061;transport=tls;lr>
Min-SE: 1200
Alert-Info: >cid:[email protected]>;avaya-cm-alert-type=internal
Accept-Language: en
Contact: “Sascha 1692” >sip:[email protected]:5061;transport=tls;gsid=c93df4ee-5fe0-41e7-84fa-000c29b8fde3>
Allow: INVITE, ACK, OPTIONS, BYE, CANCEL, SUBSCRIBE, NOTIFY, REFER, INFO, PRACK, PUBLISH, UPDATE
Supported: 100rel, histinfo, join, replaces, sdp-anat, timer
Via: SIP/2.0/UDP 192.168.1.167;rport;branch=z9hG4bK843396824039733-AP;ft=192.168.1.167~13c4
Via: SIP/2.0/UDP 192.168.1.67:15060;rport=15060;ibmsid=local.1495200556906_2063447_2064242;branch=z9hG4bK843396824039733
Via: SIP/2.0/UDP 192.168.1.67:15060;rport;ibmsid=local.1495200556906_2063446_2064241;branch=z9hG4bK128639007732735
Via: SIP/2.0/TLS 192.168.1.167;branch=z9hG4bKc93ebf05fe041e784fe0c29b8fde3-AP;ft=4;received=192.168.1.167;rport=54777
Via: SIP/2.0/TLS 192.168.1.60;branch=z9hG4bKc93ebf05fe041e784fe0c29b8fde3
Via: SIP/2.0/TCP 192.168.1.3;branch=z9hG4bKc93ebf05fe041e784fe0c29b8fde3
User-Agent: Avaya CM/R017x.00.0.441.0 AVAYA-SM-7.0.1.1.701114
From: “Sascha 1692” >sip:[email protected]>;tag=c93e385fe041e784fc0c29b8fde3
To: >sip:[email protected]>
Call-ID: c93e3305fe041e784fd0c29b8fde3
Max-Forwards: 66
CSeq: 1 INVITE
Content-Type: application/sdp
Content-Length: 212
Av-Global-Session-ID: c93df4ee-5fe0-41e7-84fa-000c29b8fde3
P-Location: SM;origlocname=“mydomain.local”;origsiglocname=“mydomain.local”;origmedialocname=“mydomain.local”;termlocname=“AsteriskVoIPServer”;termsiglocname=“AsteriskVoIPServer”;smaccounting=“true”

Asterisk is sending this one to my provider:

Via: SIP/2.0/UDP 192.168.1.89:5060;branch=z9hG4bK26730112;rport
Max-Forwards: 70
From: “Sascha 1692” >sip:[email protected]>;tag=as1e25250f
To: >sip:[email protected]>
Contact: >sip:[email protected]:5060>
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: FPBX-AsteriskNOW-13.0.192.9(13.16.0)
Date: Mon, 03 Jul 2017 11:14:31 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
P-Asserted-Identity: >sip:0aaaa749476>
P-Asserted-Identity: “Sascha 1692” >sip:[email protected]>
Content-Type: application/sdp
Content-Length: 321

Why does it add another PAI so that I in the end have two? Why does the first PAI have the number only? Where is it coming from?

Whereby - as an explanation - 0aaaa749476 is my real number @ home and 0bbbb6223489 is the incoming external number I want to send out. At the end, the faked number should be shown as the calling number on all external destinations. My real home number should just act as a validation for my provider that it is me who is placing the call to allow the invite.

To show you the rest of my trunks SIP settings:

type=friend
username=0aaaa749476
fromuser=0aaaa749476
secret=mypassword
host=tel.t-online.de
nat=yes
dtmfmode=auto
canreinvite=update
fromdomain=tel.t-online.de
qualify=yes
insecure=very
maxexpirey=240
defaultexpirey=240
allow=g722&alaw&ulaw
trustrpid=yes
sendrpid=pai

Thanks for brainstorming :wink:

Cheers