[ previous ] [ next ] [ threads ]
 To :  Yate mailing list <yate@v...>
 From :  Alfred Stainer <alfred.stainer@g...>
 Subject :  Problem with NAT
 Date :  Wed, 9 Jun 2010 12:59:58 +0200
Hi,
I have a strange problem to make a call between two sip phones.

The scenario is:
1. Yate 3 svn version on CentOs with a public IP
2. Phone1 behind a NAT (NAT-1), caller
3. Phone2 behind a NAT (NAT-2), called

Both phone are capable to register to Yate but I cannot make a call from
Phone1 to Phone2.

I have captured packets with tcmdump and it seems that the problem is due to
the INVITE that Yate sends to the called phone because this INVITE is sent
to the called private IP address instead of the public IP address of NAT of
called.

The captured packets for registration are:

No.     Time        Source                Destination           Protocol
Info

      5 35.912891   public-ip-NAT         public-ip-Yate        SIP
 Request: REGISTER sip:public-ip-Yate

      7 35.918036   public-ip-Yate        public-ip-NAT         SIP
 Status: 100 Trying    (0 bindings)

     10 35.923132   public-ip-Yate        public-ip-NAT         SIP
 Status: 401 Unauthorized    (0 bindings)

     12 35.957614   public-ip-NAT         public-ip-Yate        SIP
 Request: REGISTER sip:public-ip-Yate

     14 35.963068   public-ip-Yate        public-ip-NAT         SIP
 Status: 100 Trying    (0 bindings)

     19 35.968126   public-ip-Yate        public-ip-NAT         SIP
 Status: 200 OK    (1 bindings)

And this phase is ok.
The problem is in the call where the captured packet are:

No.     Time        Source                Destination           Protocol
Info

      4 4.116033    public-ip-NAT-1       public-ip-Yate       SIP/SDP
 Request: INVITE sip:called@public-ip-Yate, with session description

      6 4.121562    public-ip-Yate        public-ip-NAT-1      SIP
 Status: 100 Trying

     11 4.126563    public-ip-Yate        private-ip-called     SIP/SDP
 Request: INVITE sip:called@private-ip-called:5060;transport=udp;user=phone,
with session description

     15 4.631553    public-ip-Yate        private-ip-called     SIP/SDP
 Request: INVITE sip:called@private-ip-called:5060;transport=udp;user=phone,
with session description

     18 5.136565    public-ip-Yate        private-ip-called     SIP/SDP
 Request: INVITE sip:called@private-ip-called:5060;transport=udp;user=phone,
with session description

     22 6.141524    public-ip-Yate        private-ip-called     SIP/SDP
 Request: INVITE sip:called@private-ip-called:5060;transport=udp;user=phone,
with session description

     26 8.141544    public-ip-Yate        private-ip-called     SIP/SDP
 Request: INVITE sip:called@private-ip-called:5060;transport=udp;user=phone,
with session description

     40 12.142031   public-ip-Yate        private-ip-called     SIP
 Request: CANCEL sip:called@private-ip-called:5060;transport=udp;user=phone

     41 12.146509   public-ip-Yate        public-ip-NAT-1     SIP
 Status: 503 Service Unavailable

     46 12.183013   public-ip-NAT-1      public-ip-Yate       SIP
 Request: ACK sip:called@public-ip-Yate

     49 12.648504   public-ip-Yate        private-ip-called     SIP
 Request: CANCEL sip:called@private-ip-called:5060;transport=udp;user=phone

     53 13.153514   public-ip-Yate        private-ip-called     SIP
 Request: CANCEL sip:called@private-ip-called:5060;transport=udp;user=phone

     56 14.153473   public-ip-Yate        private-ip-called     SIP
 Request: CANCEL sip:called@private-ip-called:5060;transport=udp;user=phone

     59 16.158495   public-ip-Yate        private-ip-called     SIP
 Request: CANCEL sip:called@private-ip-called:5060;transport=udp;user=phone


And to me the problem seems to be the packet #11:
public-ip-Yate        private-ip-called     SIP/SDP  Request: INVITE
sip:called@private-ip-called:5060;transport=udp;user=phone, with session
description

