[asterisk-commits] rmudgett: branch group/issue14292 r172701 - /team/group/issue14292/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 30 20:36:24 CST 2009


Author: rmudgett
Date: Fri Jan 30 20:36:24 2009
New Revision: 172701

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=172701
Log:
*  Fixed compiler warnings
*  Changed CCBS/CCNR ast_verbose() usage to use ast_verb().

Modified:
    team/group/issue14292/channels/chan_dahdi.c

Modified: team/group/issue14292/channels/chan_dahdi.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue14292/channels/chan_dahdi.c?view=diff&rev=172701&r1=172700&r2=172701
==============================================================================
--- team/group/issue14292/channels/chan_dahdi.c (original)
+++ team/group/issue14292/channels/chan_dahdi.c Fri Jan 30 20:36:24 2009
@@ -385,7 +385,7 @@
 	ccbsnr = ccbsnr_list;
 	while (ccbsnr) {
 		if ((ccbsnr->age + 86400) < time(NULL)) {
-			ast_verbose(VERBOSE_PREFIX_3 "DAHDI: CCBS/CCNR handle=%d timeout.\n", ccbsnr->handle);
+			ast_verb(3, "DAHDI: CCBS/CCNR handle=%d timeout.\n", ccbsnr->handle);
 			if (!tmp) {
 				ccbsnr_list = ccbsnr->next;
 			} else {
@@ -411,8 +411,9 @@
 		*state = CC_IDLE;
 	}
 
-	if (handle)
-		ast_verbose(VERBOSE_PREFIX_3 "DAHDI: ccbsnr_get_link: handle=%x\n", handle);
+	if (handle) {
+		ast_verb(3, "DAHDI: ccbsnr_get_link: handle=%x\n", handle);
+	}
 
 	ast_mutex_lock(&ccbsnr_lock);
 
@@ -441,8 +442,11 @@
 	}
 
 	if (callingnum && callernum) {
-		if (strlen(callingnum) && strlen(callernum))
-			ast_verbose(VERBOSE_PREFIX_3 "DAHDI: ccbsnr_get_link_by_number: callingnum=%s callernum=%s\n", callingnum, callernum);
+		if (strlen(callingnum) && strlen(callernum)) {
+			ast_verb(3,
+				"DAHDI: ccbsnr_get_link_by_number: callingnum=%s callernum=%s\n",
+				callingnum, callernum);
+		}
 	} else {
 		return NULL;
 	}
@@ -468,14 +472,14 @@
 /*
  * select CCBS/CCNR id
  */
-static struct ccbsnr_link *ccbsnr_select_link(unsigned int handle) {
-
+static struct ccbsnr_link *ccbsnr_select_link(unsigned int handle)
+{
 	struct ccbsnr_link *ccbsnr;
-	struct ccbsnr_link * ret = NULL;
+	struct ccbsnr_link *ret = NULL;
 	int ccbsnronprispan;
 	int cr;
 
-	ast_verbose(VERBOSE_PREFIX_3 "DAHDI: ccbsnr_select_link: handle=%x\n", handle);
+	ast_verb(3, "DAHDI: ccbsnr_select_link: handle=%x\n", handle);
 
 	ast_mutex_lock(&ccbsnr_lock);
 
@@ -487,8 +491,11 @@
 
 			ccbsnronprispan = CCBS_SPAN(handle);
 			cr = CCBS_CR(handle);
-			ast_verbose(VERBOSE_PREFIX_3 "DAHDI: request CCBS/NR span=%d type=%d cr =%x handle=%x state=%d (%s, %s, %s, %s, %d)\n",
-				ccbsnronprispan, ccbsnr->type, cr, handle, ccbsnr->state, ccbsnr->callingnum, ccbsnr->callernum, ccbsnr->callername, ccbsnr->context, ccbsnr->priority);
+			ast_verb(3,
+				"DAHDI: request CCBS/NR span=%d type=%d cr =%x handle=%x state=%d (%s, %s, %s, %s, %d)\n",
+				ccbsnronprispan, ccbsnr->type, cr, handle, ccbsnr->state,
+				ccbsnr->callingnum, ccbsnr->callernum, ccbsnr->callername,
+				ccbsnr->context, ccbsnr->priority);
 			break;
 		}
 		ccbsnr = ccbsnr->next;
@@ -509,7 +516,7 @@
 	int ccbsnronprispan;
 	int cr;
 
-	ast_verbose(VERBOSE_PREFIX_3 "DAHDI: ccbsnr_del_link: handle=%x\n", handle);
+	ast_verb(3, "DAHDI: ccbsnr_del_link: handle=%x\n", handle);
 
 	ast_mutex_lock(&ccbsnr_lock);
 
@@ -524,11 +531,16 @@
 			ccbsnronprispan = CCBS_SPAN(handle);
 			cr = CCBS_CR(handle);
 
-			ast_verbose(VERBOSE_PREFIX_3 "DAHDI: destroy CCBS/NR span=%d type=%d cr=%x handle=%x state=%d (%s, %s, %s, %s, %d)\n",
-				ccbsnronprispan, ccbsnr->type, cr, handle, ccbsnr->state, ccbsnr->callingnum, ccbsnr->callernum, ccbsnr->callername, ccbsnr->context, ccbsnr->priority);
-
-			if (ccbsnr->call )
-				ast_log(LOG_NOTICE, "call(%x) must be 'NULL'. Memory leak!\n", (int)ccbsnr->call);
+			ast_verb(3,
+				"DAHDI: destroy CCBS/NR span=%d type=%d cr=%x handle=%x state=%d (%s, %s, %s, %s, %d)\n",
+				ccbsnronprispan, ccbsnr->type, cr, handle, ccbsnr->state,
+				ccbsnr->callingnum, ccbsnr->callernum, ccbsnr->callername,
+				ccbsnr->context, ccbsnr->priority);
+
+			if (ccbsnr->call) {
+				ast_log(LOG_NOTICE, "call(%p) must be 'NULL'. Memory leak!\n",
+					ccbsnr->call);
+			}
 
 			ast_free(ccbsnr);
 			break;
@@ -579,7 +591,7 @@
 			/* remove too old entries */
 			if ((peerlinkchannel[i].age + CC_TIMEOUT_PEERLINKCHANNELS) < time(NULL)) {
 				peerlinkchannel[i].channel = NULL;
-				ast_verbose(VERBOSE_PREFIX_4 "DAHDI: peerlink %d timeout-erase\n", i);
+				ast_verb(4, "DAHDI: peerlink %d timeout-erase\n", i);
 			}
 		}
 	}
