decided to do this differently i think it was slightly wrong
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15372 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
3994b72e2b
commit
f5b0b8e2ad
|
@ -929,7 +929,6 @@ typedef enum {
|
||||||
CF_NOT_READY,
|
CF_NOT_READY,
|
||||||
CF_SIGNAL_BRIDGE_TTL,
|
CF_SIGNAL_BRIDGE_TTL,
|
||||||
CF_MEDIA_BRIDGE_TTL,
|
CF_MEDIA_BRIDGE_TTL,
|
||||||
CF_HANGUP_AFTER_BRIDGE,
|
|
||||||
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
|
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
|
||||||
CF_FLAG_MAX
|
CF_FLAG_MAX
|
||||||
} switch_channel_flag_t;
|
} switch_channel_flag_t;
|
||||||
|
|
|
@ -793,10 +793,6 @@ static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session)
|
||||||
switch_channel_set_variable(other_channel, SWITCH_BRIDGE_VARIABLE, NULL);
|
switch_channel_set_variable(other_channel, SWITCH_BRIDGE_VARIABLE, NULL);
|
||||||
|
|
||||||
if (switch_channel_up(other_channel)) {
|
if (switch_channel_up(other_channel)) {
|
||||||
if (switch_channel_test_flag(other_channel, CF_HANGUP_AFTER_BRIDGE)) {
|
|
||||||
switch_channel_hangup(other_channel, switch_channel_get_cause(channel));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_true(switch_channel_get_variable(other_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) {
|
if (switch_true(switch_channel_get_variable(other_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) {
|
||||||
switch_ivr_park_session(other_session);
|
switch_ivr_park_session(other_session);
|
||||||
} else if ((var = switch_channel_get_variable(other_channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) {
|
} else if ((var = switch_channel_get_variable(other_channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) {
|
||||||
|
@ -1127,10 +1123,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
|
||||||
if ((state != CS_EXECUTE && state != CS_SOFT_EXECUTE && state != CS_PARK && state != CS_ROUTING) ||
|
if ((state != CS_EXECUTE && state != CS_SOFT_EXECUTE && state != CS_PARK && state != CS_ROUTING) ||
|
||||||
(switch_channel_test_flag(peer_channel, CF_ANSWERED) && state < CS_HANGUP)) {
|
(switch_channel_test_flag(peer_channel, CF_ANSWERED) && state < CS_HANGUP)) {
|
||||||
|
|
||||||
if (switch_channel_test_flag(caller_channel, CF_HANGUP_AFTER_BRIDGE)) {
|
|
||||||
switch_channel_hangup(caller_channel, switch_channel_get_cause(peer_channel));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_true(switch_channel_get_variable(caller_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) {
|
if (switch_true(switch_channel_get_variable(caller_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) {
|
||||||
switch_ivr_park_session(session);
|
switch_ivr_park_session(session);
|
||||||
} else if ((var = switch_channel_get_variable(caller_channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) {
|
} else if ((var = switch_channel_get_variable(caller_channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) {
|
||||||
|
|
|
@ -2340,7 +2340,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||||
force_reason = SWITCH_CAUSE_ATTENDED_TRANSFER;
|
force_reason = SWITCH_CAUSE_ATTENDED_TRANSFER;
|
||||||
|
|
||||||
if ((holding_session = switch_core_session_locate(holding))) {
|
if ((holding_session = switch_core_session_locate(holding))) {
|
||||||
switch_channel_set_flag(switch_core_session_get_channel(holding_session), CF_HANGUP_AFTER_BRIDGE);
|
switch_channel_set_variable(switch_core_session_get_channel(holding_session), SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE, "true");
|
||||||
switch_core_session_rwunlock(holding_session);
|
switch_core_session_rwunlock(holding_session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2361,6 +2361,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||||
switch_channel_t *holding_channel = switch_core_session_get_channel(holding_session);
|
switch_channel_t *holding_channel = switch_core_session_get_channel(holding_session);
|
||||||
|
|
||||||
if (caller_channel && switch_channel_ready(caller_channel)) {
|
if (caller_channel && switch_channel_ready(caller_channel)) {
|
||||||
|
switch_channel_set_variable(holding_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE, "true");
|
||||||
switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(session));
|
switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(session));
|
||||||
holding = NULL;
|
holding = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2403,7 +2404,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
||||||
}
|
}
|
||||||
|
|
||||||
if (holding && oglobals.idx != IDX_TIMEOUT && oglobals.idx != IDX_KEY_CANCEL) {
|
if (holding && oglobals.idx != IDX_TIMEOUT && oglobals.idx != IDX_KEY_CANCEL) {
|
||||||
|
switch_core_session_t *holding_session;
|
||||||
|
|
||||||
|
if ((holding_session = switch_core_session_locate(holding))) {
|
||||||
|
switch_channel_set_variable(switch_core_session_get_channel(holding_session), SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE, "true");
|
||||||
|
switch_core_session_rwunlock(holding_session);
|
||||||
|
}
|
||||||
|
|
||||||
switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(originate_status[i].peer_session));
|
switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(originate_status[i].peer_session));
|
||||||
|
holding = NULL;
|
||||||
} else {
|
} else {
|
||||||
switch_channel_hangup(originate_status[i].peer_channel, reason);
|
switch_channel_hangup(originate_status[i].peer_channel, reason);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue