[asterisk-commits] pabelanger: trunk r329473 - in /trunk: ./ main/enum.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 25 14:57:31 CDT 2011


Author: pabelanger
Date: Mon Jul 25 14:57:27 2011
New Revision: 329473

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=329473
Log:
Merged revisions 329472 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r329472 | pabelanger | 2011-07-25 15:55:33 -0400 (Mon, 25 Jul 2011) | 9 lines
  
  Merged revisions 329471 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r329471 | pabelanger | 2011-07-25 15:49:40 -0400 (Mon, 25 Jul 2011) | 2 lines
    
    Decrease verbose messages to debug, to help clean up CLI.
  ........
................

Modified:
    trunk/   (props changed)
    trunk/main/enum.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-10-merged (original)
+++ branch-10-merged Mon Jul 25 14:57:27 2011
@@ -1,1 +1,1 @@
-/branches/10:1-328075,328120,328162,328207,328247,328317,328329,328428-328429,328448,328451,328541,328609,328611,328664,328717,328771,328824,328879,328936,328992,329055,329145,329200,329204,329257,329331,329334
+/branches/10:1-328075,328120,328162,328207,328247,328317,328329,328428-328429,328448,328451,328541,328609,328611,328664,328717,328771,328824,328879,328936,328992,329055,329145,329200,329204,329257,329331,329334,329472

Modified: trunk/main/enum.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/enum.c?view=diff&rev=329473&r1=329472&r2=329473
==============================================================================
--- trunk/main/enum.c (original)
+++ trunk/main/enum.c Mon Jul 25 14:57:27 2011
@@ -644,13 +644,13 @@
 	int z = 0;
 	int spaceleft = 0;
 	struct timeval time_start, time_end;
- 
+
 	if (ast_strlen_zero(suffix)) {
 		ast_log(LOG_WARNING, "ast_get_enum need a suffix parameter now.\n");
 		return -1;
 	}
 
-	ast_verb(2, "ast_get_enum(num='%s', tech='%s', suffix='%s', options='%s', record=%d\n", number, tech, suffix, options, record);
+	ast_debug(2, "num='%s', tech='%s', suffix='%s', options='%s', record=%d\n", number, tech, suffix, options, record);
 
 /*
   We don't need that any more, that "n" preceding the number has been replaced by a flag
@@ -668,11 +668,12 @@
 		number++;
 	}
 
-	if (!(context = ast_calloc(1, sizeof(*context))))
-		return -1;
-
-	if((p3 = strchr(naptrinput, '*'))) {
-		*p3='\0';		
+	if (!(context = ast_calloc(1, sizeof(*context)))) {
+		return -1;
+	}
+
+	if ((p3 = strchr(naptrinput, '*'))) {
+		*p3='\0';
 	}
 
 	context->naptrinput = naptrinput;	/* The number */
@@ -710,8 +711,8 @@
 			context->options |= ENUMLOOKUP_OPTIONS_ISN;
 		}
 	}
-	ast_verb(2, "ENUM options(%s): pos=%d, options='%d'\n", options, context->position, context->options);
-	ast_debug(1, "ast_get_enum(): n='%s', tech='%s', suffix='%s', options='%d', record='%d'\n",
+	ast_debug(2, "ENUM options(%s): pos=%d, options='%d'\n", options, context->position, context->options);
+	ast_debug(1, "n='%s', tech='%s', suffix='%s', options='%d', record='%d'\n",
 			number, tech, suffix, context->options, context->position);
 
 	/*
@@ -742,15 +743,13 @@
 		ast_copy_string(left, number, sizeof(left));
 		ast_copy_string(middle, p1, sizeof(middle) - 1);
 		strcat(middle, ".");
-
-		ast_verb(2, "ISN ENUM: left=%s, middle='%s'\n", left, middle);
+		ast_debug(2, "ISN ENUM: left=%s, middle='%s'\n", left, middle);
 	/* Direct DNS lookup rewrite */
 	} else if (context->options & ENUMLOOKUP_OPTIONS_DIRECT) {
 		left[0] = 0; /* nothing to flip around */
 		ast_copy_string(middle, number, sizeof(middle) - 1);
 		strcat(middle, ".");
- 
-		ast_verb(2, "DIRECT ENUM:  middle='%s'\n", middle);
+		ast_debug(2, "DIRECT ENUM:  middle='%s'\n", middle);
 	/* Infrastructure ENUM rewrite */
 	} else if (context->options & ENUMLOOKUP_OPTIONS_IENUM) {
 		int sdl = 0;
@@ -769,7 +768,7 @@
 
 			if (sdl >= 0) {
 				ast_copy_string(apex, n_apex, sizeof(apex));
-				ast_verb(2, "EBL ENUM: sep=%s, apex='%s'\n", sep, n_apex);
+				ast_debug(2, "EBL ENUM: sep=%s, apex='%s'\n", sep, n_apex);
 			} else {
 				sdl = cc_len;
 			}
@@ -778,8 +777,9 @@
 			ast_copy_string(cc, number, cc_len); /* cclen() never returns more than 3 */
 			sdl = blr_txt(cc, suffix);
 
-			if (sdl < 0) 
+			if (sdl < 0) {
 				sdl = cc_len;
+			}
 			break;
 
 		case ENUMLOOKUP_BLR_CC:	/* BLR is at the country-code level */
@@ -814,7 +814,7 @@
 		}
 		*p1 = '\0';
 
-		ast_verb(2, "I-ENUM: cclen=%d, left=%s, middle='%s', apex='%s'\n", cc_len, left, middle, apex);
+		ast_debug(2, "I-ENUM: cclen=%d, left=%s, middle='%s', apex='%s'\n", cc_len, left, middle, apex);
 	}
 
 	if (strlen(left) * 2 + 2 > sizeof(domain)) {
@@ -851,7 +851,7 @@
 	ret = ast_search_dns(context, tmp, C_IN, T_NAPTR, enum_callback);
 	time_end = ast_tvnow();
 
-	ast_verb(2, "ast_get_enum() profiling: %s, %s, %" PRIi64 " ms\n", 
+	ast_debug(2, "profiling: %s, %s, %" PRIi64 " ms\n",
 			(ret == 0) ? "OK" : "FAIL", tmp, ast_tvdiff_ms(time_end, time_start));
 
 	if (ret < 0) {
@@ -896,11 +896,12 @@
 	} else if (!(context->options & ENUMLOOKUP_OPTIONS_COUNT)) {
 		context->dst[0] = 0;
 	} else if ((context->options & ENUMLOOKUP_OPTIONS_COUNT)) {
-		snprintf(context->dst,context->dstlen,"%d",context->count);
-	}
-
-	if (chan)
+		snprintf(context->dst, context->dstlen, "%d", context->count);
+	}
+
+	if (chan) {
 		ret |= ast_autoservice_stop(chan);
+	}
 
 	if (!argcontext) {
 		for (k = 0; k < context->naptr_rrs_count; k++) {
@@ -909,8 +910,9 @@
 		}
 		ast_free(context->naptr_rrs);
 		ast_free(context);
-	} else
+	} else {
 		*argcontext = context;
+	}
 
 	return ret;
 }




More information about the asterisk-commits mailing list