[asterisk-commits] moy: branch moy/mfcr2-1.4 r130572 - in /team/moy/mfcr2-1.4: channels/ configs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jul 13 17:25:44 CDT 2008


Author: moy
Date: Sun Jul 13 17:25:44 2008
New Revision: 130572

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

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

Modified: team/moy/mfcr2-1.4/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2-1.4/channels/chan_zap.c?view=diff&rev=130572&r1=130571&r2=130572
==============================================================================
--- team/moy/mfcr2-1.4/channels/chan_zap.c (original)
+++ team/moy/mfcr2-1.4/channels/chan_zap.c Sun Jul 13 17:25:44 2008
@@ -320,6 +320,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;
 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;
@@ -614,6 +615,7 @@
 	openr2_chan_t *r2chan;
 	openr2_calling_party_category_t mfcr2_recvd_category;
 	openr2_calling_party_category_t mfcr2_category;
+	int mfcr2_allow_collect_calls;
 #endif
 	int polarity;
 	int dsp_features;
@@ -941,6 +943,11 @@
 	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 (!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) {
@@ -7856,6 +7863,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++;
 				}
 			}
@@ -12072,6 +12080,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-1.4/configs/zapata.conf.sample
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2-1.4/configs/zapata.conf.sample?view=diff&rev=130572&r1=130571&r2=130572
==============================================================================
--- team/moy/mfcr2-1.4/configs/zapata.conf.sample (original)
+++ team/moy/mfcr2-1.4/configs/zapata.conf.sample Sun Jul 13 17:25:44 2008
@@ -745,6 +745,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
 
 ;




More information about the asterisk-commits mailing list