[svn-commits] moy: branch moy/mfcr2 r130570 - in /team/moy/mfcr2: channels/ configs/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Jul 13 15:14:06 CDT 2008


Author: moy
Date: Sun Jul 13 15:14:06 2008
New Revision: 130570

URL: http://svn.digium.com/view/asterisk?view=rev&rev=130570
Log:
added support to block collect calls using Group B signals in Brazil

Modified:
    team/moy/mfcr2/channels/chan_zap.c
    team/moy/mfcr2/configs/zapata.conf.sample

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=130570&r1=130569&r2=130570
==============================================================================
--- team/moy/mfcr2/channels/chan_zap.c (original)
+++ team/moy/mfcr2/channels/chan_zap.c Sun Jul 13 15:14:06 2008
@@ -421,6 +421,7 @@
 static int mfcr2_cur_get_ani_first = 0;
 static int mfcr2_cur_context_index = 0;
 static int mfcr2_cur_call_files = 0;
+static int mfcr2_cur_allow_collect_calls = 0; /* don't allow collect calls by default */
 static char mfcr2_cur_logdir[OR2_MAX_LOGDIR];
 static openr2_log_level_t mfcr2_cur_loglevel = OR2_LOG_ERROR | OR2_LOG_WARNING;
 static openr2_calling_party_category_t mfcr2_cur_category = OR2_CALLING_PARTY_CATEGORY_NATIONAL_SUBSCRIBER;
@@ -766,6 +767,7 @@
 	openr2_calling_party_category_t mfcr2_category;
 	struct zt_mf_tx_state mf_tx_state;
 	struct zt_mf_rx_state mf_rx_state;
+	int mfcr2_allow_collect_calls;
 #endif
 	char begindigit;
 	int muting;
@@ -1327,6 +1329,12 @@
 	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));
 	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) {
+		ast_log(LOG_NOTICE, "Rejecting MFC/R2 collect call\n");
+		openr2_chan_disconnect_call(r2chan, OR2_CAUSE_COLLECT_CALL_REJECTED);
+		return;
+	}
 	ast_mutex_lock(&p->lock);
 	p->mfcr2_recvd_category = category;
 	if (p->use_callerid && ani) {
@@ -8887,6 +8895,7 @@
 					tmp->mfcr2_category = mfcr2_cur_category;
 					tmp->mfcr2 = zap_r2;
 					tmp->mfcr2call = 0;
+					tmp->mfcr2_allow_collect_calls = mfcr2_cur_allow_collect_calls;
 					zap_r2->monitored_count++;
 				}
 			}
@@ -15134,6 +15143,8 @@
 				}
 			} else if (!strcasecmp(v->name, "mfcr2_get_ani_first")) {
 				mfcr2_cur_get_ani_first = ast_true(v->value);
+			} else if (!strcasecmp(v->name, "mfcr2_allow_collect_calls")) {
+				mfcr2_cur_allow_collect_calls = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "mfcr2_call_files")) {
 				mfcr2_cur_call_files = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "mfcr2_max_ani")) {

Modified: team/moy/mfcr2/configs/zapata.conf.sample
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2/configs/zapata.conf.sample?view=diff&rev=130570&r1=130569&r2=130570
==============================================================================
--- team/moy/mfcr2/configs/zapata.conf.sample (original)
+++ team/moy/mfcr2/configs/zapata.conf.sample Sun Jul 13 15:14:06 2008
@@ -947,6 +947,12 @@
 ; Any negative value means 'default'. 
 ; mfcr2_metering_pulse_timeout=-1
 
+; Brazil uses a special calling party category for collect calls (llamadas por cobrar)
+; instead of using the operator (as in Mexico). The R2 spec in Brazil says a special GB tone
+; should be used to reject collect calls. If you want to ALLOW collect calls specify 'yes',
+; if you want to BLOCK collect calls then say 'no'. Default is to block collect calls.
+; mfcr2_allow_collect_calls=no
+
 ; ---------------- END of options to be used with signalling=mfcr2
 
 ; ---------------- Options for use with signalling=ss7 -----------------




More information about the svn-commits mailing list