Asterisk16 PJSIP "Contact:" ( fqdn problem)

Call from Asterisk to
This is INVITE from Asterisk16 to :

Transmitting SIP request (806 bytes) to TLS:
Via: SIP/2.0/TLS;rport;branch=z9hG4bKPjd2eab8f8-666c-4cb0-94ed-cc747dafcd8a;alias
Contact: sip:asterisk@;transport=TLS

How to change the string
Contact: sip:asterisk@;transport=TLS
so that it would be in this form

Please, help me.

why do I need it?
This is answer from

VIA: SIP/2.0/TLS;branch=z9hG4bKPjd2eab8f8-666c-4cb0-94ed-cc747dafcd8a;rport;alias
REASON: Q.850;cause=21;text=“88a1e69a-e890-4ce4-922a-a8a158042533;Provided Trunk FQDN ‘’ is not allowed. Connection allows following fqdns:,”

in the field of Contact there has to be FQDN…


From the SIP RFC:

Contact contains a SIP or SIPS URI that represents a direct route to
contact Alice, usually composed of a username at a fully qualified
domain name (FQDN). While an FQDN is preferred, many end systems do not have registered domain names, so IP addresses are permitted.

So the requirement is invalid.

I can not affect Microsoft. ; (
Therefore, I am looking for - how to reconfigure an asterisk 16, so that in the Contact field, instead of the IP there was a FQDN…

Can anyone know what can be changed in the source code of pjsip?
how to achieve this by changing the configuration file asterisk pjsip.conf ?

If you don’t see an option in pjsip.conf or the wiki then there isn’t a way to do. (In fact such options HAVE to be documented when implemented and thus appear on the wiki).

Code modifications would be required, easiest option would be to follow contact_user and see how it is done.

Exactly known -
in which variable (array) is the generated header string?
"Contact: … "

That’s a developer question, but this is an end user forum. Also, as PJSIP is third party code, it is possible that the Asterisk developers didn’t need to touch that part of the code.

In which forum would you advise asking this question?


The asterisk-dev mailing list[1] can be used for developer discussion. I pointed to contact_user as a way to find the location as you’ll need to be able to find/understand things in order to modify the code. It’s done in the res/res_pjsip.c file, just search for contact_user.


Thank. I do not have much experience writing programs in C.
I hope it will be enough. :slight_smile:
I will try to look for the place I need in res_pjsip.c