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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Sep 14 13:23:55 CDT 2008


Author: moy
Date: Sun Sep 14 13:23:54 2008
New Revision: 143079

URL: http://svn.digium.com/view/asterisk?view=rev&rev=143079
Log:
added mfcr2_forced_release option

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=143079&r1=143078&r2=143079
==============================================================================
--- team/moy/mfcr2/channels/chan_dahdi.c (original)
+++ team/moy/mfcr2/channels/chan_dahdi.c Sun Sep 14 13:23:54 2008
@@ -423,6 +423,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_forced_release = 0; 
 static int mfcr2_cur_double_answer = 0; 
 static int mfcr2_cur_immediate_accept = 0;
 static char mfcr2_cur_logdir[OR2_MAX_LOGDIR];
@@ -775,6 +776,7 @@
 	struct dahdi_mf_tx_state mf_tx_state;
 	struct dahdi_mf_rx_state mf_rx_state;
 	int mfcr2_allow_collect_calls;
+	int mfcr2_forced_release;
 #endif
 	char begindigit;
 	int muting;
@@ -1136,6 +1138,7 @@
 	mfcr2_cur_context_index = 0;
 	mfcr2_cur_call_files = 0;
 	mfcr2_cur_allow_collect_calls = 0;
+	mfcr2_cur_forced_release = 0;
 	mfcr2_cur_double_answer = 0;
 	mfcr2_cur_immediate_accept = 0;
 	mfcr2_cur_loglevel = OR2_LOG_ERROR | OR2_LOG_WARNING;
@@ -3800,7 +3803,11 @@
 #ifdef HAVE_OPENR2
 		if (p->mfcr2) {
 			ast_log(LOG_DEBUG, "disconnecting MFC/R2 call on chan %d\n", p->channel);
-			openr2_chan_disconnect_call(p->r2chan, OR2_CAUSE_NORMAL_CLEARING);
+			if (openr2_chan_get_direction(p->r2chan) == OR2_DIR_BACKWARD && p->mfcr2_forced_release) {
+				openr2_chan_disconnect_call(p->r2chan, OR2_CAUSE_FORCED_RELEASE);
+			} else {
+				openr2_chan_disconnect_call(p->r2chan, OR2_CAUSE_NORMAL_CLEARING);
+			}	
 			dahdi_r2_update_monitor_count(p->mfcr2, 1);
 		}	
 #endif
@@ -9143,6 +9150,7 @@
 					tmp->mfcr2 = zap_r2;
 					tmp->mfcr2call = 0;
 					tmp->mfcr2_allow_collect_calls = mfcr2_cur_allow_collect_calls;
+					tmp->mfcr2_forced_release = mfcr2_cur_forced_release;
 					zap_r2->monitored_count++;
 				}
 			}
@@ -13587,6 +13595,8 @@
 				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 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));
 				ast_cli(a->fd, "MFC/R2 R2 Metering Pulse Timeout: %dms\n", openr2_context_get_metering_pulse_timeout(r2context));
 				ast_cli(a->fd, "MFC/R2 Rx State: %s\n", openr2_proto_get_rx_state_string(tmp->r2chan));
@@ -13594,8 +13604,6 @@
 				ast_cli(a->fd, "MFC/R2 MF Tx Signal: %d\n", openr2_proto_get_mf_tx(tmp->r2chan));
 				ast_cli(a->fd, "MFC/R2 MF Rx Signal: %d\n", openr2_proto_get_mf_rx(tmp->r2chan));
 				ast_cli(a->fd, "MFC/R2 Call Files Directory: %s\n", openr2_context_get_log_directory(r2context, calldir, sizeof(calldir)));
-
-
 			}
 #endif
 #ifdef HAVE_SS7
@@ -15674,6 +15682,8 @@
 				mfcr2_cur_double_answer = 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")) {
+				mfcr2_cur_forced_release = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "mfcr2_immediate_accept")) {
 				mfcr2_cur_immediate_accept = ast_true(v->value);
 			} else if (!strcasecmp(v->name, "mfcr2_call_files")) {

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=143079&r1=143078&r2=143079
==============================================================================
--- team/moy/mfcr2/configs/chan_dahdi.conf.sample (original)
+++ team/moy/mfcr2/configs/chan_dahdi.conf.sample Sun Sep 14 13:23:54 2008
@@ -1065,6 +1065,14 @@
 ; for more info
 ; mfcr2_advanced_protocol_file=/path/to/r2proto.conf
 
+; Brazil use a special signal to force the release of the line (hangup) from the
+; backward perspective. When mfcr2_forced_release=no, the normal clear back signal
+; will be sent on hangup, which is OK for all mfcr2 variants I know of, except for
+; Brazilian variant, where the central will leave the line up for several seconds (30, 60)
+; which sometimes is not what people really want. When mfcr2_forced_release=yes, a different
+; signal will be sent to hangup the call indicating that the line should be released immediately
+; mfcr2_forced_release=no
+
 ; ---------------- END of options to be used with signalling=mfcr2
 
 ; Configuration Sections




More information about the asterisk-commits mailing list