add process_cdr variable

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7211 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-01-14 15:26:46 +00:00
parent 05670cfc53
commit 5baaa35b7d
2 changed files with 14 additions and 4 deletions

View File

@ -101,6 +101,7 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_PATH_SEPARATOR "/"
#endif
#define SWITCH_URL_SEPARATOR "://"
#define SWITCH_PROCESS_CDR_VARIABLE "process_cdr"
#define SWITCH_BRIDGE_CHANNEL_VARIABLE "bridge_channel"
#define SWITCH_CHANNEL_NAME_VARIABLE "channel_name"
#define SWITCH_BRIDGE_UUID_VARIABLE "bridge_uuid"

View File

@ -307,7 +307,7 @@ void switch_core_state_machine_init(switch_memory_pool_t *pool)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State %s\n", switch_channel_get_name(session->channel), __STATE_STR); \
if (!driver_state_handler->on_##__STATE || (driver_state_handler->on_##__STATE(session) == SWITCH_STATUS_SUCCESS \
&& midstate == switch_channel_get_state(session->channel))) { \
while ((application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) { \
while (do_extra_handlers && (application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) { \
if (!application_state_handler || !application_state_handler->on_##__STATE \
|| (application_state_handler->on_##__STATE \
&& application_state_handler->on_##__STATE(session) == SWITCH_STATUS_SUCCESS \
@ -320,7 +320,7 @@ void switch_core_state_machine_init(switch_memory_pool_t *pool)
} \
} \
index = 0; \
while (proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) { \
while (do_extra_handlers && proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) { \
if (!application_state_handler || !application_state_handler->on_##__STATE || \
(application_state_handler->on_##__STATE && \
application_state_handler->on_##__STATE(session) == SWITCH_STATUS_SUCCESS \
@ -408,7 +408,8 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
if (state != switch_channel_get_running_state(session->channel) || state == CS_HANGUP || exception) {
int index = 0;
int proceed = 1;
int do_extra_handlers = 1;
switch_channel_set_running_state(session->channel);
switch (state) {
@ -418,7 +419,15 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
case CS_DONE:
goto done;
case CS_HANGUP: /* Deactivate and end the thread */
STATE_MACRO(hangup, "HANGUP");
{
const char *var = NULL;
if (!(var = switch_channel_get_variable(session->channel, SWITCH_PROCESS_CDR_VARIABLE)) || !switch_true(var)) {
do_extra_handlers = 0;
}
STATE_MACRO(hangup, "HANGUP");
}
goto done;
case CS_INIT: /* Basic setup tasks */
STATE_MACRO(init, "INIT");