[asterisk-commits] rmudgett: branch group/issue8824 r144355 - in /team/group/issue8824/channels:...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 24 20:34:39 CDT 2008


Author: rmudgett
Date: Wed Sep 24 20:34:39 2008
New Revision: 144355

URL: http://svn.digium.com/view/asterisk?view=rev&rev=144355
Log:
*  Made some chan_misdn debug messages less cryptic
*  Added caller, connected, and redirecting name to debug messages.
*  Added some better error handling to misdn_call() and
misdn_request().


Modified:
    team/group/issue8824/channels/chan_misdn.c
    team/group/issue8824/channels/misdn/isdn_lib.c

Modified: team/group/issue8824/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/chan_misdn.c?view=diff&rev=144355&r1=144354&r2=144355
==============================================================================
--- team/group/issue8824/channels/chan_misdn.c (original)
+++ team/group/issue8824/channels/chan_misdn.c Wed Sep 24 20:34:39 2008
@@ -1928,12 +1928,19 @@
 	struct ast_channel *ast = help->ast;
 
 	ast_cli(fd,
-		"* Pid:%d Prt:%d Ch:%d Mode:%s Org:%s dad:%s oad:%s rad:%s ctx:%s state:%s\n",
-		bc->pid, bc->port, bc->channel,
+		"* Pid:%d Port:%d Ch:%d Mode:%s Orig:%s dialed:%s\n"
+		"  --> caller:\"%s\" <%s>\n"
+		"  --> redirecting:\"%s\" <%s>\n"
+		"  --> context:%s state:%s\n",
+		bc->pid,
+		bc->port,
+		bc->channel,
 		bc->nt ? "NT" : "TE",
 		help->originator == ORG_AST ? "*" : "I",
 		ast ? ast->exten : "",
+		(ast && ast->cid.cid_name) ? ast->cid.cid_name : "",
 		(ast && ast->cid.cid_num) ? ast->cid.cid_num : "",
+		bc->redirecting.from.name,
 		bc->redirecting.from.number,
 		ast ? ast->context : "",
 		misdn_get_ch_state(help));
@@ -1961,7 +1968,6 @@
 			bc->addr,
 			bc->l3_id,
 			bc->display,
-			
 			bc->active,
 			bc_state2str(bc->bc_state),
 			bearer2str(bc->capability),
@@ -1970,7 +1976,6 @@
 #else
 			bc->ec_enable,
 #endif
-
 			help->norxtone, help->notxtone,
 			bc->holded);
 	}
@@ -2018,15 +2023,17 @@
 			if (help->state == MISDN_HOLDED) {
 				ast_cli(a->fd, "ITS A HOLDED BC:\n");
 				ast_cli(a->fd, " --> l3_id: %x\n"
-						" --> dad:%s oad:%s\n"
-						" --> hold_port: %d\n"
-						" --> hold_channel: %d\n",
-						help->l3id,
-						ast->exten,
-						ast->cid.cid_num,
-						help->hold_info.port,
-						help->hold_info.channel
-						);
+					" --> dialed:%s\n"
+					" --> caller:\"%s\" <%s>\n"
+					" --> hold_port: %d\n"
+					" --> hold_channel: %d\n",
+					help->l3id,
+					ast->exten,
+					ast->cid.cid_name ? ast->cid.cid_name : "",
+					ast->cid.cid_num ? ast->cid.cid_num : "",
+					help->hold_info.port,
+					help->hold_info.channel
+					);
 			} else {
 				ast_cli(a->fd, "* Channel in unknown STATE !!! Exten:%s, Callerid:%s\n", ast->exten, ast->cid.cid_num);
 			}
@@ -2785,7 +2792,7 @@
 
 		misdn_cfg_get(port, MISDN_CFG_CALLERID, callerid, sizeof(callerid));
 		if ( ! ast_strlen_zero(callerid) ) {
-			chan_misdn_log(1, port, " --> * Setting Caller id to %s\n", callerid);
+			chan_misdn_log(1, port, " --> * Setting caller id number to %s\n", callerid);
 			ast_copy_string(bc->caller.number, callerid, sizeof(bc->caller.number));
 		}
 
