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

Freeswitch SVN mikej at freeswitch.org
Mon Jan 29 15:06:23 EST 2007


Author: mikej
Date: Mon Jan 29 15:06:23 2007
New Revision: 4085

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

Log:
add queue_dtmf application, takes one param, a string of dtmf that will be queued to send from the channel.  You could use this in the dialplan before a bridge to queue up dtmf to be sent to the other channel for example if you need to dial digits after answer for an fxo ata device.

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 Jan 29 15:06:23 2007
@@ -71,6 +71,16 @@
 	switch_channel_ringback(channel);
 }
 
+static void queue_dtmf_function(switch_core_session_t *session, char *data)
+{
+	switch_channel_t *channel;
+	if (!switch_strlen_zero(data)) {
+		channel = switch_core_session_get_channel(session);
+		assert(channel != NULL);
+		switch_channel_queue_dtmf(channel, data);
+	}
+}
+
 static void transfer_function(switch_core_session_t *session, char *data)
 {
 	int argc;
@@ -469,13 +479,22 @@
 	/*.next */ &dptools_api_interface
 };
 
+static const switch_application_interface_t queuedtmf_application_interface = {
+	/*.interface_name */ "queue_dtmf",
+	/*.application_function */ queue_dtmf_function,	
+	/* long_desc */ "Queue dtmf to be sent from a session",
+	/* short_desc */ "Queue dtmf to be sent",
+	/* syntax */ "<dtmf_data>",
+	/*.next */ NULL
+};
+
 static const switch_application_interface_t redirect_application_interface = {
 	/*.interface_name */ "redirect",
 	/*.application_function */ redirect_function,	
 	/* long_desc */ "Send a redirect message to a session.",
 	/* short_desc */ "Send session redirect",
 	/* syntax */ "<redirect_data>",
-	/*.next */ NULL
+	/*.next */ &queuedtmf_application_interface
 };
 
 static const switch_application_interface_t ivr_application_interface = {



More information about the Freeswitch-svn mailing list