@@ -607,7 +619,8 @@
 		ast = peerlinkchannel[id].channel;
 		peerlinkchannel[id].channel = NULL;
 	}
-	ast_verbose(VERBOSE_PREFIX_4 "DAHDI: peerlink %d allocated, peer is %s\n", id, (ast)?ast->name:"unlinked");
+	ast_verb(4, "DAHDI: peerlink %d allocated, peer is %s\n", id,
+		(ast) ? ast->name : "unlinked");
 	ast_mutex_unlock(&peerlink_lock);
 	return ast;
 }
@@ -1665,7 +1678,7 @@
 		ccbsnr = ccbsnr->next;
 		span = CCBS_SPAN(tmp->handle);
 		cr = CCBS_CR(tmp->handle);
-		ast_log(LOG_NOTICE, "ccbsnr_clear_all: ccbsnr found(%x) span %d\n", (int)tmp, span);
+		ast_log(LOG_NOTICE, "ccbsnr_clear_all: ccbsnr found(%p) span %d\n", tmp, span);
 		ast_free(tmp);
 	}
 
@@ -1690,7 +1703,7 @@
 		ccbs_span = CCBS_SPAN(ccbsnr->handle);
 		cr = CCBS_CR(ccbsnr->handle);
 		if (ccbs_span == span) {
-			ast_log(LOG_NOTICE, "ccbsnr found(%x) ccbs_span %d\n", (int)ccbsnr, ccbs_span);
+			ast_log(LOG_NOTICE, "ccbsnr found(%p) ccbs_span %d\n", ccbsnr, ccbs_span);
 
 			tmp = ccbsnr;
 			if (!prev) {
@@ -1702,10 +1715,11 @@
 
 			if (tmp->call) {
 				call = pri_find_call(pri->pri, cr);
-				ast_log(LOG_NOTICE, "call found(%x)\n", (int)call);
+				ast_log(LOG_NOTICE, "call found(%p)\n", call);
 
 				if (call == tmp->call) {
-					ast_log(LOG_WARNING, "Q931Call(%x) cr(%x) found, hang it up it.\n", (int)call, cr);
+					ast_log(LOG_WARNING, "Q931Call(%p) cr(%x) found, hang it up it.\n",
+						call, cr);
 
 					pri_call_set_cc_operation(call, PRI_CC_CANCEL);
 					pri_hangup(pri->pri, call, -1);
@@ -1713,7 +1727,7 @@
 				}
 			}
 			ast_free(tmp);
-			ast_log(LOG_WARNING, "Free ccbsnr-link (%x) ccbs_span %d\n", (int)tmp, ccbs_span);
+			ast_log(LOG_WARNING, "Free ccbsnr-link (%p) ccbs_span %d\n", tmp, ccbs_span);
 		} else {
 			prev = ccbsnr;
 			ccbsnr = ccbsnr->next;
@@ -1743,7 +1757,7 @@
 		ccbsnr = ccbsnr->next;
 		span = CCBS_SPAN(tmp->handle);
 		cr = CCBS_CR(tmp->handle);
-		ast_log(LOG_NOTICE, "ccbsnr_destroy_all: ccbsnr found(%x) span %d\n", (int)tmp, span);
+		ast_log(LOG_NOTICE, "ccbsnr_destroy_all: ccbsnr found(%p) span %d\n", tmp, span);
 
 		if (tmp->call) {
 			pri = &pris[span - 1];
@@ -1754,10 +1768,12 @@
 			}
 
 			call = pri_find_call(pri->pri, cr);
-			ast_log(LOG_NOTICE, "ccbsnr_destroy_all: call found(%x)\n", (int)call);
+			ast_log(LOG_NOTICE, "ccbsnr_destroy_all: call found(%p)\n", call);
 
 			if (call == tmp->call) {
-				ast_log(LOG_WARNING, "ccbsnr_destroy_all(%x) cr(%x):Q931_call found, hang it up it.\n", (int)call, cr);
+				ast_log(LOG_WARNING,
+					"ccbsnr_destroy_all(%p) cr(%x):Q931_call found, hang it up it.\n",
+					call, cr);
 
 				pri_call_set_cc_operation(call, PRI_CC_CANCEL);
 				pri_hangup(pri->pri, call, -1);
@@ -1783,7 +1799,7 @@
 	int state = AST_STATE_DOWN;
 	struct dahdi_pvt *dummy;
 
-	ast_verbose(VERBOSE_PREFIX_3 "ccbsnr_remote_user_free: handle %x\n", handle);
+	ast_verb(3, "ccbsnr_remote_user_free: handle %x\n", handle);
 
 	ast_mutex_lock(&ccbsnr_lock);
 
@@ -1818,8 +1834,8 @@
 	ast->tech_pvt = dummy;
 	ast_string_field_build(ast, name, "CCBSNR/%x", ccbsnr->handle);
 
-	ast_verbose(VERBOSE_PREFIX_3 "ccbsnr_remote_user_free: ast=%x name=%s ast->_softhangup=%x ast->tech%x\n",
-		(int)ast, ast->name, ast->_softhangup, (int)ast->tech);
+	ast_verb(3, "ccbsnr_remote_user_free: ast=%p name=%s ast->_softhangup=%x ast->tech%p\n",
+		ast, ast->name, ast->_softhangup, ast->tech);
 
 	ast->_softhangup = 0;
 	memset(&ast->whentohangup, 0, sizeof(ast->whentohangup));
@@ -1840,13 +1856,17 @@
 	ast_copy_string(ast->exten, ccbsnr->callingnum, sizeof(ast->exten));
 
 	ast_setstate(ast, state);
-	ast_verbose(VERBOSE_PREFIX_3 "ccbsnr_remote_user_free: ast_pbx_start:ast %x cc-req(%d)\n", (int)ast, ccbsnr->type);
+	ast_verb(3, "ccbsnr_remote_user_free: ast_pbx_start:ast %p cc-req(%d)\n",
+		ast, ccbsnr->type);
 
 	if (ast_pbx_start(ast)) {
+		int ccbs_span;
+		struct dahdi_pri *ccbs_pri;
+
 		pri_call_set_cc_operation(ccbsnr->call, PRI_CC_CANCEL);
 
-		int ccbs_span = CCBS_SPAN(ccbsnr->handle);
-		struct dahdi_pri *ccbs_pri = &pris[ccbs_span - 1];
+		ccbs_span = CCBS_SPAN(ccbsnr->handle);
+		ccbs_pri = &pris[ccbs_span - 1];
 
 		if (pri_nochannel_grab(ccbs_pri)) {
 			ast_log(LOG_WARNING, "Failed to grab PRI!\n");
@@ -1861,8 +1881,10 @@
 
 		return;
 	} else {
-		ast_verbose(VERBOSE_PREFIX_3 "DAHDI-span%d: started PBX for CCBS/CCNR callback (context:%s/callingnum:%s/prio:%d)callernum:%s callername:%s peer=%x\n",
-			CCBS_SPAN(ccbsnr->handle), ccbsnr->context, ccbsnr->callingnum, ccbsnr->priority, ccbsnr->callernum, ccbsnr->callername, (int)ccbsnr->peer);
+		ast_verb(3,
+			"DAHDI-span%d: started PBX for CCBS/CCNR callback (context:%s/callingnum:%s/prio:%d)callernum:%s callername:%s peer=%p\n",
+			CCBS_SPAN(ccbsnr->handle), ccbsnr->context, ccbsnr->callingnum,
+			ccbsnr->priority, ccbsnr->callernum, ccbsnr->callername, ccbsnr->peer);
 		ccbsnr->state = CC_WAIT_USER_A_ANSWER_N;
 	}
 
@@ -3958,7 +3980,9 @@
 			if (cclink) {
 				pri_sr_set_ccringout(sr, p->ccringout);
 			} else {
-				ast_verbose(VERBOSE_PREFIX_3 "DAHDI-Call: ccbsnr-link found. state(%d). Change to Dial without CC-Ringout\n", state);
+				ast_verb(3,
+					"DAHDI-Call: ccbsnr-link found. state(%d). Change to Dial without CC-Ringout\n",
+					state);
 				p->ccringout = 0;
 			}
 		} else {
@@ -3971,8 +3995,9 @@
 				case CC_WAIT_ACK:
 				case CC_WAIT_USER_A_ANSWER_N:
 				case CC_INVOKED_A_RET:
-					ast_verbose(VERBOSE_PREFIX_4 "DAHDI-Call: CCBS-List-Obj 0x%x: handle %x span(%d) peer=%x\n", \
-						(int)cclink, cclink->handle, span, (int)cclink->peer);
+					ast_verb(4,
+						"DAHDI-Call: CCBS-List-Obj 0x%p: handle %x span(%d) peer=%p\n",
+						cclink, cclink->handle, span, cclink->peer);
 
 					if (cclink->call) {
 						pri_call_set_cc_operation(cclink->call, PRI_CC_CANCEL);
@@ -3995,7 +4020,8 @@
 					ccbsnr_del_link(cclink->handle);
 					break;
 				default:
-					ast_verbose(VERBOSE_PREFIX_3 "DAHDI-Call:wrong ccbsnr-link-state '%d'\n", state);
+					ast_verb(3, "DAHDI-Call:wrong ccbsnr-link-state '%d'\n", state);
+					break;
 				}
 			}
 		}
@@ -4017,7 +4043,7 @@
 
 			pbx_builtin_setvar_helper(peer, "CCPEERLINKID", "0");
 
-			ast_verbose(VERBOSE_PREFIX_3 "DAHDI peer link is %x %s.\n", (int)peer, peer->name);
+			ast_verb(3, "DAHDI peer link is %p %s.\n", peer, peer->name);
 
 			snprintf(tmp, sizeof(tmp) - 1, "%d", p->pri->span);
 			pbx_builtin_setvar_helper(peer, "CCBSNRONPRISPAN", tmp);
@@ -4122,7 +4148,7 @@
 		/* Free associated memory */
 		if (pl)
 			destroy_dahdi_pvt(&pl);
-		if (option_verbose > 2)
+		if (option_verbose > 2) 
 			ast_verbose(VERBOSE_PREFIX_2 "Unregistered channel %d\n", x);
 	}
 	iflist = NULL;
@@ -4150,8 +4176,7 @@
 		pbx_builtin_setvar_helper(ast, "_CCBSNRONPRISPAN", "0");
 	}
 
