[asterisk-users] Using SIP with NAT (technical code question)

jezzzz . jezonthenet at yahoo.com
Mon Dec 11 12:54:22 MST 2006


In chan_sip.c, line 5876 (Asterisk-1.2.13), the
function parse_ok_contact returns whether the host
that requested an invite is a valid or invalid host.

In line 5925 the following clause is tested:

if (!(ast_test_flag(pvt, SIP_NAT) & SIP_NAT_ROUTE))
    hp = ast_gethostbyname(n, &ahp);

If this clause is true then Asterisk will attempt to
retrieve the IP address by using the hostname provided
in the invite.

My question is, is this test always going to be true
if a user (who receives the invite) uses NAT? (this is
set up in sip.conf as nat=yes) Is there a reason why
this was set up only for NAT? 

Thanks,

Jez

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the asterisk-users mailing list