<!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-&gt;sr_offer_recv &amp;&amp; !sr0-&gt;sr_answer_sent))
</span><span class="cx">           break;
</span><span class="cx"> 
</span><del>-    if (nh-&gt;nh_soa &amp;&amp; overlap)
-      return nua_server_retry_after(sr, 500, &quot;Overlapping Offer/Answer&quot;, 1, 9);
</del><ins>+    if (nh-&gt;nh_soa &amp;&amp; overlap) {
+                return nua_server_retry_after(sr, 500, &quot;Overlapping Offer/Answer&quot;, 1, 9);
+        }
</ins><span class="cx"> 
</span><span class="cx">     if (nh-&gt;nh_soa &amp;&amp;
</span><span class="cx">         soa_set_remote_sdp(nh-&gt;nh_soa, NULL, sr-&gt;sr_sdp, sr-&gt;sr_sdp_len) &lt; 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-&gt;channel, &quot;sip_callee_id_name&quot;))) {
-                if (!(callee_number = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;sip_callee_id_number&quot;))) {
</del><ins>+        if (!(callee_name = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;sip_callee_id_name&quot;))) {
+                callee_name = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;callee_id_name&quot;);
+        }
+
+        if (!(callee_number = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;sip_callee_id_number&quot;))) {
+                if (!(callee_number = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;callee_id_number&quot;))) {
</ins><span class="cx">                         callee_number = tech_pvt-&gt;caller_profile-&gt;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, &quot;sip:%s@cluecon.com&quot;, callee_number);
-                        callee_number = tmp;
-                }
-
-                pai = switch_core_session_sprintf(tech_pvt-&gt;session, &quot;P-Asserted-Identity: \&quot;%s\&quot; &lt;%s&gt;&quot;, callee_name, callee_number);
</del><ins>+        if (callee_name &amp;&amp; callee_number) {
+                pai = switch_core_session_sprintf(tech_pvt-&gt;session, &quot;P-Asserted-Identity: \&quot;%s\&quot; &lt;%s&gt;\nX-FS-Display-Name: %s\nX-FS-Display-Number: %s\n&quot;, 
+                                                                                  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(&quot;cn telephone-event&quot;), 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(&quot;X-Actually-Support: &quot;SOFIA_ACTUALLY_SUPPORT),
</del><ins>+                                                        SIPTAG_HEADER_STR(&quot;X-FS-Support: &quot;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, &quot;3PCC-PROXY, Sent a 200 OK, waiting for ACK\n&quot;);
</span><span class="lines">@@ -572,7 +574,7 @@
</span><span class="cx">                                         SOATAG_USER_SDP_STR(tech_pvt-&gt;local_sdp_str),
</span><span class="cx">                                         SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX(&quot;cn telephone-event&quot;), 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(&quot;X-Actually-Support: &quot;SOFIA_ACTUALLY_SUPPORT),
</del><ins>+                                        SIPTAG_HEADER_STR(&quot;X-FS-Support: &quot;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-&gt;caller_profile-&gt;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, &quot;sip_callee_id_name&quot;, name);
-                                        switch_channel_set_variable(channel, &quot;sip_callee_id_number&quot;, number);
-                                } else {
</del><ins>+                                if (switch_channel_test_flag(channel, CF_ANSWERED) &amp;&amp; !sofia_test_flag(tech_pvt, TFLAG_UPDATING_DISPLAY)) {
</ins><span class="cx">                                         if (switch_strlen_zero(tech_pvt-&gt;last_sent_callee_id_name) || strcmp(tech_pvt-&gt;last_sent_callee_id_name, name) ||
</span><span class="cx">                                                 switch_strlen_zero(tech_pvt-&gt;last_sent_callee_id_number) || strcmp(tech_pvt-&gt;last_sent_callee_id_number, number)) {
</span><del>-                                        
-                                                if (ua &amp;&amp; switch_stristr(&quot;snom&quot;, ua)) {
</del><ins>+                                                
+                                                if (switch_stristr(&quot;update_display&quot;, tech_pvt-&gt;x_freeswitch_support_remote)) {
+                                                        snprintf(message, sizeof(message), &quot;X-FS-Display-Name: %s\nX-FS-Display-Number: %s\n&quot;, name, number);
+
+                                                        nua_info(tech_pvt-&gt;nh, SIPTAG_CONTENT_TYPE_STR(&quot;message/update_display&quot;),
+                                                                         TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),
+                                                                         TAG_IF(!switch_strlen_zero(tech_pvt-&gt;user_via), SIPTAG_VIA_STR(tech_pvt-&gt;user_via)),
+                                                                         TAG_END());
+                                                } else if (ua &amp;&amp; switch_stristr(&quot;snom&quot;, ua)) {
</ins><span class="cx">                                                         snprintf(message, sizeof(message), &quot;From:\r\nTo: \&quot;%s\&quot; %s\r\n&quot;, name, number);
</span><span class="cx">                                                         nua_info(tech_pvt-&gt;nh, SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag&quot;),
</span><span class="cx">                                                                          TAG_IF(!switch_strlen_zero(tech_pvt-&gt;user_via), SIPTAG_VIA_STR(tech_pvt-&gt;user_via)),
</span><span class="cx">                                                                          SIPTAG_PAYLOAD_STR(message), TAG_END());
</span><del>-                                                } else if ((ua &amp;&amp; (switch_stristr(&quot;polycom&quot;, ua) ||
-                                                                                   switch_stristr(&quot;UPDATE&quot;, tech_pvt-&gt;x_actually_support_remote)))) {
</del><ins>+                                                } else if ((ua &amp;&amp; (switch_stristr(&quot;polycom&quot;, ua)))) {
</ins><span class="cx">                                                         snprintf(message, sizeof(message), &quot;P-Asserted-Identity: \&quot;%s\&quot; &lt;%s&gt;&quot;, name, number);
</span><ins>+                                                        sofia_set_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY);
</ins><span class="cx">                                                         nua_update(tech_pvt-&gt;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-&gt;user_via), SIPTAG_VIA_STR(tech_pvt-&gt;user_via)),
</span><span class="lines">@@ -1519,7 +1525,7 @@
</span><span class="cx">                                                 SIPTAG_CONTACT_STR(tech_pvt-&gt;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(&quot;X-Actually-Support: &quot;SOFIA_ACTUALLY_SUPPORT),
</del><ins>+                                                SIPTAG_HEADER_STR(&quot;X-FS-Support: &quot;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-&gt;adv_sdp_audio_ip),
</span><span class="cx">                                                                 SOATAG_USER_SDP_STR(tech_pvt-&gt;local_sdp_str), SOATAG_AUDIO_AUX(&quot;cn telephone-event&quot;), 
</span><span class="cx">                                                                 TAG_IF(!switch_strlen_zero(extra_header), SIPTAG_HEADER_STR(extra_header)),
</span><del>-                                                                SIPTAG_HEADER_STR(&quot;X-Actually-Support: &quot;SOFIA_ACTUALLY_SUPPORT),
</del><ins>+                                                                SIPTAG_HEADER_STR(&quot;X-FS-Support: &quot;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 &quot;sip_secure_media_confirmed&quot;
</span><span class="cx"> #define SOFIA_HAS_CRYPTO_VARIABLE &quot;sip_has_crypto&quot;
</span><span class="cx"> #define SOFIA_CRYPTO_MANDATORY_VARIABLE &quot;sip_crypto_mandatory&quot;
</span><del>-#define SOFIA_ACTUALLY_SUPPORT &quot;UPDATE&quot;
</del><ins>+#define FREESWITCH_SUPPORT &quot;update_display&quot;
</ins><span class="cx"> 
</span><span class="cx"> #include &lt;sofia-sip/nua.h&gt;
</span><span class="cx"> #include &lt;sofia-sip/sip_status.h&gt;
</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 = &quot;unknown&quot;;
</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)) &amp;&amp; (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, &quot;callee_id_name&quot;, name);
+                //switch_channel_set_profile_var(channel_b, &quot;callee_id_number&quot;, 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-&gt;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 = &quot;unknown&quot;;
</del><ins>+        char *name = NULL;
</ins><span class="cx">         const char *number = &quot;unknown&quot;, *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-&gt;sip_to) {
</span><span class="cx">                 number = sip-&gt;sip_to-&gt;a_url-&gt;url_user;
</span><span class="cx">         }
</span><del>-        
-        if ((passerted = sip_p_asserted_identity(sip))) {
-                if (passerted-&gt;paid_url &amp;&amp; passerted-&gt;paid_url-&gt;url_user) {
-                        number = passerted-&gt;paid_url-&gt;url_user;
-                }
-                if (!switch_strlen_zero(passerted-&gt;paid_display)) {
-                        dup = strdup(passerted-&gt;paid_display);
-                        if (*dup == '&quot;') {
-                                name = dup + 1;
-                        } else {
-                                name = dup;
</del><ins>+
+        if ((val = sofia_glue_get_unknown_header(sip, &quot;X-FS-Display-Number&quot;))) {
+                number = val;
+                fs++;
+        }
+
+        if ((val = sofia_glue_get_unknown_header(sip, &quot;X-FS-Display-Name&quot;))) {
+                name = (char *)val;
+                fs++;
+        }
+
+        if (!fs) {
+                if ((passerted = sip_p_asserted_identity(sip))) {
+                        if (passerted-&gt;paid_url &amp;&amp; passerted-&gt;paid_url-&gt;url_user) {
+                                number = passerted-&gt;paid_url-&gt;url_user;
</ins><span class="cx">                         }
</span><del>-                        if (end_of(name) == '&quot;') {
-                                end_of(name) = '\0';
</del><ins>+                        if (!switch_strlen_zero(passerted-&gt;paid_display)) {
+                                dup = strdup(passerted-&gt;paid_display);
+                                if (*dup == '&quot;') {
+                                        name = dup + 1;
+                                } else {
+                                        name = dup;
+                                }
+                                if (end_of(name) == '&quot;') {
+                                        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, &quot;sip_callee_id_name&quot;))) {
</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(&amp;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, &quot;Direction&quot;, &quot;RECV&quot;);
</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 &amp;&amp; tech_pvt &amp;&amp; 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-&gt;mflags &amp; MFLAG_REGISTER), NUTAG_ALLOW(&quot;REGISTER&quot;)),
</span><span class="cx">                                    TAG_IF((profile-&gt;mflags &amp; MFLAG_REFER), NUTAG_ALLOW(&quot;REFER&quot;)),
</span><del>-                                   TAG_IF((profile-&gt;mflags &amp; MFLAG_UPDATE), NUTAG_ALLOW(&quot;UPDATE&quot;)),
</del><ins>+                                   //TAG_IF((profile-&gt;mflags &amp; MFLAG_UPDATE), NUTAG_ALLOW(&quot;UPDATE&quot;)),
</ins><span class="cx">                                    TAG_IF(!sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_ALLOW(&quot;PRACK&quot;)),
</span><span class="cx">                                    NUTAG_ALLOW(&quot;INFO&quot;),
</span><span class="cx">                                    NUTAG_ALLOW(&quot;NOTIFY&quot;),
</span><span class="lines">@@ -1069,7 +1092,7 @@
</span><span class="cx">                                            NUTAG_AUTOALERT(0),
</span><span class="cx">                                            TAG_IF((profile-&gt;mflags &amp; MFLAG_REGISTER), NUTAG_ALLOW(&quot;REGISTER&quot;)),
</span><span class="cx">                                            TAG_IF((profile-&gt;mflags &amp; MFLAG_REFER), NUTAG_ALLOW(&quot;REFER&quot;)),
</span><del>-                                           TAG_IF((profile-&gt;mflags &amp; MFLAG_UPDATE), NUTAG_ALLOW(&quot;UPDATE&quot;)),
</del><ins>+                                           //TAG_IF((profile-&gt;mflags &amp; MFLAG_UPDATE), NUTAG_ALLOW(&quot;UPDATE&quot;)),
</ins><span class="cx">                                            NUTAG_ALLOW(&quot;INFO&quot;),
</span><span class="cx">                                            TAG_IF(profile-&gt;pres_type, NUTAG_ALLOW(&quot;PUBLISH&quot;)),
</span><span class="cx">                                            TAG_IF(profile-&gt;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, &quot;X-Actually-Support&quot;))) {
-                                tech_pvt-&gt;x_actually_support_remote = switch_core_session_strdup(session, x_actually_support);
</del><ins>+                        if ((x_freeswitch_support = sofia_glue_get_unknown_header(sip, &quot;X-FS-Support&quot;))) {
+                                tech_pvt-&gt;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-&gt;sip_user_agent &amp;&amp; sip-&gt;sip_user_agent-&gt;g_string) {
</span><span class="lines">@@ -4603,6 +4626,8 @@
</span><span class="cx">                         } else if (!strncasecmp(sip-&gt;sip_content_type-&gt;c_type, &quot;application&quot;, 11) &amp;&amp; !strcasecmp(sip-&gt;sip_content_type-&gt;c_subtype, &quot;dtmf&quot;)) {
</span><span class="cx">                                 int tmp = atoi(sip-&gt;sip_payload-&gt;pl_data);
</span><span class="cx">                                 dtmf.digit = switch_rfc2833_to_char(tmp);
</span><ins>+                        } else if (!strncasecmp(sip-&gt;sip_content_type-&gt;c_type, &quot;message&quot;, 11) &amp;&amp; !strcasecmp(sip-&gt;sip_content_type-&gt;c_subtype, &quot;update_display&quot;)) {
+                                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-&gt;un_name, &quot;History-Info&quot;, 12)) {
</span><span class="cx">                                 switch_channel_set_variable(channel, &quot;sip_history_info&quot;, un-&gt;un_value);
</span><del>-                        } else if (!strcasecmp(un-&gt;un_name, &quot;X-Actually-Support&quot;)) {
-                                tech_pvt-&gt;x_actually_support_remote = switch_core_session_strdup(session, un-&gt;un_value);
</del><ins>+                        } else if (!strcasecmp(un-&gt;un_name, &quot;X-FS-Support&quot;)) {
+                                tech_pvt-&gt;x_freeswitch_support_remote = switch_core_session_strdup(session, un-&gt;un_value);
</ins><span class="cx">                         } else if (!strncasecmp(un-&gt;un_name, &quot;X-&quot;, 2) || !strncasecmp(un-&gt;un_name, &quot;P-&quot;, 2)) {
</span><span class="cx">                                 if (!switch_strlen_zero(un-&gt;un_value)) {
</span><span class="cx">                                         char new_name[512] = &quot;&quot;;
</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-&gt;flags[x] = profile-&gt;flags[x];
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        tech_pvt-&gt;x_actually_support_local = SOFIA_ACTUALLY_SUPPORT;
</del><ins>+        tech_pvt-&gt;x_freeswitch_support_local = FREESWITCH_SUPPORT;
</ins><span class="cx"> 
</span><span class="cx">         tech_pvt-&gt;profile = profile;
</span><span class="cx">         profile-&gt;inuse++;
</span><span class="lines">@@ -1773,7 +1773,7 @@
</span><span class="cx">                            TAG_IF(!switch_strlen_zero(tech_pvt-&gt;privacy), SIPTAG_PRIVACY_STR(tech_pvt-&gt;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(&quot;X-Actually-Support: &quot;SOFIA_ACTUALLY_SUPPORT),
</del><ins>+                           SIPTAG_HEADER_STR(&quot;X-FS-Support: &quot;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-&gt;profile_mutex);
+        switch_mutex_lock(other_channel-&gt;profile_mutex);
+
+        if (!switch_strlen_zero(channel-&gt;caller_profile-&gt;callee_id_name)) {
+                other_channel-&gt;caller_profile-&gt;callee_id_name = switch_core_strdup(channel-&gt;caller_profile-&gt;pool, channel-&gt;caller_profile-&gt;callee_id_name);
+                x++;
+        }
+
+        if (!switch_strlen_zero(channel-&gt;caller_profile-&gt;callee_id_number)) {
+                other_channel-&gt;caller_profile-&gt;callee_id_number = switch_core_strdup(channel-&gt;caller_profile-&gt;pool, channel-&gt;caller_profile-&gt;callee_id_number);
+                x++;
+        }
+
+        switch_mutex_unlock(other_channel-&gt;profile_mutex);
+        switch_mutex_unlock(channel-&gt;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-&gt;message_queue) {
</span><span class="cx">                 if ((status = (switch_status_t) switch_queue_trypop(session-&gt;message_queue, &amp;pop)) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         *message = (switch_core_session_message_t *) pop;
</span><ins>+                        if ((*message)-&gt;delivery_time &amp;&amp; (*message)-&gt;delivery_time &gt; 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 &amp;&amp; originator) {
</span><span class="cx"> 
</span><span class="cx">                         if (!ans_b &amp;&amp; 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, &quot;%s Media Establishment Failed.\n&quot;, 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, &quot;%s Media Establishment Failed.\n&quot;, 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, &amp;audio_bridge_peer_state_handlers);
</span><span class="cx"> 
</span><span class="cx">         if (switch_channel_test_flag(peer_channel, CF_ANSWERED) &amp;&amp; !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-&gt;ring_ready) {
</span><span class="cx">                                 oglobals-&gt;ring_ready = 1;
</span><span class="cx">                                 if (caller_channel &amp;&amp; !oglobals-&gt;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-&gt;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>