Re: [asterisk-users] NAT and Dial to two channels at once

2006-12-19 Thread Brad Templeton
On Mon, Dec 11, 2006 at 06:48:18PM -0500, Andrew Joakimsen wrote:
 You need to understand how NAT works, if you can chan2 and chan2 is behind a
 NAT and suddenly someone else is invited to chan2's IP address port 5060
 chan2's router willl say WTF I dont have an estabished connection on port
 5060 (to the client being reinvited to chan2) and it wont work. You need to
 have the media path go through asterisk in that case.

Actually, it's more complex than that.

If the NAT box has had a hole poked (in its config) for the RTP port (SIP
port is only used by Asterisk) then any machine can send it RTP on that
port.

In addition, if the NAT is of the full cone type, any host can send to
your port once you have sent a packet out that port.

With Restricted cone and Port restricted cones, it also works as long as
the Natted IP phone is sending packets out to the other host already.
Which it should be if we have symmetric RTP.

Symmetric NATs, which are rare, will change the port number when they
start talking to a different host for RTP.  This will screw up all but
the cleverest implementations.  (Though there are endpoints that notice
if the RTP is coming from a port other than they were told, and start
sending to that instead of the one in the SDP)

What doesn't work is assymetric RTP with NAT.   In this case we have
the audio going through asterisk in one direction, and directly in
the other direction.  That will fail if the direct direction tries
to go into a nat (it should work if it's only leaving a nat)

Asterisk currently does assymetric RTP if it thinks it only has to
listen to one end of the audio path.  That's a good idea in
general -- but not one that works through anything but a
manually opened NAT.


___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] NAT and Dial to two channels at once

2006-12-11 Thread Andrew Joakimsen

You need to understand how NAT works, if you can chan2 and chan2 is behind a
NAT and suddenly someone else is invited to chan2's IP address port 5060
chan2's router willl say WTF I dont have an estabished connection on port
5060 (to the client being reinvited to chan2) and it wont work. You need to
have the media path go through asterisk in that case.

On 12/10/06, Brad Templeton [EMAIL PROTECTED] wrote:


On Sun, Dec 10, 2006 at 01:39:10PM -0500, Eric Jacksch wrote:
 Someone may have a more elegant solution, but I have found that allowing
 reinvite on a phone connected via NAT gateway causes too many problems,
 especially with the difference in the various NAT implementations.  I
 set canreinvite=no host=dynamic nat=yes qualify=yes for all phones that
 connect from the Internet.

 A note to anyone doing Internet telephony -- the latest Linksys routers
 seem to ignore the small UDP keepalive that some phones like the
 grandstreams send, so the NAT hole closes.  I've had to start using
 qualify=yes to get asterisk to keep the NAT hole open.


Actually, that part is working, and in any event I can hand-open holes
in the NAT in cases where it doesn't work.

As long as the incoming call is redirected to a single channel, it
works fine.   Setting canreinvite=no and nat=yes and the rest don't
help the problem we get when the incoming call is sent to a
Dial(chan1chan2).

I don't want to turn reinvite off, it's a very important feature.
I'm giving IP phones to all members of the family this christmas,
and most of them live 2500 miles away.   Nobody will want to have
their audio hairpin through my server.   That would just add lots of
latency -- indeed enough to make the calls much less pleasant -- as
well as eat my own bandwidth and add risk of packet loss for no
reason.

As noted, it all works with just one channel, but for many of them,
to get them introduced to voip, it would be nice if I could have their
DID ring both their new SIP phone and their old PSTN phone (and
possibly their cell phone at the same time, though the voice-mail
problem remains a curse if you do that until I can convince Mark to
put in my fix for that.)


Ringing both the pstn phone and the IP phone is not just for
newcomers, however.  If you only have one IP phone in the house,
and you are not near it, you may not hear it and you don't want to
have to run elsewhere to get it.  (Could do call pickup over
PSTN.)

I understand if you Dial(chan1chan2) you need to do independent
invites with their own SDPs, because the two channels can be in
different places, with different codecs.  You don't know until
one answers what you will finally do, though if the one that answers
can be native bridged, it should be native bridged.

However, the current situation -- no audio at all until a reinvite
is triggered by putting the call on hold -- is obviously not very
exciting.
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users