if (msg->string_array_arg[0]) {
tech_pvt->proxy_refer_uuid = (char *)msg->string_array_arg[0];
- } else {
+ } else if (!switch_channel_var_true(tech_pvt->channel, "sip_refer_continue_after_reply")) {
switch_mutex_unlock(tech_pvt->sofia_mutex);
sofia_wait_for_reply(tech_pvt, 9999, 10);
switch_mutex_lock(tech_pvt->sofia_mutex);
status_val = atoi(p);
}
if (!status_val || status_val >= 200) {
+ switch_channel_set_variable_printf(channel, "sip_refer_target_status_code", "%d", status_val);
switch_channel_set_variable(channel, "sip_refer_reply", sip->sip_payload->pl_data);
- if (status_val == 200) {
+ if (status_val == 200 && !switch_channel_var_true(channel, "sip_refer_continue_after_reply")) {
switch_channel_hangup(channel, SWITCH_CAUSE_BLIND_TRANSFER);
}
if ((int)tech_pvt->want_event == 9999) {
tech_pvt->want_event = 0;
}
+ } else if (status_val < 200) {
+ switch_channel_set_variable_printf(channel, "sip_refer_target_provisional_status_code", "%d", status_val);
}
}
}