[asterisk-dev] Why do a DNS search on sip_devicestate
Russell Bryant
russell at digium.com
Mon Aug 3 20:33:48 CDT 2009
Gabriel Ortiz Lour wrote:
> Hi Asterisk gurus,
>
> I'm experiencing a problem with my 1.4.19 asterisk and found that has
> to do with DNS delays... so looking in the code I have found that the
> chan_sip would do like:
>
> static int sip_devicestate(void *data)
> .
> .
> .
> ... else ...{
> char *port = strchr(host, ':');
> if (port)
> *port = '\0';
> hp = ast_gethostbyname(host, &ahp);
> if (hp)
> res = AST_DEVICE_UNKNOWN;
> }
>
> just to return AST_DEVICE_UNKNOWN, so I was just wondering if someone
> could tell me why does it have the trouble to do a DNS lookup and then
> returns AST_DEVICE_UNKNOWN
>
> I also saw that 1.6.1.2 does not do this lookup...
1.4.19 is very old. Please upgrade to the latest 1.4 version, as this
issue has been addressed. The lookup is still there, but changes were
made elsewhere such that it will not hit that code nearly as often (or
at all, depending on your config).
--
Russell Bryant
Digium, Inc. | Engineering Manager, Open Source Software
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org
More information about the asterisk-dev
mailing list