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;
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 {
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) ||
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)) {
}
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) {