actually-support

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15116 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-10-08 15:07:12 +00:00
parent eab6464f62
commit 75eed77d5e
4 changed files with 15 additions and 6 deletions

View File

@ -1294,7 +1294,8 @@ 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(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
SIPTAG_PAYLOAD_STR(message), TAG_END());
} else if (ua && (switch_stristr("polycom", ua) || switch_stristr("FreeSWITCH", ua))) {
} else if ((ua && (switch_stristr("polycom", ua) || switch_stristr("FreeSWITCH", ua))) ||
switch_stristr("UPDATE", tech_pvt->x_actually_support_remote)) {
snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", name, number);
nua_update(tech_pvt->nh,
TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),

View File

@ -581,8 +581,8 @@ struct private_object {
char *extrtpip;
char *stun_ip;
char *route_uri;
char *x_actually_supported_remote;
char *x_actually_supported_local;
char *x_actually_support_remote;
char *x_actually_support_local;
switch_port_t stun_port;
uint32_t stun_flags;
unsigned long rm_rate;

View File

@ -3095,6 +3095,12 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
switch_channel_clear_flag(channel, CF_REQ_MEDIA);
if ((status == 180 || status == 183 || status == 200)) {
const char *x_actually_support;
if ((x_actually_support = sofia_glue_get_unknown_header(sip, "X-Actually-Support"))) {
tech_pvt->x_actually_support_remote = switch_core_session_strdup(session, x_actually_support);
}
if (sip->sip_user_agent && sip->sip_user_agent->g_string) {
switch_channel_set_variable(channel, "sip_user_agent", sip->sip_user_agent->g_string);
} else if (sip->sip_server && sip->sip_server->g_string) {
@ -5491,8 +5497,8 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
}
} else if (!strncasecmp(un->un_name, "History-Info", 12)) {
switch_channel_set_variable(channel, "sip_history_info", un->un_value);
} else if (!strcasecmp(un->un_name, "X-Actually-Supported")) {
tech_pvt->x_actually_supported_remote = switch_core_session_strdup(session, un->un_value);
} else if (!strcasecmp(un->un_name, "X-Actually-Support")) {
tech_pvt->x_actually_support_remote = switch_core_session_strdup(session, un->un_value);
} else if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2)) {
if (!switch_strlen_zero(un->un_value)) {
char new_name[512] = "";

View File

@ -496,6 +496,8 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
tech_pvt->flags[x] = profile->flags[x];
}
tech_pvt->x_actually_support_local = SOFIA_ACTUALLY_SUPPORT;
tech_pvt->profile = profile;
profile->inuse++;
switch_mutex_unlock(profile->flag_mutex);
@ -1767,7 +1769,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
TAG_IF(!switch_strlen_zero(tech_pvt->privacy), SIPTAG_PRIVACY_STR(tech_pvt->privacy)),
TAG_IF(!switch_strlen_zero(alert_info), SIPTAG_HEADER_STR(alert_info)),
TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
SIPTAG_HEADER_STR("X-Actually-Support: UPDATE"),
SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)),
TAG_IF(!switch_strlen_zero(route_uri), NUTAG_PROXY(route_uri)),
TAG_IF(!switch_strlen_zero(route), SIPTAG_ROUTE_STR(route)),