@@ -2969,22 +2976,10 @@
 	int r;
 	int exceed;
 	int bridging;
-	struct chan_list *ch = MISDN_ASTERISK_TECH_PVT(ast);
+	struct chan_list *ch;
 	struct misdn_bchannel *newbc;
 	char *opts = NULL, *ext, *tokb;
-	char *dest_cp = ast_strdupa(dest);
-
-	ext = strtok_r(dest_cp, "/", &tokb);
-
-	if (ext) {
-		ext = strtok_r(NULL, "/", &tokb);
-		if (ext) {
-			opts = strtok_r(NULL, "/", &tokb);
-		} else {
-			chan_misdn_log(0, 0, "misdn_call: No Extension given!\n");
-			return -1;
-		}
-	}
+	char *dest_cp;
 
 	if (!ast) {
 		ast_log(LOG_WARNING, " --> ! misdn_call called on ast_channel *ast where ast == NULL\n");
@@ -2998,43 +2993,60 @@
 		return -1;
 	}
 
+	ch = MISDN_ASTERISK_TECH_PVT(ast);
 	if (!ch) {
-		ast_log(LOG_WARNING, " --> ! misdn_call called on %s, neither down nor reserved (or dest==NULL)\n", ast->name);
+		ast_log(LOG_WARNING, " --> ! misdn_call called on %s, chan_list *ch==NULL\n", ast->name);
 		ast->hangupcause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE;
 		ast_setstate(ast, AST_STATE_DOWN);
 		return -1;
 	}
 	
 	newbc = ch->bc;
-	
 	if (!newbc) {
-		ast_log(LOG_WARNING, " --> ! misdn_call called on %s, neither down nor reserved (or dest==NULL)\n", ast->name);
+		ast_log(LOG_WARNING, " --> ! misdn_call called on %s, newbc==NULL\n", ast->name);
 		ast->hangupcause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE;
 		ast_setstate(ast, AST_STATE_DOWN);
 		return -1;
 	}
+
+	dest_cp = ast_strdupa(dest);
+	ext = strtok_r(dest_cp, "/", &tokb);
+	if (ext) {
+		ext = strtok_r(NULL, "/", &tokb);
+		if (ext) {
+			opts = strtok_r(NULL, "/", &tokb);
+		}
+	}
+	if (!ext) {
+		chan_misdn_log(0, 0, "misdn_call: No Extension given!\n");
+		ast->hangupcause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE;
+		ast_setstate(ast, AST_STATE_DOWN);
+		return -1;
+	}
 	
 	port = newbc->port;
 
-	if ((exceed = add_out_calls(port))) {
+	exceed = add_out_calls(port);
+	if (exceed != 0) {
 		char tmp[16];
 		snprintf(tmp, sizeof(tmp), "%d", exceed);
 		pbx_builtin_setvar_helper(ast, "MAX_OVERFLOW", tmp);
+		ast->hangupcause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE;
+		ast_setstate(ast, AST_STATE_DOWN);
 		return -1;
 	}
 	
 	chan_misdn_log(1, port, "* CALL: %s\n", dest);
 	
-	chan_misdn_log(2, port, " --> * dad:%s tech:%s ctx:%s\n", ast->exten, ast->name, ast->context);
-	
-	chan_misdn_log(3, port, " --> * adding2newbc ext %s\n", ast->exten);
+	chan_misdn_log(2, port, " --> * dialed:%s tech:%s context:%s\n", ext, ast->name, ast->context);
+	
 	ast_copy_string(ast->exten, ext, sizeof(ast->exten));
 	ast_copy_string(newbc->dialed.number, ext, sizeof(newbc->dialed.number));
 
 	if (ast_strlen_zero(newbc->caller.number) && !ast_strlen_zero(ast->connected.id.number)) {
-		chan_misdn_log(3, port, " --> * adding2newbc callerid %s\n", ast->connected.id.number);
 		ast_copy_string(newbc->caller.number, ast->connected.id.number, sizeof(newbc->caller.number));
 		ast_copy_string(newbc->caller.name, S_OR(ast->connected.id.name, ""), sizeof(newbc->caller.name));
+		chan_misdn_log(3, port, " --> * set caller:\"%s\" <%s>\n", newbc->caller.name, newbc->caller.number);
 	}
 
 	newbc->capability = ast->transfercapability;
@@ -3429,11 +3441,17 @@
 		bc->out_cause = tmpcause ? tmpcause : AST_CAUSE_NORMAL_CLEARING;
 	}
     
