Wrong domain in FROM header, two interfaces

Hello all,
I have Asterisk 18, config. with 3 interfaces, one for sip trunk, the others two for internal endpoints. The problem is the address in FROM header, inbound call.
The endpoint is connected to a interface and in From header appear the address of the other interface. Is this behavior normal ?



In pjsip.conf parameter from_domain is empty. What is the default value in case of two interfaces? My intention is for the corresponding address to appear in the header in any network I would connect the phone to.
Thank you

The From header, for inbound calls, is supplied by the remote party and out of Asterisk’s control.

You didn’t provide the logging from Asterisk, and you truncated it so much that I can’t tell whether it really is inbound to Asterisk. Please provide logging as plain text, in future.

14:55:27.675665 ens224 In IP 172.27.242.99.5060 > 10.103.57.115.5060: SIP: INVITE sip:+40374999823@ASBCRBT.SBC.MNC010.MCC226.3GPPNETWORK.ORG;user=phone SIP/2.0
E… …0…c
g9s…INVITE sip:+40374999823@ASBCRBT.SBC.MNC010.MCC226.3GPPNETWORK.ORG;user=phone SIP/2.0
Via: SIP/2.0/UDP 172.27.242.99:5060;branch=z9hG4bK8qdtsf2050d1r7mfn760.1
From: sip:+40374441700@172.20.34.65;user=phone;tag=00001598048215
To: sip:+40374999823@ASBCRBT.SBC.MNC010.MCC226.3GPPNETWORK.ORG;user=phone
Max-Forwards: 69
Call-ID: 3wcV6275514250gvbcGhEfEfNcD0g@BC00.TP02.MSCS.MNC010.MCC226.3GPPNETWORK.ORG
CSeq: 52801 INVITE
P-Asserted-Identity: sip:+40374441700@172.20.34.65;user=phone
Accept: application/sdp
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,PRACK,UPDATE
P-Charging-Vector: icid-value=6E0B6C3000-0125-14552704;icid-generated-at=BC00.TP02.MSCS.MNC010.MCC226.3GPPNETWORK.ORG;orig-ioi=MSCS.MNC010.MCC226.3GPPNETWORK.ORG
P-Early-Media: supported
Supported: 100rel,histinfo
Content-Type: application/sdp
Contact: sip:172.27.242.99:5060;transport=udp
Content-Length: 556
Route: sip:+40374999823@10.103.57.115:5060;user=phone;lr

v=0
o=- 6863112 6863112 IN IP4 172.27.242.99
s=-
c=IN IP4 172.27.242.99
t=0 0
a=sendrecv
m=audio 40104 RTP/AVP 96 97 98 8 18 99
c=IN IP4 172.27.242.99
b=RR:0
b=RS:0
a=rtpmap:96 AMR/8000
a=fmtp:96 mode-set=0,2,4,7;mode-change-period=2;mode-change-capability=2;mode-change-neighbor=1;max-red=0;octet-align=1
a=rtpmap:97 AMR/8000
a=fmtp:97 mode-set=7;max-red=0;octet-align=1
a=rtpmap:98 GSM-EFR/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=yes
a=rtpmap:99 telephone-event/8000
a=fmtp:99
14:55:27.676878 ens224 Out IP 10.103.57.115.5060 > 172.27.242.99.5060: SIP: SIP/2.0 100 Trying
E…FV@.@…t
g9s…c… SIP/2.0 100 Trying
Via: SIP/2.0/UDP 172.27.242.99:5060;rport=5060;received=172.27.242.99;branch=z9hG4bK8qdtsf2050d1r7mfn760.1
Call-ID: 3wcV6275514250gvbcGhEfEfNcD0g@BC00.TP02.MSCS.MNC010.MCC226.3GPPNETWORK.ORG
From: sip:+40374441700@172.20.34.65;user=phone;tag=00001598048215
To: sip:+40374999823@ASBCRBT.SBC.MNC010.MCC226.3GPPNETWORK.ORG;user=phone
CSeq: 52801 INVITE
Server: Asterisk PBX 18.9.0
Content-Length: 0

14:55:27.683936 ens256 Out IP 172.16.115.66.5060 > 172.16.115.167.5060: SIP: INVITE sip:823@172.16.115.167:5060 SIP/2.0
E…@.@.V…sB…s…C.INVITE sip:823@172.16.115.167:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.115.66:5060;rport;branch=z9hG4bKPj2a1e3d6c-2265-444b-b489-ee3d08db0759
From: sip:+40374441700@192.168.179.110;tag=bb1e91da-e856-40b4-9c30-cece009a1dc7
To: sip:823@172.16.115.167
Contact: sip:+40374441700@172.16.115.66:5060
Call-ID: f2e5d7d3-9245-426e-b441-3b2ddffbf03d
CSeq: 23829 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 18.9.0
Content-Type: application/sdp
Content-Length: 310

v=0
o=- 1353131538 1353131538 IN IP4 172.16.115.66
s=Asterisk
c=IN IP4 172.16.115.66
t=0 0
m=audio 13458 RTP/AVP 8 18 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

The call is coming from siptrunk (first INVITE) and is ended to my sip phone 823. The second Invite is from asterisk to internal endpoint 823. Thank you

I don’t know my way around chan_pjsip to give a definitive answer, but given that you can override it in the configuration, I would think the logical answer is that it is fixed at configuration time, and may well be based on the OS’ idea of the machine’s identity.

If you have a broken multi-homed configuration, I’d suggest that you should be using a transport for each disjoint network.

Phone’s generally don’t care. ITSPs generally either want the URI to be in their address of record space (i.e. their domain name), or don’t care.

I note that Contact, which is what should matter, is reflecting the interface used.

1 Like

Thank you. You are wright, I can override in pjsip.conf, parameter from_domain. If this is empty, I thought it would be logical to write the address of the interface from which the message comes. But in may case, with two interfaces, only one address is used. And, again you are wright, phone don’t care and contact is correct value.
Regards

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