[Asterisk-cvs] asterisk/channels chan_sip.c,1.510.2.41,1.510.2.42

russell at lists.digium.com russell at lists.digium.com
Thu Jan 27 18:56:10 CST 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv13553/channels

Modified Files:
      Tag: v1-0
	chan_sip.c 
Log Message:
don't fail register on dns error (bug #3424)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.510.2.41
retrieving revision 1.510.2.42
diff -u -d -r1.510.2.41 -r1.510.2.42
--- chan_sip.c	17 Jan 2005 19:29:10 -0000	1.510.2.41
+++ chan_sip.c	28 Jan 2005 00:58:09 -0000	1.510.2.42
@@ -4081,7 +4081,15 @@
 		}
 		/* 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;
 		}
 




More information about the svn-commits mailing list