add process_cdr variable

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7212 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-01-14 15:37:00 +00:00
parent 5baaa35b7d
commit f0e7a5ea1c
1 changed files with 10 additions and 3 deletions

View File

@ -420,10 +420,17 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
goto done;
case CS_HANGUP: /* Deactivate and end the thread */
{
const char *var = NULL;
const char *var = switch_channel_get_variable(session->channel, SWITCH_PROCESS_CDR_VARIABLE);
if (!(var = switch_channel_get_variable(session->channel, SWITCH_PROCESS_CDR_VARIABLE)) || !switch_true(var)) {
do_extra_handlers = 0;
if (!switch_strlen_zero(var)) {
if (!strcasecmp(var, "a_only") && !switch_channel_test_flag(session->channel, CF_ORIGINATOR)) {
do_extra_handlers = 0;
} else if (!strcasecmp(var, "b_only") && switch_channel_test_flag(session->channel, CF_ORIGINATOR)) {
do_extra_handlers = 0;
} else if (!switch_true(var)) {
do_extra_handlers = 0;
}
}
STATE_MACRO(hangup, "HANGUP");