[OpenSIPS-Users] Call from non-NATed endpoint toNATedendpointfailed

Leon Li Leon.Li at aarnet.edu.au
Thu Sep 3 08:25:02 CEST 2009


I found some error in mediaproxy after opensips call use_media_proxy().ERROR:mediaproxy:use_media_proxy: mediaproxy returned error.

So I reconfigure mediaproxy config.ini by stating IP address etc. Now the error has gone, however, there is still one-way issue.

Ngrep shows the following where I can see content IP (c=IN IP4 OPENSIPS_IP ) in SDP header of the INVITE sent from UA1(private IP) to UA2(public IP) has been modified to OpenSIPs's public IP (where mediaproxy installed).

Any ideas? Thanks.

#
U +5.734390 UA1_NAT_PUB_IP:5060 -> OPENSIPS_IP:5060
INVITE sip:1001 at OPENSIPS_IP SIP/2.0 
Via: SIP/2.0/UDP 192.168.1.101:5060;rport;branch=z9hG4bKPjci6iqaytqc4xvlrawp96asftc9izz-nq 
Max-Forwards: 70 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl 
To: <sip:1001 at OPENSIPS_IP> 
Contact: <sip:1000 at UA1_NAT_PUB_IP:5060;transport=UDP> 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23447 INVITE 
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, PUBLISH, REFER, MESSAGE, OPTIONS 
Supported: replaces, 100rel, norefersub 
User-Agent: SipPhone v3.0/iPhoneOS 
Content-Type: application/sdp 
Content-Length:   267 
 
v=0 
o=- 3460945218 3460945218 IN IP4 192.168.1.101 
s=pjmedia 
c=IN IP4 192.168.1.101 
t=0 0 
a=X-nat:0 
m=audio 4004 RTP/AVP 0 3 8 101 
a=rtpmap:0 PCMU/8000 
a=rtpmap:3 GSM/8000 
a=rtpmap:8 PCMA/8000 
a=sendrecv 
a=rtpmap:101 telephone-event/8000 
a=fmtp:101 0-15 

#
U +0.013557 OPENSIPS_IP:5060 -> UA1_NAT_PUB_IP:5060
SIP/2.0 407 Proxy Authentication Required 
Via: SIP/2.0/UDP 192.168.1.101:5060;rport=5060;branch=z9hG4bKPjci6iqaytqc4xvlrawp96asftc9izz-nq;received=UA1_NAT_PUB_IP 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl 
To: <sip:1001 at OPENSIPS_IP>;tag=a6e24cb425b3b4d8ae91dac7ac2b8a80.9aa6 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23447 INVITE 
Proxy-Authenticate: Digest realm="OPENSIPS_IP", nonce="4a9f56a700000005c0093b6c66301f0208337bc9fd42f1af" 
Server: OpenSIPS (1.5.2-notls (i386/linux)) 
Content-Length: 0 
 

#
U +0.008545 UA1_NAT_PUB_IP:5060 -> OPENSIPS_IP:5060
ACK sip:1001 at OPENSIPS_IP SIP/2.0 
Via: SIP/2.0/UDP 192.168.1.101:5060;rport;branch=z9hG4bKPjci6iqaytqc4xvlrawp96asftc9izz-nq 
Max-Forwards: 70 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl 
To: <sip:1001 at OPENSIPS_IP>;tag=a6e24cb425b3b4d8ae91dac7ac2b8a80.9aa6 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23447 ACK 
Content-Length:  0 
 

#
U +0.026819 UA1_NAT_PUB_IP:5060 -> OPENSIPS_IP:5060
INVITE sip:1001 at OPENSIPS_IP SIP/2.0 
Via: SIP/2.0/UDP 192.168.1.101:5060;rport;branch=z9hG4bKPjrryrlutlg6apx.pggkebrdvsnnqconym 
Max-Forwards: 70 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl 
To: <sip:1001 at OPENSIPS_IP> 
Contact: <sip:1000 at UA1_NAT_PUB_IP:5060;transport=UDP> 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23448 INVITE 
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, PUBLISH, REFER, MESSAGE, OPTIONS 
Supported: replaces, 100rel, norefersub 
User-Agent: SipPhone v3.0/iPhoneOS 
Proxy-Authorization: Digest username="1000", realm="OPENSIPS_IP", nonce="4a9f56a700000005c0093b6c66301f0208337bc9fd42f1af", uri="sip:1001 at OPENSIPS_IP", response="fe1175734e963dd17030e62247a2351e" 
Content-Type: application/sdp 
Content-Length:   267 
 
