Seems "domain" option in pjsip transport section does not work

I have an Asterisk hosted in private IP behind the NAT and when Asterisk making an INVITE request to one of the endpoints he put his private IP in header “From” like here:

From: “softphone” sip:softphone@; tag=aeccbaf7-456a-4045-a611-409b49ae1cde

It’s a little bit confusing the users when they see an incoming call from that IP. I want substitute this for something

Full INVITE request with header “From” from pjsip log:

<--- Transmitting SIP request (909 bytes) to UDP: --->
INVITE sip:mobile@ SIP/2.0
Via: SIP/2.0/UDP;rport;branch=z9hG4bKPj31027f66-ca14-4a7a-9e36-ec508c730a15
From: "softphone" <sip:softphone@>;tag=aeccbaf7-456a-4045-a611-409b49ae1cde
To: <sip:mobile@>
Contact: <sip:asterisk@>
Call-ID: 7b45b371-21dc-4b8c-8415-b331d2319df0
CSeq: 10751 INVITE
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 16.7.0
Content-Type: application/sdp
Content-Length:   239

I found that this value can be substituted by option “from_domain” in section type “endpoint”. But for avoid duplications can it be substituted not on each endpoint section but globally?

Section “transport” has an option “domain”:

domain - Domain the transport comes from

But when I put example value and restart asterisk “core restart now” for apply changes and making a test call I didn’t see any mentions of my example value in output of enabled pjsip log, also I saw on my device old domain (private IP Asterisk value when asterisk call it.

Can Asterisk domain (which now is private ip be substitutes on the global level but not on each endpoint section?

Thank you.

No, that option is not for this purpose and chan_pjsip doesn’t have global or general options that inherit. The “from_domain” option on the endpoint is used for setting the From domain.

1 Like

Now is much clearer! Thank you for answer!

Just interesting to know for what then domain option is in transport section?
My understanding description: “Domain the transport comes from” is that domain from which SIP messages will come to Asterisk, but setting something that is not a source of SIP message coming to Asterisk do not broke anything.

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