mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 09:12:25 +00:00
FS-7378 play_and_detect_speech: protect against NULL result
This commit is contained in:
parent
ab3d967115
commit
21d1e6fc4b
@ -515,7 +515,9 @@ SWITCH_STANDARD_APP(play_and_detect_speech_function)
|
|||||||
char *grammar = argv[1];
|
char *grammar = argv[1];
|
||||||
char *result = NULL;
|
char *result = NULL;
|
||||||
switch_ivr_play_and_detect_speech(session, file, engine, grammar, &result, 0, NULL);
|
switch_ivr_play_and_detect_speech(session, file, engine, grammar, &result, 0, NULL);
|
||||||
|
if (!zstr(result)) {
|
||||||
switch_channel_set_variable(channel, "detect_speech_result", result);
|
switch_channel_set_variable(channel, "detect_speech_result", result);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* bad input */
|
/* bad input */
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", PLAY_AND_DETECT_SPEECH_SYNTAX);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", PLAY_AND_DETECT_SPEECH_SYNTAX);
|
||||||
|
@ -3928,7 +3928,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_and_detect_speech(switch_core_se
|
|||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
int recognizing = 0;
|
int recognizing = 0;
|
||||||
switch_input_args_t myargs = { 0 };
|
switch_input_args_t myargs = { 0 };
|
||||||
play_and_detect_speech_state_t state = { 0 };
|
play_and_detect_speech_state_t state = { 0, "" };
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
|
|
||||||
arg_recursion_check_start(args);
|
arg_recursion_check_start(args);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user