v=0 
o=- 3460945218 3460945218 IN IP4 192.168.1.101 
s=pjmedia 
c=IN IP4 192.168.1.101 
t=0 0 
a=X-nat:0 
m=audio 4004 RTP/AVP 0 3 8 101 
a=rtpmap:0 PCMU/8000 
a=rtpmap:3 GSM/8000 
a=rtpmap:8 PCMA/8000 
a=sendrecv 
a=rtpmap:101 telephone-event/8000 
a=fmtp:101 0-15 

#
U +0.007063 OPENSIPS_IP:5060 -> UA1_NAT_PUB_IP:5060
SIP/2.0 100 Giving a try 
Via: SIP/2.0/UDP 192.168.1.101:5060;rport=5060;branch=z9hG4bKPjrryrlutlg6apx.pggkebrdvsnnqconym;received=UA1_NAT_PUB_IP 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl 
To: <sip:1001 at OPENSIPS_IP> 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23448 INVITE 
Server: OpenSIPS (1.5.2-notls (i386/linux)) 
Content-Length: 0 
 

#
U +0.000415 OPENSIPS_IP:5060 -> UA2_PUB_IP:5060
INVITE sip:1001 at UA2_PUB_IP:5060 SIP/2.0 
Record-Route: <sip:OPENSIPS_IP;lr=on;ftag=snnj0sq1ck-lgimxje3lonn5qtilrodl;nat=yes> 
Via: SIP/2.0/UDP OPENSIPS_IP;branch=z9hG4bK3665.b94c8913.0 
Via: SIP/2.0/UDP 192.168.1.101:5060;received=UA1_NAT_PUB_IP;rport=5060;branch=z9hG4bKPjrryrlutlg6apx.pggkebrdvsnnqconym 
Max-Forwards: 69 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl 
To: <sip:1001 at OPENSIPS_IP> 
Contact: <sip:1000 at UA1_NAT_PUB_IP:5060;transport=UDP> 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23448 INVITE 
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, PUBLISH, REFER, MESSAGE, OPTIONS 
Supported: replaces, 100rel, norefersub 
User-Agent: SipPhone v3.0/iPhoneOS 
Content-Type: application/sdp 
Content-Length: 270 
P-hint: route(3)|setflag7,forcerport,fix_contact 
P-hint: inbound->inbound  
P-hint: Route[6]: mediaproxy  
 
v=0 
o=- 3460945218 3460945218 IN IP4 192.168.1.101 
s=pjmedia 
c=IN IP4 OPENSIPS_IP 
t=0 0 
a=X-nat:0 
m=audio 50006 RTP/AVP 0 3 8 101 
a=rtpmap:0 PCMU/8000 
a=rtpmap:3 GSM/8000 
a=rtpmap:8 PCMA/8000 
a=sendrecv 
a=rtpmap:101 telephone-event/8000 
a=fmtp:101 0-15 

#
U +0.014298 UA2_PUB_IP:5060 -> OPENSIPS_IP:5060
SIP/2.0 100 TRYING 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl;epid=0AB911C0 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23448 INVITE 
Via: SIP/2.0/UDP OPENSIPS_IP;branch=z9hG4bK3665.b94c8913.0;received=OPENSIPS_IP 
Via: SIP/2.0/UDP 192.168.1.101:5060;received=UA1_NAT_PUB_IP;rport=5060;branch=z9hG4bKPjrryrlutlg6apx.pggkebrdvsnnqconym 
To: <sip:1001 at OPENSIPS_IP>;tag=DLdd71fe7a27 
Allow: INVITE,CANCEL,ACK,OPTIONS,INFO,SUBSCRIBE,NOTIFY,BYE,MESSAGE,UPDATE,REFER 
Record-Route: <sip:OPENSIPS_IP;lr=on;ftag=snnj0sq1ck-lgimxje3lonn5qtilrodl;nat=yes> 
Contact: "1001" <sip:1001 at UA2_PUB_IP:5060> 
User-Agent: Dylogic Mirial 7.0.3 
Content-Length: 0 
 

