if (switch_dir_make_recursive(path, SWITCH_DEFAULT_DIR_PERMS, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error creating %s\n", path);
+ set_completion_cause(rh, "uri-failure");
switch_goto_status(SWITCH_STATUS_GENERR, err);
}
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
}
+ set_completion_cause(rh, "uri-failure");
switch_goto_status(SWITCH_STATUS_GENERR, err);
}
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
}
+ set_completion_cause(rh, "uri-failure");
switch_goto_status(SWITCH_STATUS_GENERR, err);
}
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
}
+ set_completion_cause(rh, "uri-failure");
switch_goto_status(SWITCH_STATUS_GENERR, err);
}
return SWITCH_STATUS_SUCCESS;
err:
+ if (!zstr(rh->completion_cause)) {
+ switch_channel_set_variable_printf(channel, "record_completion_cause", "%s", rh->completion_cause);
+ }
record_helper_destroy(&rh, session);
return status;