-	ast_verbose(VERBOSE_PREFIX_3 "Added %s as DAHDI peer link.\n",
-		ast->name);
+	ast_verb(3, "Added %s as DAHDI peer link.\n", ast->name);
 
 	return 0;
 }
@@ -4218,16 +4243,17 @@
 	for (cnt = 0; cnt < MAX_DISSALOWED; cnt++) {
 		tok = strtok_r(NULL, "|", &tokb);
 		if (!tok) {
-			ast_verbose(VERBOSE_PREFIX_3 "DAHDIQsigCheckCcbsnr without dissalowed-callernum argument\n");
+			ast_verb(3, "DAHDIQsigCheckCcbsnr without dissalowed-callernum argument\n");
 		} else {
 			dissalowed_callernum[cnt] = tok;
 		}
 	}
 
-	ast_verbose(VERBOSE_PREFIX_3 "DAHDI ccbsnr: '%s' '%s' '%s'\n", maxcounter, callingnum, callernum);
+	ast_verb(3, "DAHDI ccbsnr: '%s' '%s' '%s'\n", maxcounter, callingnum, callernum);
 	for (cnt = 0; cnt < MAX_DISSALOWED; cnt++) {
-		if (dissalowed_callernum[cnt])
-			ast_verbose(VERBOSE_PREFIX_3 "DAHDI ccbsnr: '%s'\n", dissalowed_callernum[cnt]);
+		if (dissalowed_callernum[cnt]) {
+			ast_verb(3, "DAHDI ccbsnr: '%s'\n", dissalowed_callernum[cnt]);
+		}
 	}
 
 	maxcount = (int)strtol(maxcounter, NULL, 0);
@@ -4240,13 +4266,15 @@
 
 	if (ast_strlen_zero(callernum)) {
 		flag = 1;
-		ast_verbose(VERBOSE_PREFIX_3 "DAHDIQsigCheckCcbsnr: no caller number - <callingnum>|<callernum>\n");
+		ast_verb(3, "DAHDIQsigCheckCcbsnr: no caller number - <callingnum>|<callernum>\n");
 	} else if (ast_strlen_zero(callingnum)) {
 		flag = 1;
-		ast_verbose(VERBOSE_PREFIX_3 "DAHDIQsigCheckCcbsnr: no caller number - <callingnum>|<callernum>\n");
+		ast_verb(3, "DAHDIQsigCheckCcbsnr: no caller number - <callingnum>|<callernum>\n");
 	} else if (!strcmp(callernum, callingnum)) {
 		flag = 1;
-		ast_verbose(VERBOSE_PREFIX_3 "DAHDIQsigCheckCcbsnr: caller number(%s) and calling number are equal\n", callernum);
+		ast_verb(3,
+			"DAHDIQsigCheckCcbsnr: caller number(%s) and calling number are equal\n",
+			callernum);
 	} else {
 		for (c = callernum; *c; c++)
 			*c = tolower(*c);
@@ -4254,21 +4282,23 @@
 			if (dissalowed_callernum[cnt]) {
 				if (!strcmp(callernum, dissalowed_callernum[cnt])) {
 					flag = 1;
-					ast_verbose(VERBOSE_PREFIX_4 "DAHDIQsigCheckCcbsnr: dissalowed_callernum - %s\n", dissalowed_callernum[cnt]);
+					ast_verb(4, "DAHDIQsigCheckCcbsnr: dissalowed_callernum - %s\n",
+						dissalowed_callernum[cnt]);
 					break;
 				}
 			}
 		}
 		count = ccbsnr_count_callingnum(callingnum);
-		ast_verbose(VERBOSE_PREFIX_4 "DAHDIQsigCheckCcbsnr: maxcount(%d) count(%d)\n", maxcount, count);
+		ast_verb(4, "DAHDIQsigCheckCcbsnr: maxcount(%d) count(%d)\n", maxcount, count);
 		if (count >= maxcount) {
 			flag = 1;
-			ast_verbose(VERBOSE_PREFIX_3 "DAHDIQsigCheckCcbsnr: count(%d) <callingnum>|<callernum>\n", count);
+			ast_verb(3, "DAHDIQsigCheckCcbsnr: count(%d) <callingnum>|<callernum>\n",
+				count);
 		}
 	}
 
 	if (flag) {
-		ast_verbose(VERBOSE_PREFIX_3 "Set CCBSNRREQSTATE to NOTAVAILABLE\n");
+		ast_verb(3, "Set CCBSNRREQSTATE to NOTAVAILABLE\n");
 		pbx_builtin_setvar_helper(ast, "CCBSNRREQSTATE", "NOTAVAILABLE");
 	}
 
@@ -4303,11 +4333,11 @@
 		return -1;
 	}
 
-	ast_verbose(VERBOSE_PREFIX_3 "DAHDI ccbsnr: '%s' '%s'\n", callingnum, callernum);
+	ast_verb(3, "DAHDI ccbsnr: '%s' '%s'\n", callingnum, callernum);
 
 	cclink = ccbsnr_get_link_by_number(callingnum, callernum, &state);
 	if (cclink) {
-		ast_verbose(VERBOSE_PREFIX_3 "DAHDI ccbsnr: state(%d)\n", state);
+		ast_verb(3, "DAHDI ccbsnr: state(%d)\n", state);
 
 		switch (state) {
 		case CC_WAIT_ACK:
@@ -4324,10 +4354,11 @@
 				cr = CCBS_CR(cclink->handle);
 				call = pri_find_call(pri->pri, cr);
 
-				ast_log(LOG_NOTICE, "destroy cclink: call found(%x)\n", (int)call);
+				ast_log(LOG_NOTICE, "destroy cclink: call found(%p)\n", call);
 
 				if (call == cclink->call) {
-					ast_log(LOG_NOTICE, "destroy call(%x) cr(%x):Q931_call found, hang it up it.\n", (int)call, cr);
+					ast_log(LOG_NOTICE, "destroy call(%p) cr(%x):Q931_call found, hang it up it.\n",
+						call, cr);
 
 					pri_call_set_cc_operation(call, PRI_CC_CANCEL);
 					pri_hangup(pri->pri, call, -1);
@@ -4340,10 +4371,13 @@
 			ccbsnr_del_link(cclink->handle);
 			break;
 		default:
-			ast_verbose(VERBOSE_PREFIX_2 "PRI_EVENT_HANGUP:wrong state '%d'\n", state);
+			ast_verb(2, "PRI_EVENT_HANGUP:wrong state '%d'\n", state);
+			break;
 		}
 	} else {
-		ast_verbose(VERBOSE_PREFIX_2 "dahdi_qsig_clear_nochannel: CCBS-List-Obj for callingnum(%s) callernum(%s) not found\n", callingnum, callernum);
+		ast_verb(2,
+			"dahdi_qsig_clear_nochannel: CCBS-List-Obj for callingnum(%s) callernum(%s) not found\n",
+			callingnum, callernum);
 		return 0;
 	}
 	return 0;
@@ -4368,9 +4402,6 @@
 	struct pri_sr *sr;
 	int pridialplan;
 	int prilocaldialplan;
-	l = NULL;
-	n = NULL;
-
 	struct dahdi_pri *pri;
 	struct ccbsnr_link *cclink;
 	q931_call *call;
@@ -4400,7 +4431,7 @@
 		return -1;
 	}
 
