From bea7d8ec71775ccfc43e0b27d7956e3f7b2118a9 Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Mon, 27 Oct 2014 13:41:52 -0400 Subject: [PATCH] FS-5853 #resolve #comment mod_rayo now reports record completion cause --- src/mod/event_handlers/mod_rayo/rayo_record_component.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mod/event_handlers/mod_rayo/rayo_record_component.c b/src/mod/event_handlers/mod_rayo/rayo_record_component.c index 20d857377c..82a36d79b8 100644 --- a/src/mod/event_handlers/mod_rayo/rayo_record_component.c +++ b/src/mod/event_handlers/mod_rayo/rayo_record_component.c @@ -134,11 +134,17 @@ static void on_call_record_stop_event(switch_event_t *event) struct rayo_component *component = RAYO_COMPONENT_LOCATE(file_path); if (component) { + const char *completion_cause = switch_event_get_header(event, "Record-Completion-Cause"); + completion_cause = zstr(completion_cause) ? "" : completion_cause; RECORD_COMPONENT(component)->duration_ms += (switch_micro_time_now() - RECORD_COMPONENT(component)->start_time) / 1000; if (RECORD_COMPONENT(component)->stop) { complete_record(component, COMPONENT_COMPLETE_STOP); + } else if (!strcmp(completion_cause, "no-input-timeout")) { + complete_record(component, RECORD_COMPLETE_INITIAL_TIMEOUT); + } else if (!strcmp(completion_cause, "success-maxtime")) { + complete_record(component, RECORD_COMPLETE_MAX_DURATION); } else { - /* TODO assume final timeout, for now */ + /* assume final timeout */ complete_record(component, RECORD_COMPLETE_FINAL_TIMEOUT); } RAYO_RELEASE(component);