From: Russell Bryant Date: Fri, 28 Jan 2005 00:58:09 +0000 (+0000) Subject: don't fail register on dns error (bug #3424) X-Git-Tag: 1.0.11.1~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3696407c6730d285d5d5a5ed462185082d1ea6e0;p=thirdparty%2Fasterisk.git don't fail register on dns error (bug #3424) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4902 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 51f6dada57..bcbdacff49 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4081,7 +4081,15 @@ static int transmit_register(struct sip_registry *r, char *cmd, char *auth, char } /* Find address to hostname */ if (create_addr(p,r->hostname)) { - sip_destroy(p); + /* we have what we hope is a temporary network error, + * probably DNS. We need to reschedule a registration try */ + sip_destroy(p); + if (r->timeout > -1) { + ast_log(LOG_WARNING, "Still have a registration timeout (create_addr() error), %d\n", r->timeout); + ast_sched_del(sched, r->timeout); + } + r->timeout = ast_sched_add(sched, 20*1000, sip_reg_timeout, r); + return 0; }