[asterisk-users] Connection question...

Brian Candler B.Candler at pobox.com
Fri Oct 13 02:24:39 MST 2006


On Thu, Oct 12, 2006 at 01:50:53AM -0300, Danko Miocevic wrote:
> Dovid, the thing is that my server is on one internet connection connected 
> directly... without nat... but my phones are behind a nat and they are in 
> their own network, separated from the server. I just wanted to manage the 
> calls with my server but making something like a direct connection between 
> them...

So do you mean something like this?

   phone 1  ---------|    192.168.1.1      x.x.x.x        y.y.y.y
  192.168.1.200      +--------------- NAT ----------------------- Asterisk
                     |                F/W
   phone 2 ----------|
  192.168.1.201

So the phones are pointing at Asterisk y.y.y.y as their SIP proxy, but if
phone 1 places a call to phone 2 you want the audio to go directly between
192.168.1.200 and 192.168.1.201 on the LAN, is that it?

You can get almost this if you install 'siproxd' on the NAT firewall, and
configure the phones to use 192.168.1.1 as their outbound SIP proxy. What
actually happens for an internal call is that the media stream will go from
192.168.1.200 to 192.168.1.1 to 192.168.1.201, but at least it stays on the
LAN.

Asterisk will believe that the phones are at IP address x.x.x.x, and will
see SDP messages giving a media endpoint of x.x.x.x, because that's what
siproxd does. You should probably then set 'nat=no' on the Asterisk SIP
channels, because Asterisk no longer needs to do any special NAT processing.

siproxd doesn't handle multiple concurrent registrations of the same SIP
user ID, but then neither does Asterisk yet, so that won't be a limitation
for you.

That's the simplest solution I know of. You can play with openser but that's
a much more complex beastie, essentially a toolbox for forwarding and
modifying SIP packets. Or if you're happier with Asterisk, you could install
another Asterisk server on the NAT F/W or on the LAN. (But that's much more
complex to setup and maintain than siproxd; with siproxd on the LAN all the
call routing intelligence still resides on your main Asterisk server)

I'm not 100% sure, but I don't think your external Asterisk server can do
what you want without assistance from a local SIP proxy on the LAN. Setting
'canreinvite=yes' would allow Asterisk to point the phones at each other,
but you've probably already had to set 'nat=yes' which means that Asterisk
ignores a lot of the private IP information contained within the SIP/SDP
packets and uses the source IP address it sees (x.x.x.x) instead.

HTH,

Brian.


More information about the asterisk-users mailing list