add skip_cdr_causes variable to list call hangup causes that should not trigger cdr processing
This commit is contained in:
parent
927c646dc7
commit
3cf238fc9a
|
@ -163,6 +163,7 @@ SWITCH_BEGIN_EXTERN_C
|
||||||
#define SWITCH_API_REPORTING_HOOK_VARIABLE "api_reporting_hook"
|
#define SWITCH_API_REPORTING_HOOK_VARIABLE "api_reporting_hook"
|
||||||
#define SWITCH_SESSION_IN_HANGUP_HOOK_VARIABLE "session_in_hangup_hook"
|
#define SWITCH_SESSION_IN_HANGUP_HOOK_VARIABLE "session_in_hangup_hook"
|
||||||
#define SWITCH_PROCESS_CDR_VARIABLE "process_cdr"
|
#define SWITCH_PROCESS_CDR_VARIABLE "process_cdr"
|
||||||
|
#define SWITCH_SKIP_CDR_CAUSES_VARIABLE "skip_cdr_causes"
|
||||||
#define SWITCH_FORCE_PROCESS_CDR_VARIABLE "force_process_cdr"
|
#define SWITCH_FORCE_PROCESS_CDR_VARIABLE "force_process_cdr"
|
||||||
#define SWITCH_BRIDGE_CHANNEL_VARIABLE "bridge_channel"
|
#define SWITCH_BRIDGE_CHANNEL_VARIABLE "bridge_channel"
|
||||||
#define SWITCH_CHANNEL_NAME_VARIABLE "channel_name"
|
#define SWITCH_CHANNEL_NAME_VARIABLE "channel_name"
|
||||||
|
|
|
@ -662,6 +662,7 @@ SWITCH_DECLARE(void) switch_core_session_reporting_state(switch_core_session_t *
|
||||||
int silly = 0;
|
int silly = 0;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
const char *var = switch_channel_get_variable(session->channel, SWITCH_PROCESS_CDR_VARIABLE);
|
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;
|
const char *hook_var;
|
||||||
int use_session = 0;
|
int use_session = 0;
|
||||||
switch_event_t *event;
|
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)) {
|
if (switch_channel_test_flag(session->channel, CF_NO_CDR)) {
|
||||||
do_extra_handlers = 0;
|
do_extra_handlers = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue