This commit is contained in:
Anthony Minessale 2014-02-23 05:17:01 +05:00
parent c0d078e0bb
commit e47aba1e7e
3 changed files with 15 additions and 7 deletions

View File

@ -653,7 +653,7 @@ SWITCH_DECLARE(void) switch_channel_mark_hold(switch_channel_t *channel, switch_
SWITCH_DECLARE(switch_status_t) switch_channel_execute_on(switch_channel_t *channel, const char *variable_prefix);
SWITCH_DECLARE(switch_status_t) switch_channel_api_on(switch_channel_t *channel, const char *variable_prefix);
SWITCH_DECLARE(void) switch_channel_process_device_hangup(switch_channel_t *channel);
SWITCH_DECLARE(switch_caller_extension_t *) switch_channel_get_queued_extension(switch_channel_t *channel);
SWITCH_DECLARE(void) switch_channel_transfer_to_extension(switch_channel_t *channel, switch_caller_extension_t *caller_extension);
SWITCH_DECLARE(const char *) switch_channel_get_partner_uuid(switch_channel_t *channel);

View File

@ -278,11 +278,9 @@ SWITCH_DECLARE(void) switch_channel_perform_set_callstate(switch_channel_t *chan
"(%s) Callstate Change %s -> %s\n", channel->name,
switch_channel_callstate2str(o_callstate), switch_channel_callstate2str(callstate));
switch_channel_check_device_state(channel, channel->callstate);
if (callstate == CCS_HANGUP) {
process_device_hup(channel);
}
if (callstate != CCS_HANGUP) {
switch_channel_check_device_state(channel, channel->callstate);
}
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_CALLSTATE) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Original-Channel-Call-State", switch_channel_callstate2str(o_callstate));
@ -4849,6 +4847,14 @@ SWITCH_DECLARE(void) switch_channel_clear_device_record(switch_channel_t *channe
}
SWITCH_DECLARE(void) switch_channel_process_device_hangup(switch_channel_t *channel)
{
switch_channel_check_device_state(channel, channel->callstate);
process_device_hup(channel);
}
static void process_device_hup(switch_channel_t *channel)
{
switch_hold_record_t *hr, *newhr, *last = NULL;

View File

@ -727,6 +727,7 @@ SWITCH_DECLARE(void) switch_core_session_hangup_state(switch_core_session_t *ses
//switch_channel_presence(session->channel, "unknown", switch_channel_cause2str(cause), NULL);
switch_channel_set_timestamps(session->channel);
switch_channel_set_callstate(session->channel, CCS_HANGUP);
STATE_MACRO(hangup, "HANGUP");
@ -741,7 +742,8 @@ SWITCH_DECLARE(void) switch_core_session_hangup_state(switch_core_session_t *ses
api_hook(session, hook_var, use_session);
}
switch_channel_set_callstate(session->channel, CCS_HANGUP);
switch_channel_process_device_hangup(session->channel);
switch_set_flag(session, SSF_HANGUP);
}