Didelot Loic
2004-Jun-11 05:37 UTC
[Asterisk-Users] phone calls betweens phones behind the same nat
Hi, I have the following problem. I have 5 phones behind the same nat (canreinvite=yes). it works fine to receive calls and to make calls. sound quality is good, so everything works fine. The poblem is that the phone behind nat cant call each other. It works if canreinvite=no. But i want to do this. Does anyone have an idea? Regards, cjk.
brian
2004-Jun-11 06:49 UTC
[Asterisk-Users] phone calls betweens phones behind the same nat
That's the only way to make it work.> -----Original Message----- > From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users- > admin@lists.digium.com] On Behalf Of Didelot Loic > Sent: Friday, June 11, 2004 7:38 AM > To: asterisk-users@lists.digium.com > Subject: [Asterisk-Users] phone calls betweens phones behind the same nat > > Hi, > I have the following problem. > > I have 5 phones behind the same nat (canreinvite=yes). it works fine to > receive calls and to make calls. sound quality is good, so everything > works fine. > > The poblem is that the phone behind nat cant call each other. It works > if canreinvite=no. But i want to do this. > > Does anyone have an idea? > > Regards, > cjk. > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > lists.digium.com/mailman/listinfo/asterisk-users
Soren Rathje
2004-Jun-11 07:16 UTC
[Asterisk-Users] phone calls betweens phones behind the same nat
if Asterisk publishes the external IP address in the SIP messages you get trapped in the "NAT Trap".. internal IP1 -> NAT -> external IP -> NAT -> internal IP2 He.. Take a string/thread/wire, make a loop and put it through the hole in a coin, place a match/stick in the loop going through the coin, pull the string tight so the match/stick is flat against the coin. Now, pull one end of the string while holding the coin.... Get it ?? Not that many devices can do this... And if the do, they cost really big money... :-) -- Soren ----- Original Message ----- From: "Didelot Loic" <loic@didelot.org> To: <asterisk-users@lists.digium.com> Sent: Friday, June 11, 2004 2:37 PM Subject: [Asterisk-Users] phone calls betweens phones behind the same nat> Hi, > I have the following problem. > > I have 5 phones behind the same nat (canreinvite=yes). it works fine to > receive calls and to make calls. sound quality is good, so everything > works fine. > > The poblem is that the phone behind nat cant call each other. It works > if canreinvite=no. But i want to do this. > > Does anyone have an idea? > > Regards, > cjk. > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > lists.digium.com/mailman/listinfo/asterisk-users >
Richard Neese
2004-Jun-11 07:33 UTC
[Asterisk-Users] phone calls betweens phones behind the same nat
make sure you have nat=yes also in yur sip.conf for each phone entry
brian
2004-Jun-11 08:01 UTC
[Asterisk-Users] phone calls betweens phones behind the same nat
That has nothing to do with this problem. Reinvites will not work in this case. bkw> -----Original Message----- > From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users- > admin@lists.digium.com] On Behalf Of Richard Neese > Sent: Friday, June 11, 2004 9:34 AM > To: asterisk-users@lists.digium.com > Subject: Re: [Asterisk-Users] phone calls betweens phones behind the same > nat > > make sure you have nat=yes also in yur sip.conf for each phone entry > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > lists.digium.com/mailman/listinfo/asterisk-users
Soren Rathje
2004-Jun-11 08:08 UTC
[Asterisk-Users] phone calls betweens phones behind the same nat
BTW.. Q1: Are you using HEAD or STABLE? Q2: Are you using "bindaddr", "externip", "localnet" and "localmask" in your SIP.CONF? Something tells me that the CVS HEAD version of Asterisk is smart enough to figure out if we'r inside or outside... (chan_sip.c checked out june-10) /*--- ast_sip_ouraddrfor: NAT fix - decide which IP address to use for ASterisk server? ---*/ /* Only used for outbound registrations */ static int ast_sip_ouraddrfor(struct in_addr *them, struct in_addr *us) { /* * Using the localaddr structure built up with localnet statements * apply it to their address to see if we need to substitute our * externip or can get away with our internal bindaddr */ Then again, I could be wrong.. ;-) -- Soren ----- Original Message ----- From: "Didelot Loic" <loic@didelot.org> To: <asterisk-users@lists.digium.com> Sent: Friday, June 11, 2004 2:37 PM Subject: [Asterisk-Users] phone calls betweens phones behind the same nat> Hi, > I have the following problem. > > I have 5 phones behind the same nat (canreinvite=yes). it works fine to > receive calls and to make calls. sound quality is good, so everything > works fine. > > The poblem is that the phone behind nat cant call each other. It works > if canreinvite=no. But i want to do this. > > Does anyone have an idea? > > Regards, > cjk. > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > lists.digium.com/mailman/listinfo/asterisk-users >
Rich Adamson
2004-Jun-11 08:09 UTC
[Asterisk-Users] phone calls betweens phones behind the same nat
> I have 5 phones behind the same nat (canreinvite=yes). it works fine to > receive calls and to make calls. sound quality is good, so everything > works fine. > > The poblem is that the phone behind nat cant call each other. It works > if canreinvite=no. But i want to do this.That is what would be expected. The isssue is that remote phone A attempts to contact remove phone B (invite) directly, and the firewall/nat box at phone B is blocking that inbound attempt (that's what the nat box is suppose to do). In some cases there are ways to work around that, but it does require a full understanding of exactly how your nat boxes work, how your sip phones work, typically a sniffer at the remote locations to "see" exactly what is going on, and a good understanding of the sip protocol. Alternatives include: - use iax2-based phones - deploy an * box at each location - use canreinvite=no - "possible" use of sip-aware nat box (lots of other questions need to be answered first) The bottom line for sip use is the protocol dictates the phones get to pick rtp ports (audio) on their own using whatever udp port numbers the manufacturer preprogrammed into the phone, and your nat boxes aren't aware of that negotiation. Lots of documentation on this in the archives and the wiki.