]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add param setting function to asr
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 10 Feb 2010 15:38:32 +0000 (15:38 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 10 Feb 2010 15:38:32 +0000 (15:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16600 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_ivr.h
src/mod/applications/mod_dptools/mod_dptools.c
src/switch_ivr_async.c

index f4a00addb2458c11f1a025afee992056ebc86348..72068249e443864769f40ac762819408d213dcfd 100644 (file)
@@ -198,6 +198,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_cor
 */
 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
index 48f76c8eb7eac77113f20671b30e3a2ce63a7b4c..945d951dc2fefe62f13bade8579bb10e07a66c5f 100644 (file)
@@ -114,6 +114,8 @@ SWITCH_STANDARD_APP(detect_speech_function)
                        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);
                }
index 0ce2fc4af6e19b029da89fae635ea20901c9ca06..2456a841a00d41a4b61457803e8c65d367e4f563 100644 (file)
@@ -2582,6 +2582,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_cor
        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);