[Users] contact field port problem when behind nats

Jack Wei cowlemon at yahoo.com
Fri Jan 6 20:14:14 CET 2006


Hi,

I'm having a problem when an UAC is behind NAT and has a public port other than
5060.  The public port isn't present in the contact field so when an ACK for an
INVITE is sent to the UAC, it's directed to the default port of 5060.  I'm
currently using v1.0.0 w/ the NATHELPER module.  The UAC is SJphone.  Any help
would be greatly appreciated.





NAT part of my openser.cfg :

if (nat_uac_test("19"))
{
        if ( method == "REGISTER" )
        {
                fix_nated_register();
                force_rport();
        }
        else
        {
                force_rport();
                fix_nated_contact();

                if (method == "INVITE")
                {
                        fix_nated_sdp("1");
                };
        };

        append_hf( "P-hint: NAT traversal\r\n" );
}




the sip proxy is voip.somewhere.com and 1.1.1.1
the pstn gateway is 2.2.2.2

the caller is from pstn and the callee is the uac.


Here's a log of SIP msgs:

#
U 2.2.2.2:5060 -> 1.1.1.1:5060
INVITE sip:2139435286 at voip.somewhere.com:5060;user=phone SIP/2.0.
t:   <sip:2139435286 at voip.somewhere.com:5060;user=phone>.
f: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
Remote-Party-Id:
<sip:2139961998 at 2.2.2.2:5060;user=phone>;screen=no;id-type=subscriber;party=calling;privacy=off.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 7528304 INVITE.
v: SIP/2.0/UDP 2.2.2.2:5060.
Max-Forwards: 70.
m: <sip:2139961998 at 2.2.2.2:5060;user=phone>.
k: replaces.
c: application/sdp.
Accept: application/sdp.
Accept-Encoding: .
Accept-Language: en.
User-Agent: Lucent-Universal-Gateway.
l: 244.
.
v=0.
o=VTX-SIP-TNT01 505428282 505428282 IN IP4 2.2.2.2.
s=Session SDP.
c=IN IP4 2.2.2.2.
t=0 0.
m=audio 41788 RTP/AVP 0 101.
a=silenceSupp:off.
a=ecan:b on g168.
a=ptime:20.
a=rtpmap:101 telephone-event/8000.
a=rtpmap:0 PCMU/8000.

#
U 1.1.1.1:5060 -> 2.2.2.2:5060
SIP/2.0 100 trying -- your call is important to us.
t:   <sip:2139435286 at voip.somewhere.com:5060;user=phone>.
f: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 7528304 INVITE.
v: SIP/2.0/UDP 2.2.2.2:5060.
Server: OpenSer (1.0.0-tls (i386/linux)).
Content-Length: 0.
.

#
U 1.1.1.1:5060 -> 64.77.236.227:32883
INVITE sip:2139435286 at 64.77.236.227 SIP/2.0.
Record-Route:
<sip:2139435286 at voip.somewhere.com;ftag=20712b63-1e20393a-83ef4d40;lr=on>.
t:   <sip:2139435286 at voip.somewhere.com:5060;user=phone>.
f: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
Remote-Party-Id:
<sip:2139961998 at 2.2.2.2:5060;user=phone>;screen=no;id-type=subscriber;party=calling;privacy=off.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 7528304 INVITE.
Via: SIP/2.0/UDP voip.somewhere.com;branch=z9hG4bK8325.35c96c63.0.
v: SIP/2.0/UDP 2.2.2.2:5060.
Max-Forwards: 69.
m: <sip:2139961998 at 2.2.2.2:5060;user=phone>.
k: replaces.
c: application/sdp.
Accept: application/sdp.
Accept-Encoding: .
Accept-Language: en.
User-Agent: Lucent-Universal-Gateway.
l: 244.
P-hint: VOIP OUTBOUND.
.
v=0.
o=VTX-SIP-TNT01 505428282 505428282 IN IP4 2.2.2.2.
s=Session SDP.
c=IN IP4 2.2.2.2.
t=0 0.
m=audio 41788 RTP/AVP 0 101.
a=silenceSupp:off.
a=ecan:b on g168.
a=ptime:20.
a=rtpmap:101 telephone-event/8000.
a=rtpmap:0 PCMU/8000.

