[asterisk-commits] file: trunk r61618 - /trunk/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Apr 12 12:32:00 MST 2007


Author: file
Date: Thu Apr 12 14:32:00 2007
New Revision: 61618

URL: http://svn.digium.com/view/asterisk?view=rev&rev=61618
Log:
Don't treat a host lookup as failed if sipregs is not in use when doing a realtime lookup. (issue #9255 reported by sergee)

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=61618&r1=61617&r2=61618
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Apr 12 14:32:00 2007
@@ -2657,14 +2657,16 @@
 	} else if (sin) {	/* Then check on IP address for dynamic peers */
 		ast_copy_string(ipaddr, ast_inet_ntoa(sin->sin_addr), sizeof(ipaddr));
 		var = ast_load_realtime("sippeers", "host", ipaddr, NULL);	/* First check for fixed IP hosts */
-		if (var && realtimeregs) {
-			tmp = var;
-			while (tmp) {
-				if (!newpeername && !strcasecmp(tmp->name, "name"))
-					newpeername = tmp->value;
-				tmp = tmp->next;
+		if (var) {
+			if (realtimeregs) {
+				tmp = var;
+				while (tmp) {
+					if (!newpeername && !strcasecmp(tmp->name, "name"))
+						newpeername = tmp->value;
+					tmp = tmp->next;
+				}
+				varregs = ast_load_realtime("sipregs", "name", newpeername, NULL);
 			}
-			varregs = ast_load_realtime("sipregs", "name", newpeername, NULL);
 		} else {
 			if (realtimeregs)
 				varregs = ast_load_realtime("sipregs", "ipaddr", ipaddr, NULL); /* Then check for registered hosts */



More information about the asterisk-commits mailing list