-	chan_misdn_log(1, bc->port, "* IND : HANGUP\tpid:%d ctx:%s dad:%s oad:%s State:%s\n", p->bc ? p->bc->pid : -1, ast->context, ast->exten, ast->cid.cid_num, misdn_get_ch_state(p));
+	chan_misdn_log(1, bc->port,
+		"* IND : HANGUP\tpid:%d context:%s dialed:%s caller:\"%s\" <%s> State:%s\n",
+		p->bc ? p->bc->pid : -1,
+		ast->context,
+		ast->exten,
+		ast->cid.cid_name ? ast->cid.cid_name : "",
+		ast->cid.cid_num ? ast->cid.cid_num : "",
+		misdn_get_ch_state(p));
 	chan_misdn_log(3, bc->port, " --> l3id:%x\n", p->l3id);
 	chan_misdn_log(3, bc->port, " --> cause:%d\n", bc->cause);
 	chan_misdn_log(2, bc->port, " --> out_cause:%d\n", bc->out_cause);
-	chan_misdn_log(2, bc->port, " --> state:%s\n", misdn_get_ch_state(p));
 
 	switch (p->state) {
 	case MISDN_INCOMING_SETUP:
@@ -3578,7 +3596,7 @@
  						if (ast_async_goto(ast, context, "fax", 1))
  							ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, context);
   					} else
- 						ast_log(LOG_NOTICE, "Fax detected, but no fax extension ctx:%s exten:%s\n", context, ast->exten);
+ 						ast_log(LOG_NOTICE, "Fax detected but no fax extension, context:%s exten:%s\n", context, ast->exten);
  				} else {
 					ast_debug(1, "Already in a fax extension, not redirecting\n");
 				}
@@ -3836,7 +3854,11 @@
 
 	ast_verb(3, "Native bridging %s and %s\n", c0->name, c1->name);
 
-	chan_misdn_log(1, ch1->bc->port, "* Making Native Bridge between %s and %s\n", ch1->bc->caller.number, ch2->bc->caller.number);
+	chan_misdn_log(1, ch1->bc->port, "* Making Native Bridge between \"%s\" <%s> and \"%s\" <%s>\n",
+		ch1->bc->caller.name,
+		ch1->bc->caller.number,
+		ch2->bc->caller.name,
+		ch2->bc->caller.number);
  
 	if (! (flags & AST_BRIDGE_DTMF_CHANNEL_0) )
 		ch1->ignore_dtmf = 1;
