[Freeswitch-svn] [commit] r5256 - freeswitch/trunk/src/mod/applications/mod_dptools

Freeswitch SVN mikej at freeswitch.org
Mon Jun 4 13:12:43 EDT 2007


Author: mikej
Date: Mon Jun  4 13:12:43 2007
New Revision: 5256

Modified:
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c

Log:
add start_dtmf and stop_dtmf apps, inspired by trixter.

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	Mon Jun  4 13:12:43 2007
@@ -649,6 +649,27 @@
 }
 
 
+static void dtm_session_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+
+	channel = switch_core_session_get_channel(session);
+	assert(channel != NULL);
+
+	switch_ivr_inband_dtmf_session(session);
+}
+
+
+static void stop_dtmf_session_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+
+	channel = switch_core_session_get_channel(session);
+	assert(channel != NULL);
+
+	switch_ivr_stop_inband_dtmf_session(session);
+}
+
 static const switch_api_interface_t strepoch_api_interface = {
 	/*.interface_name */ "strepoch",
 	/*.desc */ "Convert a date string into epoch time",
@@ -681,6 +702,25 @@
 	/*.next */ &dptools_api_interface
 };
 
+static const switch_application_interface_t dtmf_application_interface = {
+	/*.interface_name */ "start_dtmf",
+	/*.application_function */ dtm_session_function,
+	/* long_desc */ "Detect inband dtmf on the session",
+	/* short_desc */ "Detect dtmf",
+	/* syntax */ "",
+	/* flags */ SAF_NONE,
+	NULL
+};
+
+static const switch_application_interface_t stop_dtmf_application_interface = {
+	/*.interface_name */ "stop_dtmf",
+	/*.application_function */ stop_dtmf_session_function,
+	/* long_desc */ "Stop detecting inband dtmf.",
+	/* short_desc */ "stop inband dtmf.",
+	/* syntax */ "<path>",
+	/* flags */ SAF_NONE,
+	&dtmf_application_interface
+};
 
 static const switch_application_interface_t exe_application_interface = {
 	/*.interface_name */ "execute_extension",
@@ -689,7 +729,7 @@
 	/*.short_desc */ "Execute an extension",
 	/*.syntax */ "<extension> <dialplan> <context>",
 	/* flags */ SAF_SUPPORT_NOMEDIA,
-	/*.next */
+	/*.next */ &stop_dtmf_application_interface
 };
 
 static const switch_application_interface_t sched_transfer_application_interface = {



More information about the Freeswitch-svn mailing list