add skip_cdr_causes variable to list call hangup causes that should not trigger cdr processing

This commit is contained in:
Anthony Minessale
2012-09-19 10:49:50 -05:00
parent 927c646dc7
commit 3cf238fc9a
2 changed files with 18 additions and 0 deletions

View File

@@ -662,6 +662,7 @@ SWITCH_DECLARE(void) switch_core_session_reporting_state(switch_core_session_t *
int silly = 0;
int index = 0;
const char *var = switch_channel_get_variable(session->channel, SWITCH_PROCESS_CDR_VARIABLE);
const char *skip_var = switch_channel_get_variable(session->channel, SWITCH_SKIP_CDR_CAUSES_VARIABLE);
const char *hook_var;
int use_session = 0;
switch_event_t *event;
@@ -695,6 +696,22 @@ SWITCH_DECLARE(void) switch_core_session_reporting_state(switch_core_session_t *
}
}
if (!zstr(skip_var)) {
int x, ttl = 0;
char *list[128] = { 0 };
char *dup = switch_core_session_strdup(session, skip_var);
ttl = switch_split(dup, '|', list);
for(x = 0; x < ttl; x++) {
if (switch_channel_str2cause(list[x]) == cause) {
do_extra_handlers = 0;
break;
}
}
}
if (switch_channel_test_flag(session->channel, CF_NO_CDR)) {
do_extra_handlers = 0;
}