@@ -4001,21 +4023,22 @@
 {
 	struct ast_channel *tmp = NULL;
 	char group[BUFFERSIZE + 1] = "";
-	char buf[128];
-	char *buf2 = ast_strdupa(data), *ext = NULL, *port_str;
+	char dial_str[128];
+	char *buf2 = ast_strdupa(data), *ext, *port_str;
 	char *tokb = NULL, *p = NULL;
 	int channel = 0, port = 0;
 	struct misdn_bchannel *newbc = NULL;
 	int dec = 0;
 
-	struct chan_list *cl = init_chan_list(ORG_AST);
-
-	snprintf(buf, sizeof(buf), "%s/%s", misdn_type, (char*)data);
-
+	struct chan_list *cl;
+
+	snprintf(dial_str, sizeof(dial_str), "%s/%s", misdn_type, (char*)data);
+
+	/* 
+	 * Dial(mISDN/g:group_name/extension[/options])
+	 * Dial(mISDN/port[:preselected_channel]/extension[/options])
+	 */
 	port_str = strtok_r(buf2, "/", &tokb);
-
-	ext = strtok_r(NULL, "/", &tokb);
-
 	if (port_str) {
 		if (port_str[0] == 'g' && port_str[1] == ':' ) {
 			/* We make a group call lets checkout which ports are in my group */
@@ -4024,15 +4047,21 @@
 			chan_misdn_log(2, 0, " --> Group Call group: %s\n", group);
 		} else if ((p = strchr(port_str, ':'))) {
 			/* we have a preselected channel */
-			*p = 0;
-			channel = atoi(++p);
+			*p++ = 0;
+			channel = atoi(p);
 			port = atoi(port_str);
 			chan_misdn_log(2, port, " --> Call on preselected Channel (%d).\n", channel);
 		} else {
 			port = atoi(port_str);
 		}
 	} else {
-		ast_log(LOG_WARNING, " --> ! IND : CALL dad:%s WITHOUT PORT/Group, check extensions.conf\n", ext);
+		ast_log(LOG_WARNING, " --> ! IND : Dial(%s) WITHOUT Port or Group, check extensions.conf\n", dial_str);
+		return NULL;
+	}
+
+	ext = strtok_r(NULL, "/", &tokb);
+	if (!ext) {
+		ast_log(LOG_WARNING, " --> ! IND : Dial(%s) WITHOUT extension, check extensions.conf\n", dial_str);
 		return NULL;
 	}
 
@@ -4044,6 +4073,8 @@
 	if (!ast_strlen_zero(group)) {
 		char cfg_group[BUFFERSIZE + 1];
 		struct robin_list *rr = NULL;
+
+		/* Group dial */
 
 		if (misdn_cfg_is_group_method(group, METHOD_ROUND_ROBIN)) {
 			chan_misdn_log(4, port, " --> STARTING ROUND ROBIN...\n");
@@ -4137,19 +4168,24 @@
 					, group);
 			return NULL;
 		}
-	} else { /* 'Normal' Port dial * Port dial */
+	} else {
+		/* 'Normal' Port dial * Port dial */
 		if (channel)
 			chan_misdn_log(1, port, " --> preselected_channel: %d\n", channel);
 		newbc = misdn_lib_get_free_bc(port, channel, 0, dec);
-
 		if (!newbc) {
-			ast_log(LOG_WARNING, "Could not create channel on port:%d with extensions:%s\n", port, ext);
+			ast_log(LOG_WARNING, "Could not create channel on port:%d for Dial(%s)\n", port, dial_str);
 			return NULL;
 		}
 	}
 	
 
 	/* create ast_channel and link all the objects together */
+	cl = init_chan_list(ORG_AST);
+	if (!cl) {
+		ast_log(LOG_WARNING, "Could not create Asterisk channel for Dial(%s)\n", dial_str);
+		return NULL;
+	}
 	cl->bc = newbc;
 	
 	tmp = misdn_new(cl, AST_STATE_RESERVED, ext, NULL, format, port, channel);
@@ -4272,7 +4308,7 @@
 	tmp = ast_channel_alloc(1, state, cid_num, cid_name, "", exten, "", 0, "%s/%s%d-u%d", misdn_type, c ? "" : "tmp", chan_offset + c, glob_channel++);
 
 	if (tmp) {
-		chan_misdn_log(2, 0, " --> * NEW CHANNEL dad:%s oad:%s\n", exten, callerid);
+		chan_misdn_log(2, 0, " --> * NEW CHANNEL dialed:%s caller:%s\n", exten, callerid);
 
 		tmp->nativeformats = prefformat;
 
@@ -4329,7 +4365,11 @@
 		if (help->bc == bc) return help;
 	}
 
-	chan_misdn_log(6, bc->port, "$$$ find_chan: No channel found for oad:%s dad:%s\n", bc->caller.number, bc->dialed.number);
+	chan_misdn_log(6, bc->port,
+		"$$$ find_chan_by_bc: No channel found for dialed:%s caller:\"%s\" <%s>\n",
+		bc->dialed.number,
+		bc->caller.name,
+		bc->caller.number);
 
 	return NULL;
 }
@@ -4341,7 +4381,7 @@
 		if ( help->bc && (help->bc->pid == pid) ) return help;
 	}
 
