char *event_lock = switch_event_get_header(event, "event-lock");
char *event_lock_pri = switch_event_get_header(event, "event-lock-pri");
switch_status_t status = SWITCH_STATUS_FALSE;
+ int el = 0, elp = 0;
if (zstr(cmd)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Command!\n");
if (switch_true(event_lock)) {
switch_channel_set_flag_recursive(channel, CF_EVENT_LOCK);
+ el = 1;
}
if (switch_true(event_lock_pri)) {
switch_channel_set_flag_recursive(channel, CF_EVENT_LOCK_PRI);
+ elp = 1;
}
if (lead_frames) {
status = SWITCH_STATUS_SUCCESS;
done:
+
switch_channel_clear_flag_recursive(channel, CF_EVENT_PARSE);
- switch_channel_clear_flag_recursive(channel, CF_EVENT_LOCK);
- switch_channel_clear_flag_recursive(channel, CF_EVENT_LOCK_PRI);
+
+ if (el) {
+ switch_channel_clear_flag_recursive(channel, CF_EVENT_LOCK);
+ }
+
+ if (elp) {
+ switch_channel_clear_flag_recursive(channel, CF_EVENT_LOCK_PRI);
+ }
return status;
}