Merge pull request #1147 in FS/freeswitch from bugfix/FS-9931-display-updates-are-sent-to-endpoints to master
* commit '5d5b815e426fa87392a6dd9657106664cb4caa42': FS-9931: [mod_sofia] don't send display updates to endpoints who don't have UPDATE in their Allow header
This commit is contained in:
commit
9b9408bc9e
|
@ -1891,10 +1891,15 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
if (!zstr(name) && strcmp(name, "_undef_")) {
|
||||
char message[256] = "";
|
||||
const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
|
||||
const char *allow = switch_channel_get_variable(tech_pvt->channel, "sip_allow");
|
||||
switch_event_t *event;
|
||||
int update_allowed = 0;
|
||||
|
||||
check_decode(name, tech_pvt->session);
|
||||
|
||||
if (allow) {
|
||||
update_allowed = !!switch_stristr("UPDATE", allow);
|
||||
}
|
||||
|
||||
if (zstr(number)) {
|
||||
number = tech_pvt->caller_profile->destination_number;
|
||||
|
@ -1957,7 +1962,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
|
||||
nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
|
||||
TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), SIPTAG_PAYLOAD_STR(message), TAG_END());
|
||||
} else if ((ua && (switch_stristr("polycom", ua)))) {
|
||||
} else if (update_allowed && ua && switch_stristr("polycom", ua)) {
|
||||
if ( switch_stristr("UA/4", ua) ) {
|
||||
snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <sip:%s@%s>", name, number, tech_pvt->profile->sipip);
|
||||
} else {
|
||||
|
@ -1971,7 +1976,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
TAG_IF(!zstr(tech_pvt->route_uri), NUTAG_PROXY(tech_pvt->route_uri)),
|
||||
TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)),
|
||||
TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), TAG_END());
|
||||
} else if (ua && ((switch_stristr("aastra", ua) && !switch_stristr("Intelligate", ua)) ||
|
||||
} else if (update_allowed && ua && ((switch_stristr("aastra", ua) && !switch_stristr("Intelligate", ua)) ||
|
||||
(switch_stristr("cisco/spa50", ua) || switch_stristr("cisco/spa525", ua)) ||
|
||||
switch_stristr("cisco/spa30", ua) || switch_stristr("Grandstream GXP", ua) ||
|
||||
switch_stristr("Yealink", ua) || switch_stristr("Mitel", ua) ||
|
||||
|
|
|
@ -6570,6 +6570,8 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
|
|||
switch_channel_set_variable(channel, "sip_user_agent", sip->sip_server->g_string);
|
||||
}
|
||||
|
||||
sofia_add_invite_header_to_chanvars(channel, nh, sip->sip_allow, "sip_allow");
|
||||
|
||||
sofia_update_callee_id(session, profile, sip, SWITCH_FALSE);
|
||||
|
||||
if (sofia_test_media_flag(tech_pvt->profile, SCMF_AUTOFIX_TIMING)) {
|
||||
|
@ -10430,6 +10432,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
|
|||
}
|
||||
|
||||
extract_header_vars(profile, sip, session, nh);
|
||||
sofia_add_invite_header_to_chanvars(channel, nh, sip->sip_allow, "sip_allow");
|
||||
|
||||
req_uri = url_set_chanvars(session, sip->sip_request->rq_url, sip_req);
|
||||
if (sip->sip_request->rq_url->url_user) {
|
||||
|
|
Loading…
Reference in New Issue