[Asterisk-Users] qualify and NAT....

Eric Wieling eric at fnords.org
Mon Mar 14 10:34:19 MST 2005


Brian McCrary wrote:

> Hello,
> 
> I'm trying to run an ATA behind a NAT device, and am confused on exactly
> what the qualify config option does, other than send NOTIFY packets.  
> 
> Outbound calls work fine, but inbound calls do not go through.  With
> qualify=yes and nat=yes, my show sip peers looks like:
> 
> 7771111001/7771111001      10.0.0.10     D   N      255.255.255.255
> 1222  OK (36 ms)
> 
> So, it has established a connection with the peer on port 1222, however,
> when an incoming call comes in, it instead tries to go to port 5060,
> which doesn't work.
> 
> I know I could use port forwarding, but that won't work well for
> multiple ATAs.  So, am I right in thinking Asterisk should automagically
> forward the call to the port listed in show sip peers or am I missing
> something?  Any help DEFINATELY appreciated!!

Qualify will make Asterisk send an OPTIONS packet.  This allows 
Asterisk to see latency of the response to the OPTIONS packet (this 
does NOT test ICMP latency like ping does).  This gives Asterisk a 
GENERAL idea of how lagged the device is.

Since Qualify sends packets every once in a while (every 2 seconds?) 
it will also cause the dynamic port forwarding of your NAT router to 
keep the UDP translation active.  You could set the registration 
interval for your SIP device to some really low number like 60 seconds 
and that will accomplish the same thing as the qualify=yes option.

Remember clients send packets from a random high port number which 
changes.  Port forwarding on your router is pretty useless.  nat=yes 
combined with qualify=yes should cause enough traffic on the right 
ports to keep the NAT translations open on your NAT router.

Now, if ASTERISK is behind NAT it's a whole other set of issues and 
fixes, but you don't mention that so I won't cover it.

--Eric

-- 
Always do right. This will gratify some people and astonish the rest.
Mark Twain



More information about the asterisk-users mailing list