[asterisk-commits] moy: branch moy/mfcr2-1.4 r218584 - /team/moy/mfcr2-1.4/channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 15 11:13:16 CDT 2009


Author: moy
Date: Tue Sep 15 11:13:13 2009
New Revision: 218584

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=218584
Log:
added DTMF R2 detection settings and proper ifdefs to use DTMF R2 support only when available

Modified:
    team/moy/mfcr2-1.4/channels/chan_dahdi.c

Modified: team/moy/mfcr2-1.4/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/moy/mfcr2-1.4/channels/chan_dahdi.c?view=diff&rev=218584&r1=218583&r2=218584
==============================================================================
--- team/moy/mfcr2-1.4/channels/chan_dahdi.c (original)
+++ team/moy/mfcr2-1.4/channels/chan_dahdi.c Tue Sep 15 11:13:13 2009
@@ -327,7 +327,11 @@
 static int mfcr2_cur_forced_release = 0;
 static int mfcr2_cur_double_answer = 0;
 static int mfcr2_cur_immediate_accept = -1;
+/* starting with openr2 interface 3 we have DTMF support */
+#if defined(OR2_LIB_INTERFACE) && OR2_LIB_INTERFACE > 2
 static int mfcr2_cur_dtmf_dialing = -1;
+static int mfcr2_cur_dtmf_detection = -1;
+#endif
 static int mfcr2_cur_dtmf_time_on = OR2_DEFAULT_DTMF_ON;
 static int mfcr2_cur_dtmf_time_off = OR2_DEFAULT_DTMF_OFF;
 static char mfcr2_cur_logdir[OR2_MAX_PATH];
@@ -1240,9 +1244,12 @@
 	mfcr2_cur_max_ani = 10;
 	mfcr2_cur_max_dnis = 4;
 	mfcr2_cur_get_ani_first = -1;
+#if defined(OR2_LIB_INTERFACE) && OR2_LIB_INTERFACE > 2
 	mfcr2_cur_dtmf_dialing = -1;
+	mfcr2_cur_dtmf_detection = -1;
 	mfcr2_cur_dtmf_time_on = OR2_DEFAULT_DTMF_ON;
 	mfcr2_cur_dtmf_time_off = OR2_DEFAULT_DTMF_OFF;
+#endif
 	mfcr2_cur_skip_category = -1;
 	mfcr2_cur_call_files = 0;
 	mfcr2_cur_allow_collect_calls = 0;
@@ -8696,7 +8703,10 @@
 					openr2_context_set_metering_pulse_timeout(dahdi_r2->protocol_context, mfcr2_cur_metering_pulse_timeout);
 					openr2_context_set_double_answer(dahdi_r2->protocol_context, mfcr2_cur_double_answer);
 					openr2_context_set_immediate_accept(dahdi_r2->protocol_context, mfcr2_cur_immediate_accept);
+#if defined(OR2_LIB_INTERFACE) && OR2_LIB_INTERFACE > 2
 					openr2_context_set_dtmf_dialing(dahdi_r2->protocol_context, mfcr2_cur_dtmf_dialing, mfcr2_cur_dtmf_time_on, mfcr2_cur_dtmf_time_off);
+					openr2_context_set_dtmf_detection(dahdi_r2->protocol_context, mfcr2_cur_dtmf_detection);
+#endif
 					if (ast_strlen_zero(mfcr2_cur_logdir)) {
 						if (openr2_context_set_log_directory(dahdi_r2->protocol_context, tmplogdir)) {
 							ast_log(LOG_ERROR, "Failed setting default MFC/R2 log directory %s\n", tmplogdir);
@@ -12086,6 +12096,7 @@
 				ast_cli(fd, "MFC/R2 Max ANI: %d\n", openr2_context_get_max_ani(r2context));
 				ast_cli(fd, "MFC/R2 Max DNIS: %d\n", openr2_context_get_max_dnis(r2context));
 				ast_cli(fd, "MFC/R2 DTMF Dialing: %s\n", openr2_context_get_dtmf_dialing(r2context, NULL, NULL) ? "Yes" : "No");
+				ast_cli(fd, "MFC/R2 DTMF Detection: %s\n", openr2_context_get_dtmf_detection(r2context) ? "Yes" : "No");
 				ast_cli(fd, "MFC/R2 Get ANI First: %s\n", openr2_context_get_ani_first(r2context) ? "Yes" : "No");
 				ast_cli(fd, "MFC/R2 Skip Category: %s\n", openr2_context_get_skip_category_request(r2context) ? "Yes" : "No");
 				ast_cli(fd, "MFC/R2 Immediate Accept: %s\n", openr2_context_get_immediate_accept(r2context) ? "Yes" : "No");
@@ -13343,12 +13354,16 @@
 				if (mfcr2_cur_metering_pulse_timeout > 500) {
 					ast_log(LOG_WARNING, "mfcr2_metering_pulse_timeout greater than 500ms is not recommended, you have been warned!\n");
 				}
+#if defined(OR2_LIB_INTERFACE) && OR2_LIB_INTERFACE > 2
+			} else if (!strcasecmp(v->name, "mfcr2_dtmf_detection")) {
+				mfcr2_cur_dtmf_detection = ast_true(v->value) ? 1 : 0;
 			} else if (!strcasecmp(v->name, "mfcr2_dtmf_dialing")) {
 				mfcr2_cur_dtmf_dialing = ast_true(v->value) ? 1 : 0;
 			} else if (!strcasecmp(v->name, "mfcr2_dtmf_time_on")) {
 				mfcr2_cur_dtmf_time_on = atoi(v->value);
 			} else if (!strcasecmp(v->name, "mfcr2_dtmf_time_off")) {
 				mfcr2_cur_dtmf_time_off = atoi(v->value);
+#endif
 			} else if (!strcasecmp(v->name, "mfcr2_get_ani_first")) {
 				mfcr2_cur_get_ani_first = ast_true(v->value) ? 1 : 0;
 			} else if (!strcasecmp(v->name, "mfcr2_skip_category")) {




More information about the asterisk-commits mailing list