[asterisk-commits] rizzo: branch rizzo/astobj2 r47716 - /team/rizzo/astobj2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Nov 15 17:57:54 MST 2006


Author: rizzo
Date: Wed Nov 15 18:57:53 2006
New Revision: 47716

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47716
Log:
prepare for reducing nesting in parsing of user.conf


Modified:
    team/rizzo/astobj2/channels/chan_sip.c

Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=47716&r1=47715&r2=47716
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Wed Nov 15 18:57:53 2006
@@ -16654,9 +16654,11 @@
 		genhassip = ast_true(ast_variable_retrieve(ucfg, "general", "hassip"));
 		genregistersip = ast_true(ast_variable_retrieve(ucfg, "general", "registersip"));
 		gen = ast_variable_browse(ucfg, "general");
-		cat = ast_category_browse(ucfg, NULL);
-		while (cat) {
-			if (strcasecmp(cat, "general")) {
+		cat = NULL;
+		while ( (cat = ast_category_browse(ucfg, cat)) ) {
+			if (!strcasecmp(cat, "general"))	/* skip 'general' */
+				continue;
+
 				hassip = ast_variable_retrieve(ucfg, cat, "hassip");
 				registersip = ast_variable_retrieve(ucfg, cat, "registersip");
 				if (ast_true(hassip) || (!hassip && genhassip)) {
@@ -16690,8 +16692,6 @@
 							registry_count++;
 					}
 				}
-			}
-			cat = ast_category_browse(ucfg, cat);
 		}
 		ast_config_destroy(ucfg);
 	}



More information about the asterisk-commits mailing list