[asterisk-commits] moy: branch moy/mfcr2-1.2 r132375 - /team/moy/mfcr2-1.2/channels/chan_zap.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jul 20 01:13:29 CDT 2008


Author: moy
Date: Sun Jul 20 01:13:29 2008
New Revision: 132375

URL: http://svn.digium.com/view/asterisk?view=rev&rev=132375
Log:
minor fixes for restricted ANI and logging format of mfcr2 show channels

Modified:
    team/moy/mfcr2-1.2/channels/chan_zap.c

Modified: team/moy/mfcr2-1.2/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2-1.2/channels/chan_zap.c?view=diff&rev=132375&r1=132374&r2=132375
==============================================================================
--- team/moy/mfcr2-1.2/channels/chan_zap.c (original)
+++ team/moy/mfcr2-1.2/channels/chan_zap.c Sun Jul 20 01:13:29 2008
@@ -1352,7 +1352,7 @@
 {
 	struct zt_pvt *p;
 	ast_log(LOG_NOTICE, "MFC/R2 call offered on chan %d. DNIS = %s, ANI = %s, Category = %s\n", 
-			openr2_chan_get_number(r2chan), dnis, ani, openr2_proto_get_category_string(category));
+			openr2_chan_get_number(r2chan), dnis, ani ? ani : "(restricted)", openr2_proto_get_category_string(category));
 	p = openr2_chan_get_client_data(r2chan);
 	/* if collect calls are not allowed and this is a collect call, reject it! */
 	if (!p->mfcr2_allow_collect_calls && category == OR2_CALLING_PARTY_CATEGORY_COLLECT_CALL) {
@@ -1370,12 +1370,12 @@
 		p->cid_num[0] = 0;
 	}
 	ast_copy_string(p->rdnis, dnis, sizeof(p->rdnis));
-       if (p->immediate || !openr2_context_get_max_dnis(openr2_chan_get_context(r2chan))) {
-               ast_log(LOG_DEBUG, "setting exten => s because of immediate or 0 DNIS configured\n");
-               ast_copy_string(p->exten, "s", sizeof(p->exten));
-       } else {
-               ast_copy_string(p->exten, dnis, sizeof(p->exten));
-       }
+	if (p->immediate || !openr2_context_get_max_dnis(openr2_chan_get_context(r2chan))) {
+		ast_log(LOG_DEBUG, "setting exten => s because of immediate or 0 DNIS configured\n");
+		ast_copy_string(p->exten, "s", sizeof(p->exten));
+	} else {
+		ast_copy_string(p->exten, dnis, sizeof(p->exten));
+	}
 	ast_mutex_unlock(&p->lock);
 	if (!ast_exists_extension(NULL, p->context, p->exten, 1, p->cid_num)) {
 		ast_log(LOG_NOTICE, "MFC/R2 call on channel %d requested non-existent extension '%s' in context '%s'. Rejecting call.\n",
@@ -1481,6 +1481,8 @@
 	ast_log(LOG_NOTICE, "MFC/R2 call disconnected on chan %d\n", openr2_chan_get_number(r2chan));
 	ast_mutex_lock(&p->lock);
 	if (p->owner) {
+		/* when we have an owner we don't call openr2_chan_disconnect_call here, that will
+	 	   be done in zt_hangup */
 		if (p->owner->_state == AST_STATE_UP) {
 			p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
 			ast_mutex_unlock(&p->lock);
@@ -1509,7 +1511,7 @@
 			p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
 		}	
 	} else {
-		/* no owner, let's just disconnect our side */
+		/* no owner, therefore we can't use zt_hangup to disconnect, do it right now */
 		openr2_chan_disconnect_call(r2chan, OR2_CAUSE_NORMAL_CLEARING);
 	}
 }
@@ -9976,7 +9978,7 @@
 
 static int handle_mfcr2_show_channels(int fd, int argc, char *argv[])
 {
-#define FORMAT "%7s %-10.10s %-15.15s %-10.10s %-20.20s %-20.20s %-10.10s %-10.10s\n"
+#define FORMAT "%4s %-7.7s %-7.7s %-8.8s %-9.9s %-16.16s %-8.8s %-8.8s\n"
 	int filtertype = 0;
 	int targetnum = 0;
 	char channo[5];




More information about the asterisk-commits mailing list