提交 7cdc8342 authored 作者: Travis Cross's avatar Travis Cross

if user has set presence_id, don't override it

上级 0521886d
......@@ -4358,9 +4358,12 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
if (tech_pvt->local_url) {
switch_channel_set_variable(nchannel, "sip_local_url", tech_pvt->local_url);
if (profile->pres_type) {
const char *presence_id = switch_channel_get_variable(nchannel, "presence_id");
if (zstr(presence_id)) {
switch_channel_set_variable(nchannel, "presence_id", tech_pvt->local_url);
}
}
}
switch_channel_set_variable(nchannel, "sip_destination_url", tech_pvt->dest);
#if 0
dest_num = switch_core_session_strdup(nsession, dest);
......
......@@ -7501,14 +7501,16 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
}
if (profile->pres_type) {
const char *presence_id = switch_channel_get_variable(channel, "presence_id");
if (zstr(presence_id)) {
const char *user = switch_str_nil(sip->sip_from->a_url->url_user);
const char *host = switch_str_nil(sip->sip_from->a_url->url_host);
char *tmp = switch_mprintf("%s@%s", user, host);
switch_assert(tmp);
switch_channel_set_variable(channel, "presence_id", tmp);
free(tmp);
}
}
if (sip->sip_request->rq_url->url_params) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论