add support for yealink display update

This commit is contained in:
Anthony Minessale 2012-01-25 10:25:02 -06:00
parent a067edeec4
commit 39c4e7a320
1 changed files with 10 additions and 1 deletions

View File

@ -2099,7 +2099,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
} }
if (sofia_test_flag(tech_pvt, TFLAG_UPDATING_DISPLAY) || !switch_channel_test_flag(channel, CF_ANSWERED)) { if (sofia_test_flag(tech_pvt, TFLAG_UPDATING_DISPLAY) || !switch_channel_test_flag(channel, CF_ANSWERED)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_WARNING,
"Cannot send display update to %s " "Cannot send display update to %s "
"Did not receive reply to last update or channel has not been answered yet.\n", "Did not receive reply to last update or channel has not been answered yet.\n",
switch_channel_get_name(tech_pvt->channel)); switch_channel_get_name(tech_pvt->channel));
@ -2150,6 +2150,15 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
} else if ((ua && (switch_stristr("cisco/spa50", ua) || switch_stristr("cisco/spa525", ua)))) { } else if ((ua && (switch_stristr("cisco/spa50", ua) || switch_stristr("cisco/spa525", ua)))) {
snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <sip:%s@%s>", name, number, tech_pvt->profile->sipip); snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <sip:%s@%s>", name, number, tech_pvt->profile->sipip);
sofia_set_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY);
nua_update(tech_pvt->nh,
NUTAG_SESSION_TIMER(tech_pvt->session_timeout),
NUTAG_SESSION_REFRESHER(tech_pvt->session_refresher),
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("Yealink", ua)))) {
snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <sip:%s@%s>", name, number, tech_pvt->profile->sipip);
sofia_set_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY); sofia_set_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY);
nua_update(tech_pvt->nh, nua_update(tech_pvt->nh,
NUTAG_SESSION_TIMER(tech_pvt->session_timeout), NUTAG_SESSION_TIMER(tech_pvt->session_timeout),