]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add support for yealink display update
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 25 Jan 2012 16:25:02 +0000 (10:25 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 25 Jan 2012 16:25:02 +0000 (10:25 -0600)
src/mod/endpoints/mod_sofia/mod_sofia.c

index 927c53a25367ce9db9003832d1b7a8b656b76d94..75d77308e0b9db45bfae95823d494dee80bae8a3 100644 (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)) {
-                                       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 "
                                                                          "Did not receive reply to last update or channel has not been answered yet.\n", 
                                                                          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)))) {
                                                        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);
                                                        nua_update(tech_pvt->nh,
                                                                           NUTAG_SESSION_TIMER(tech_pvt->session_timeout),