#
U 64.77.236.227:32883 -> 1.1.1.1:5060
SIP/2.0 100 Trying.
v: SIP/2.0/UDP
voip.somewhere.com;received=1.1.1.1;branch=z9hG4bK8325.35c96c63.0,SIP/2.0/UDP
2.2.2.2:5060.
f: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
t: ""<sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 7528304 INVITE.
l: 0.
Server: SJphone/1.61.306c (SJ Labs).
.

#
U 64.77.236.227:32883 -> 1.1.1.1:5060
SIP/2.0 200 OK.
v: SIP/2.0/UDP
voip.somewhere.com;received=1.1.1.1;branch=z9hG4bK8325.35c96c63.0,SIP/2.0/UDP
2.2.2.2:5060.
f: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
t: "Jack
Wei"<sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
m: <sip:2139435286 at 64.77.236.227>.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 7528304 INVITE.
l: 217.
c: application/sdp.
Server: SJphone/1.61.306c (SJ Labs).
Record-Route:
<sip:2139435286 at voip.somewhere.com;ftag=20712b63-1e20393a-83ef4d40;lr=on>.
.
v=0.
o=- 3345559486 3345559486 IN IP4 64.77.236.227.
s=SJphone.
c=IN IP4 64.77.236.227.
t=0 0.
a=setup:active.
m=audio 49154 RTP/AVP 0 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-11,16.

#
U 1.1.1.1:5060 -> 2.2.2.2:5060
SIP/2.0 200 OK.
v: SIP/2.0/UDP 2.2.2.2:5060.
f: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
t: "Jack
Wei"<sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
m: <sip:2139435286 at 64.77.236.227>.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 7528304 INVITE.
l: 217.
c: application/sdp.
Server: SJphone/1.61.306c (SJ Labs).
Record-Route:
<sip:2139435286 at voip.somewhere.com;ftag=20712b63-1e20393a-83ef4d40;lr=on>.
.
v=0.
o=- 3345559486 3345559486 IN IP4 64.77.236.227.
s=SJphone.
c=IN IP4 64.77.236.227.
t=0 0.
a=setup:active.
m=audio 49154 RTP/AVP 0 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-11,16.

#
U 2.2.2.2:5060 -> 1.1.1.1:5060
ACK sip:2139435286 at voip.somewhere.com;ftag=20712b63-1e20393a-83ef4d40;lr=on
SIP/2.0.
t:   <sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
f: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 7528304 ACK.
v: SIP/2.0/UDP 2.2.2.2:5060.
Max-Forwards: 70.
Route: <sip:2139435286 at 64.77.236.227>.
User-Agent: Lucent-Universal-Gateway.
l: 0.
.

#
U 1.1.1.1:5060 -> 64.77.236.227:5060
ACK sip:2139435286 at 64.77.236.227 SIP/2.0.
Record-Route:
<sip:2139435286 at voip.somewhere.com;ftag=20712b63-1e20393a-83ef4d40;lr=on>.
t:   <sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
f: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 7528304 ACK.
Via: SIP/2.0/UDP voip.somewhere.com;branch=0.
v: SIP/2.0/UDP 2.2.2.2:5060.
Max-Forwards: 69.
User-Agent: Lucent-Universal-Gateway.
l: 0.
P-hint: rr-enforced.
.

#
U 64.77.236.227:32883 -> 1.1.1.1:5060
SIP/2.0 200 OK.
v: SIP/2.0/UDP
voip.somewhere.com;received=1.1.1.1;branch=z9hG4bK8325.35c96c63.0,SIP/2.0/UDP
2.2.2.2:5060.
f: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
t: "Jack
Wei"<sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
m: <sip:2139435286 at 64.77.236.227>.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 7528304 INVITE.
l: 217.
c: application/sdp.
Server: SJphone/1.61.306c (SJ Labs).
Record-Route:
<sip:2139435286 at voip.somewhere.com;ftag=20712b63-1e20393a-83ef4d40;lr=on>.
.
v=0.
o=- 3345559486 3345559486 IN IP4 64.77.236.227.
s=SJphone.
c=IN IP4 64.77.236.227.
t=0 0.
a=setup:active.
m=audio 49154 RTP/AVP 0 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-11,16.

