Revision
16610
Author
anthm
Date
2010-02-11 16:15:41 -0600 (Thu, 11 Feb 2010)

Log Message

fix possible seg

Modified Paths

Diff

Modified: freeswitch/trunk/src/include/switch_ivr.h (16609 => 16610)


--- freeswitch/trunk/src/include/switch_ivr.h	2010-02-11 20:53:05 UTC (rev 16609)
+++ freeswitch/trunk/src/include/switch_ivr.h	2010-02-11 22:15:41 UTC (rev 16610)
@@ -198,7 +198,7 @@
 */
 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

Modified: freeswitch/trunk/src/switch_ivr_async.c (16609 => 16610)


--- freeswitch/trunk/src/switch_ivr_async.c	2010-02-11 20:53:05 UTC (rev 16609)
+++ freeswitch/trunk/src/switch_ivr_async.c	2010-02-11 22:15:41 UTC (rev 16610)
@@ -2582,13 +2582,17 @@
 	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)