FS-9654 introduce origination_aleg_uuid
This commit is contained in:
parent
5ef273b4b3
commit
b7578ecd98
|
@ -624,6 +624,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
|
|||
switch_event_t *event;
|
||||
switch_channel_t *peer_channel = switch_core_session_get_channel(*new_session);
|
||||
const char *use_uuid;
|
||||
switch_core_session_t *other_session = NULL;
|
||||
|
||||
switch_assert(peer_channel);
|
||||
|
||||
|
@ -644,6 +645,15 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
|
|||
}
|
||||
}
|
||||
|
||||
if (!channel && var_event) {
|
||||
const char *other_uuid;
|
||||
|
||||
if ((other_uuid = switch_event_get_header(var_event, "origination_aleg_uuid")) && (other_session = switch_core_session_locate(other_uuid))) {
|
||||
channel = switch_core_session_get_channel(other_session);
|
||||
session = other_session;
|
||||
}
|
||||
}
|
||||
|
||||
if (channel) {
|
||||
const char *val;
|
||||
switch_codec_t *vid_read_codec = NULL, *read_codec = switch_core_session_get_read_codec(session);
|
||||
|
@ -740,6 +750,13 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
|
|||
|
||||
}
|
||||
|
||||
if (other_session) {
|
||||
switch_core_session_rwunlock(other_session);
|
||||
channel = NULL;
|
||||
session = NULL;
|
||||
}
|
||||
|
||||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_OUTGOING) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_event_set_data(peer_channel, event);
|
||||
switch_event_fire(&event);
|
||||
|
|
|
@ -2181,6 +2181,10 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session
|
|||
rchannel = switch_core_session_get_channel(rsession);
|
||||
buuid = switch_channel_get_partner_uuid(rchannel);
|
||||
|
||||
if (!strcasecmp(buuid, switch_core_session_get_uuid(session))) {
|
||||
buuid = NULL;
|
||||
}
|
||||
|
||||
if ((var = switch_channel_get_variable(channel, "intercept_unbridged_only")) && switch_true(var)) {
|
||||
if ((switch_channel_test_flag(rchannel, CF_BRIDGED))) {
|
||||
switch_core_session_rwunlock(rsession);
|
||||
|
|
Loading…
Reference in New Issue