提交 7f1ee9ad authored 作者: Brian West's avatar Brian West

Merge pull request #1088 in FS/freeswitch from…

Merge pull request #1088 in FS/freeswitch from ~ROMANAT/freeswitch:feature/FS-9734-add-channel-vars-att_xfer to master

* commit 'c20fa5e8':
  FS-9734: updated keys to be set in memory on att_xfer execution
...@@ -2520,20 +2520,39 @@ void *SWITCH_THREAD_FUNC att_thread_run(switch_thread_t *thread, void *obj) ...@@ -2520,20 +2520,39 @@ void *SWITCH_THREAD_FUNC att_thread_run(switch_thread_t *thread, void *obj)
return NULL; return NULL;
} }
bond = switch_channel_get_partner_uuid(channel);
switch_channel_set_variable(channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE, bond);
switch_core_event_hook_add_state_change(session, tmp_hanguphook);
if (follow_recording && (b_session = switch_core_session_locate(bond))) {
switch_ivr_transfer_recordings(b_session, session);
switch_core_session_rwunlock(b_session);
}
if (switch_ivr_originate(session, &peer_session, &cause, data, 0, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL)
!= SWITCH_STATUS_SUCCESS || !peer_session) {
switch_channel_set_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE, bond);
goto end;
}
peer_channel = switch_core_session_get_channel(peer_session);
switch_channel_set_flag(peer_channel, CF_INNER_BRIDGE);
switch_channel_set_flag(channel, CF_INNER_BRIDGE);
if (!(attxfer_cancel_key = switch_channel_get_variable(channel, "attxfer_cancel_key"))) { if (!(attxfer_cancel_key = switch_channel_get_variable(channel, "attxfer_cancel_key"))) {
if (!(attxfer_cancel_key = switch_channel_get_variable_partner(channel, "attxfer_cancel_key"))) { if (!(attxfer_cancel_key = switch_channel_get_variable(peer_channel, "attxfer_cancel_key"))) {
attxfer_cancel_key = "#"; attxfer_cancel_key = "#";
} }
} }
if (!(attxfer_hangup_key = switch_channel_get_variable(channel, "attxfer_hangup_key"))) { if (!(attxfer_hangup_key = switch_channel_get_variable(channel, "attxfer_hangup_key"))) {
if (!(attxfer_hangup_key = switch_channel_get_variable_partner(channel, "attxfer_hangup_key"))) { if (!(attxfer_hangup_key = switch_channel_get_variable(peer_channel, "attxfer_hangup_key"))) {
attxfer_hangup_key = "*"; attxfer_hangup_key = "*";
} }
} }
if (!(attxfer_conf_key = switch_channel_get_variable(channel, "attxfer_conf_key"))) { if (!(attxfer_conf_key = switch_channel_get_variable(channel, "attxfer_conf_key"))) {
if (!(attxfer_conf_key = switch_channel_get_variable_partner(channel, "attxfer_conf_key"))) { if (!(attxfer_conf_key = switch_channel_get_variable(peer_channel, "attxfer_conf_key"))) {
attxfer_conf_key = "0"; attxfer_conf_key = "0";
} }
} }
...@@ -2544,25 +2563,6 @@ void *SWITCH_THREAD_FUNC att_thread_run(switch_thread_t *thread, void *obj) ...@@ -2544,25 +2563,6 @@ void *SWITCH_THREAD_FUNC att_thread_run(switch_thread_t *thread, void *obj)
keys->attxfer_conf_key = switch_core_session_strdup(session, attxfer_conf_key); keys->attxfer_conf_key = switch_core_session_strdup(session, attxfer_conf_key);
switch_channel_set_private(channel, "__keys", keys); switch_channel_set_private(channel, "__keys", keys);
bond = switch_channel_get_partner_uuid(channel);
switch_channel_set_variable(channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE, bond);
switch_core_event_hook_add_state_change(session, tmp_hanguphook);
if (follow_recording && (b_session = switch_core_session_locate(bond))) {
switch_ivr_transfer_recordings(b_session, session);
switch_core_session_rwunlock(b_session);
}
if (switch_ivr_originate(session, &peer_session, &cause, data, 0, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL)
!= SWITCH_STATUS_SUCCESS || !peer_session) {
switch_channel_set_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE, bond);
goto end;
}
peer_channel = switch_core_session_get_channel(peer_session);
switch_channel_set_flag(peer_channel, CF_INNER_BRIDGE);
switch_channel_set_flag(channel, CF_INNER_BRIDGE);
switch_ivr_multi_threaded_bridge(session, peer_session, xfer_on_dtmf, peer_session, NULL); switch_ivr_multi_threaded_bridge(session, peer_session, xfer_on_dtmf, peer_session, NULL);
switch_channel_clear_flag(peer_channel, CF_INNER_BRIDGE); switch_channel_clear_flag(peer_channel, CF_INNER_BRIDGE);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论