[asterisk-dev] Getting IP of host when not NATted (technical code question)

jezzzz . jezonthenet at yahoo.com
Tue Dec 12 08:34:02 MST 2006


(I asked this question in users, was referred to the
dev list)

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 false 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) does not use NAT
and the person sending the invite sends a hostname
rather than an IP? Is there a reason why this was set
up only for non-NATted?

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-dev mailing list