Merge pull request #263 in FS/freeswitch from ~LAZEDO/freeswitch-fs-7463:FS-7463 to master

* commit 'e12608bd11c62de715c1d6eecf05a8fe8b8becb0':
  FS-7463 #resolve
This commit is contained in:
William King 2015-07-03 12:28:16 -05:00
commit 20be305b1c
1 changed files with 19 additions and 12 deletions

View File

@ -9970,21 +9970,28 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
"%sanswer,sofia_sla:%s", codec_str, b_private->uuid); "%sanswer,sofia_sla:%s", codec_str, b_private->uuid);
} }
} else { } else {
if (!zstr(bridge_uuid)) { char *a_leg = NULL;
if (sip->sip_replaces && sip->sip_replaces->rp_params && sip->sip_replaces->rp_call_id) {
a_leg = switch_find_parameter(*(sip->sip_replaces->rp_params), "a-leg", switch_core_session_get_pool(session));
}
if(a_leg) {
switch_channel_mark_hold(b_channel, SWITCH_FALSE); switch_channel_mark_hold(b_channel, SWITCH_FALSE);
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,intercept:%s", bridge_uuid); tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,intercept:%s", sip->sip_replaces->rp_call_id);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "call %s picked up on a-leg\n", sip->sip_replaces->rp_call_id);
} else { } else {
const char *b_app = switch_channel_get_variable(b_channel, SWITCH_CURRENT_APPLICATION_VARIABLE); if (!zstr(bridge_uuid)) {
const char *b_data = switch_channel_get_variable(b_channel, SWITCH_CURRENT_APPLICATION_DATA_VARIABLE); switch_channel_mark_hold(b_channel, SWITCH_FALSE);
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,intercept:%s", bridge_uuid);
if (b_data && b_app) { } else {
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,%s:%s", b_app, b_data); const char *b_app = switch_channel_get_variable(b_channel, SWITCH_CURRENT_APPLICATION_VARIABLE);
} else if (b_app) { const char *b_data = switch_channel_get_variable(b_channel, SWITCH_CURRENT_APPLICATION_DATA_VARIABLE);
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,%s", b_app); if (b_data && b_app) {
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,%s:%s", b_app, b_data);
} else if (b_app) {
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool, "answer,%s", b_app);
}
switch_channel_hangup(b_channel, SWITCH_CAUSE_ATTENDED_TRANSFER);
} }
switch_channel_hangup(b_channel, SWITCH_CAUSE_ATTENDED_TRANSFER);
} }
} }