From 6cdbd6903c60580c699e7eac0158eacd13aa5e23 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Sun, 2 May 2004 17:43:15 +0000 Subject: [PATCH] On a reload, don't stop supporting sip if we can't find our ip. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2860 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 858c06ade0..10858a2f04 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -6899,9 +6899,10 @@ static int reload_config(void) hp = ast_gethostbyname(ourhost, &ahp); if (!hp) { ast_log(LOG_WARNING, "Unable to get IP address for %s, SIP disabled\n", ourhost); - return 0; - } - memcpy(&__ourip, hp->h_addr, sizeof(__ourip)); + if (!__ourip.sin_addr.s_addr) + return 0; + } else + memcpy(&__ourip, hp->h_addr, sizeof(__ourip)); } if (!ntohs(bindaddr.sin_port)) bindaddr.sin_port = ntohs(DEFAULT_SIP_PORT);