-	chan_misdn_log(6, 0, "$$$ find_chan: No channel found for pid:%d\n", pid);
+	chan_misdn_log(6, 0, "$$$ find_chan_by_pid: No channel found for pid:%d\n", pid);
 
 	return NULL;
 }
@@ -4352,14 +4392,22 @@
 
 	if (bc->pri) return NULL;
 
-	chan_misdn_log(6, bc->port, "$$$ find_holded: channel:%d oad:%s dad:%s\n", bc->channel, bc->caller.number, bc->dialed.number);
+	chan_misdn_log(6, bc->port, "$$$ find_holded: channel:%d dialed:%s caller:\"%s\" <%s>\n",
+		bc->channel,
+		bc->dialed.number,
+		bc->caller.name,
+		bc->caller.number);
 	for (;help; help = help->next) {
 		chan_misdn_log(4, bc->port, "$$$ find_holded: --> holded:%d channel:%d\n", help->state==MISDN_HOLDED, help->hold_info.channel);
 		if ( 	(help->state == MISDN_HOLDED) && 
 			(help->hold_info.port == bc->port) ) 
 			return help;
 	}
-	chan_misdn_log(6, bc->port, "$$$ find_chan: No channel found for oad:%s dad:%s\n", bc->caller.number, bc->dialed.number);
+	chan_misdn_log(6, bc->port,
+		"$$$ find_holded: No channel found for dialed:%s caller:\"%s\" <%s>\n",
+		bc->dialed.number,
+		bc->caller.name,
+		bc->caller.number);
 
 	return NULL;
 }
@@ -4525,7 +4573,14 @@
 			close(ch->pipe[1]);
 
 			if (ast && MISDN_ASTERISK_TECH_PVT(ast)) {
-				chan_misdn_log(1, bc->port, "* RELEASING CHANNEL pid:%d ctx:%s dad:%s oad:%s state: %s\n", bc ? bc->pid : -1, ast->context, ast->exten, ast->cid.cid_num, misdn_get_ch_state(ch));
+				chan_misdn_log(1, bc->port,
+					"* RELEASING CHANNEL pid:%d context:%s dialed:%s caller:\"%s\" <%s> state: %s\n",
+					bc ? bc->pid : -1,
+					ast->context,
+					ast->exten,
+					ast->cid.cid_name ? ast->cid.cid_name : "",
+					ast->cid.cid_num ? ast->cid.cid_num : "",
+					misdn_get_ch_state(ch));
 				chan_misdn_log(3, bc->port, " --> * State Down\n");
 				MISDN_ASTERISK_TECH_PVT(ast) = NULL;
 
@@ -4587,7 +4642,12 @@
 		ch->state = MISDN_INCOMING_SETUP;
 	}
 
-	chan_misdn_log(1, bc->port, "* Starting Ast ctx:%s dad:%s oad:%s with 's' extension\n", ast->context, ast->exten, ast->cid.cid_num);
+	chan_misdn_log(1, bc->port,
+		"* Starting Ast context:%s dialed:%s caller:\"%s\" <%s> with 's' extension\n",
+		ast->context,
+		ast->exten,
+		ast->cid.cid_name ? ast->cid.cid_name : "",
+		ast->cid.cid_num ? ast->cid.cid_num : "");
   
 	strncpy(ast->exten, "s", 2);
   
@@ -4799,7 +4859,14 @@
 		if ( event == EVENT_CLEANUP && !user_data)
 			debuglevel = 5;
 
