]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8103 #resolve #comment [mod_rayo] handle <prompt> where <output> finishes unexpect...
authorChris Rienzo <chris.rienzo@citrix.com>
Tue, 1 Sep 2015 15:00:54 +0000 (11:00 -0400)
committerChris Rienzo <chris.rienzo@citrix.com>
Tue, 1 Sep 2015 15:00:54 +0000 (11:00 -0400)
src/mod/event_handlers/mod_rayo/rayo_prompt_component.c

index 8936618e92cdd6489965ea70998b9d92f80535d8..5c27524c55b8a02efadd45df2acc05eb134e85ad 100644 (file)
@@ -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 <prompt> attrib\n");
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Bad <prompt> attrib\n");
                return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "Bad <prompt> attrib value");
        }
 
        output = iks_find(prompt, "output");
        if (!output) {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Missing <output>\n");
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Missing <output>\n");
                return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "Missing <output>");
        }
 
        input = iks_find(prompt, "input");
        if (!input) {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Missing <input>\n");
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Missing <input>\n");
                return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "Missing <input>");
        }