Revision
16600
Author
anthm
Date
2010-02-10 09:38:32 -0600 (Wed, 10 Feb 2010)

Log Message

add param setting function to asr

Modified Paths

Diff

Modified: freeswitch/trunk/src/include/switch_ivr.h (16599 => 16600)


--- freeswitch/trunk/src/include/switch_ivr.h	2010-02-10 14:49:32 UTC (rev 16599)
+++ freeswitch/trunk/src/include/switch_ivr.h	2010-02-10 15:38:32 UTC (rev 16600)
@@ -198,6 +198,8 @@
 */
 SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *name);
 
+SWITCH_DECLARE(void) switch_ivr_set_param_detect_speech(switch_core_session_t *session, const char *name, const char *val);
+
 /*!
   \brief Record a session to disk
   \param session the session to record

Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (16599 => 16600)


--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	2010-02-10 14:49:32 UTC (rev 16599)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c	2010-02-10 15:38:32 UTC (rev 16600)
@@ -114,6 +114,8 @@
 			switch_ivr_resume_detect_speech(session);
 		} else if (!strcasecmp(argv[0], "stop")) {
 			switch_ivr_stop_detect_speech(session);
+		} else if (!strcasecmp(argv[0], "param")) {
+			switch_ivr_set_param_detect_speech(session, argv[1], argv[2]);
 		} else if (argc >= 3) {
 			switch_ivr_detect_speech(session, argv[0], argv[1], argv[2], argv[3], NULL);
 		}

Modified: freeswitch/trunk/src/switch_ivr_async.c (16599 => 16600)


--- freeswitch/trunk/src/switch_ivr_async.c	2010-02-10 14:49:32 UTC (rev 16599)
+++ freeswitch/trunk/src/switch_ivr_async.c	2010-02-10 15:38:32 UTC (rev 16600)
@@ -2582,6 +2582,15 @@
 	return SWITCH_STATUS_FALSE;
 }
 
+SWITCH_DECLARE(void) switch_ivr_set_param_detect_speech(switch_core_session_t *session, const char *name, const char *val) 
+{
+	struct speech_thread_handle *sth = switch_channel_get_private(switch_core_session_get_channel(session), SWITCH_SPEECH_KEY);
+
+	if (sth->ah && name && val) {
+		switch_core_asr_text_param(sth->ah, (char *) name, val);
+	}
+}
+
 SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *name)
 {
 	switch_channel_t *channel = switch_core_session_get_channel(session);