mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
add reset state (make sure you do full rebuild)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5493 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -47,6 +47,14 @@ static void switch_core_standard_on_hangup(switch_core_session_t *session)
|
||||
|
||||
}
|
||||
|
||||
static void switch_core_standard_on_reset(switch_core_session_t *session)
|
||||
{
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Standard RESET %s\n",
|
||||
switch_channel_get_name(session->channel));
|
||||
|
||||
}
|
||||
|
||||
static void switch_core_standard_on_ring(switch_core_session_t *session)
|
||||
{
|
||||
switch_dialplan_interface_t *dialplan_interface = NULL;
|
||||
@@ -433,6 +441,41 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CS_RESET: /* Look for a dialplan and find something to do */
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State RESET\n", switch_channel_get_name(session->channel));
|
||||
if (!driver_state_handler->on_reset
|
||||
|| (driver_state_handler->on_reset && driver_state_handler->on_reset(session) == SWITCH_STATUS_SUCCESS
|
||||
&& midstate == switch_channel_get_state(session->channel))) {
|
||||
while ((application_state_handler = switch_channel_get_state_handler(session->channel, index++)) != 0) {
|
||||
if (!application_state_handler || !application_state_handler->on_reset
|
||||
|| (application_state_handler->on_reset
|
||||
&& application_state_handler->on_reset(session) == SWITCH_STATUS_SUCCESS
|
||||
&& midstate == switch_channel_get_state(session->channel))) {
|
||||
proceed++;
|
||||
continue;
|
||||
} else {
|
||||
proceed = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
index = 0;
|
||||
while (proceed && (application_state_handler = switch_core_get_state_handler(index++)) != 0) {
|
||||
if (!application_state_handler || !application_state_handler->on_reset ||
|
||||
(application_state_handler->on_reset &&
|
||||
application_state_handler->on_reset(session) == SWITCH_STATUS_SUCCESS
|
||||
&& midstate == switch_channel_get_state(session->channel))) {
|
||||
proceed++;
|
||||
continue;
|
||||
} else {
|
||||
proceed = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (proceed) {
|
||||
switch_core_standard_on_reset(session);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CS_EXECUTE: /* Execute an Operation */
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) State EXECUTE\n", switch_channel_get_name(session->channel));
|
||||
if (!driver_state_handler->on_execute
|
||||
|
||||
Reference in New Issue
Block a user