I try to change the user part of the contact header. I have configured a SIP trunk.
If I made an outbound call the INVITE message contains always the following contact header sip:asterisk@192.168.40.33.
I have trying some changes in the pjsip.conf but nothing works. I’ve got always the same contact header.
The only requirement on Contact headers is that they be recognizable by the entity that sets them and should route the response back to that entity. The user part does not have to represent anything meaningful in the real world.
What is the source of your requirement for semantics beyond those required by the RFCs?
Sorry, I have seen the first post missing the contact header example. Asterisk always includes the following contact header sip:asterisk@192.168.1.11
I need the possibility to configure the value of the user port.
Especially I replace the value ‘asterisk’ with the user part of the from header.
For example, a SIP device with the phone number 12345 make an outgoing call to the SIP trunk.
The INVITE message of the SIP trunk should contains the following contact header sip:12345@192.168.1.11 instead of sip:asterisk@192.168.1.11.
There is no valid reason why this should be necessary. As I already said, your device seems to be reading more into the Contact header than it is allowed to read into it.
This seams like what I’m after, I may be mistaken though, I tried setting and doesn’t seam to change anything. Do you know what this does?
<configOption name="contact_user" default="">
<synopsis>Force the user on the outgoing Contact header to this value.</synopsis>
<description><para>
On outbound requests, force the user portion of the Contact header to this value.
</para></description>
</configOption>
Are you setting this in pjsip.conf or in the dialplan? We have a requirement from a carrier to dynamically set the contact for calls and I was looking for a way to do this.
I’d go with a supplier that implements SIP. The user part of the contact has no meaning to anything except the system that sent the Contact header. Often it doesn’t even have a meaning t that system.
For anyone wondering about this today it’s well documented.
;[mytrunk]
;type=registration
;contact_user=1234567890 ; On outgoing requests, force the user portion of the Contact
; header to this value (default: “”)
;[endpoint]
;contact_user=1234567890 ; On outgoing requests, force the user portion of the Contact
; header to this value (default: “”)