[Freeswitch-svn] [commit] r8912 - freeswitch/trunk/src

Freeswitch SVN anthm at freeswitch.org
Mon Jul 7 18:07:01 EDT 2008


Author: anthm
Date: Mon Jul  7 18:07:00 2008
New Revision: 8912

Modified:
   freeswitch/trunk/src/switch_ivr_async.c

Log:
tweak

Modified: freeswitch/trunk/src/switch_ivr_async.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_async.c	(original)
+++ freeswitch/trunk/src/switch_ivr_async.c	Mon Jul  7 18:07:00 2008
@@ -1518,6 +1518,49 @@
 				goto done;
 			}
 
+			if (status == SWITCH_STATUS_SUCCESS && switch_true(switch_channel_get_variable(channel, "asr_intercept_dtmf"))) {
+				const char *p;
+
+				if ((p = switch_stristr("<input>", xmlstr))) {
+					p += 7;
+				}
+				
+				while(p && *p) {
+					char c;
+
+					if (*p == '<') {
+						break;
+					}
+					
+					if (!strncasecmp(p, "pound", 5)) {
+						c = '#';
+						p += 5;
+					} else if (!strncasecmp(p, "hash", 4)) {
+						c = '#';
+						p += 4;
+					} else if (!strncasecmp(p, "star", 4)) {
+						c = '*';
+						p += 4;
+					} else if (!strncasecmp(p, "asterisk", 8)) {
+						c = '*';
+						p += 8;
+					} else {
+						c = *p;
+						p++;
+					}
+					
+					if (is_dtmf(c)) {
+						switch_dtmf_t dtmf;
+						dtmf.digit = c;
+						dtmf.duration = switch_core_default_dtmf_duration(0);
+						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Queue speech detected dtmf %c\n", c);
+						switch_channel_queue_dtmf(channel, &dtmf);						
+					}
+					
+				}
+				switch_ivr_resume_detect_speech(sth->session);
+			}
+
 			if (switch_event_create(&event, SWITCH_EVENT_DETECTED_SPEECH) == SWITCH_STATUS_SUCCESS) {
 				if (status == SWITCH_STATUS_SUCCESS) {
 					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Speech-Type", "detected-speech");



More information about the Freeswitch-svn mailing list