[SOLVED] PJSIP OPTIONS - tweaking headers


#1

Hello everyone
I recently changed from chan_sip to PJSIP and want to know what are the configuration parameters responsible for the content of From and Contact headers in the OPTIONS request.


#2

What are you wanting to change and why?


#3

As stated at the beginning, I want to change From and Contact headers, userpart only.
My Asterisk configuration files are generated by FreePBX and currently I see the trunk names there as they were configured in FreePBX:

<--- Transmitting SIP request (451 bytes) to TLS:x.x.x.x:5061 --->
OPTIONS sip:12345678@domain.tld:5061 SIP/2.0
Via: SIP/2.0/TLS 192.168.1.88:5061;rport;branch=xxxxxxxxxxxxxxx;alias
From: <sip:TRUNKNAME@domain.tld>;tag=xxxxxxxxxxxxx
To: <sip:12345678@domain.tld>
Contact: <sip:TRUNKNAME@192.168.1.88:5061;transport=TLS>

I want to get back to the old scenario where those messages were sent from asterisk as I recall.


#4

PJSIP_HEADER allows you to read specific SIP headers from the inbound PJSIP channel as well as write(add, update, remove) headers on the outbound channel. But this is this functions works for INVITE request, and it wont allow you to change from and contact header


#5

I think what you want is the “from_user” parameter on pjsip endpoints.


#6

Thank you, @gjoseph - that was obvious, but on the trunk I used as an example I intentionally had no “from_user” configured as I use “From:” header to dynamically send my Caller Id. Thanks again!


#7