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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Sep 27 20:19:07 CDT 2008


Author: moy
Date: Sat Sep 27 20:19:07 2008
New Revision: 145019

URL: http://svn.digium.com/view/asterisk?view=rev&rev=145019
Log:
added support for mfcr2_charge_calls parameter in order to charge or not the calls

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

Modified: team/moy/mfcr2/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2/channels/chan_dahdi.c?view=diff&rev=145019&r1=145018&r2=145019
==============================================================================
--- team/moy/mfcr2/channels/chan_dahdi.c (original)
+++ team/moy/mfcr2/channels/chan_dahdi.c Sat Sep 27 20:19:07 2008
@@ -420,6 +420,7 @@
 static int mfcr2_cur_context_index = 0;
 static int mfcr2_cur_call_files = 0;
 static int mfcr2_cur_allow_collect_calls = 0; 
+static int mfcr2_cur_charge_calls = 1; 
 static int mfcr2_cur_forced_release = 0; 
 static int mfcr2_cur_double_answer = 0; 
 static int mfcr2_cur_immediate_accept = 0;
@@ -791,6 +792,7 @@
 	openr2_calling_party_category_t mfcr2_category;
 	struct dahdi_mf_tx_state mf_tx_state;
 	struct dahdi_mf_rx_state mf_rx_state;
+	int mfcr2_charge_calls;
 	int mfcr2_allow_collect_calls;
 	int mfcr2_forced_release;
 	int mfcr2_dnis_index;
@@ -1424,7 +1426,11 @@
 				p->channel, p->exten, p->context);
 		openr2_chan_disconnect_call(r2chan, OR2_CAUSE_UNALLOCATED_NUMBER);
 	} else {
-		openr2_chan_accept_call(r2chan, OR2_CALL_WITH_CHARGE);
+		if (p->mfcr2_charge_calls) {
+			openr2_chan_accept_call(r2chan, OR2_CALL_WITH_CHARGE);
+		} else {
+			openr2_chan_accept_call(r2chan, OR2_CALL_NO_CHARGE);
+		}
 	}	
 }
 
@@ -9206,6 +9212,7 @@
 					tmp->mfcr2_category = mfcr2_cur_category;
 					tmp->mfcr2 = zap_r2;
 					tmp->mfcr2call = 0;
+					tmp->mfcr2_charge_calls = mfcr2_cur_charge_calls;
 					tmp->mfcr2_dnis_index = 0;
 					tmp->mfcr2_ani_index = 0;
 					tmp->mfcr2_allow_collect_calls = mfcr2_cur_allow_collect_calls;
@@ -13642,6 +13649,7 @@
 				ast_cli(a->fd, "MFC/R2 Max DNIS: %d\n", openr2_context_get_max_dnis(r2context));
 				ast_cli(a->fd, "MFC/R2 Get ANI First: %s\n", openr2_context_get_ani_first(r2context) ? "Yes" : "No");
 				ast_cli(a->fd, "MFC/R2 Immediate Accept: %s\n", openr2_context_get_immediate_accept(r2context) ? "Yes" : "No");
+				ast_cli(a->fd, "MFC/R2 Charge Calls: %s\n", tmp->mfcr2_charge_calls ? "Yes" : "No");
 				ast_cli(a->fd, "MFC/R2 Allow Collect Calls: %s\n", tmp->mfcr2_allow_collect_calls ? "Yes" : "No");
 				ast_cli(a->fd, "MFC/R2 Forced Release: %s\n", tmp->mfcr2_forced_release ? "Yes" : "No");
 				ast_cli(a->fd, "MFC/R2 MF Back Timeout: %dms\n", openr2_context_get_mf_back_timeout(r2context));
@@ -15701,6 +15709,8 @@
 				mfcr2_cur_get_ani_first = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "mfcr2_double_answer")) {
 				mfcr2_cur_double_answer = ast_true(v->value);
+			} else if (!strcasecmp(v->name, "mfcr2_charge_calls")) {
+				mfcr2_cur_charge_calls = 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_forced_release")) {

Modified: team/moy/mfcr2/configs/chan_dahdi.conf.sample
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2/configs/chan_dahdi.conf.sample?view=diff&rev=145019&r1=145018&r2=145019
==============================================================================
--- team/moy/mfcr2/configs/chan_dahdi.conf.sample (original)
+++ team/moy/mfcr2/configs/chan_dahdi.conf.sample Sat Sep 27 20:19:07 2008
@@ -1073,6 +1073,13 @@
 ; signal will be sent to hangup the call indicating that the line should be released immediately
 ; mfcr2_forced_release=no
 
+; Whether or not report to the other end 'accept call with charge'
+; This setting has no effect with most telecos, usually is safe
+; leave the default (yes), but once in a while when interconnecting with
+; old PBXs this may be useful.
+; Concretely this affects the Group B signal used to accept calls
+; mfcr2_charge_calls=yes
+
 ; ---------------- END of options to be used with signalling=mfcr2
 
 ; Configuration Sections




More information about the asterisk-commits mailing list