mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-21 20:56:39 +00:00
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
This commit is contained in:
@@ -17283,9 +17283,6 @@ static int sip_devicestate(void *data)
|
|||||||
{
|
{
|
||||||
char *host;
|
char *host;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
struct hostent *hp;
|
|
||||||
struct ast_hostent ahp;
|
|
||||||
struct sip_peer *p;
|
struct sip_peer *p;
|
||||||
|
|
||||||
int res = AST_DEVICE_INVALID;
|
int res = AST_DEVICE_INVALID;
|
||||||
@@ -17338,12 +17335,7 @@ static int sip_devicestate(void *data)
|
|||||||
}
|
}
|
||||||
unref_peer(p);
|
unref_peer(p);
|
||||||
} else {
|
} else {
|
||||||
char *port = strchr(host, ':');
|
res = AST_DEVICE_UNKNOWN;
|
||||||
if (port)
|
|
||||||
*port = '\0';
|
|
||||||
hp = ast_gethostbyname(host, &ahp);
|
|
||||||
if (hp)
|
|
||||||
res = AST_DEVICE_UNKNOWN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
Reference in New Issue
Block a user