-		chan_misdn_log(debuglevel, bc->port, "I IND :%s oad:%s dad:%s pid:%d state:%s\n", manager_isdn_get_info(event), bc->caller.number, bc->dialed.number, bc->pid, ch ? misdn_get_ch_state(ch) : "none");
+		chan_misdn_log(debuglevel, bc->port,
+			"I IND :%s caller:\"%s\" <%s> dialed:%s pid:%d state:%s\n",
+			manager_isdn_get_info(event),
+			bc->caller.name,
+			bc->caller.number,
+			bc->dialed.number,
+			bc->pid,
+			ch ? misdn_get_ch_state(ch) : "none");
 		if (debuglevel == 1) {
 			misdn_lib_log_ies(bc);
 			chan_misdn_log(4, bc->port, " --> bc_state:%s\n", bc_state2str(bc->bc_state));
@@ -5166,16 +5233,16 @@
 		}
 
 		/*
-		   added support for s extension hope it will help those poor cretains
-		   which haven't overlap dial.
-		   */
+		 * added support for s extension hope it will help those poor cretains
+		 * which haven't overlap dial.
+		 */
 		misdn_cfg_get(bc->port, MISDN_CFG_ALWAYS_IMMEDIATE, &ai, sizeof(ai));
 		if (ai) {
 			do_immediate_setup(bc, ch, chan);
 			break;
 		}
 
