]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix possible seg
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 11 Feb 2010 22:15:41 +0000 (22:15 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 11 Feb 2010 22:15:41 +0000 (22:15 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16610 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_ivr.h
src/switch_ivr_async.c

index 72068249e443864769f40ac762819408d213dcfd..ba7a7a1a73c0074ed52151c88235ec51a2f1cb67 100644 (file)
@@ -198,7 +198,7 @@ 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);
+SWITCH_DECLARE(switch_status_t) switch_ivr_set_param_detect_speech(switch_core_session_t *session, const char *name, const char *val);
 
 /*!
   \brief Record a session to disk
index 2456a841a00d41a4b61457803e8c65d367e4f563..bf84e9a8fc78b44ed9ff1bedc4872f6fd571e6ce 100644 (file)
@@ -2582,13 +2582,17 @@ 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) 
+SWITCH_DECLARE(switch_status_t) 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);
+       switch_status_t status = SWITCH_STATUS_FALSE;
 
-       if (sth->ah && name && val) {
+       if (sth && sth->ah && name && val) {
                switch_core_asr_text_param(sth->ah, (char *) name, val);
+               status = SWITCH_STATUS_SUCCESS;
        }
+
+       return status;
 }
 
 SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *name)