<!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][16445] </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=16445">16445</a></dd>
<dt>Author</dt> <dd>anthm</dd>
<dt>Date</dt> <dd>2010-01-21 18:51:32 -0600 (Thu, 21 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>try this darren</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcincludeswitch_typesh">freeswitch/trunk/src/include/switch_types.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_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_core_codecc">freeswitch/trunk/src/switch_core_codec.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_core_rwlockc">freeswitch/trunk/src/switch_core_rwlock.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_ivrc">freeswitch/trunk/src/switch_ivr.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="freeswitchtrunksrcincludeswitch_typesh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_types.h (16444 => 16445)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_types.h        2010-01-22 00:31:43 UTC (rev 16444)
+++ freeswitch/trunk/src/include/switch_types.h        2010-01-22 00:51:32 UTC (rev 16445)
</span><span class="lines">@@ -955,6 +955,7 @@
</span><span class="cx">         CF_LEG_HOLDING,
</span><span class="cx">         CF_BROADCAST_DROP_MEDIA,
</span><span class="cx">         CF_EARLY_HANGUP,
</span><ins>+        CF_MEDIA_SET,
</ins><span class="cx">         /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
</span><span class="cx">         CF_FLAG_MAX
</span><span class="cx"> } switch_channel_flag_t;
</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 (16444 => 16445)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c        2010-01-22 00:31:43 UTC (rev 16444)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c        2010-01-22 00:51:32 UTC (rev 16445)
</span><span class="lines">@@ -1410,7 +1410,6 @@
</span><span class="cx">                         if (!(switch_channel_test_flag(channel, CF_ANSWERED) || switch_channel_test_flag(channel, CF_EARLY_MEDIA))) {
</span><span class="cx">                                 if (!switch_channel_test_flag(tech_pvt-&gt;channel, CF_OUTBOUND)) {
</span><span class="cx">                                         const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
</span><del>-
</del><span class="cx">                                         tech_pvt-&gt;num_codecs = 0;
</span><span class="cx">                                         sofia_glue_tech_prepare_codecs(tech_pvt);
</span><span class="cx">                                         if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_sofiasofiac"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (16444 => 16445)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c        2010-01-22 00:31:43 UTC (rev 16444)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c        2010-01-22 00:51:32 UTC (rev 16445)
</span><span class="lines">@@ -4300,6 +4300,7 @@
</span><span class="cx">                                                                         if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                                                                 switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, &quot;CODEC NEGOTIATION ERROR&quot;);
</span><span class="cx">                                                                                 status = SWITCH_STATUS_FALSE;
</span><ins>+                                                                                switch_core_session_rwunlock(other_session);
</ins><span class="cx">                                                                                 goto done;
</span><span class="cx">                                                                         }
</span><span class="cx">                                                                 }
</span><span class="lines">@@ -4309,6 +4310,7 @@
</span><span class="cx">                                                                 sofia_glue_tech_prepare_codecs(tech_pvt);
</span><span class="cx">                                                                 if ((status = sofia_glue_tech_choose_port(tech_pvt, 0)) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                                                         switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
</span><ins>+                                                                        switch_core_session_rwunlock(other_session);
</ins><span class="cx">                                                                         goto done;
</span><span class="cx">                                                                 }
</span><span class="cx">                                                         }
</span><span class="lines">@@ -4715,8 +4717,9 @@
</span><span class="cx"> 
</span><span class="cx">                         nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;messsage/sipfrag&quot;),
</span><span class="cx">                                            NUTAG_SUBSTATE(nua_substate_terminated),
</span><del>-                                           SIPTAG_PAYLOAD_STR(status == SWITCH_STATUS_SUCCESS ? &quot;SIP/2.0 200 OK&quot;: 
-                                                                                  &quot;SIP/2.0 403 Forbidden&quot;), SIPTAG_EVENT_STR(nhelper-&gt;event), TAG_END());
</del><ins>+                                           SIPTAG_HEADER_STR(status == SWITCH_STATUS_SUCCESS ? &quot;Status-Line: SIP/2.0 200 OK\n&quot; : &quot;Status-Line: SIP/2.0 403 Forbidden\n&quot;),
+                                           SIPTAG_PAYLOAD_STR(status == SWITCH_STATUS_SUCCESS ? &quot;SIP/2.0 200 OK\r\n&quot;: 
+                                                                                  &quot;SIP/2.0 403 Forbidden\r\n&quot;), SIPTAG_EVENT_STR(nhelper-&gt;event), TAG_END());
</ins><span class="cx"> 
</span><span class="cx">                         switch_core_session_rwunlock(session);
</span><span class="cx">                 }
</span><span class="lines">@@ -4962,8 +4965,8 @@
</span><span class="cx">                                                                 
</span><span class="cx">                                                                 switch_core_session_rwunlock(a_session);
</span><span class="cx"> 
</span><del>-                                                                nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag&quot;),
-                                                                                   NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 200 OK&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</del><ins>+                                                                nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag;version=2.0&quot;),
+                                                                                   NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 200 OK\r\n&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</ins><span class="cx">                                                                 
</span><span class="cx">                                                                 if (b_tech_pvt &amp;&amp; !sofia_test_flag(b_tech_pvt, TFLAG_BYE)) {
</span><span class="cx">                                                                         char* q850 = NULL;
</span><span class="lines">@@ -4981,9 +4984,9 @@
</span><span class="cx">                                                                 
</span><span class="cx">                                                                 }
</span><span class="cx">                                                         } else {
</span><del>-                                                                nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag&quot;),
</del><ins>+                                                                nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag;version=2.0&quot;),
</ins><span class="cx">                                                                                    NUTAG_SUBSTATE(nua_substate_terminated),
</span><del>-                                                                                   SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 403 Forbidden&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</del><ins>+                                                                                   SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 403 Forbidden\r\n&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</ins><span class="cx">                                                         }
</span><span class="cx"> 
</span><span class="cx">                                                 } else if (br_a &amp;&amp; br_b) {
</span><span class="lines">@@ -5001,8 +5004,8 @@
</span><span class="cx">                                                         
</span><span class="cx">                                                         switch_ivr_uuid_bridge(br_b, br_a);
</span><span class="cx">                                                         switch_channel_set_variable(channel_b, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, &quot;ATTENDED_TRANSFER&quot;);
</span><del>-                                                        nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag&quot;),
-                                                                           NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 200 OK&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</del><ins>+                                                        nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag;version=2.0&quot;),
+                                                                           NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 200 OK\r\n&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</ins><span class="cx"> 
</span><span class="cx">                                                         sofia_clear_flag_locked(b_tech_pvt, TFLAG_SIP_HOLD);
</span><span class="cx">                                                         switch_channel_clear_flag(channel_b, CF_LEG_HOLDING);
</span><span class="lines">@@ -5013,9 +5016,9 @@
</span><span class="cx">                                                 } else {
</span><span class="cx">                                                         if (!br_a &amp;&amp; !br_b) {
</span><span class="cx">                                                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, &quot;Cannot transfer channels that are not in a bridge.\n&quot;);
</span><del>-                                                                nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag&quot;),
</del><ins>+                                                                nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag;version=2.0&quot;),
</ins><span class="cx">                                                                                    NUTAG_SUBSTATE(nua_substate_terminated),
</span><del>-                                                                                   SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 403 Forbidden&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</del><ins>+                                                                                   SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 403 Forbidden\r\n&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</ins><span class="cx">                                                         } else {
</span><span class="cx">                                                                 switch_core_session_t *t_session;
</span><span class="cx">                                                                 switch_channel_t *hup_channel;
</span><span class="lines">@@ -5056,16 +5059,16 @@
</span><span class="cx">                                                                         
</span><span class="cx">                                                                         nua_notify(tech_pvt-&gt;nh,
</span><span class="cx">                                                                                            NUTAG_NEWSUB(1),
</span><del>-                                                                                           SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag&quot;),
</del><ins>+                                                                                           SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag;version=2.0&quot;),
</ins><span class="cx">                                                                                            NUTAG_SUBSTATE(nua_substate_terminated),
</span><del>-                                                                                           SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 200 OK&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</del><ins>+                                                                                           SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 200 OK\r\n&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</ins><span class="cx">                                                                         switch_core_session_rwunlock(t_session);
</span><span class="cx">                                                                         switch_channel_hangup(hup_channel, SWITCH_CAUSE_ATTENDED_TRANSFER);
</span><span class="cx">                                                                 } else {
</span><span class="cx">                                                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, &quot;Session to transfer to not found.\n&quot;);
</span><del>-                                                                        nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag&quot;),
</del><ins>+                                                                        nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag;version=2.0&quot;),
</ins><span class="cx">                                                                                            NUTAG_SUBSTATE(nua_substate_terminated),
</span><del>-                                                                                           SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 403 Forbidden&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</del><ins>+                                                                                           SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 403 Forbidden\r\n&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</ins><span class="cx">                                                                 }
</span><span class="cx">                                                         }
</span><span class="cx">                                                 }
</span><span class="lines">@@ -5150,8 +5153,8 @@
</span><span class="cx">                                           error:
</span><span class="cx">                                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, &quot;Invalid Transfer! [%s]\n&quot;, br_a);
</span><span class="cx">                                                 switch_channel_set_variable(channel_a, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, &quot;ATTENDED_TRANSFER_ERROR&quot;);
</span><del>-                                                nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag&quot;),
-                                                                   NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 403 Forbidden&quot;), SIPTAG_EVENT_STR(etmp),
</del><ins>+                                                nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag;version=2.0&quot;),
+                                                                   NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 403 Forbidden\r\n&quot;), SIPTAG_EVENT_STR(etmp),
</ins><span class="cx">                                                                    TAG_END());
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="lines">@@ -5188,14 +5191,14 @@
</span><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, &quot;BLIND_TRANSFER&quot;);
</span><del>-                        nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag&quot;),
-                                           NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 200 OK&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</del><ins>+                        nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag;version=2.0&quot;),
+                                           NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 200 OK\r\n&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</ins><span class="cx"> 
</span><span class="cx">                 } else {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, &quot;Cannot Blind Transfer 1 Legged calls\n&quot;);
</span><span class="cx">                         switch_channel_set_variable(channel_a, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, &quot;ATTENDED_TRANSFER_ERROR&quot;);
</span><del>-                        nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag&quot;),
-                                           NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 403 Forbidden&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</del><ins>+                        nua_notify(tech_pvt-&gt;nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag;version=2.0&quot;),
+                                           NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR(&quot;SIP/2.0 403 Forbidden\r\n&quot;), SIPTAG_EVENT_STR(etmp), TAG_END());
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -6441,7 +6444,7 @@
</span><span class="cx">                                         snprintf(message, sizeof(message), &quot;From:\r\nTo: \&quot;%s\&quot; %s\r\n&quot;, acp-&gt;caller_id_name, acp-&gt;caller_id_number);
</span><span class="cx">                                 }
</span><span class="cx">                                 nua_info(b_tech_pvt-&gt;nh,
</span><del>-                                                 SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag&quot;),
</del><ins>+                                                 SIPTAG_CONTENT_TYPE_STR(&quot;message/sipfrag;version=2.0&quot;),
</ins><span class="cx">                                                  TAG_IF(!zstr(b_tech_pvt-&gt;user_via), SIPTAG_VIA_STR(b_tech_pvt-&gt;user_via)),
</span><span class="cx">                                                  SIPTAG_PAYLOAD_STR(message), TAG_END());
</span><span class="cx">                         } else if (ua &amp;&amp; switch_stristr(&quot;polycom&quot;, ua)) {
</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 (16444 => 16445)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c        2010-01-22 00:31:43 UTC (rev 16444)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c        2010-01-22 00:51:32 UTC (rev 16445)
</span><span class="lines">@@ -1459,6 +1459,7 @@
</span><span class="cx">         max_forwards = switch_channel_get_variable(channel, SWITCH_MAX_FORWARDS_VARIABLE);
</span><span class="cx"> 
</span><span class="cx">         if ((status = sofia_glue_tech_choose_port(tech_pvt, 0)) != SWITCH_STATUS_SUCCESS) {
</span><ins>+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_ERROR, &quot;Port Error!\n&quot;);
</ins><span class="cx">                 return status;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -1803,6 +1804,8 @@
</span><span class="cx">                 tech_pvt-&gt;route_uri = switch_core_session_strdup(tech_pvt-&gt;session, route_uri);
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        switch_channel_clear_flag(channel, CF_MEDIA_ACK);
+
</ins><span class="cx">         if (sofia_use_soa(tech_pvt)) {
</span><span class="cx">                 nua_invite(tech_pvt-&gt;nh,
</span><span class="cx">                                    NUTAG_AUTOANSWER(0),
</span><span class="lines">@@ -2201,6 +2204,7 @@
</span><span class="cx">                 switch_core_session_unlock_codec_read(tech_pvt-&gt;session);
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx">         return status;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_core_codecc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_core_codec.c (16444 => 16445)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_core_codec.c        2010-01-22 00:31:43 UTC (rev 16444)
+++ freeswitch/trunk/src/switch_core_codec.c        2010-01-22 00:51:32 UTC (rev 16445)
</span><span class="lines">@@ -167,6 +167,10 @@
</span><span class="cx"> 
</span><span class="cx">  end:
</span><span class="cx"> 
</span><ins>+        if (session-&gt;read_codec) {
+                switch_channel_set_flag(channel, CF_MEDIA_SET);
+        }
+
</ins><span class="cx">         switch_mutex_unlock(session-&gt;codec_read_mutex);
</span><span class="cx">         return status;
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_core_rwlockc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_core_rwlock.c (16444 => 16445)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_core_rwlock.c        2010-01-22 00:31:43 UTC (rev 16444)
+++ freeswitch/trunk/src/switch_core_rwlock.c        2010-01-22 00:51:32 UTC (rev 16445)
</span><span class="lines">@@ -47,7 +47,17 @@
</span><span class="cx">         if (session-&gt;rwlock) {
</span><span class="cx">                 if (switch_test_flag(session, SSF_DESTROYED) || switch_channel_down(session-&gt;channel)) {
</span><span class="cx">                         status = SWITCH_STATUS_FALSE;
</span><ins>+                        if (switch_thread_rwlock_tryrdlock(session-&gt;rwlock) == SWITCH_STATUS_SUCCESS) {
+                                if (switch_channel_test_flag(session-&gt;channel, CF_THREAD_SLEEPING)) {
</ins><span class="cx"> #ifdef SWITCH_DEBUG_RWLOCKS
</span><ins>+                                        switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_core_session_get_uuid(session), SWITCH_LOG_ERROR, &quot;%s Ping thread\n&quot;,
+                                                                          switch_channel_get_name(session-&gt;channel));
+#endif
+                                        switch_core_session_wake_session_thread(session);
+                                }
+                                switch_thread_rwlock_unlock(session-&gt;rwlock);
+                        }
+#ifdef SWITCH_DEBUG_RWLOCKS
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_core_session_get_uuid(session), SWITCH_LOG_ERROR, &quot;%s Read lock FAIL\n&quot;,
</span><span class="cx">                                                           switch_channel_get_name(session-&gt;channel));
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_ivrc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_ivr.c (16444 => 16445)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_ivr.c        2010-01-22 00:31:43 UTC (rev 16444)
+++ freeswitch/trunk/src/switch_ivr.c        2010-01-22 00:51:32 UTC (rev 16445)
</span><span class="lines">@@ -1202,8 +1202,11 @@
</span><span class="cx">                                 switch_channel_wait_for_flag(channel, CF_REQ_MEDIA, SWITCH_FALSE, 250, NULL);
</span><span class="cx">                                 switch_yield(250000);
</span><span class="cx">                         } else {
</span><ins>+                                switch_status_t st;
</ins><span class="cx">                                 switch_channel_wait_for_flag(channel, CF_REQ_MEDIA, SWITCH_FALSE, 10000, NULL);
</span><del>-                                switch_core_session_read_frame(session, &amp;read_frame, SWITCH_IO_FLAG_NONE, 0);
</del><ins>+                                switch_channel_wait_for_flag(channel, CF_MEDIA_ACK, SWITCH_TRUE, 10000, NULL);
+                                switch_channel_wait_for_flag(channel, CF_MEDIA_SET, SWITCH_TRUE, 10000, NULL);
+                                st = switch_core_session_read_frame(session, &amp;read_frame, SWITCH_IO_FLAG_NONE, 0);
</ins><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         if ((flags &amp; SMF_REBRIDGE)
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_ivr_bridgec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_ivr_bridge.c (16444 => 16445)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_ivr_bridge.c        2010-01-22 00:31:43 UTC (rev 16444)
+++ freeswitch/trunk/src/switch_ivr_bridge.c        2010-01-22 00:51:32 UTC (rev 16445)
</span><span class="lines">@@ -33,6 +33,8 @@
</span><span class="cx"> #define DEFAULT_LEAD_FRAMES 5
</span><span class="cx"> 
</span><span class="cx"> static const switch_state_handler_table_t audio_bridge_peer_state_handlers;
</span><ins>+static void cleanup_proxy_mode_a(switch_core_session_t *session);
+static void cleanup_proxy_mode_b(switch_core_session_t *session);
</ins><span class="cx"> 
</span><span class="cx"> /* Bridge Related Stuff*/
</span><span class="cx"> /*********************************************************************************/
</span><span class="lines">@@ -693,6 +695,8 @@
</span><span class="cx"> 
</span><span class="cx">         switch_channel_clear_flag(channel, CF_ORIGINATING);
</span><span class="cx"> 
</span><ins>+        cleanup_proxy_mode_b(session);
+
</ins><span class="cx">         if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) {
</span><span class="cx">                 switch_channel_set_state(channel, CS_SOFT_EXECUTE);
</span><span class="cx">         }
</span><span class="lines">@@ -780,7 +784,8 @@
</span><span class="cx">                         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, &quot;Application-Data&quot;, switch_core_session_get_uuid(session));
</span><span class="cx">                         switch_event_fire(&amp;event);
</span><span class="cx">                 }
</span><del>-
</del><ins>+                printf(&quot;DAMMIT %d %d   %d %d\n&quot;, switch_channel_ready(channel), switch_channel_ready(other_channel), 
+                           switch_channel_media_ready(channel), switch_channel_media_ready(other_channel));
</ins><span class="cx">                 switch_ivr_multi_threaded_bridge(session, other_session, NULL, NULL, NULL);
</span><span class="cx">                 
</span><span class="cx">                 state = switch_channel_get_state(channel);
</span><span class="lines">@@ -1197,8 +1202,19 @@
</span><span class="cx">         return status;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void cleanup_proxy_mode(switch_core_session_t *session)
</del><ins>+static void cleanup_proxy_mode_b(switch_core_session_t *session)
</ins><span class="cx"> {
</span><ins>+        switch_channel_t *channel = switch_core_session_get_channel(session);
+
+
+        if (switch_channel_test_flag(channel, CF_PROXY_MODE)) {
+                switch_ivr_media(switch_core_session_get_uuid(session), SMF_NONE);
+        }
+}
+
+
+static void cleanup_proxy_mode_a(switch_core_session_t *session)
+{
</ins><span class="cx">         switch_core_session_t *sbsession;
</span><span class="cx"> 
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="lines">@@ -1206,10 +1222,6 @@
</span><span class="cx"> 
</span><span class="cx">         if (switch_channel_test_flag(channel, CF_PROXY_MODE)) {
</span><span class="cx">                 const char *sbv = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
</span><del>-                
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;Restore media to %s\n&quot;, switch_channel_get_name(channel));
-                switch_ivr_media(switch_core_session_get_uuid(session), SMF_IMMEDIATE);
-
</del><span class="cx">                 if (!zstr(sbv) &amp;&amp; (sbsession = switch_core_session_locate(sbv))) {
</span><span class="cx">                         switch_channel_t *sbchannel = switch_core_session_get_channel(sbsession);
</span><span class="cx">                         switch_channel_hangup(sbchannel, SWITCH_CAUSE_ATTENDED_TRANSFER);
</span><span class="lines">@@ -1262,8 +1274,8 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx"> 
</span><del>-                        cleanup_proxy_mode(originator_session);
-                        cleanup_proxy_mode(originatee_session);
</del><ins>+                        cleanup_proxy_mode_a(originator_session);
+                        cleanup_proxy_mode_a(originatee_session);
</ins><span class="cx">                         
</span><span class="cx">                         /* override transmit state for originator_channel to bridge to originatee_channel 
</span><span class="cx">                          * install pointer to originatee_session into originator_channel
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_ivr_originatec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_ivr_originate.c (16444 => 16445)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_ivr_originate.c        2010-01-22 00:31:43 UTC (rev 16444)
+++ freeswitch/trunk/src/switch_ivr_originate.c        2010-01-22 00:51:32 UTC (rev 16445)
</span><span class="lines">@@ -2988,7 +2988,6 @@
</span><span class="cx">                                                         switch_channel_set_variable(switch_core_session_get_channel(holding_session), SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE, &quot;true&quot;);
</span><span class="cx">                                                         switch_core_session_rwunlock(holding_session);
</span><span class="cx">                                                 }
</span><del>-                                                
</del><span class="cx">                                                 switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(peer_session));
</span><span class="cx">                                                 holding = NULL;
</span><span class="cx">                                                 oglobals.idx = IDX_NADA;
</span><span class="lines">@@ -3055,7 +3054,6 @@
</span><span class="cx">                                                                 switch_channel_set_variable(switch_core_session_get_channel(holding_session), SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE, &quot;true&quot;);
</span><span class="cx">                                                                 switch_core_session_rwunlock(holding_session);
</span><span class="cx">                                                         }
</span><del>-                                                        
</del><span class="cx">                             switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(originate_status[i].peer_session));
</span><span class="cx">                                                         holding = NULL;
</span><span class="cx">                         } else {
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>