#
U 1.1.1.1:5060 -> 2.2.2.2:5060
SIP/2.0 200 OK.
v: SIP/2.0/UDP 2.2.2.2:5060.
f: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
t: "Jack
Wei"<sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
m: <sip:2139435286 at 64.77.236.227>.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 7528304 INVITE.
l: 217.
c: application/sdp.
Server: SJphone/1.61.306c (SJ Labs).
Record-Route:
<sip:2139435286 at voip.somewhere.com;ftag=20712b63-1e20393a-83ef4d40;lr=on>.
.
v=0.
o=- 3345559486 3345559486 IN IP4 64.77.236.227.
s=SJphone.
c=IN IP4 64.77.236.227.
t=0 0.
a=setup:active.
m=audio 49154 RTP/AVP 0 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-11,16.

#
U 2.2.2.2:5060 -> 1.1.1.1:5060
ACK sip:2139435286 at voip.somewhere.com;ftag=20712b63-1e20393a-83ef4d40;lr=on
SIP/2.0.
t:   <sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
f: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 7528304 ACK.
v: SIP/2.0/UDP 2.2.2.2:5060.
Max-Forwards: 70.
Route: <sip:2139435286 at 64.77.236.227>.
User-Agent: Lucent-Universal-Gateway.
l: 0.
.

#
U 1.1.1.1:5060 -> 64.77.236.227:5060
ACK sip:2139435286 at 64.77.236.227 SIP/2.0.
Record-Route:
<sip:2139435286 at voip.somewhere.com;ftag=20712b63-1e20393a-83ef4d40;lr=on>.
t:   <sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
f: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 7528304 ACK.
Via: SIP/2.0/UDP voip.somewhere.com;branch=0.
v: SIP/2.0/UDP 2.2.2.2:5060.
Max-Forwards: 69.
User-Agent: Lucent-Universal-Gateway.
l: 0.
P-hint: rr-enforced.
.






................<REPEAT OKs and ACKs>........................








#
U 64.77.236.227:32883 -> 1.1.1.1:5060
BYE sip:2139961998 at 2.2.2.2:5060;user=phone SIP/2.0.
v: SIP/2.0/UDP
192.168.0.100;rport;branch=z9hG4bKc0a800640000002243beb15e0000571700000028.
f: "Jack
Wei"<sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
t: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 1 BYE.
Max-Forwards: 70.
User-Agent: SJphone/1.61.306c (SJ Labs).
l: 0.
Route:
<sip:2139435286 at voip.somewhere.com;ftag=20712b63-1e20393a-83ef4d40;lr=on>.
.

#
U 1.1.1.1:5060 -> 2.2.2.2:5060
BYE sip:2139961998 at 2.2.2.2:5060;user=phone SIP/2.0.
Record-Route: <sip:2139961998 at voip.somewhere.com;ftag=71451719939;lr=on>.
Via: SIP/2.0/UDP voip.somewhere.com;branch=z9hG4bK4f59.28705173.0.
v: SIP/2.0/UDP
192.168.0.100;received=64.77.236.227;rport=32883;branch=z9hG4bKc0a800640000002243beb15e0000571700000028.
f: "Jack
Wei"<sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
t: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 1 BYE.
Max-Forwards: 69.
User-Agent: SJphone/1.61.306c (SJ Labs).
l: 0.
P-hint: NAT traversal.
P-hint: rr-enforced.
.

#
U 2.2.2.2:5060 -> 1.1.1.1:5060
SIP/2.0 200 OK.
v: SIP/2.0/UDP voip.somewhere.com;branch=z9hG4bK4f59.28705173.0.
v: SIP/2.0/UDP
192.168.0.100;received=64.77.236.227;rport=32883;branch=z9hG4bKc0a800640000002243beb15e0000571700000028.
t: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
f: "Jack Wei"
<sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 1 BYE.
Server: Lucent-Universal-Gateway.
User-Agent: Lucent-Universal-Gateway.
l: 0.
.

#
U 1.1.1.1:5060 -> 64.77.236.227:32883
SIP/2.0 200 OK.
v: SIP/2.0/UDP
192.168.0.100;received=64.77.236.227;rport=32883;branch=z9hG4bKc0a800640000002243beb15e0000571700000028.
t: <sip:2139961998 at 2.2.2.2:5060;user=phone>;tag=20712b63-1e20393a-83ef4d40.
f: "Jack Wei"
<sip:2139435286 at voip.somewhere.com:5060;user=phone>;tag=71451719939.
i: dfc2b0e2-380-1e20393a at 2.2.2.2.
CSeq: 1 BYE.
Server: Lucent-Universal-Gateway.
User-Agent: Lucent-Universal-Gateway.
l: 0.
.


Jack Wei


		
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 





More information about the Users mailing list