From: Joshua Colp Date: Wed, 16 Jan 2008 02:30:13 +0000 (+0000) Subject: Remove DNS lookup from sip_devicestate. This seems to come from way back when and... X-Git-Tag: 1.6.0-beta1~3^2~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1faba2a90c6ee82a00e37f3b95ead033b2f9b5b7;p=thirdparty%2Fasterisk.git Remove DNS lookup from sip_devicestate. This seems to come from way back when and I can't think of a reason for it being here, plus it could cause needless DNS lookups. (closes issue #10983) Reported by: jtodd git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98954 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index f9b64a02cf..cb76b22123 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -17283,9 +17283,6 @@ static int sip_devicestate(void *data) { char *host; char *tmp; - - struct hostent *hp; - struct ast_hostent ahp; struct sip_peer *p; int res = AST_DEVICE_INVALID; @@ -17338,12 +17335,7 @@ static int sip_devicestate(void *data) } unref_peer(p); } else { - char *port = strchr(host, ':'); - if (port) - *port = '\0'; - hp = ast_gethostbyname(host, &ahp); - if (hp) - res = AST_DEVICE_UNKNOWN; + res = AST_DEVICE_UNKNOWN; } return res;