add param:confirm-blind-transfer var:confirm_blind_transfer that makes blind transfers keep the transferrer on the line until its confirmed that the call was completed or brings it back to the bridge. blind_transfer_ack app can be executed in the dp by the transferee to indicate sucess or fail or a sucessful bridge will automatically trigger a success

This commit is contained in:
Anthony Minessale
2012-05-08 08:50:33 -05:00
parent 2325dfbc4a
commit 07204a1fb5
7 changed files with 143 additions and 20 deletions

View File

@@ -188,6 +188,7 @@ static void switch_core_standard_on_routing(switch_core_session_t *session)
static void switch_core_standard_on_execute(switch_core_session_t *session)
{
switch_caller_extension_t *extension;
const char *uuid;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Standard EXECUTE\n", switch_channel_get_name(session->channel));
@@ -222,6 +223,25 @@ static void switch_core_standard_on_execute(switch_core_session_t *session)
}
if (switch_channel_ready(session->channel) && switch_channel_get_state(session->channel) == CS_EXECUTE &&
switch_channel_test_flag(session->channel, CF_CONFIRM_BLIND_TRANSFER) &&
(uuid = switch_channel_get_variable(session->channel, "blind_transfer_uuid"))) {
switch_core_session_t *other_session;
if ((other_session = switch_core_session_locate(uuid))) {
switch_core_session_message_t msg = { 0 };
msg.message_id = SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE;
msg.from = __FILE__;
msg.numeric_arg = 0;
switch_core_session_receive_message(other_session, &msg);
switch_core_session_rwunlock(other_session);
switch_channel_set_variable(session->channel, "park_timeout", "10:blind_transfer");
switch_channel_set_state(session->channel, CS_PARK);
switch_channel_clear_flag(session->channel, CF_CONFIRM_BLIND_TRANSFER);
}
}
if (switch_channel_ready(session->channel) && switch_channel_get_state(session->channel) == CS_EXECUTE) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "%s has executed the last dialplan instruction, hanging up.\n",
switch_channel_get_name(session->channel));