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

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


Author: moy
Date: Sun Jul 20 01:02:06 2008
New Revision: 132374

URL: http://svn.digium.com/view/asterisk?view=rev&rev=132374
Log:
changed to internal MF detector to see if helps with the ocasional MF missmatching

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

Modified: team/moy/mfcr2/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2/channels/chan_zap.c?view=diff&rev=132374&r1=132373&r2=132374
==============================================================================
--- team/moy/mfcr2/channels/chan_zap.c (original)
+++ team/moy/mfcr2/channels/chan_zap.c Sun Jul 20 01:02:06 2008
@@ -1273,15 +1273,18 @@
 static openr2_mflib_interface_t zt_r2_mf_iface = {
 	/*(openr2_mf_read_init_func)zt_r2_mf_rx_init,*/
 	NULL,
-	(openr2_mf_write_init_func)zt_r2_mf_tx_init, 
+	/*(openr2_mf_write_init_func)zt_r2_mf_tx_init,*/
+	NULL,
 
 	/*(openr2_mf_detect_tone_func)zt_r2_mf_rx,*/
 	NULL,
-	(openr2_mf_generate_tone_func)zt_r2_mf_tx,
-
-	(openr2_mf_select_tone_func)zt_r2_mf_tx_put,
-
-	(openr2_mf_want_generate_func)zt_r2_mf_want_generate,
+	/*(openr2_mf_generate_tone_func)zt_r2_mf_tx, */
+
+	/*(openr2_mf_select_tone_func)zt_r2_mf_tx_put, */
+	NULL,
+
+	/*(openr2_mf_want_generate_func)zt_r2_mf_want_generate,*/
+	NULL,
 	/*(openr2_mf_read_dispose_func)zt_r2_mf_rx_dispose,*/
 	NULL,
 	NULL
@@ -1329,7 +1332,8 @@
 {
 	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) {
@@ -1347,12 +1351,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",
@@ -1457,6 +1461,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);
@@ -1485,7 +1491,7 @@
 			ast_queue_hangup_with_cause(p->owner, zt_r2_cause_to_ast_cause(cause));
 		}	
 	} 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);
 	}
 }
@@ -12542,7 +12548,7 @@
 
 static char *handle_mfcr2_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
-#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