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

* commit 'aadd81d6d33dc6402d10ae452394aa8ddd3d1176':
  FS-9734: added new channel vars in att_xfer which allow cancel, hangup and conf keys to be changed
This commit is contained in:
Brian West 2016-11-30 10:37:46 -06:00
commit 9d249a66ff
1 changed files with 23 additions and 3 deletions

View File

@ -2387,17 +2387,37 @@ static switch_status_t xfer_on_dtmf(switch_core_session_t *session, void *input,
switch_channel_t *channel = switch_core_session_get_channel(session);
switch_channel_t *peer_channel = switch_core_session_get_channel(peer_session);
if (dtmf->digit == '*') {
const char *attxfer_cancel_key = NULL, *attxfer_hangup_key = NULL, *attxfer_conf_key = NULL;
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"))) {
attxfer_cancel_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"))) {
attxfer_hangup_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"))) {
attxfer_conf_key = "0";
}
}
if (dtmf->digit == *attxfer_hangup_key) {
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
return SWITCH_STATUS_FALSE;
}
if (dtmf->digit == '#') {
if (dtmf->digit == *attxfer_cancel_key) {
switch_channel_hangup(peer_channel, SWITCH_CAUSE_NORMAL_CLEARING);
return SWITCH_STATUS_FALSE;
}
if (dtmf->digit == '0') {
if (dtmf->digit == *attxfer_conf_key) {
switch_caller_extension_t *extension = NULL;
const char *app = "three_way";
const char *app_arg = switch_core_session_get_uuid(session);