-	ast_verbose(VERBOSE_PREFIX_3 "DAHDI ccbsnr: '%s' '%s' '%s' '%s' '%s' '%s'\n",
+	ast_verb(3, "DAHDI ccbsnr: '%s' '%s' '%s' '%s' '%s' '%s'\n",
 		ccbsnrtype, callingnum, callernum, callername, context, priority);
 
 	 if (!strcmp(callernum, callingnum)) {
@@ -4413,12 +4444,12 @@
 	else if (!strcmp(ccbsnrtype, "CCNR"))
 		type = PRI_CC_CCNRREQUEST;
 	else {
-		ast_verbose(VERBOSE_PREFIX_2 "DAHDIQsigCcbsnrRequest requires <CCBS/CCNR>|<callingnum>|<callernum>|<callername>|<context>|<priority>\n");
+		ast_verb(2, "DAHDIQsigCcbsnrRequest requires <CCBS/CCNR>|<callingnum>|<callernum>|<callername>|<context>|<priority>\n");
 		return -1;
 	}
 
 	ccbsnronprispan = pbx_builtin_getvar_helper(ast, "CCBSNRONPRISPAN");
-	ast_verbose(VERBOSE_PREFIX_3 "DAHDI ccbsnronprispan: '%s'\n", ccbsnronprispan);
+	ast_verb(3, "DAHDI ccbsnronprispan: '%s'\n", ccbsnronprispan);
 
 	if (ast_strlen_zero(ccbsnronprispan)) {
 		ast_debug(1, "DAHDIQsigCcbsnrRequest: Use initialize befor use this funktion\n");
@@ -4428,7 +4459,8 @@
 	prispan = (int)strtol(ccbsnronprispan, NULL, 0);
 
 	if ((prispan < 1) || (prispan > NUM_SPANS)) {
-		ast_verbose(VERBOSE_PREFIX_2 "DAHDI:Invalid span %d.  Should be a number %d to %d\n", prispan, 1, NUM_SPANS);
+		ast_verb(2, "DAHDI:Invalid span %d.  Should be a number %d to %d\n", prispan,
+			1, NUM_SPANS);
 		return -1;
 	}
 
@@ -4457,7 +4489,8 @@
 	if (pri->facilityenable)
 		pri_facility_enable(pri->pri);
 
-	ast_verbose(VERBOSE_PREFIX_4 "DAHDI:Requested transfer capability: 0x%.2x - %s\n", ast->transfercapability, ast_transfercapability2str(ast->transfercapability));
+	ast_verb(4, "DAHDI:Requested transfer capability: 0x%.2x - %s\n",
+		ast->transfercapability, ast_transfercapability2str(ast->transfercapability));
 	dp_strip = 0;
 	pridialplan = pri->dialplan - 1;
 	c = callingnum;
@@ -4855,7 +4888,7 @@
 #ifdef HAVE_PRI
 	if (p->dummychannel == 1) {
 		ast_verb(3, "Hangup: dummy-channel(%s)\n", ast->name);
-		ast_verb(3, "Hangup:tech_pvt=%x q931_call=%x\n", (int)p, (int)p->call);
+		ast_verb(3, "Hangup:tech_pvt=%p q931_call=%p\n", p, p->call);
 
 		ast->tech_pvt = NULL;
 		ast_mutex_unlock(&p->lock);
@@ -13323,7 +13356,8 @@
 
 					channel = PRI_CHANNEL(channel);
 
-					ast_verbose(VERBOSE_PREFIX_4 "PRI_EVENT_CC_FACILITY e->facility.channel(0x%x) span(%d) explicit(%d) channel(%d)\n", \
+					ast_verb(4,
+						"PRI_EVENT_CC_FACILITY e->facility.channel(0x%x) span(%d) explicit(%d) channel(%d)\n",
 						e->facility.channel, ccbsnronprispan, explicit, channel);
 					if (channel == 0) {
 						for (i = 0; i < e->facility.subcmds.counter_subcmd; i++) {
@@ -13332,24 +13366,33 @@
 							case CMD_CC_EXECPOSIBLE_INV:
 								{
 									int cr = e->facility.cref;
-									ast_verbose(VERBOSE_PREFIX_4 "Facility cc-execposible INV cr %d channel %d/%d, span %d\n",
+									unsigned int state;
+
+									ast_verb(4,
+										"Facility cc-execposible INV cr %d channel %d/%d, span %d\n",
 										cr, ccbsnronprispan, channel, pri->span);
 
-									handle = CCBS_HANDLE(ccbsnronprispan,cr);
-									unsigned int state = 0;
-									ast_verbose(VERBOSE_PREFIX_4 "Facility cc-execposible: handle=%x\n", handle);
+									handle = CCBS_HANDLE(ccbsnronprispan, cr);
+									state = 0;
+									ast_verb(4,
+										"Facility cc-execposible: handle=%x\n", handle);
 									if (ccbsnr_get_link(handle, &state) != NULL) {
 										if (state == CC_INVOKED_A_RET) {
-											ast_verbose(VERBOSE_PREFIX_4 "DAHDI ccbsnr_remote_user_free: state '%d'\n", state);
+											ast_verb(4,
+												"DAHDI ccbsnr_remote_user_free: state '%d'\n",
+												state);
 											ccbsnr_remote_user_free(handle);
 										}
 									} else {
-										ast_verbose(VERBOSE_PREFIX_3 "Facility cc-execposible: List-obj not found - handle=%x state=%d\n", handle, state);
+										ast_verb(3,
+											"Facility cc-execposible: List-obj not found - handle=%x state=%d\n",
+											handle, state);
 									}
 								}
 								break;
 							default:
-								ast_log(LOG_WARNING, "Illegal subcommand %d in facility request  on channel %d/%d span %d\n", \
+								ast_log(LOG_WARNING,
+									"Illegal subcommand %d in facility request  on channel %d/%d span %d\n",
 									subcmd->cmd, ccbsnronprispan, channel, pri->span);
 								break;
 							}
@@ -13413,7 +13456,7 @@
 										}
 										break;
 									default:
-										ast_log(LOG_WARNING, "Illegal subcommand %d in facility request on channel %d/%d not in use on span %d\n", \
+										ast_log(LOG_WARNING, "Illegal subcommand %d in facility request on channel %d/%d not in use on span %d\n",
 											subcmd->cmd, PRI_SPAN(e->facility.channel), PRI_CHANNEL(e->facility.channel), pri->span);
 										break;
 									}
@@ -13429,10 +13472,12 @@
 					int channel = e->answer.channel;
 					int ccbsnronprispan = PRI_SPAN(channel);
 					int explicit = PRI_EXPLICIT(channel);
+					int i;
+
 					channel = PRI_CHANNEL(channel);
-					int i;
-
-					ast_verbose(VERBOSE_PREFIX_4 "PRI_EVENT_ANSWER e->answer.channel(0x%x) span(%d) explicit(%d) channel(%d)\n", \
+
+					ast_verb(4,
+						"PRI_EVENT_ANSWER e->answer.channel(0x%x) span(%d) explicit(%d) channel(%d)\n",
 						e->answer.channel, ccbsnronprispan, explicit, channel);
 
 					if (channel == 0) {	/* No channel Connection */
@@ -13447,7 +13492,8 @@
 									int no_path_reservation = subcmd->cc_ccbs_rr.cc_request_res.no_path_reservation;
 									int retain_service      = subcmd->cc_ccbs_rr.cc_request_res.retain_service;
 
-									ast_verbose(VERBOSE_PREFIX_4 "Answer ccbs-request RR no-path-reservation '%d' retain-service '%d' on channel %d/%d on span %d\n",
+									ast_verb(4,
+										"Answer ccbs-request RR no-path-reservation '%d' retain-service '%d' on channel %d/%d on span %d\n",
 										no_path_reservation, retain_service,
 										PRI_SPAN(e->answer.channel), PRI_CHANNEL(e->answer.channel), pri->span);
 									handle = CCBS_HANDLE(ccbsnronprispan,cr);
@@ -13456,16 +13502,22 @@
 										struct ast_channel *peer;
 										peer = cclink->peer;
 										cclink->peer = NULL;
-										ast_verbose(VERBOSE_PREFIX_4 "PRI_EVENT_ANSWER: peer on CCBS-List-Obj (%x))\n", (int)peer);
+										ast_verb(4,
+											"PRI_EVENT_ANSWER: peer on CCBS-List-Obj (%p))\n",
+											peer);
 
 										if (peer) {
-											ast_verbose(VERBOSE_PREFIX_4 "fac-ev:PRI_CC_CCBSREQUEST:set per peer %x state ACTIVATED\n", (int)peer);
+											ast_verb(4,
+												"fac-ev:PRI_CC_CCBSREQUEST:set per peer %p state ACTIVATED\n",
+												peer);
 											pbx_builtin_setvar_helper(peer, "CCBSNRREQSTATE", "ACTIVATED");
 										} else {
-											ast_verbose(VERBOSE_PREFIX_4 "PRI_EVENT_ANSWER: No peer on CCBS-List-Obj found\n");
+											ast_verb(4,
+												"PRI_EVENT_ANSWER: No peer on CCBS-List-Obj found\n");
 										}
 									} else {
-										ast_verbose(VERBOSE_PREFIX_3 "PRI_EVENT_ANSWER: CCBS-List-Obj not found: e->answer.channel(0x%x) span(%d) explicit(%d) channel(%d)\n",
+										ast_verb(3,
+											"PRI_EVENT_ANSWER: CCBS-List-Obj not found: e->answer.channel(0x%x) span(%d) explicit(%d) channel(%d)\n",
 											e->answer.channel, ccbsnronprispan, explicit, channel);
 									}
 								}
@@ -13479,7 +13531,8 @@
 									int no_path_reservation = subcmd->cc_ccnr_rr.cc_request_res.no_path_reservation;
 									int retain_service      = subcmd->cc_ccnr_rr.cc_request_res.retain_service;
 
-									ast_verbose(VERBOSE_PREFIX_3 "Answer ccnr-request RR no-path-reservation '%d' retain-service '%d' on channel %d/%d on span %d\n",
+									ast_verb(3,
+										"Answer ccnr-request RR no-path-reservation '%d' retain-service '%d' on channel %d/%d on span %d\n",
 										no_path_reservation, retain_service,
 										PRI_SPAN(e->answer.channel), PRI_CHANNEL(e->answer.channel), pri->span);
 									handle = CCBS_HANDLE(ccbsnronprispan,cr);
@@ -13488,23 +13541,27 @@
 										struct ast_channel *peer;
 										peer = cclink->peer;
 										cclink->peer = NULL;
-										ast_verbose(VERBOSE_PREFIX_4 "PRI_EVENT_ANSWER: peer on CCBS-List-Obj (%x))\n", (int)peer);
+										ast_verb(4,
+											"PRI_EVENT_ANSWER: peer on CCBS-List-Obj (%p))\n", peer);
 
 										if (peer) {
-											ast_verbose(VERBOSE_PREFIX_4 "fac-ev:PRI_CC_CCBSREQUEST:set per peer %x state ACTIVATED\n", (int)peer);
+											ast_verb(4,
+												"fac-ev:PRI_CC_CCBSREQUEST:set per peer %p state ACTIVATED\n",
+												peer);
 											pbx_builtin_setvar_helper(peer, "CCBSNRREQSTATE", "ACTIVATED");
 										} else {
-											ast_verbose(VERBOSE_PREFIX_3 "PRI_EVENT_ANSWER: No peer on CCBS-List-Obj found\n");
+											ast_verb(3, "PRI_EVENT_ANSWER: No peer on CCBS-List-Obj found\n");
 										}
 									} else {
-										ast_verbose(VERBOSE_PREFIX_3 "PRI_EVENT_ANSWER: CCBS-List-Obj not found: e->answer.channel(0x%x) span(%d) explicit(%d) channel(%d)\n",
+										ast_verb(3,
+											"PRI_EVENT_ANSWER: CCBS-List-Obj not found: e->answer.channel(0x%x) span(%d) explicit(%d) channel(%d)\n",
 											e->answer.channel, ccbsnronprispan, explicit, channel);
 									}
 								}
 								break;
 
 							default:
-								ast_log(LOG_WARNING, "Illegal subcommand %d in answer on channel %d/%d span %d\n", \
+								ast_log(LOG_WARNING, "Illegal subcommand %d in answer on channel %d/%d span %d\n",
 									subcmd->cmd, PRI_SPAN(e->answer.channel), PRI_CHANNEL(e->answer.channel), pri->span);
 								break;
 							}
@@ -13595,35 +13652,40 @@
 
 					channel = PRI_CHANNEL(channel);
 
-					ast_verbose(VERBOSE_PREFIX_4 "Channel %d/%d, span %d got hangup, cause %d\n",
+					ast_verb(4, "Channel %d/%d, span %d got hangup, cause %d\n",
 						ccbsnronprispan, channel, pri->span, e->hangup.cause);
 
 					if (channel == 0) {	/* No channel Connection */
+						struct ccbsnr_link *cclink;
+						unsigned int handle;
+						int cr;
+						unsigned int state;
+
 						for (i = 0; i < e->hangup.subcmds.counter_subcmd; i++) {
 							subcommand *subcmd = &e->hangup.subcmds.subcmd[i];
 							switch (subcmd->cmd) {
 							case CMD_CC_ERROR:
 								errorvalue = subcmd->cc_error.error_value;
-								ast_verbose(VERBOSE_PREFIX_4 "Hangup cc-error RR value '%d' on channel %d/%d on span %d\n",
+								ast_verb(4,
+									"Hangup cc-error RR value '%d' on channel %d/%d on span %d\n",
 									errorvalue, PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
 								break;
 							case CMD_CC_CANCEL_INV:
-								ast_verbose(VERBOSE_PREFIX_4 "Hangup cc-cancel INV numberA '%s' numberB '%s' on channel %d/%d on span %d\n",
+								ast_verb(4,
+									"Hangup cc-cancel INV numberA '%s' numberB '%s' on channel %d/%d on span %d\n",
 									subcmd->cc_cancel_inv.cc_optional_arg.number_A,
 									subcmd->cc_cancel_inv.cc_optional_arg.number_B,
 									PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
 								break;
 							default:
-								ast_log(LOG_WARNING, "Illegal subcommand %d in hangup on channel %d/%d span %d\n", \
+								ast_log(LOG_WARNING, "Illegal subcommand %d in hangup on channel %d/%d span %d\n",
 									subcmd->cmd, PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
 								break;
 							}
 						}
 
-						struct ccbsnr_link *cclink;
-						unsigned int handle;
-						int cr = e->hangup.cref;
-						unsigned int state = 0;
+						cr = e->hangup.cref;
+						state = 0;
 
 						handle = CCBS_HANDLE(ccbsnronprispan,cr);
 						cclink = ccbsnr_get_link(handle, &state);
@@ -13632,20 +13694,22 @@
 							case CC_WAIT_ACK:
 							case CC_WAIT_USER_A_ANSWER_N:
 							case CC_INVOKED_A_RET:
-								ast_verbose(VERBOSE_PREFIX_4 "PRI_EVENT_HANGUP: CCBS-List-Obj 0x%x: handle %x e->hangup.channel(0x%x) span(%d) explicit(%d) channel(%d) error(%d) peer=%x\n",
-									(int)cclink, handle, e->hangup.channel, ccbsnronprispan, explicit, channel, errorvalue, (int)cclink->peer);
+								ast_verb(4,
+									"PRI_EVENT_HANGUP: CCBS-List-Obj 0x%p: handle %x e->hangup.channel(0x%x) span(%d) explicit(%d) channel(%d) error(%d) peer=%p\n",
+									cclink, handle, e->hangup.channel, ccbsnronprispan, explicit, channel, errorvalue, cclink->peer);
 
 								pri_hangup(pri->pri, cclink->call, e->hangup.cause);
 								cclink->call = NULL;
 								ccbsnr_del_link(handle);
 								break;
 							default:
-								ast_verbose(VERBOSE_PREFIX_3 "PRI_EVENT_HANGUP:wrong state '%d'\n", state);
+								ast_verb(3, "PRI_EVENT_HANGUP:wrong state '%d'\n", state);
+								break;
 							}
 						} else {
-							ast_verbose(VERBOSE_PREFIX_4 "PRI_EVENT_HANGUP: CCBS-List-Obj not found: e->hangup.channel(0x%x) span(%d) explicit(%d) channel(%d)\n",
+							ast_verb(4, "PRI_EVENT_HANGUP: CCBS-List-Obj not found: e->hangup.channel(0x%x) span(%d) explicit(%d) channel(%d)\n",
 								e->hangup.channel, ccbsnronprispan, explicit, channel);
-							ast_verbose(VERBOSE_PREFIX_3 "Hangup on bad channel %d/%d on span %d\n",
+							ast_verb(3, "Hangup on bad channel %d/%d on span %d\n",
 								PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
 						}
 					} else {
@@ -13682,6 +13746,7 @@
 												break;
 											default:
 												pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
+												break;
 											}
 										}
 									}
@@ -13721,8 +13786,9 @@
 										break;
 
 									default:
-										ast_log(LOG_WARNING, "Illegal subcommand %d in hangup on channel %d/%d not in use on span %d\n", \
+										ast_log(LOG_WARNING, "Illegal subcommand %d in hangup on channel %d/%d not in use on span %d\n",
 											subcmd->cmd, PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
+										break;
 									}
 								}
 
@@ -13808,9 +13874,9 @@
 					int explicit = PRI_EXPLICIT(channel);
 					channel = PRI_CHANNEL(channel);
 
-					ast_verbose(VERBOSE_PREFIX_4 "PRI_EVENT_HANGUP_ACK e->hangup.cause(%d) e->hangup.channel(0x%x) span(%d) explicit(%d) channel(%d)\n",
+					ast_verb(4, "PRI_EVENT_HANGUP_ACK e->hangup.cause(%d) e->hangup.channel(0x%x) span(%d) explicit(%d) channel(%d)\n",
 						e->hangup.cause, e->hangup.channel, ccbsnronprispan, explicit, channel);
-					ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup, cause %d\n",
+					ast_verb(3, "Channel %d/%d, span %d got hangup, cause %d\n",
 						ccbsnronprispan, channel, pri->span, e->hangup.cause);
 					if (channel == 0) {	/* No channel Connection */
 						struct ccbsnr_link *cclink;
@@ -13821,13 +13887,15 @@
 						handle = CCBS_HANDLE(ccbsnronprispan,cr);
 						cclink = ccbsnr_get_link(handle, &state);
 						if (cclink) {
-							ast_verbose(VERBOSE_PREFIX_4 "PRI_EVENT_HANGUP_ACK: CCBS-List-Obj 0x%x: handle %x e->hangup.channel(0x%x) span(%d) explicit(%d) channel(%d) peer=%x\n",
-								(int)cclink, handle, e->hangup.channel, ccbsnronprispan, explicit, channel, (int)cclink->peer);
+							ast_verb(4,
+								"PRI_EVENT_HANGUP_ACK: CCBS-List-Obj 0x%p: handle %x e->hangup.channel(0x%x) span(%d) explicit(%d) channel(%d) peer=%p\n",
+								cclink, handle, e->hangup.channel, ccbsnronprispan, explicit, channel, cclink->peer);
 							cclink->call = NULL;
 							ccbsnr_del_link(handle);
 						} else {
-							ast_verbose(VERBOSE_PREFIX_4 "PRI_EVENT_HANGUP_ACK: CCBS-List-Obj 0x%x: handle %x e->hangup.channel(0x%x) span(%d) explicit(%d) channel(%d)",
-								(int)cclink, handle, e->hangup.channel, ccbsnronprispan, explicit, channel);
+							ast_verb(4,
+								"PRI_EVENT_HANGUP_ACK: CCBS-List-Obj 0x%p: handle %x e->hangup.channel(0x%x) span(%d) explicit(%d) channel(%d)",
+								cclink, handle, e->hangup.channel, ccbsnronprispan, explicit, channel);
 						}
 						break;
 					}
@@ -14296,16 +14364,18 @@
 
 	ast_mutex_lock(&ccbsnr_lock);
 	ccbsnr = ccbsnr_list;
-	if (ccbsnr)
-		ast_cli(a->fd, "ccbsnr-list: %x\n", (int)ccbsnr);
+	if (ccbsnr) {
+		ast_cli(a->fd, "ccbsnr-list: %p\n", ccbsnr);
+	}
 
 	while (ccbsnr) {
 		ccbsnronprispan = CCBS_SPAN(ccbsnr->handle);
 		cr = CCBS_CR(ccbsnr->handle);
-		ast_cli(a->fd, "%d. Active No Channel Call: Q.931 Call %x cr=%d span=%d type=%d handle=%x state=%d (%s, %s, %s, %s, %d) peer=%x\n",
-			++counter, (int)ccbsnr->call, cr, ccbsnronprispan, ccbsnr->type, ccbsnr->handle, ccbsnr->state,
+		ast_cli(a->fd,
+			"%d. Active No Channel Call: Q.931 Call %p cr=%d span=%d type=%d handle=%x state=%d (%s, %s, %s, %s, %d) peer=%p\n",
+			++counter, ccbsnr->call, cr, ccbsnronprispan, ccbsnr->type, ccbsnr->handle, ccbsnr->state,
 			ccbsnr->callingnum, ccbsnr->callernum, ccbsnr->callername,
-			ccbsnr->context, ccbsnr->priority, (int)ccbsnr->peer );
+			ccbsnr->context, ccbsnr->priority, ccbsnr->peer);
 
 		ccbsnr = ccbsnr->next;
 	}




More information about the asterisk-commits mailing list