Ser + asterisk + nat

Hi all

I have the following configuration :
A SER with a public and a private interface.
A Asterisk with a public and a private interface.

Calls come in on the public interface of the SER.
I forward it statefully (rewritehostport) to the Asterisk. See the invite packet below :

10.42.1.131:1024 -> 10.42.1.140:5060
INVITE sip:111@10.42.1.140:5060 SIP/2.0…Record-Route: sip:193.25.194.162;ftag=97337712230106;lr=on…Record-Route:
sip:111@10.42.1.131:5060;nat=yes;ftag=97337712230106;lr=on…Via: SIP/2.0/UDP 193.25.154.162;branch=z9hG4bK8e0f.e5
0879e4.0…Via: SIP/2.0/UDP 10.42.10.21;received=193.25.194.242;rport=54464;branch=z9hG4bK0a2a0a150000029744f29c57000
051cb000010de…Content-Length: 356…Contact: sip:889@193.25.194.242:54464…Call-ID: A343F333-C549-4C76-BBEE-C0FA43
2A4F6D@10.42.10.21…Content-Type: application/sdp…CSeq: 1 INVITE…From: "unknown"sip:889@193.25.194.162;tag=97337
712230106…Max-Forwards: 16…To: sip:111@193.25.154.162…User-Agent: SJphone/1.60.289a (SJ Labs)…v=0…o=- 33657
39213 3365739213 IN IP4 10.42.10.21…s=SJphone…c=IN IP4 193.25.194.162…t=0 0…a=direction:active…m=audio 35352 RT
P/AVP 3 97 98 8 0 101…a=rtpmap:3 GSM/8000…a=rtpmap:97 iLBC/8000…a=rtpmap:98 iLBC/8000…a=fmtp:98 mode=20…a=rtpma
p:8 PCMA/8000…a=rtpmap:0 PCMU/8000…a=rtpmap:101 telephone-event/8000…a=fmtp:101 0-11,16…a=nortpproxy:yes…

What I really don’t understand is that Asterisk is replying on his public interface :

193.25.154.163:5060 -> 193.25.154.162:5060
SIP/2.0 407 Proxy Authentication Required…Via: SIP/2.0/UDP 193.25.194.162;branch=z9hG4bK8e0f.e50879e4.0;received=10
.42.1.131…Via: SIP/2.0/UDP 10.42.10.21;received=193.25.154.242;rport=54464;branch=z9hG4bK0a2a0a150000029744f29c5700
0051cb000010de…From: "unknown"sip:889@193.25.194.162;tag=97337712230106…To: sip:111@193.25.154.162;tag=as22357
c16…Call-ID: A343F333-C549-4C76-BBEE-C0FA432A4F6D@10.42.10.21…CSeq: 1 INVITE…User-Agent: SW VT…Allow: INVITE, AC
K, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY…Contact: sip:111@10.42.1.140…Proxy-Authenticate: Digest algori
thm=MD5, realm=“trucmuch.com”, nonce=“73b42582”…Content-Length: 0…

Does someone understand whet I am doing wrong ?

Thanks

Have you set externip and localnet settings in asterisk sip.conf? Looks like asterisk is trying to do natting.

More on this link - voip-info.org/wiki-Asterisk+ … +solutions