#
U +0.006483 UA2_PUB_IP:5060 -> OPENSIPS_IP:5060
SIP/2.0 180 RINGING 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl;epid=0AB911C0 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23448 INVITE 
Via: SIP/2.0/UDP OPENSIPS_IP;branch=z9hG4bK3665.b94c8913.0;received=OPENSIPS_IP 
Via: SIP/2.0/UDP 192.168.1.101:5060;received=UA1_NAT_PUB_IP;rport=5060;branch=z9hG4bKPjrryrlutlg6apx.pggkebrdvsnnqconym 
To: <sip:1001 at OPENSIPS_IP>;tag=DLdd71fe7a27 
Record-Route: <sip:OPENSIPS_IP;lr=on;ftag=snnj0sq1ck-lgimxje3lonn5qtilrodl;nat=yes> 
Contact: "1001" <sip:1001 at UA2_PUB_IP:5060> 
Allow: INVITE,CANCEL,ACK,OPTIONS,INFO,SUBSCRIBE,NOTIFY,BYE,MESSAGE,UPDATE,REFER 
User-Agent: Dylogic Mirial 7.0.3 
Content-Length: 0 
 

#
U +0.000332 OPENSIPS_IP:5060 -> UA1_NAT_PUB_IP:5060
SIP/2.0 180 RINGING 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl;epid=0AB911C0 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23448 INVITE 
Via: SIP/2.0/UDP 192.168.1.101:5060;received=UA1_NAT_PUB_IP;rport=5060;branch=z9hG4bKPjrryrlutlg6apx.pggkebrdvsnnqconym 
To: <sip:1001 at OPENSIPS_IP>;tag=DLdd71fe7a27 
Record-Route: <sip:OPENSIPS_IP;lr=on;ftag=snnj0sq1ck-lgimxje3lonn5qtilrodl;nat=yes> 
Contact: "1001" <sip:1001 at UA2_PUB_IP:5060> 
Allow: INVITE,CANCEL,ACK,OPTIONS,INFO,SUBSCRIBE,NOTIFY,BYE,MESSAGE,UPDATE,REFER 
User-Agent: Dylogic Mirial 7.0.3 
Content-Length: 0 
 

#
U +2.898154 UA2_PUB_IP:5060 -> OPENSIPS_IP:5060
SIP/2.0 200 OK 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl;epid=0AB911C0 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23448 INVITE 
Via: SIP/2.0/UDP OPENSIPS_IP;branch=z9hG4bK3665.b94c8913.0;received=OPENSIPS_IP 
Via: SIP/2.0/UDP 192.168.1.101:5060;received=UA1_NAT_PUB_IP;rport=5060;branch=z9hG4bKPjrryrlutlg6apx.pggkebrdvsnnqconym 
To: <sip:1001 at OPENSIPS_IP>;tag=DLdd71fe7a27 
Allow: INVITE,CANCEL,ACK,OPTIONS,INFO,SUBSCRIBE,NOTIFY,BYE,MESSAGE,UPDATE,REFER 
Supported: replaces,norefersub 
Record-Route: <sip:OPENSIPS_IP;lr=on;ftag=snnj0sq1ck-lgimxje3lonn5qtilrodl;nat=yes> 
Contact: "1001" <sip:1001 at UA2_PUB_IP:5060> 
Content-Type: application/sdp 
Content-Length: 296 
User-Agent: Dylogic Mirial 7.0.3 
 
v=0 
o=1001 905599228 0 IN IP4 UA2_PUB_IP 
s=pjmedia 
i=Dylogic Mirial 7.0.3 
c=IN IP4 UA2_PUB_IP 
b=AS:384 
a=X-nat:0 
t=0 0 
m=audio 26816 RTP/AVP 0 8 101 
a=rtpmap:0 PCMU/8000 
a=rtpmap:8 PCMA/8000 
a=rtpmap:101 telephone-event/8000 
a=fmtp:101 0-16 
a=x-mpdp:UA2_PUB_IP:26816 

