mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 12:42:02 +00:00
wait for reply of refer
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10471 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -1120,6 +1120,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
case SWITCH_MESSAGE_INDICATE_DEFLECT:
|
||||
{
|
||||
char ref_to[128] = "";
|
||||
const char *var;
|
||||
|
||||
if (!strstr(msg->string_arg, "sip:")) {
|
||||
const char *format = strchr(tech_pvt->profile->sipip, ':') ? "sip:%s@[%s]" : "sip:%s@%s";
|
||||
@@ -1128,6 +1129,16 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
||||
switch_set_string(ref_to, msg->string_arg);
|
||||
}
|
||||
nua_refer(tech_pvt->nh, SIPTAG_REFER_TO_STR(ref_to), SIPTAG_REFERRED_BY_STR(tech_pvt->contact_url), TAG_END());
|
||||
switch_mutex_unlock(tech_pvt->sofia_mutex);
|
||||
sofia_wait_for_reply(tech_pvt, 9999, 300);
|
||||
switch_mutex_lock(tech_pvt->sofia_mutex);
|
||||
|
||||
if ((var = switch_channel_get_variable(tech_pvt->channel, "sip_refer_reply"))) {
|
||||
msg->string_reply = strdup(var);
|
||||
switch_set_flag(msg, SCSMF_FREE_STRING_REPLY);
|
||||
} else {
|
||||
msg->string_reply = "no reply";
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user