<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][15186] </title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=15186">15186</a></dd>
<dt>Author</dt> <dd>anthm</dd>
<dt>Date</dt> <dd>2009-10-21 13:48:28 -0500 (Wed, 21 Oct 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre><a href="http://jira.freeswitch.org/browse/FSCORE-471">FSCORE-471</a> and any other update related bugs</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunklibssofiasiplibsofiasipuanuanua_sessionc">freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c</a></li>
<li><a href="#freeswitchtrunksrcincludeswitch_channelh">freeswitch/trunk/src/include/switch_channel.h</a></li>
<li><a href="#freeswitchtrunksrcincludeswitch_coreh">freeswitch/trunk/src/include/switch_core.h</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_sofiamod_sofiac">freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_sofiamod_sofiah">freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_sofiasofiac">freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_sofiasofia_gluec">freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_channelc">freeswitch/trunk/src/switch_channel.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_core_sessionc">freeswitch/trunk/src/switch_core_session.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_ivr_bridgec">freeswitch/trunk/src/switch_ivr_bridge.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_ivr_originatec">freeswitch/trunk/src/switch_ivr_originate.c</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunklibssofiasiplibsofiasipuanuanua_sessionc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (15185 => 15186)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c        2009-10-21 17:55:31 UTC (rev 15185)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c        2009-10-21 18:48:28 UTC (rev 15186)
</span><span class="lines">@@ -3490,8 +3490,9 @@
</span><span class="cx">         if ((overlap = sr0->sr_offer_recv && !sr0->sr_answer_sent))
</span><span class="cx">          break;
</span><span class="cx">
</span><del>- if (nh->nh_soa && overlap)
- return nua_server_retry_after(sr, 500, "Overlapping Offer/Answer", 1, 9);
</del><ins>+ if (nh->nh_soa && overlap) {
+                return nua_server_retry_after(sr, 500, "Overlapping Offer/Answer", 1, 9);
+        }
</ins><span class="cx">
</span><span class="cx"> if (nh->nh_soa &&
</span><span class="cx">         soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
</span></span></pre></div>
<a id="freeswitchtrunksrcincludeswitch_channelh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_channel.h (15185 => 15186)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_channel.h        2009-10-21 17:55:31 UTC (rev 15185)
+++ freeswitch/trunk/src/include/switch_channel.h        2009-10-21 18:48:28 UTC (rev 15186)
</span><span class="lines">@@ -252,6 +252,8 @@
</span><span class="cx"> SWITCH_DECLARE(const char *) switch_channel_get_variable(switch_channel_t *channel, const char *varname);
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_channel_get_variables(switch_channel_t *channel, switch_event_t **event);
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(switch_status_t) switch_channel_pass_callee_id(switch_channel_t *channel, switch_channel_t *other_channel);
+
</ins><span class="cx"> /*!
</span><span class="cx"> * \brief Start iterating over the entries in the channel variable list.
</span><span class="cx"> * \param channel the channel to iterate the variables for
</span></span></pre></div>
<a id="freeswitchtrunksrcincludeswitch_coreh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_core.h (15185 => 15186)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_core.h        2009-10-21 17:55:31 UTC (rev 15185)
+++ freeswitch/trunk/src/include/switch_core.h        2009-10-21 18:48:28 UTC (rev 15186)
</span><span class="lines">@@ -96,6 +96,7 @@
</span><span class="cx">         const char *_func;
</span><span class="cx">         int _line;
</span><span class="cx">         const char *string_array_arg[MESSAGE_STRING_ARG_MAX];
</span><ins>+        time_t delivery_time;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> /*! \brief A generic object to pass as a thread's session object to allow mutiple arguements and a pool */
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_sofiamod_sofiac"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (15185 => 15186)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c        2009-10-21 17:55:31 UTC (rev 15185)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c        2009-10-21 18:48:28 UTC (rev 15186)
</span><span class="lines">@@ -181,17 +181,19 @@
</span><span class="cx">         const char *callee_name = NULL, *callee_number = NULL;
</span><span class="cx">         char *pai = NULL;
</span><span class="cx">
</span><del>-        if ((callee_name = switch_channel_get_variable(tech_pvt->channel, "sip_callee_id_name"))) {
-                if (!(callee_number = switch_channel_get_variable(tech_pvt->channel, "sip_callee_id_number"))) {
</del><ins>+        if (!(callee_name = switch_channel_get_variable(tech_pvt->channel, "sip_callee_id_name"))) {
+                callee_name = switch_channel_get_variable(tech_pvt->channel, "callee_id_name");
+        }
+
+        if (!(callee_number = switch_channel_get_variable(tech_pvt->channel, "sip_callee_id_number"))) {
+                if (!(callee_number = switch_channel_get_variable(tech_pvt->channel, "callee_id_number"))) {
</ins><span class="cx">                         callee_number = tech_pvt->caller_profile->destination_number;
</span><span class="cx">                 }
</span><ins>+        }
</ins><span class="cx">
</span><del>-                if (!strchr(callee_number, '@')) {
-                        char *tmp = switch_core_session_sprintf(session, "sip:%s@cluecon.com", callee_number);
-                        callee_number = tmp;
-                }
-
-                pai = switch_core_session_sprintf(tech_pvt->session, "P-Asserted-Identity: \"%s\" <%s>", callee_name, callee_number);
</del><ins>+        if (callee_name && callee_number) {
+                pai = switch_core_session_sprintf(tech_pvt->session, "P-Asserted-Identity: \"%s\" <%s>\nX-FS-Display-Name: %s\nX-FS-Display-Number: %s\n",
+                                                                                 callee_name, callee_number, callee_name, callee_number);
</ins><span class="cx">         }
</span><span class="cx">         return pai;
</span><span class="cx"> }
</span><span class="lines">@@ -483,7 +485,7 @@
</span><span class="cx">                                                         SOATAG_REUSE_REJECTED(1),
</span><span class="cx">                                                         SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1),
</span><span class="cx">                                                         TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
</span><del>-                                                        SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
</del><ins>+                                                        SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT),
</ins><span class="cx">                                                         TAG_END());
</span><span class="cx">
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "3PCC-PROXY, Sent a 200 OK, waiting for ACK\n");
</span><span class="lines">@@ -572,7 +574,7 @@
</span><span class="cx">                                         SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
</span><span class="cx">                                         SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1),
</span><span class="cx">                                         TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
</span><del>-                                        SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
</del><ins>+                                        SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT),
</ins><span class="cx">                                         TAG_END());
</span><span class="cx">                 switch_safe_free(extra_headers);
</span><span class="cx">                 sofia_set_flag_locked(tech_pvt, TFLAG_ANS);
</span><span class="lines">@@ -1289,21 +1291,25 @@
</span><span class="cx">                                         number = tech_pvt->caller_profile->destination_number;
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (!switch_channel_test_flag(channel, CF_ANSWERED)) {
-                                        switch_channel_set_variable(channel, "sip_callee_id_name", name);
-                                        switch_channel_set_variable(channel, "sip_callee_id_number", number);
-                                } else {
</del><ins>+                                if (switch_channel_test_flag(channel, CF_ANSWERED) && !sofia_test_flag(tech_pvt, TFLAG_UPDATING_DISPLAY)) {
</ins><span class="cx">                                         if (switch_strlen_zero(tech_pvt->last_sent_callee_id_name) || strcmp(tech_pvt->last_sent_callee_id_name, name) ||
</span><span class="cx">                                                 switch_strlen_zero(tech_pvt->last_sent_callee_id_number) || strcmp(tech_pvt->last_sent_callee_id_number, number)) {
</span><del>-                                        
-                                                if (ua && switch_stristr("snom", ua)) {
</del><ins>+                                                
+                                                if (switch_stristr("update_display", tech_pvt->x_freeswitch_support_remote)) {
+                                                        snprintf(message, sizeof(message), "X-FS-Display-Name: %s\nX-FS-Display-Number: %s\n", name, number);
+
+                                                        nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/update_display"),
+                                                                         TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),
+                                                                         TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+                                                                         TAG_END());
+                                                } else if (ua && switch_stristr("snom", ua)) {
</ins><span class="cx">                                                         snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", name, number);
</span><span class="cx">                                                         nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
</span><span class="cx">                                                                          TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
</span><span class="cx">                                                                          SIPTAG_PAYLOAD_STR(message), TAG_END());
</span><del>-                                                } else if ((ua && (switch_stristr("polycom", ua) ||
-                                                                                 switch_stristr("UPDATE", tech_pvt->x_actually_support_remote)))) {
</del><ins>+                                                } else if ((ua && (switch_stristr("polycom", ua)))) {
</ins><span class="cx">                                                         snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", name, number);
</span><ins>+                                                        sofia_set_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY);
</ins><span class="cx">                                                         nua_update(tech_pvt->nh,
</span><span class="cx">                                                                          TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),
</span><span class="cx">                                                                          TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
</span><span class="lines">@@ -1519,7 +1525,7 @@
</span><span class="cx">                                                 SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
</span><span class="cx">                                                 SIPTAG_HEADER_STR(generate_pai_str(session)),
</span><span class="cx">                                                 TAG_IF(!switch_strlen_zero(extra_header), SIPTAG_HEADER_STR(extra_header)),
</span><del>-                                                SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
</del><ins>+                                                SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT),
</ins><span class="cx">                                                 TAG_END());
</span><span class="cx">                         switch_safe_free(extra_header);
</span><span class="cx">                         switch_channel_mark_ring_ready(channel);
</span><span class="lines">@@ -1605,7 +1611,7 @@
</span><span class="cx">                                                                 SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip),
</span><span class="cx">                                                                 SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"),
</span><span class="cx">                                                                 TAG_IF(!switch_strlen_zero(extra_header), SIPTAG_HEADER_STR(extra_header)),
</span><del>-                                                                SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
</del><ins>+                                                                SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT),
</ins><span class="cx">                                                                 TAG_END());
</span><span class="cx">                                         switch_safe_free(extra_header);
</span><span class="cx">                                 }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_sofiamod_sofiah"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (15185 => 15186)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h        2009-10-21 17:55:31 UTC (rev 15185)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h        2009-10-21 18:48:28 UTC (rev 15186)
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> #define SOFIA_SECURE_MEDIA_CONFIRMED_VARIABLE "sip_secure_media_confirmed"
</span><span class="cx"> #define SOFIA_HAS_CRYPTO_VARIABLE "sip_has_crypto"
</span><span class="cx"> #define SOFIA_CRYPTO_MANDATORY_VARIABLE "sip_crypto_mandatory"
</span><del>-#define SOFIA_ACTUALLY_SUPPORT "UPDATE"
</del><ins>+#define FREESWITCH_SUPPORT "update_display"
</ins><span class="cx">
</span><span class="cx"> #include <sofia-sip/nua.h>
</span><span class="cx"> #include <sofia-sip/sip_status.h>
</span><span class="lines">@@ -247,7 +247,7 @@
</span><span class="cx">         TFLAG_HOLD_LOCK,
</span><span class="cx">         TFLAG_3PCC_HAS_ACK,
</span><span class="cx">         TFLAG_PASS_RFC2833,
</span><del>-
</del><ins>+        TFLAG_UPDATING_DISPLAY,
</ins><span class="cx">         /* No new flags below this line */
</span><span class="cx">         TFLAG_MAX
</span><span class="cx"> } TFLAGS;
</span><span class="lines">@@ -581,8 +581,8 @@
</span><span class="cx">         char *extrtpip;
</span><span class="cx">         char *stun_ip;
</span><span class="cx">         char *route_uri;
</span><del>-        char *x_actually_support_remote;
-        char *x_actually_support_local;
</del><ins>+        char *x_freeswitch_support_remote;
+        char *x_freeswitch_support_local;
</ins><span class="cx">         char *last_sent_callee_id_name;
</span><span class="cx">         char *last_sent_callee_id_number;
</span><span class="cx">         switch_port_t stun_port;
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_sofiasofiac"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (15185 => 15186)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c        2009-10-21 17:55:31 UTC (rev 15185)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c        2009-10-21 18:48:28 UTC (rev 15186)
</span><span class="lines">@@ -393,7 +393,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         if (switch_strlen_zero(name)) {
</span><del>-                name = "unknown";
</del><ins>+                name = number;
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         if (switch_strlen_zero(number)) {
</span><span class="lines">@@ -402,7 +402,11 @@
</span><span class="cx">
</span><span class="cx">         if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (session_b = switch_core_session_locate(uuid))) {
</span><span class="cx">                 switch_core_session_message_t *msg;
</span><del>-                
</del><ins>+                //switch_channel_t *channel_b = switch_core_session_get_channel(session_b);
+
+                //switch_channel_set_profile_var(channel_b, "callee_id_name", name);
+                //switch_channel_set_profile_var(channel_b, "callee_id_number", number);
+
</ins><span class="cx">                 msg = switch_core_session_alloc(session_b, sizeof(*msg));
</span><span class="cx">                 MESSAGE_STAMP_FFL(msg);
</span><span class="cx">                 msg->message_id = SWITCH_MESSAGE_INDICATE_DISPLAY;
</span><span class="lines">@@ -418,33 +422,47 @@
</span><span class="cx"> {
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx">         sip_p_asserted_identity_t *passerted = NULL;
</span><del>-        char *name = "unknown";
</del><ins>+        char *name = NULL;
</ins><span class="cx">         const char *number = "unknown", *tmp;
</span><span class="cx">         switch_caller_profile_t *caller_profile;
</span><span class="cx">         char *dup = NULL;
</span><span class="cx">         switch_event_t *event;
</span><ins>+        const char *val;
+        int fs = 0;
</ins><span class="cx">
</span><span class="cx">         if (sip->sip_to) {
</span><span class="cx">                 number = sip->sip_to->a_url->url_user;
</span><span class="cx">         }
</span><del>-        
-        if ((passerted = sip_p_asserted_identity(sip))) {
-                if (passerted->paid_url && passerted->paid_url->url_user) {
-                        number = passerted->paid_url->url_user;
-                }
-                if (!switch_strlen_zero(passerted->paid_display)) {
-                        dup = strdup(passerted->paid_display);
-                        if (*dup == '"') {
-                                name = dup + 1;
-                        } else {
-                                name = dup;
</del><ins>+
+        if ((val = sofia_glue_get_unknown_header(sip, "X-FS-Display-Number"))) {
+                number = val;
+                fs++;
+        }
+
+        if ((val = sofia_glue_get_unknown_header(sip, "X-FS-Display-Name"))) {
+                name = (char *)val;
+                fs++;
+        }
+
+        if (!fs) {
+                if ((passerted = sip_p_asserted_identity(sip))) {
+                        if (passerted->paid_url && passerted->paid_url->url_user) {
+                                number = passerted->paid_url->url_user;
</ins><span class="cx">                         }
</span><del>-                        if (end_of(name) == '"') {
-                                end_of(name) = '\0';
</del><ins>+                        if (!switch_strlen_zero(passerted->paid_display)) {
+                                dup = strdup(passerted->paid_display);
+                                if (*dup == '"') {
+                                        name = dup + 1;
+                                } else {
+                                        name = dup;
+                                }
+                                if (end_of(name) == '"') {
+                                        end_of(name) = '\0';
+                                }
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ((tmp = switch_channel_get_variable(channel, "sip_callee_id_name"))) {
</span><span class="cx">                 name = (char *)tmp;
</span><span class="cx">         }
</span><span class="lines">@@ -453,6 +471,8 @@
</span><span class="cx">                 number = tmp;
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        if (!name) name = (char *) number;
+
</ins><span class="cx">         if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                 const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "RECV");
</span><span class="lines">@@ -663,6 +683,9 @@
</span><span class="cx">                 if (session) sofia_handle_sip_i_update(nua, profile, nh, session, sip, tags);
</span><span class="cx">                 break;
</span><span class="cx">         case nua_r_update:
</span><ins>+                if (session && tech_pvt && locked) {
+                        sofia_clear_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY);
+                }
</ins><span class="cx">                 break;
</span><span class="cx">         case nua_r_refer:
</span><span class="cx">                 break;
</span><span class="lines">@@ -1033,7 +1056,7 @@
</span><span class="cx">                                  NUTAG_ENABLEMESSENGER(1),
</span><span class="cx">                                  TAG_IF((profile->mflags & MFLAG_REGISTER), NUTAG_ALLOW("REGISTER")),
</span><span class="cx">                                  TAG_IF((profile->mflags & MFLAG_REFER), NUTAG_ALLOW("REFER")),
</span><del>-                                 TAG_IF((profile->mflags & MFLAG_UPDATE), NUTAG_ALLOW("UPDATE")),
</del><ins>+                                 //TAG_IF((profile->mflags & MFLAG_UPDATE), NUTAG_ALLOW("UPDATE")),
</ins><span class="cx">                                  TAG_IF(!sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_ALLOW("PRACK")),
</span><span class="cx">                                  NUTAG_ALLOW("INFO"),
</span><span class="cx">                                  NUTAG_ALLOW("NOTIFY"),
</span><span class="lines">@@ -1069,7 +1092,7 @@
</span><span class="cx">                                          NUTAG_AUTOALERT(0),
</span><span class="cx">                                          TAG_IF((profile->mflags & MFLAG_REGISTER), NUTAG_ALLOW("REGISTER")),
</span><span class="cx">                                          TAG_IF((profile->mflags & MFLAG_REFER), NUTAG_ALLOW("REFER")),
</span><del>-                                         TAG_IF((profile->mflags & MFLAG_UPDATE), NUTAG_ALLOW("UPDATE")),
</del><ins>+                                         //TAG_IF((profile->mflags & MFLAG_UPDATE), NUTAG_ALLOW("UPDATE")),
</ins><span class="cx">                                          NUTAG_ALLOW("INFO"),
</span><span class="cx">                                          TAG_IF(profile->pres_type, NUTAG_ALLOW("PUBLISH")),
</span><span class="cx">                                          TAG_IF(profile->pres_type, NUTAG_ENABLEMESSAGE(1)),
</span><span class="lines">@@ -3116,12 +3139,12 @@
</span><span class="cx">                 switch_channel_clear_flag(channel, CF_REQ_MEDIA);
</span><span class="cx">
</span><span class="cx">                 if ((status == 180 || status == 183 || status == 200)) {
</span><del>-                        const char *x_actually_support;
</del><ins>+                        const char *x_freeswitch_support;
</ins><span class="cx">
</span><span class="cx">                         switch_channel_set_flag(channel, CF_MEDIA_ACK);
</span><span class="cx">
</span><del>-                        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);
</del><ins>+                        if ((x_freeswitch_support = sofia_glue_get_unknown_header(sip, "X-FS-Support"))) {
+                                tech_pvt->x_freeswitch_support_remote = switch_core_session_strdup(session, x_freeswitch_support);
</ins><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         if (sip->sip_user_agent && sip->sip_user_agent->g_string) {
</span><span class="lines">@@ -4603,6 +4626,8 @@
</span><span class="cx">                         } else if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "dtmf")) {
</span><span class="cx">                                 int tmp = atoi(sip->sip_payload->pl_data);
</span><span class="cx">                                 dtmf.digit = switch_rfc2833_to_char(tmp);
</span><ins>+                        } else if (!strncasecmp(sip->sip_content_type->c_type, "message", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "update_display")) {
+                                sofia_update_callee_id(session, profile, sip, SWITCH_TRUE);
</ins><span class="cx">                         } else {
</span><span class="cx">                                 goto end;
</span><span class="cx">                         }
</span><span class="lines">@@ -5558,8 +5583,8 @@
</span><span class="cx">                                 }
</span><span class="cx">                         } else if (!strncasecmp(un->un_name, "History-Info", 12)) {
</span><span class="cx">                                 switch_channel_set_variable(channel, "sip_history_info", un->un_value);
</span><del>-                        } else if (!strcasecmp(un->un_name, "X-Actually-Support")) {
-                                tech_pvt->x_actually_support_remote = switch_core_session_strdup(session, un->un_value);
</del><ins>+                        } else if (!strcasecmp(un->un_name, "X-FS-Support")) {
+                                tech_pvt->x_freeswitch_support_remote = switch_core_session_strdup(session, un->un_value);
</ins><span class="cx">                         } else if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2)) {
</span><span class="cx">                                 if (!switch_strlen_zero(un->un_value)) {
</span><span class="cx">                                         char new_name[512] = "";
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_sofiasofia_gluec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (15185 => 15186)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c        2009-10-21 17:55:31 UTC (rev 15185)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c        2009-10-21 18:48:28 UTC (rev 15186)
</span><span class="lines">@@ -496,7 +496,7 @@
</span><span class="cx">                 tech_pvt->flags[x] = profile->flags[x];
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        tech_pvt->x_actually_support_local = SOFIA_ACTUALLY_SUPPORT;
</del><ins>+        tech_pvt->x_freeswitch_support_local = FREESWITCH_SUPPORT;
</ins><span class="cx">
</span><span class="cx">         tech_pvt->profile = profile;
</span><span class="cx">         profile->inuse++;
</span><span class="lines">@@ -1773,7 +1773,7 @@
</span><span class="cx">                          TAG_IF(!switch_strlen_zero(tech_pvt->privacy), SIPTAG_PRIVACY_STR(tech_pvt->privacy)),
</span><span class="cx">                          TAG_IF(!switch_strlen_zero(alert_info), SIPTAG_HEADER_STR(alert_info)),
</span><span class="cx">                          TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
</span><del>-                         SIPTAG_HEADER_STR("X-Actually-Support: "SOFIA_ACTUALLY_SUPPORT),
</del><ins>+                         SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT),
</ins><span class="cx">                          TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)),
</span><span class="cx">                          TAG_IF(!switch_strlen_zero(route_uri), NUTAG_PROXY(route_uri)),
</span><span class="cx">                          TAG_IF(!switch_strlen_zero(route), SIPTAG_ROUTE_STR(route)),
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_channelc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_channel.c (15185 => 15186)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_channel.c        2009-10-21 17:55:31 UTC (rev 15185)
+++ freeswitch/trunk/src/switch_channel.c        2009-10-21 18:48:28 UTC (rev 15186)
</span><span class="lines">@@ -2531,6 +2531,32 @@
</span><span class="cx">         return stream.data;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(switch_status_t) switch_channel_pass_callee_id(switch_channel_t *channel, switch_channel_t *other_channel)
+{
+        int x = 0;
+
+        switch_assert(channel);
+        switch_assert(other_channel);
+
+        switch_mutex_lock(channel->profile_mutex);
+        switch_mutex_lock(other_channel->profile_mutex);
+
+        if (!switch_strlen_zero(channel->caller_profile->callee_id_name)) {
+                other_channel->caller_profile->callee_id_name = switch_core_strdup(channel->caller_profile->pool, channel->caller_profile->callee_id_name);
+                x++;
+        }
+
+        if (!switch_strlen_zero(channel->caller_profile->callee_id_number)) {
+                other_channel->caller_profile->callee_id_number = switch_core_strdup(channel->caller_profile->pool, channel->caller_profile->callee_id_number);
+                x++;
+        }
+
+        switch_mutex_unlock(other_channel->profile_mutex);
+        switch_mutex_unlock(channel->profile_mutex);
+
+        return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
+}
+
</ins><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_channel_get_variables(switch_channel_t *channel, switch_event_t **event)
</span><span class="cx"> {
</span><span class="cx">         switch_status_t status;
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_core_sessionc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_core_session.c (15185 => 15186)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_core_session.c        2009-10-21 17:55:31 UTC (rev 15185)
+++ freeswitch/trunk/src/switch_core_session.c        2009-10-21 18:48:28 UTC (rev 15186)
</span><span class="lines">@@ -751,6 +751,11 @@
</span><span class="cx">         if (session->message_queue) {
</span><span class="cx">                 if ((status = (switch_status_t) switch_queue_trypop(session->message_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         *message = (switch_core_session_message_t *) pop;
</span><ins>+                        if ((*message)->delivery_time && (*message)->delivery_time > switch_epoch_time_now(NULL)) {
+                                switch_core_session_queue_message(session, *message);
+                                *message = NULL;
+                                status = SWITCH_STATUS_FALSE;
+                        }
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_ivr_bridgec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_ivr_bridge.c (15185 => 15186)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_ivr_bridge.c        2009-10-21 17:55:31 UTC (rev 15185)
+++ freeswitch/trunk/src/switch_ivr_bridge.c        2009-10-21 18:48:28 UTC (rev 15186)
</span><span class="lines">@@ -375,6 +375,7 @@
</span><span class="cx">                 if (!ans_a && originator) {
</span><span class="cx">
</span><span class="cx">                         if (!ans_b && switch_channel_test_flag(chan_b, CF_ANSWERED)) {
</span><ins>+                                switch_channel_pass_callee_id(chan_b, chan_a);
</ins><span class="cx">                                 if (switch_channel_answer(chan_a) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n", switch_channel_get_name(chan_a));
</span><span class="cx">                                         goto end_of_bridge_loop;
</span><span class="lines">@@ -397,6 +398,7 @@
</span><span class="cx">                         switch_channel_t *un = ans_a ? chan_b : chan_a;
</span><span class="cx">                         
</span><span class="cx">                         if (!switch_channel_test_flag(un, CF_OUTBOUND)) {
</span><ins>+                                switch_channel_pass_callee_id(un == chan_b ? chan_a : chan_b, un);
</ins><span class="cx">                                 if (switch_channel_answer(un) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n", switch_channel_get_name(un));
</span><span class="cx">                                         goto end_of_bridge_loop;
</span><span class="lines">@@ -920,6 +922,7 @@
</span><span class="cx">         switch_channel_add_state_handler(peer_channel, &audio_bridge_peer_state_handlers);
</span><span class="cx">
</span><span class="cx">         if (switch_channel_test_flag(peer_channel, CF_ANSWERED) && !switch_channel_test_flag(caller_channel, CF_ANSWERED)) {
</span><ins>+                switch_channel_pass_callee_id(peer_channel, caller_channel);
</ins><span class="cx">                 switch_channel_answer(caller_channel);
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_ivr_originatec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_ivr_originate.c (15185 => 15186)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_ivr_originate.c        2009-10-21 17:55:31 UTC (rev 15185)
+++ freeswitch/trunk/src/switch_ivr_originate.c        2009-10-21 18:48:28 UTC (rev 15186)
</span><span class="lines">@@ -385,6 +385,9 @@
</span><span class="cx">                         if (!oglobals->ring_ready) {
</span><span class="cx">                                 oglobals->ring_ready = 1;
</span><span class="cx">                                 if (caller_channel && !oglobals->ignore_ring_ready) {
</span><ins>+                                        if (len == 1) {
+                                                switch_channel_pass_callee_id(originate_status[0].peer_channel, caller_channel);
+                                        }
</ins><span class="cx">                                         switch_channel_ring_ready(caller_channel);
</span><span class="cx">                                         oglobals->sent_ring = 1;
</span><span class="cx">                                 }
</span><span class="lines">@@ -2321,6 +2324,7 @@
</span><span class="cx">
</span><span class="cx">                         if (caller_channel) {
</span><span class="cx">                                 if (switch_channel_test_flag(peer_channel, CF_ANSWERED)) {
</span><ins>+                                        switch_channel_pass_callee_id(peer_channel, caller_channel);
</ins><span class="cx">                                         status = switch_channel_answer(caller_channel);
</span><span class="cx">                                 } else if (switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA)) {
</span><span class="cx">                                         status = switch_channel_pre_answer(caller_channel);
</span><span class="lines">@@ -2561,7 +2565,7 @@
</span><span class="cx">
</span><span class="cx">         switch_safe_free(write_frame.data);
</span><span class="cx">         switch_safe_free(fail_on_single_reject_var);
</span><del>-
</del><ins>+        
</ins><span class="cx">         if (caller_channel) {
</span><span class="cx">                 switch_channel_clear_flag(caller_channel, CF_ORIGINATOR);
</span><span class="cx">                 switch_channel_clear_flag(caller_channel, CF_XFER_ZOMBIE);
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>