-		/* check if we should jump into s when we have no dad */
+		/* check if we should jump into s when we have no dialed.number */
 		misdn_cfg_get(bc->port, MISDN_CFG_IMMEDIATE, &im, sizeof(im));
 		if (im && ast_strlen_zero(bc->dialed.number)) {
 			do_immediate_setup(bc, ch, chan);

Modified: team/group/issue8824/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/misdn/isdn_lib.c?view=diff&rev=144355&r1=144354&r2=144355
==============================================================================
--- team/group/issue8824/channels/misdn/isdn_lib.c (original)
+++ team/group/issue8824/channels/misdn/isdn_lib.c Wed Sep 24 20:34:39 2008
@@ -1578,7 +1578,14 @@
 			setup_bc(bc);
 
 			if ( *bc->crypt_key ) {
-				cb_log(4, stack->port, "ENABLING BLOWFISH channel:%d oad%d:%s dad%d:%s\n", bc->channel, bc->caller.number_type,bc->caller.number, bc->dialed.number_type,bc->dialed.number);
+				cb_log(4, stack->port,
+					"ENABLING BLOWFISH channel:%d caller%d:\"%s\" <%s> dialed%d:%s\n",
+					bc->channel,
+					bc->caller.number_type,
+					bc->caller.name,
+					bc->caller.number,
+					bc->dialed.number_type,
+					bc->dialed.number);
 				manager_ph_control_block(bc,  BF_ENABLE_KEY, bc->crypt_key, strlen(bc->crypt_key) );
 			}
 
@@ -1600,7 +1607,14 @@
 		case EVENT_CONNECT:
 
 			if ( *bc->crypt_key ) {
-				cb_log(4, stack->port, "ENABLING BLOWFISH channel:%d oad%d:%s dad%d:%s\n", bc->channel, bc->caller.number_type,bc->caller.number, bc->dialed.number_type,bc->dialed.number);
+				cb_log(4, stack->port,
+					"ENABLING BLOWFISH channel:%d caller%d:\"%s\" <%s> dialed%d:%s\n",
+					bc->channel,
+					bc->caller.number_type,
+					bc->caller.name,
+					bc->caller.number,
+					bc->dialed.number_type,
+					bc->dialed.number);
 				manager_ph_control_block(bc,  BF_ENABLE_KEY, bc->crypt_key, strlen(bc->crypt_key) );
 			}
 		case EVENT_ALERTING:
@@ -2471,7 +2485,14 @@
 	{
 		unsigned int *cont = (unsigned int *) &frm->data.p;
 		
-		cb_log(4, stack->port, "PH_CONTROL: channel:%d oad%d:%s dad%d:%s \n", bc->channel, bc->caller.number_type,bc->caller.number, bc->dialed.number_type,bc->dialed.number);
+		cb_log(4, stack->port,
+			"PH_CONTROL: channel:%d caller%d:\"%s\" <%s> dialed%d:%s \n",
+			bc->channel,
+			bc->caller.number_type,
+			bc->caller.name,
+			bc->caller.number,
+			bc->dialed.number_type,
+			bc->dialed.number);
 
 		if ((*cont & ~DTMF_TONE_MASK) == DTMF_TONE_VAL) {
 			int dtmf = *cont & DTMF_TONE_MASK;
@@ -3346,13 +3367,14 @@
 		bc->out_cause);
 	
 	cb_log(2, stack->port,
-		" --> info_dad:%s dnumtype:%d plan:%d\n",
+		" --> info_dad:%s dialed numtype:%d plan:%d\n",
 		bc->info_dad,
 		bc->dialed.number_type,
 		bc->dialed.number_plan);
 
 	cb_log(2, stack->port,
-		" --> caller:%s type:%d plan:%d pres:%d screen:%d\n",
+		" --> caller:\"%s\" <%s> type:%d plan:%d pres:%d screen:%d\n",
+		bc->caller.name,
 		bc->caller.number,
 		bc->caller.number_type,
 		bc->caller.number_plan,
@@ -3360,7 +3382,8 @@
 		bc->caller.screening);
 
 	cb_log(2, stack->port,
-		" --> redirecting:%s type:%d plan:%d pres:%d screen:%d reason:%d\n",
+		" --> redirecting:\"%s\" <%s> type:%d plan:%d pres:%d screen:%d reason:%d\n",
+		bc->redirecting.from.name,
 		bc->redirecting.from.number,
 		bc->redirecting.from.number_type,
 		bc->redirecting.from.number_plan,
@@ -3369,7 +3392,8 @@
 		bc->redirecting.reason);
 
 	cb_log(2, stack->port,
-		" --> connected:%s type:%d plan:%d pres:%d screen:%d\n",
+		" --> connected:\"%s\" <%s> type:%d plan:%d pres:%d screen:%d\n",
+		bc->connected.name,
 		bc->connected.number,
 		bc->connected.number_type,
 		bc->connected.number_plan,
@@ -3417,7 +3441,12 @@
 	stack = get_stack_by_bc(bc);
 	
 	if (!stack) {
-		cb_log(0,bc->port,"SENDEVENT: no Stack for event:%s oad:%s dad:%s \n", isdn_get_info(msgs_g, event, 0), bc->caller.number, bc->dialed.number);
+		cb_log(0,bc->port,
+			"SENDEVENT: no Stack for event:%s caller:\"%s\" <%s> dialed:%s \n",
+			isdn_get_info(msgs_g, event, 0),
+			bc->caller.name,
+			bc->caller.number,
+			bc->dialed.number);
 		RETURN(-1,OUT);
 	}
 	
@@ -3434,7 +3463,13 @@
 		RETURN(0,OUT);
 	}
 	
-	cb_log(1, stack->port, "I SEND:%s oad:%s dad:%s pid:%d\n", isdn_get_info(msgs_g, event, 0), bc->caller.number, bc->dialed.number, bc->pid);
+	cb_log(1, stack->port,
+		"I SEND:%s caller:\"%s\" <%s> dialed:%s pid:%d\n",
+		isdn_get_info(msgs_g, event, 0),
+		bc->caller.name,
+		bc->caller.number,
+		bc->dialed.number,
+		bc->pid);
 	cb_log(4, stack->port, " --> bc_state:%s\n",bc_state2str(bc->bc_state));
 	misdn_lib_log_ies(bc);
 	
@@ -3475,7 +3510,14 @@
 		if (misdn_cap_is_speech(bc->capability)) {
 			if ((event==EVENT_CONNECT)||(event==EVENT_RETRIEVE_ACKNOWLEDGE)) {
 				if ( *bc->crypt_key ) {
-					cb_log(4, stack->port,  " --> ENABLING BLOWFISH channel:%d oad%d:%s dad%d:%s \n", bc->channel, bc->caller.number_type, bc->caller.number, bc->dialed.number_type, bc->dialed.number);
+					cb_log(4, stack->port,
+						" --> ENABLING BLOWFISH channel:%d caller%d:\"%s\" <%s> dialed%d:%s\n",
+						bc->channel,
+						bc->caller.number_type,
+						bc->caller.name,
+						bc->caller.number,
+						bc->dialed.number_type,
+						bc->dialed.number);
 					
 					manager_ph_control_block(bc,  BF_ENABLE_KEY, bc->crypt_key, strlen(bc->crypt_key) );
 				}




More information about the asterisk-commits mailing list