[ previous ] [ next ] [ threads ]
 To :  Paul Chitescu <paulc@v...>
 From :  Alfred Stainer <alfred.stainer@g...>
 Subject :  Re: [yate] Problem with NAT
 Date :  Wed, 9 Jun 2010 15:21:03 +0200
Hi Paul,

I'm using Yate 3, the latest from SVN.

For registration I use "regfile" module.

Nat parameter in [general] section of ysipchan.conf is not set (so it's to
default value = enable).

In the Yate log I see:

           Registered user 'called' expires in 600 s

So it seems not detected as user behind a NAT.

The 200 OK response to register is:

SIP/2.0 200 OK
Via: SIP/2.0/UDP
public-ip-NAT:5060;rport=5060;branch=z9hG4bK1672352019;received=public-ip-NAT
From: ;tag=1365752597
To: ;tag=1375179334
Call-ID: 338000745@public-ip-Yate
CSeq: 20 REGISTER
Expires: 600
Contact: ;expires=600
Server: MYSRVSIP/3.0.0
Allow: ACK, INVITE, BYE, CANCEL, REGISTER, REFER, OPTIONS, INFO
Content-Length: 0

That not contains a X-Real-Contact field.

I'm using only IP address but in these emails, I have replaced it with
mnemonic names (public-ip-Yate for example instead of real ip of Yate).

Thanks,

Alfred

On Wed, Jun 9, 2010 at 2:33 PM, Paul Chitescu  wrote:

> Hi!
>
> What version of yate are you using? What registration module?
>
> Please check that you didn't disable automatic NAT support in ysipchan.conf
> section [general] nat=... (is on by default).
>
> Please look in logs - if yate was started with -vvv you will see entries
> like:
>
>  Registered user '???' expires in 3600 s (NAT)
>  Registered user '???' expires in 120 s
>
> On level INFO (-vvvv) there should be also:
>
>  Registration NAT detected: private 'a.b.c.d:p1' public
> 'w.x.y.z:p2'
>
> You can change the debug levels at runtime by connecting to the rmanager
> interface and issuing the command:
>
> debug sip level 9      (9=INFO, 8=NOTE, 5=WARN)
>
> http://yate.null.ro/pmwiki/index.php?n=Main.Rmanager
>
> Also look at the 200 OK for the REGISTER request, it should hold a custom
> header named X-Real-Contact: 
>
> If the phone is configured to use a domain name for building its Contact
> URI
> consider changing it to put the IP address there.
>
> Paul
>
>
> On Wednesday 09 June 2010 01:59:58 pm Alfred Stainer wrote:
> > 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.
> >
> > [...]
> >
> > 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 Paul,

I'm using Yate 3, the latest from SVN.

For registration I use "regfile" module.

Nat parameter in [general] section of ysipchan.conf is not set (so it's to default value = enable).

In the Yate log I see: 

          <sip:NOTE> Registered user 'called' expires in 600 s

So it seems not detected as user behind a NAT.

The 200 OK response to register is:

SIP/2.0 200 OK
Via: SIP/2.0/UDP public-ip-NAT:5060;rport=5060;branch=z9hG4bK1672352019;received=public-ip-NAT
From: <sip:called@public-ip-Yate>;tag=1365752597
To: <sip:called@public-ip-Yate>;tag=1375179334
Call-ID: 338000745@public-ip-Yate
CSeq: 20 REGISTER
Expires: 600
Contact: <sip:called@public-ip-NAT:5060>;expires=600
Server: MYSRVSIP/3.0.0
Allow: ACK, INVITE, BYE, CANCEL, REGISTER, REFER, OPTIONS, INFO
Content-Length: 0

That not contains a X-Real-Contact field.

I'm using only IP address but in these emails, I have replaced it with mnemonic names (public-ip-Yate for example instead of real ip of Yate).

Thanks,

Alfred

On Wed, Jun 9, 2010 at 2:33 PM, Paul Chitescu <paulc@v...> wrote:
Hi!

What version of yate are you using? What registration module?

Please check that you didn't disable automatic NAT support in ysipchan.conf
section [general] nat=... (is on by default).

Please look in logs - if yate was started with -vvv you will see entries like:

<sip:NOTE> Registered user '???' expires in 3600 s (NAT)
<sip:NOTE> Registered user '???' expires in 120 s

On level INFO (-vvvv) there should be also:

<sip:INFO> Registration NAT detected: private 'a.b.c.d:p1' public 'w.x.y.z:p2'

You can change the debug levels at runtime by connecting to the rmanager
interface and issuing the command:

debug sip level 9      (9=INFO, 8=NOTE, 5=WARN)

http://yate.null.ro/pmwiki/index.php?n=Main.Rmanager

Also look at the 200 OK for the REGISTER request, it should hold a custom
header named X-Real-Contact: <sip:user@public_ip_address:public_port>

If the phone is configured to use a domain name for building its Contact URI
consider changing it to put the IP address there.

Paul


On Wednesday 09 June 2010 01:59:58 pm Alfred Stainer wrote:
> 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.
>
> [...]
>
> 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