#
U +0.013607 OPENSIPS_IP:5060 -> UA1_NAT_PUB_IP:5060
SIP/2.0 200 OK 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl;epid=0AB911C0 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23448 INVITE 
Via: SIP/2.0/UDP 192.168.1.101:5060;received=UA1_NAT_PUB_IP;rport=5060;branch=z9hG4bKPjrryrlutlg6apx.pggkebrdvsnnqconym 
To: <sip:1001 at OPENSIPS_IP>;tag=DLdd71fe7a27 
Allow: INVITE,CANCEL,ACK,OPTIONS,INFO,SUBSCRIBE,NOTIFY,BYE,MESSAGE,UPDATE,REFER 
Supported: replaces,norefersub 
Record-Route: <sip:OPENSIPS_IP;lr=on;ftag=snnj0sq1ck-lgimxje3lonn5qtilrodl;nat=yes> 
Contact: "1001" <sip:1001 at UA2_PUB_IP:5060> 
Content-Type: application/sdp 
Content-Length: 296 
User-Agent: Dylogic Mirial 7.0.3 
P-hint: onreply_route|usemediaproxy  
 
v=0 
o=1001 905599228 0 IN IP4 UA2_PUB_IP 
s=pjmedia 
i=Dylogic Mirial 7.0.3 
c=IN IP4 OPENSIPS_IP 
b=AS:384 
a=X-nat:0 
t=0 0 
m=audio 50004 RTP/AVP 0 8 101 
a=rtpmap:0 PCMU/8000 
a=rtpmap:8 PCMA/8000 
a=rtpmap:101 telephone-event/8000 
a=fmtp:101 0-16 
a=x-mpdp:UA2_PUB_IP:26816 

#
U +0.050388 UA1_NAT_PUB_IP:5060 -> OPENSIPS_IP:5060
ACK sip:1001 at UA2_PUB_IP:5060 SIP/2.0 
Via: SIP/2.0/UDP 192.168.1.101:5060;rport;branch=z9hG4bKPjoyl9qcktty0gpfthgemiacspf.kljthf 
Max-Forwards: 70 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl 
To: <sip:1001 at OPENSIPS_IP>;tag=DLdd71fe7a27 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23448 ACK 
Route: <sip:OPENSIPS_IP;lr;ftag=snnj0sq1ck-lgimxje3lonn5qtilrodl;nat=yes> 
Content-Length:  0 
 

#
U +0.000603 OPENSIPS_IP:5060 -> UA2_PUB_IP:5060
ACK sip:1001 at UA2_PUB_IP:5060 SIP/2.0 
Record-Route: <sip:OPENSIPS_IP;lr=on;ftag=snnj0sq1ck-lgimxje3lonn5qtilrodl;nat=yes> 
Via: SIP/2.0/UDP OPENSIPS_IP;branch=z9hG4bK3665.b94c8913.2 
Via: SIP/2.0/UDP 192.168.1.101:5060;received=UA1_NAT_PUB_IP;rport=5060;branch=z9hG4bKPjoyl9qcktty0gpfthgemiacspf.kljthf 
Max-Forwards: 69 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl 
To: <sip:1001 at OPENSIPS_IP>;tag=DLdd71fe7a27 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23448 ACK 
Content-Length:  0 
P-hint: LR|fixcontact,setflag6 
 

#
U +3.254644 UA1_NAT_PUB_IP:5060 -> OPENSIPS_IP:5060
 
k   e@' { b_    
#
U +10.081446 UA1_NAT_PUB_IP:5060 -> OPENSIPS_IP:5060
BYE sip:1001 at UA2_PUB_IP:5060 SIP/2.0 
Via: SIP/2.0/UDP 192.168.1.101:5060;rport;branch=z9hG4bKPjvsm9m6ss.cpqqk0v3-bdqpca-lq9v-or 
Max-Forwards: 70 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl 
To: <sip:1001 at OPENSIPS_IP>;tag=DLdd71fe7a27 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23449 BYE 
Route: <sip:OPENSIPS_IP;lr;ftag=snnj0sq1ck-lgimxje3lonn5qtilrodl;nat=yes> 
User-Agent: SipPhone v3.0/iPhoneOS 
Content-Length:  0 
 

