]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
don't fail register on dns error (bug #3424)
authorRussell Bryant <russell@russellbryant.com>
Fri, 28 Jan 2005 00:58:09 +0000 (00:58 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 28 Jan 2005 00:58:09 +0000 (00:58 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4902 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 51f6dada57f85656d4513eedf23a99ea6df9f434..bcbdacff4915313cf41ddf51cc0759aacaebece0 100755 (executable)
@@ -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;
                }