From ed59a6286e4062105663ddf99a537d341cc4f60a Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Tue, 1 Sep 2015 11:00:54 -0400 Subject: [PATCH] FS-8103 #resolve #comment [mod_rayo] handle where finishes unexpectedly before start event is received --- .../mod_rayo/rayo_prompt_component.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/mod/event_handlers/mod_rayo/rayo_prompt_component.c b/src/mod/event_handlers/mod_rayo/rayo_prompt_component.c index 8936618e92..5c27524c55 100644 --- a/src/mod/event_handlers/mod_rayo/rayo_prompt_component.c +++ b/src/mod/event_handlers/mod_rayo/rayo_prompt_component.c @@ -456,7 +456,7 @@ static iks *prompt_component_handle_input_complete(struct rayo_actor *prompt, st case PCS_START_INPUT_OUTPUT: case PCS_START_INPUT_TIMERS: case PCS_DONE_STOP_OUTPUT: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s, unexpected start output error event\n", RAYO_JID(prompt)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s, unexpected start output error event\n", RAYO_JID(prompt)); break; } @@ -516,12 +516,20 @@ static iks *prompt_component_handle_output_complete(struct rayo_actor *prompt, s } break; case PCS_INPUT: + break; case PCS_START_OUTPUT: case PCS_START_OUTPUT_BARGE: + /* output most likely failed w/ error */ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s, prompt output finished way too quickly (possible failure), continuing w/ input\n", RAYO_JID(prompt)); + /* start input with timers enabled and barge events disabled */ + rayo_component_send_start(RAYO_COMPONENT(prompt), PROMPT_COMPONENT(prompt)->iq); + PROMPT_COMPONENT(prompt)->state = PCS_START_INPUT; + start_input(PROMPT_COMPONENT(prompt), 1, 0); + break; case PCS_START_INPUT: case PCS_START_INPUT_TIMERS: case PCS_DONE: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s, unexpected start output error event\n", RAYO_JID(prompt)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s, unexpected start output complete event\n", RAYO_JID(prompt)); break; } @@ -543,19 +551,19 @@ static iks *start_call_prompt_component(struct rayo_actor *call, struct rayo_mes iks *cmd; if (!VALIDATE_RAYO_PROMPT(prompt)) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Bad attrib\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Bad attrib\n"); return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "Bad attrib value"); } output = iks_find(prompt, "output"); if (!output) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Missing \n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Missing \n"); return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "Missing "); } input = iks_find(prompt, "input"); if (!input) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Missing \n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Missing \n"); return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "Missing "); }