#
U +0.004357 OPENSIPS_IP:5060 -> UA2_PUB_IP:5060
BYE sip:1001 at UA2_PUB_IP:5060 SIP/2.0 
Record-Route: <sip:OPENSIPS_IP;lr=on;ftag=snnj0sq1ck-lgimxje3lonn5qtilrodl;nat=yes> 
Via: SIP/2.0/UDP OPENSIPS_IP;branch=z9hG4bK2665.a6d52a52.0 
Via: SIP/2.0/UDP 192.168.1.101:5060;received=UA1_NAT_PUB_IP;rport=5060;branch=z9hG4bKPjvsm9m6ss.cpqqk0v3-bdqpca-lq9v-or 
Max-Forwards: 69 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl 
To: <sip:1001 at OPENSIPS_IP>;tag=DLdd71fe7a27 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23449 BYE 
User-Agent: SipPhone v3.0/iPhoneOS 
Content-Length:  0 
P-hint: LR|fixcontact,setflag6 
 

#
U +0.035076 UA2_PUB_IP:5060 -> OPENSIPS_IP:5060
SIP/2.0 200 OK 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl;epid=0AB911C0 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23449 BYE 
Via: SIP/2.0/UDP OPENSIPS_IP;branch=z9hG4bK2665.a6d52a52.0;received=OPENSIPS_IP 
Via: SIP/2.0/UDP 192.168.1.101:5060;received=UA1_NAT_PUB_IP;rport=5060;branch=z9hG4bKPjvsm9m6ss.cpqqk0v3-bdqpca-lq9v-or 
To: <sip:1001 at OPENSIPS_IP>;tag=DLdd71fe7a27 
Allow: INVITE,CANCEL,ACK,OPTIONS,INFO,SUBSCRIBE,NOTIFY,BYE,MESSAGE,UPDATE,REFER 
Record-Route: <sip:OPENSIPS_IP;lr=on;ftag=snnj0sq1ck-lgimxje3lonn5qtilrodl;nat=yes> 
Contact: "1001" <sip:1001 at UA2_PUB_IP:5060> 
User-Agent: Dylogic Mirial 7.0.3 
Content-Length: 0 
 

#
U +0.000397 OPENSIPS_IP:5060 -> UA1_NAT_PUB_IP:5060
SIP/2.0 200 OK 
From: "1000" <sip:1000 at OPENSIPS_IP>;tag=snnj0sq1ck-lgimxje3lonn5qtilrodl;epid=0AB911C0 
Call-ID: e.e3lbxspym5vf3dqflysidsqb1ijxsd 
CSeq: 23449 BYE 
Via: SIP/2.0/UDP 192.168.1.101:5060;received=UA1_NAT_PUB_IP;rport=5060;branch=z9hG4bKPjvsm9m6ss.cpqqk0v3-bdqpca-lq9v-or 
To: <sip:1001 at OPENSIPS_IP>;tag=DLdd71fe7a27 
Allow: INVITE,CANCEL,ACK,OPTIONS,INFO,SUBSCRIBE,NOTIFY,BYE,MESSAGE,UPDATE,REFER 
Record-Route: <sip:OPENSIPS_IP;lr=on;ftag=snnj0sq1ck-lgimxje3lonn5qtilrodl;nat=yes> 
Contact: "1001" <sip:1001 at UA2_PUB_IP:5060> 
User-Agent: Dylogic Mirial 7.0.3 
Content-Length: 0 
   

-----Original Message-----
From: users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] On Behalf Of Saúl Ibarra
Sent: Monday, 31 August 2009 4:56 PM
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] Call from non-NATed endpoint toNATedendpointfailed

On Mon, Aug 31, 2009 at 8:10 AM, Leon Li<Leon.Li at aarnet.edu.au> wrote:
> Ok, I modified the supported codec on the SIP client and the call went through successfully. However, I got one way audio. UA2(callee) with public IP can hear, but UA1(caller) with private IP cannot.
>
> The INVITE msg arrived on UA2 is like with the private IP in SDP. I think this causes the problem because UA2 (public IP) won't know how to get to private ip.
>

That's right.


> How can I debug and check whether OpenSIPs did NAT/mediaproxy part properly?
>

Add some xlog to your NAT handling part of the script to see if you
are correctly calling nat fixing functions.


Regards,


-- 
/Saúl
http://www.saghul.net | http://www.sipdoc.net

_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


More information about the Users mailing list