Make asterisk to reflect domain in the To: header

Hello everyone.

Here is the scenario:
I have an asterisk 1.8 with 2 phones registered against it.
Phone A calls phone B

<--- SIP read from UDP:15.216.102.254:25138 --->
INVITE sip:1933@some.superdomain.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.76:25138;branch=z9hG4bK938755464;rport
From: "1931" <sip:1931@some.superdomain.com>;tag=1326175813
To: <sip:1933@some.superdomain.com>
Call-ID: 1718968203-25138-28@BJC.BGI.B.HG
CSeq: 271 INVITE
Contact: "1931" <sip:1931@192.168.1.76:25138>
Authorization: Digest username="1931", realm="some.superdomain.com", nonce="71199888", uri="sip:1933@some.superdomain.com", response="dc39537606c4c4986f73e896eb690afa", algorithm=MD5
Max-Forwards: 70
User-Agent: Grandstream GXV3175 1.0.3.74
Privacy: none
P-Preferred-Identity: "1931" <sip:1931@some.superdomain.com>
Supported: replaces, path, timer, eventlist
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Type: application/sdp
Accept: application/sdp, application/dtmf-relay
Content-Length: 397

v=0
o=1931 8000 8000 IN IP4 192.168.1.76
s=SIP Call
c=IN IP4 192.168.1.76
t=0 0
m=audio 20360 RTP/AVP 0 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
m=video 41074 RTP/AVP 99
b=AS:256
a=sendrecv
a=rtpmap:99 H264/90000
a=fmtp:99 profile-level-id=428015; packetization-mode=0; sprop-parameter-sets=Z0KADJWgUH5A,aM4Ecg==; max-br=256

Asterisk gets the invite from 1931, finds a registered peer 1933 and sends an invite there:

Reliably Transmitting (NAT) to 15.216.102.254:44575:
INVITE sip:1933@192.168.1.81:44575 SIP/2.0
Via: SIP/2.0/UDP 15.216.102.5:5060;branch=z9hG4bK08dabcdc;rport
Max-Forwards: 70
From: "I can see you! 1931" <sip:1931@some.superdomain.com>;tag=as2643d50f
To: <sip:1933@192.168.1.81:44575>
Contact: <sip:1931@15.216.102.5:5060>
Call-ID: 06402be537342084601475d01119d1d0@some.superdomain.com
CSeq: 102 INVITE
User-Agent: FPBX-2.10.1(1.8.11)
Date: Tue, 05 Mar 2013 17:09:34 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 315

v=0
o=root 1244540953 1244540953 IN IP4 15.216.102.5
s=Asterisk PBX 1.8.11-cert7
c=IN IP4 15.216.102.5
b=CT:384
t=0 0
m=audio 13404 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
m=video 10860 RTP/AVP 99
a=rtpmap:99 H264/90000
a=sendrecv

The call establishes just fine. The only problem is that I need the “To:” header in the SIP packets sent by asterisk to reflect the domain name, configured in the SIP conf:
domain=some.superdomain.com

The way I would like to see the “To:” header sent by would be:
To: sip:1933@some.superdomain.com

Thank you!

domain has a competely different function.

I think the way you do this is to set host to be the super domain and then set the system to which you actually send the request to be the proxy.

I don’t think you can set the domain for the request URI separately.

Unfortunately I can not set the domain I want in the proxy field in the peer settings. The peer is dynamic.

I think you need to explain the deep background to this. Normally, hub systems should not be registering with peripheral nodes.

At the moment, if the problem you think you have is real, I think you will need to change the source code.