Contact URI User in SIP header

My service provider is rejecting my calls due to the fact that in the Contact URI in the header is as per below:

I need the Contact URI User Part to be the root number. Does anyone know which field this is when configuring a PJSIP trunk?

Thanks

I have tried entering the root number in the Contact User field within the advanced settings of the PJSIP trunk

strong text

That GUI field is for the trunk registration, and you are looking to set it for the trunk endpoint. AFAIK, the only way to do this is by looking in the file pjsip.endpoint.conf to determine the trunk name and then editing the file pjsip.endpoint_custom_post.conf with:

[trunk_name](+type=endpoint)   ; sub actual trunk name between []
contact_user=MrGrinch

It did not seem to work.

My endpoint configuration is as per below:

[to_supplier_pri]
type=endpoint
transport=0.0.0.0-tcp
context=from-pstn-toheader
disallow=all
allow=alaw,ulaw,gsm,g726,g722
aors=to_a1_pri
language=en
outbound_auth=to_supplier_pri
from_domain=siptrunk.supplier.net
from_user=sip:[email protected]
t38_udptl=no
t38_udptl_ec=none
fax_detect=no
trust_id_inbound=no
t38_udptl_nat=no
direct_media=no
rewrite_contact=yes
rtp_symmetric=yes
dtmf_mode=auto

I have then created the following into the

[to_supplier_pri](+type=endpoint)   ; sub actual trunk name between []
contact_user=+44852852852

Restarted asterisk and the Contact URI has not changed and still getting all circuits are busy with a rejection from the SIP provider.

Would this be the only way?

Thanks

You added the extra lines to the correct file? Did you do an apply config after the edit?

fwconsole reload

This is incorrect. This is not a user this is a URI, only the user goes here. Which would be +44852852852 because what you have here will basically make it

<sip:sip:[email protected]@siptrink.supplier.net>

from_user=+44852852852

or maybe
from_user=44852852852

Thanks! This worked and the contact user was changed, however the provider is now rejecting the calls because they say the To: user in the SIP header also needs to be the same.

Is this done in the same pjsip.endpoint_custom_post.conf file?

Why do they care about the Contact header? This is meant to be something you configure on your client to specify how the server contacts you.

Are you actually using a SIP trunk provider or is this a connection to a provisioned (residential, single-phone-type) service?

This is a SIP trunk provider.

Originally they specified that we must set the contact header as:
e.g. sip:[email protected]:5060

but it was sending as [email protected]:5060

We managed to get this working thanks to @lgaetz however they now specify that the To header is wrong and also needs to be sip:[email protected]:5060

When I am doing a wireshark, I can see that user is the number you have dialled. e.g. if I dialled 0191345678 it is [email protected]:5060 and not the same as the contact as previously fixed.

I think this provider does not understand SIP. There is really not a reason for them to demand how you set your Contact header. If you wanted to set it as sip:[email protected] so that incoming messages (INVITEs or whatever, attached to your registration, or in-dialog replies) are sent to that user, that is exactly what the Contact header is for…

This is where we just say “Sigh” and let it go. Some of these (especially new) SIP providers are just cray-cray sometimes.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.