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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Jul 13 17:13:07 CDT 2008


Author: moy
Date: Sun Jul 13 17:13:06 2008
New Revision: 130571

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

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

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=130571&r1=130570&r2=130571
==============================================================================
--- team/moy/mfcr2-1.2/channels/chan_zap.c (original)
+++ team/moy/mfcr2-1.2/channels/chan_zap.c Sun Jul 13 17:13:06 2008
@@ -380,6 +380,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;
@@ -774,6 +775,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
 
 	struct zt_distRings drings;
@@ -1350,6 +1352,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) {
@@ -7479,6 +7487,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++;
 				}
 			}
@@ -11406,6 +11415,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.2/configs/zapata.conf.sample
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2-1.2/configs/zapata.conf.sample?view=diff&rev=130571&r1=130570&r2=130571
==============================================================================
--- team/moy/mfcr2-1.2/configs/zapata.conf.sample (original)
+++ team/moy/mfcr2-1.2/configs/zapata.conf.sample Sun Jul 13 17:13:06 2008
@@ -658,6 +658,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 svn-commits mailing list