because is addressed to "private-ip-called" instead of "public-ip-NAT-2".

What can be wrong? Configuration?
Thanks,

Alfred



Hi,
I have a strange problem to make a call between two sip phones.

The scenario is:
1. Yate 3 svn version on CentOs with a public IP
2. Phone1 behind a NAT (NAT-1), caller
3. Phone2 behind a NAT (NAT-2), called

Both phone are capable to register to Yate but I cannot make a call from Phone1 to Phone2.

I have captured packets with tcmdump and it seems that the problem is due to the INVITE that Yate sends to the called phone because this INVITE is sent to the called private IP address instead of the public IP address of NAT of called.

The captured packets for registration are:

No.     Time        Source                Destination           Protocol Info

      5 35.912891   public-ip-NAT         public-ip-Yate        SIP      Request: REGISTER sip:public-ip-Yate

      7 35.918036   public-ip-Yate        public-ip-NAT         SIP      Status: 100 Trying    (0 bindings)

     10 35.923132   public-ip-Yate        public-ip-NAT         SIP      Status: 401 Unauthorized    (0 bindings)

     12 35.957614   public-ip-NAT         public-ip-Yate        SIP      Request: REGISTER sip:public-ip-Yate

     14 35.963068   public-ip-Yate        public-ip-NAT         SIP      Status: 100 Trying    (0 bindings)

     19 35.968126   public-ip-Yate        public-ip-NAT         SIP      Status: 200 OK    (1 bindings)

And this phase is ok.
The problem is in the call where the captured packet are:

No.     Time        Source                Destination           Protocol Info

      4 4.116033    public-ip-NAT-1       public-ip-Yate       SIP/SDP  Request: INVITE sip:called@public-ip-Yate, with session description

      6 4.121562    public-ip-Yate        public-ip-NAT-1      SIP      Status: 100 Trying

     11 4.126563    public-ip-Yate        private-ip-called     SIP/SDP  Request: INVITE sip:called@private-ip-called:5060;transport=udp;user=phone, with session description

     15 4.631553    public-ip-Yate        private-ip-called     SIP/SDP  Request: INVITE sip:called@private-ip-called:5060;transport=udp;user=phone, with session description

     18 5.136565    public-ip-Yate        private-ip-called     SIP/SDP  Request: INVITE sip:called@private-ip-called:5060;transport=udp;user=phone, with session description

     22 6.141524    public-ip-Yate        private-ip-called     SIP/SDP  Request: INVITE sip:called@private-ip-called:5060;transport=udp;user=phone, with session description

     26 8.141544    public-ip-Yate        private-ip-called     SIP/SDP  Request: INVITE sip:called@private-ip-called:5060;transport=udp;user=phone, with session description

     40 12.142031   public-ip-Yate        private-ip-called     SIP      Request: CANCEL sip:called@private-ip-called:5060;transport=udp;user=phone

     41 12.146509   public-ip-Yate        public-ip-NAT-1     SIP      Status: 503 Service Unavailable
 
     46 12.183013   public-ip-NAT-1      public-ip-Yate       SIP      Request: ACK sip:called@public-ip-Yate

     49 12.648504   public-ip-Yate        private-ip-called     SIP      Request: CANCEL sip:called@private-ip-called:5060;transport=udp;user=phone

     53 13.153514   public-ip-Yate        private-ip-called     SIP      Request: CANCEL sip:called@private-ip-called:5060;transport=udp;user=phone

     56 14.153473   public-ip-Yate        private-ip-called     SIP      Request: CANCEL sip:called@private-ip-called:5060;transport=udp;user=phone

     59 16.158495   public-ip-Yate        private-ip-called     SIP      Request: CANCEL sip:called@private-ip-called:5060;transport=udp;user=phone


And to me the problem seems to be the packet #11:
public-ip-Yate        private-ip-called     SIP/SDP  Request: INVITE sip:called@private-ip-called:5060;transport=udp;user=phone, with session description

because is addressed to "private-ip-called" instead of "public-ip-NAT-2".

What can be wrong? Configuration?
Thanks,

Alfred