How to modify P-Asserted-Identity and FROM headers on outbound calls?

Status
Not open for further replies.

Jennings9

New Member
Jan 24, 2023
4
0
1
25
When I fill in the field "Outbound Caller ID Name" and "Outbound Caller ID Number" I understand this fills out my FROM and PAID/RPID header automatically.

There are some extensions that I would like a custom FROM and P-Asserted-Identity sent out for Outbound calls - how would I do this?

I have tried various things like unsetting and setting/exporting the sip_h_P-Asserted-Identity variable, which does create a 2nd PAID but does not get rid of the 1st header.

Ideally, when I dial *67 I want it to set Privacy: id like it does but then automatically set the FROM to anonymous@anonymous.invalid rather than leaving the FROM visible but then also leaving the P-Asserted-Identity header intact as the real caller-id.

If the above not possible, just force the headers to be set to what I define for all calls on one specific extension regardless of if *67 is specified or not.

We use FusionPBX for testing, so we need to generate a wide range of scenarios including how calls might arrive from a carrier, hence the request above.
 

hfoster

Active Member
Jan 28, 2019
684
81
28
34
>We use FusionPBX for testing, so we need to generate a wide range of scenarios including how calls might arrive from a carrier, hence the request above.

Look at https://github.com/SIPp/sipp for this task. You build a porfolio of SIP scenarios and can replay them at will. Very flexible

As for changing FusionPBX behaviour, I think what you will need to do is set the appropriate FreeSWITCH variables in the outbound route in question:

<action application="set" data="sip_from_host=anonymous.invalid">
<action application="set" data="sip_from_user=anonymous">
<action application="bridge" data="sofia/gateway/primary/$1"/>

I haven't tried this myself as our trunks reject this.
 

Jennings9

New Member
Jan 24, 2023
4
0
1
25
>We use FusionPBX for testing, so we need to generate a wide range of scenarios including how calls might arrive from a carrier, hence the request above.

Look at https://github.com/SIPp/sipp for this task. You build a porfolio of SIP scenarios and can replay them at will. Very flexible

As for changing FusionPBX behaviour, I think what you will need to do is set the appropriate FreeSWITCH variables in the outbound route in question:

<action application="set" data="sip_from_host=anonymous.invalid">
<action application="set" data="sip_from_user=anonymous">
<action application="bridge" data="sofia/gateway/primary/$1"/>

I haven't tried this myself as our trunks reject this.
Thanks for the response. I have tried this in my outbound route to test with and it still sends the FROM and P-Asserted-Identity to whatever is specified in the extension's outbound caller ID settings. I also tried the settings in my *67 settings inside of the Dialplan Manager but this didn't work either.

Also, thanks for the suggestion with SIPp, we do use this for load testing already as well as sippy_cup (https://github.com/mojolingo/sippy_cup) to avoid editing the SIPp .xml files
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
Just before the bridge in the dialplan set the equivalent ot this:

Code:
<action application="set" data="sip_h_P-Asserted-Identity=sip:blah@whatever" />
<action application="set" data="sip_cid_type=none"/>

The setting cid type to none stops the gateway adding its own pid.

Hope this helps
 

Jennings9

New Member
Jan 24, 2023
4
0
1
25
Just before the bridge in the dialplan set the equivalent ot this:

Code:
<action application="set" data="sip_h_P-Asserted-Identity=sip:blah@whatever" />
<action application="set" data="sip_cid_type=none"/>

The setting cid type to none stops the gateway adding its own pid.

Hope this helps
Thanks for the reply.

This is the stage I got to last time, it is adding my 2nd P-Asserted-Identity header fine but still sending my previous FROM and P-Asserted-Identity based on what I am specifying in my extension outbound caller ID settings after adding the 2 things you mentioned. Here's an invite out to the gateway:

Code:
2023/02/01 10:51:10.451700 172.30.0.137:5080 -> externalgateway:5060
INVITE sip:+441214433443@externalgateway SIP/2.0
Via: SIP/2.0/UDP mydomain.net:5080;rport;branch=z9hG4bKer1ce9eN2Sj5F
Max-Forwards: 69
From: "Jennings9" <sip:01214433443@fusionpbx.mydomain.net>;tag=XS3cU8X0cy90N
To: <sip:+441214433443@externalgateway>
Call-ID: 2e000a18-1cc1-123c-a6b1-06e346e48953
CSeq: 63070543 INVITE
Contact: <sip:gw+dd5063ee-7b4d-442e-9e02-77b2f1783ce9@mydomain:5080;transport=udp;gw=dd5063ee-7b4d-442e-9e02-77b2f1783ce9>
User-Agent: FreeSWITCH
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY
Supported: path, replaces
Allow-Events: talk, hold, conference, refer
Privacy: none
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 297
X-FS-Support: update_display,send_info
P-Asserted-Identity: "Jennings9" <sip:01214433443@fusionpbx.mydomain.net>
P-Asserted-Identity: <sip:blah@whatever>
 

Jennings9

New Member
Jan 24, 2023
4
0
1
25
Where did you add the settings?
Dialplan -> Outbound Routes

Then I picked the outbound route that would've taken the call. Is this the right place?

This is not ideal for me to be honest as I wanted to make it for one specific extension only but I just wanted to at least get it working somehow.

I would have just create another outbound route that shares the gateway but matches on *67 instead and just force it to do this on *67 calls only.
 
Status
Not open for further replies.