[Freeswitch-svn] [commit] r9655 - in freeswitch/trunk/src: include mod/applications/mod_dptools

Freeswitch SVN anthm at freeswitch.org
Fri Sep 26 12:04:16 EDT 2008


Author: anthm
Date: Fri Sep 26 12:04:16 2008
New Revision: 9655

Modified:
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c

Log:
add patch from MODAPP-132

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Fri Sep 26 12:04:16 2008
@@ -127,6 +127,7 @@
 #define SWITCH_BRIDGE_UUID_VARIABLE "bridge_uuid"
 #define SWITCH_CONTINUE_ON_FAILURE_VARIABLE "continue_on_fail"
 #define SWITCH_PLAYBACK_TERMINATORS_VARIABLE "playback_terminators"
+#define SWITCH_PLAYBACK_TERMINATOR_USED "playback_terminator_used"
 #define SWITCH_CACHE_SPEECH_HANDLES_VARIABLE "cache_speech_handles"
 #define SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME "__cache_speech_handles_obj__"
 #define SWITCH_BYPASS_MEDIA_VARIABLE "bypass_media"

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	Fri Sep 26 12:04:16 2008
@@ -1274,6 +1274,8 @@
 
 static switch_status_t on_dtmf(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
 {
+	char sbuf[3];
+
 	switch (itype) {
 	case SWITCH_INPUT_TYPE_DTMF:
 		{
@@ -1292,6 +1294,8 @@
 
 			for (p = terminators; p && *p; p++) {
 				if (*p == dtmf->digit) {
+					switch_snprintf(sbuf, sizeof(sbuf), "%c", *p);
+					switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, sbuf );
 					return SWITCH_STATUS_BREAK;
 				}
 			}
@@ -1318,6 +1322,9 @@
 		args.buf = buf;
 		args.buflen = sizeof(buf);
 		
+		switch_channel_t *channel = switch_core_session_get_channel(session);
+		switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, "" );
+
 		switch_ivr_sleep(session, ms, &args);
 	}
 }
@@ -1389,6 +1396,9 @@
 	args.input_callback = on_dtmf;
 	args.buf = buf;
 	args.buflen = sizeof(buf);
+
+	switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, "" );
+
 	switch_ivr_speak_text(session, engine, voice, text, &args);
 }
 
@@ -1613,6 +1623,10 @@
 	switch_channel_pre_answer(switch_core_session_get_channel(session));
 
 	args.input_callback = on_dtmf;
+
+	switch_channel_t *channel = switch_core_session_get_channel(session);
+	switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, "" );
+
 	switch_ivr_play_file(session, NULL, data, &args);
 }
 
@@ -1640,6 +1654,10 @@
 	}
 
 	args.input_callback = on_dtmf;
+
+	switch_channel_t *channel = switch_core_session_get_channel(session);
+	switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, "" );
+
 	switch_ivr_gentones(session, tone_script, loops, &args);
 }
 
@@ -1729,6 +1747,9 @@
 	}
 
 	args.input_callback = on_dtmf;
+
+	switch_channel_set_variable(channel, SWITCH_PLAYBACK_TERMINATOR_USED, "" );
+
 	status = switch_ivr_record_file(session, &fh, path, &args, limit);
 
 	if (!switch_channel_ready(channel) || (status != SWITCH_STATUS_SUCCESS && !SWITCH_STATUS_IS_BREAK(status))) {



More information about the Freeswitch-svn mailing list