FS-7378 play_and_detect_speech: protect against NULL result

This commit is contained in:
Chris Rienzo committed 2015-03-18 15:30:12 -04:00
1 parent ab3d967115
commit 21d1e6fc4b
2 files changed
+4 -2

No files matched your search

@@ -515,7 +515,9 @@ SWITCH_STANDARD_APP(play_and_detect_speech_function)
char *grammar = argv[1];
char *result = NULL;
switch_ivr_play_and_detect_speech(session, file, engine, grammar, &result, 0, NULL);
switch_channel_set_variable(channel, "detect_speech_result", result);
if (!zstr(result)) {
switch_channel_set_variable(channel, "detect_speech_result", result);
}
} else {
/* bad input */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", PLAY_AND_DETECT_SPEECH_SYNTAX);