<!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][16426] </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=16426">16426</a></dd>
<dt>Author</dt> <dd>anthm</dd>
<dt>Date</dt> <dd>2010-01-20 18:12:24 -0600 (Wed, 20 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>you should get more than a steak dinner if you can make asterisk do this</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_dptoolsmod_dptoolsc">freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c</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_sofiasofia_gluec">freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_sofiasofia_regc">freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_channelc">freeswitch/trunk/src/switch_channel.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="freeswitchtrunksrcmodapplicationsmod_dptoolsmod_dptoolsc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (16425 => 16426)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c        2010-01-20 20:34:21 UTC (rev 16425)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c        2010-01-21 00:12:24 UTC (rev 16426)
</span><span class="lines">@@ -703,8 +703,6 @@
</span><span class="cx"> SWITCH_STANDARD_APP(answer_function)
</span><span class="cx"> {
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><del>-        switch_channel_clear_flag(channel, CF_PROXY_MEDIA);
-        switch_channel_clear_flag(channel, CF_PROXY_MODE);
</del><span class="cx">         switch_channel_answer(channel);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -731,8 +729,6 @@
</span><span class="cx"> SWITCH_STANDARD_APP(pre_answer_function)
</span><span class="cx"> {
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><del>-        switch_channel_clear_flag(channel, CF_PROXY_MEDIA);
-        switch_channel_clear_flag(channel, CF_PROXY_MODE);
</del><span class="cx">         switch_channel_pre_answer(channel);
</span><span class="cx"> }
</span><span class="cx"> 
</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 (16425 => 16426)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c        2010-01-20 20:34:21 UTC (rev 16425)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c        2010-01-21 00:12:24 UTC (rev 16426)
</span><span class="lines">@@ -505,7 +505,7 @@
</span><span class="cx">                         
</span><span class="cx">                         /* Send the 200 OK */
</span><span class="cx">                         if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
</span><del>-                                char *extra_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
</del><ins>+                                char *extra_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_RESPONSE_HEADER_PREFIX);
</ins><span class="cx"> 
</span><span class="cx">                                 if (sofia_use_soa(tech_pvt)) {
</span><span class="cx">                                         nua_respond(tech_pvt-&gt;nh, SIP_200_OK,
</span><span class="lines">@@ -1243,6 +1243,16 @@
</span><span class="cx">                         const char *var;
</span><span class="cx">                         const char *presence_data = switch_channel_get_variable(channel, &quot;presence_data&quot;);
</span><span class="cx">                         const char *presence_id = switch_channel_get_variable(channel, &quot;presence_id&quot;);
</span><ins>+
+
+                        if ((var = switch_channel_get_variable(channel, &quot;sip_enable_soa&quot;))) {
+                                if (switch_true(var)) {
+                                        sofia_set_flag(tech_pvt, TFLAG_ENABLE_SOA);
+                                } else {
+                                        sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
+                                }
+                        }
+
</ins><span class="cx">                         
</span><span class="cx">                         if (presence_id || presence_data) {
</span><span class="cx">                                 char *sql = switch_mprintf(&quot;update sip_dialogs set presence_id='%q',presence_data='%q' &quot;
</span><span class="lines">@@ -1382,7 +1392,6 @@
</span><span class="cx">                 {
</span><span class="cx">                         uint32_t send_invite = 1;
</span><span class="cx"> 
</span><del>-                        switch_channel_clear_flag(channel, CF_PROXY_MODE);
</del><span class="cx">                         sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE);
</span><span class="cx"> 
</span><span class="cx">                         if (!(switch_channel_test_flag(channel, CF_ANSWERED) || switch_channel_test_flag(channel, CF_EARLY_MEDIA))) {
</span><span class="lines">@@ -1411,6 +1420,7 @@
</span><span class="cx"> 
</span><span class="cx">                         if (send_invite) {
</span><span class="cx">                                 switch_channel_set_flag(channel, CF_REQ_MEDIA);
</span><ins>+                                switch_channel_clear_flag(channel, CF_PROXY_MODE);
</ins><span class="cx">                                 sofia_glue_do_invite(session);
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -3287,6 +3297,14 @@
</span><span class="cx">         *new_session = nsession;
</span><span class="cx">         cause = SWITCH_CAUSE_SUCCESS;
</span><span class="cx"> 
</span><ins>+        if ((hval = switch_event_get_header(var_event, &quot;sip_enable_soa&quot;))) {
+                if (switch_true(hval)) {
+                        sofia_set_flag(tech_pvt, TFLAG_ENABLE_SOA);
+                } else {
+                        sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
+                }
+        }
+
</ins><span class="cx">         if ((hval = switch_event_get_header(var_event, &quot;sip_auto_answer&quot;)) &amp;&amp; switch_true(hval)) {
</span><span class="cx">                 switch_channel_set_variable_printf(nchannel, &quot;sip_h_Call-Info&quot;, &quot;&lt;sip:%s&gt;;answer-after=0&quot;, profile-&gt;sipip);
</span><span class="cx">                 switch_channel_set_variable(nchannel, &quot;sip_invite_params&quot;, &quot;intercom=true&quot;);
</span><span class="lines">@@ -3331,6 +3349,12 @@
</span><span class="cx">                         tech_pvt-&gt;bte = ctech_pvt-&gt;te;
</span><span class="cx">                         tech_pvt-&gt;bcng_pt = ctech_pvt-&gt;cng_pt;
</span><span class="cx">                         tech_pvt-&gt;cid_type = ctech_pvt-&gt;cid_type;
</span><ins>+                        
+                        if (sofia_test_flag(tech_pvt, TFLAG_ENABLE_SOA)) {
+                                sofia_set_flag(ctech_pvt, TFLAG_ENABLE_SOA);
+                        } else {
+                                sofia_clear_flag(ctech_pvt, TFLAG_ENABLE_SOA);
+                        }
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 if (switch_channel_test_flag(o_channel, CF_PROXY_MEDIA)) {
</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 (16425 => 16426)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h        2010-01-20 20:34:21 UTC (rev 16425)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h        2010-01-21 00:12:24 UTC (rev 16426)
</span><span class="lines">@@ -841,9 +841,7 @@
</span><span class="cx"> void sofia_reg_release_gateway__(const char *file, const char *func, int line, sofia_gateway_t *gateway);
</span><span class="cx"> #define sofia_reg_release_gateway(x) sofia_reg_release_gateway__(__FILE__, __SWITCH_FUNC__, __LINE__, x);
</span><span class="cx"> 
</span><del>-#define sofia_use_soa(_t) (sofia_test_flag(_t, TFLAG_ENABLE_SOA)                \
-                                                   &amp;&amp; !switch_channel_test_flag(_t-&gt;channel, CF_PROXY_MODE) \
-                                                   &amp;&amp; !switch_channel_test_flag(_t-&gt;channel, CF_PROXY_MEDIA))
</del><ins>+#define sofia_use_soa(_t) sofia_test_flag(_t, TFLAG_ENABLE_SOA)
</ins><span class="cx"> 
</span><span class="cx"> #define check_decode(_var, _session) do {                                                                \
</span><span class="cx">                 assert(_session);                                                                                                \
</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 (16425 => 16426)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c        2010-01-20 20:34:21 UTC (rev 16425)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c        2010-01-21 00:12:24 UTC (rev 16426)
</span><span class="lines">@@ -1435,8 +1435,7 @@
</span><span class="cx">         char *route_uri = NULL;
</span><span class="cx">         sofia_destination_t *dst = NULL;
</span><span class="cx">         sofia_cid_type_t cid_type = tech_pvt-&gt;profile-&gt;cid_type;
</span><del>-        char *d_url = NULL, *url = NULL, *dest_host = NULL, *url_str = NULL;
-
</del><ins>+        
</ins><span class="cx">         rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
</span><span class="cx"> 
</span><span class="cx">         switch_assert(tech_pvt != NULL);
</span><span class="lines">@@ -1452,50 +1451,7 @@
</span><span class="cx">         check_decode(cid_name, session);
</span><span class="cx">         check_decode(cid_num, session);
</span><span class="cx"> 
</span><del>-        if (zstr(tech_pvt-&gt;dest)) {
-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_ERROR, &quot;URL Error!\n&quot;);
-                return SWITCH_STATUS_FALSE;
-        }
</del><span class="cx">         
</span><del>-        if ((d_url = sofia_glue_get_url_from_contact(tech_pvt-&gt;dest, 1))) {
-                url = d_url;
-        } else {
-                url = tech_pvt-&gt;dest;
-        }
-        
-        url_str = url;
-
-        if ((dest_host = strchr(url_str, '@'))) {
-                dest_host++;
-        }
-
-
-        if (!tech_pvt-&gt;from_str) {
-                const char* sipip;
-                const char* format;
-                const char *alt = NULL;
-
-                sipip = tech_pvt-&gt;profile-&gt;sipip;
-
-                if (sofia_glue_check_nat(tech_pvt-&gt;profile, dest_host)) {
-                        sipip = tech_pvt-&gt;profile-&gt;extsipip;
-                }
-
-                format = strchr(sipip, ':') ? &quot;\&quot;%s\&quot; &lt;sip:%s%s[%s]&gt;&quot; : &quot;\&quot;%s\&quot; &lt;sip:%s%s%s&gt;&quot;;
-
-                if ((alt = switch_channel_get_variable(channel, &quot;sip_invite_domain&quot;))) {
-                        sipip = alt;
-                }
-                        
-                tech_pvt-&gt;from_str = 
-                        switch_core_session_sprintf(tech_pvt-&gt;session,
-                                                                                format,
-                                                                                cid_name,
-                                                                                cid_num,
-                                                                                !zstr(cid_num) ? &quot;@&quot; : &quot;&quot;,
-                                                                                sipip);
-        }
-
</del><span class="cx">         if ((alertbuf = switch_channel_get_variable(channel, &quot;alert_info&quot;))) {
</span><span class="cx">                 alert_info = switch_core_session_sprintf(tech_pvt-&gt;session, &quot;Alert-Info: %s&quot;, alertbuf);
</span><span class="cx">         }
</span><span class="lines">@@ -1511,7 +1467,7 @@
</span><span class="cx">         sofia_set_flag_locked(tech_pvt, TFLAG_READY);
</span><span class="cx"> 
</span><span class="cx">         if (!tech_pvt-&gt;nh) {
</span><del>-
</del><ins>+                char *d_url = NULL, *url = NULL, *dest_host = NULL, *url_str = NULL;
</ins><span class="cx">                 sofia_private_t *sofia_private;
</span><span class="cx">                 char *invite_contact = NULL, *to_str, *use_from_str, *from_str;
</span><span class="cx">                 const char *t_var;
</span><span class="lines">@@ -1525,6 +1481,52 @@
</span><span class="cx">                 const char *invite_from_params = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;sip_invite_from_params&quot;);
</span><span class="cx">                 const char *from_var = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;sip_from_uri&quot;);
</span><span class="cx">                 const char *from_display = switch_channel_get_variable(tech_pvt-&gt;channel, &quot;sip_from_display&quot;);
</span><ins>+
+
+                if (zstr(tech_pvt-&gt;dest)) {
+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt-&gt;session), SWITCH_LOG_ERROR, &quot;URL Error!\n&quot;);
+                        return SWITCH_STATUS_FALSE;
+                }
+        
+                if ((d_url = sofia_glue_get_url_from_contact(tech_pvt-&gt;dest, 1))) {
+                        url = d_url;
+                } else {
+                        url = tech_pvt-&gt;dest;
+                }
+        
+                url_str = url;
+
+                if ((dest_host = strchr(url_str, '@'))) {
+                        dest_host++;
+                }
+
+
+                if (!tech_pvt-&gt;from_str) {
+                        const char* sipip;
+                        const char* format;
+                        const char *alt = NULL;
+                        
+                        sipip = tech_pvt-&gt;profile-&gt;sipip;
+                        
+                        if (sofia_glue_check_nat(tech_pvt-&gt;profile, dest_host)) {
+                                sipip = tech_pvt-&gt;profile-&gt;extsipip;
+                        }
+                        
+                        format = strchr(sipip, ':') ? &quot;\&quot;%s\&quot; &lt;sip:%s%s[%s]&gt;&quot; : &quot;\&quot;%s\&quot; &lt;sip:%s%s%s&gt;&quot;;
+                        
+                        if ((alt = switch_channel_get_variable(channel, &quot;sip_invite_domain&quot;))) {
+                                sipip = alt;
+                        }
+                        
+                        tech_pvt-&gt;from_str = 
+                                switch_core_session_sprintf(tech_pvt-&gt;session,
+                                                                                        format,
+                                                                                        cid_name,
+                                                                                        cid_num,
+                                                                                        !zstr(cid_num) ? &quot;@&quot; : &quot;&quot;,
+                                                                                        sipip);
+                }
+
</ins><span class="cx">                 
</span><span class="cx">                 if (from_var) {
</span><span class="cx">                         if (strncasecmp(from_var, &quot;sip:&quot;, 4) || strncasecmp(from_var, &quot;sips:&quot;, 5)) {
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_sofiasofia_regc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (16425 => 16426)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c        2010-01-20 20:34:21 UTC (rev 16425)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c        2010-01-21 00:12:24 UTC (rev 16426)
</span><span class="lines">@@ -1810,11 +1810,11 @@
</span><span class="cx">         for (un = sip-&gt;sip_unknown; un; un = un-&gt;un_next) {
</span><span class="cx">                 if (!strncasecmp(un-&gt;un_name, &quot;X-&quot;, 2)) {
</span><span class="cx">                         if (!zstr(un-&gt;un_value)) {
</span><del>-                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;adding %s =&gt; %s to xml_curl request\n&quot;, un-&gt;un_name, un-&gt;un_value);
</del><ins>+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, &quot;adding %s =&gt; %s to xml_curl request\n&quot;, un-&gt;un_name, un-&gt;un_value);
</ins><span class="cx">                                 switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, un-&gt;un_name, un-&gt;un_value);
</span><span class="cx">                         }
</span><span class="cx">                 } else {
</span><del>-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;skipping %s =&gt; %s from xml_curl request\n&quot;, un-&gt;un_name, un-&gt;un_value);
</del><ins>+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, &quot;skipping %s =&gt; %s from xml_curl request\n&quot;, un-&gt;un_name, un-&gt;un_value);
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_channelc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_channel.c (16425 => 16426)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_channel.c        2010-01-20 20:34:21 UTC (rev 16425)
+++ freeswitch/trunk/src/switch_channel.c        2010-01-21 00:12:24 UTC (rev 16426)
</span><span class="lines">@@ -962,6 +962,7 @@
</span><span class="cx">         switch_assert(channel-&gt;flag_mutex);
</span><span class="cx"> 
</span><span class="cx">         switch_mutex_lock(channel-&gt;flag_mutex);
</span><ins>+        
</ins><span class="cx">         channel-&gt;flags[flag] = 1;
</span><span class="cx">         switch_mutex_unlock(channel-&gt;flag_mutex);
</span><span class="cx"> 
</span><span class="lines">@@ -1051,6 +1052,7 @@
</span><span class="cx">         switch_mutex_lock(channel-&gt;flag_mutex);
</span><span class="cx">         channel-&gt;flags[flag] = 0;
</span><span class="cx">         switch_mutex_unlock(channel-&gt;flag_mutex);
</span><ins>+        
</ins><span class="cx">         if (flag == CF_OUTBOUND) {
</span><span class="cx">                 switch_channel_set_variable(channel, &quot;is_outbound&quot;, NULL);
</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 (16425 => 16426)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_ivr_bridge.c        2010-01-20 20:34:21 UTC (rev 16425)
+++ freeswitch/trunk/src/switch_ivr_bridge.c        2010-01-21 00:12:24 UTC (rev 16426)
</span><span class="lines">@@ -927,16 +927,18 @@
</span><span class="cx">                 switch_event_fire(&amp;event);
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        switch_channel_set_state_flag(caller_channel, CF_TRANSFER);
-        switch_channel_set_state_flag(peer_channel, CF_TRANSFER);
</del><ins>+        switch_channel_set_state_flag(caller_channel, CF_RESET);
+        switch_channel_set_state_flag(peer_channel, CF_RESET);
</ins><span class="cx"> 
</span><span class="cx">         switch_channel_set_state(caller_channel, CS_HIBERNATE);
</span><span class="cx">         switch_channel_set_state(peer_channel, CS_HIBERNATE);
</span><del>-        
</del><ins>+
+#if 0        
</ins><span class="cx">         if (switch_channel_test_flag(caller_channel, CF_BRIDGED)) {
</span><span class="cx">                 switch_channel_set_flag(caller_channel, CF_TRANSFER);
</span><span class="cx">                 switch_channel_set_flag(peer_channel, CF_TRANSFER);
</span><span class="cx">         }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">         switch_ivr_bridge_display(session, peer_session);
</span><span class="cx"> 
</span><span class="lines">@@ -1164,22 +1166,38 @@
</span><span class="cx"> 
</span><span class="cx">         state = switch_channel_get_state(caller_channel);
</span><span class="cx">         
</span><del>-        if (!switch_channel_test_flag(caller_channel, CF_TRANSFER) &amp;&amp; !switch_channel_test_flag(caller_channel, CF_REDIRECT) &amp;&amp; 
-                !switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE) &amp;&amp; !a_leg-&gt;clean_exit &amp;&amp; !inner_bridge) {
-                if ((state != CS_EXECUTE &amp;&amp; state != CS_SOFT_EXECUTE &amp;&amp; state != CS_PARK &amp;&amp; state != CS_ROUTING) &amp;&amp;
-                        switch_channel_test_flag(peer_channel, CF_ANSWERED) &amp;&amp; state &lt; CS_HANGUP) {
</del><ins>+        if (!switch_channel_test_flag(caller_channel, CF_TRANSFER) &amp;&amp; !switch_channel_test_flag(caller_channel, CF_REDIRECT) &amp;&amp;
+        !switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE) &amp;&amp; !a_leg-&gt;clean_exit &amp;&amp; !inner_bridge) {
+        int hup_ok = 0;
+        int x_ok = 0;
</ins><span class="cx"> 
</span><del>-                        if (switch_true(switch_channel_get_variable(caller_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) {
-                                switch_ivr_park_session(session);
-                        } else if ((var = switch_channel_get_variable(caller_channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) {
-                                transfer_after_bridge(session, var);
-                        } else if (switch_channel_test_flag(peer_channel, CF_ANSWERED) &amp;&amp; 
-                                           switch_true(switch_channel_get_variable(caller_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE))) {
-                                switch_channel_hangup(caller_channel, switch_channel_get_cause(peer_channel));
-                        }
-                }
-        }
</del><ins>+        if ((state != CS_EXECUTE &amp;&amp; state != CS_SOFT_EXECUTE &amp;&amp; state != CS_PARK &amp;&amp; state != CS_ROUTING)) {
+            hup_ok = 1;
+        }
</ins><span class="cx"> 
</span><ins>+        if (switch_channel_test_flag(peer_channel, CF_ANSWERED) &amp;&amp; state &lt; CS_HANGUP) {
+            x_ok = 1;
+        }
+
+        if (x_ok) {
+            if (switch_true(switch_channel_get_variable(caller_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) {
+                switch_ivr_park_session(session);
+                hup_ok = 0;
+            } else if ((var = switch_channel_get_variable(caller_channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) {
+                transfer_after_bridge(session, var);
+                hup_ok = 0;
+            }
+        }
+
+        if (hup_ok) {
+            if (switch_channel_test_flag(peer_channel, CF_ANSWERED) &amp;&amp;
+                switch_true(switch_channel_get_variable(caller_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE))) {
+                switch_channel_hangup(caller_channel, switch_channel_get_cause(peer_channel));
+            }
+        }
+                
+    }
+
</ins><span class="cx">         if (switch_channel_test_flag(caller_channel, CF_REDIRECT)) {
</span><span class="cx">                 state = switch_channel_get_state(caller_channel);
</span><span class="cx">                 if (!(state == CS_RESET || state == CS_PARK || state == CS_ROUTING)) {
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_ivr_originatec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_ivr_originate.c (16425 => 16426)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_ivr_originate.c        2010-01-20 20:34:21 UTC (rev 16425)
+++ freeswitch/trunk/src/switch_ivr_originate.c        2010-01-21 00:12:24 UTC (rev 16426)
</span><span class="lines">@@ -1722,20 +1722,25 @@
</span><span class="cx">                 proxy_media = switch_channel_get_variable(caller_channel, SWITCH_PROXY_MEDIA_VARIABLE);
</span><span class="cx">                 bypass_media = switch_channel_get_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE);
</span><span class="cx"> 
</span><del>-                if (switch_true(proxy_media)) {
-                        switch_channel_set_flag(caller_channel, CF_PROXY_MEDIA);
-                } else {
-                        switch_channel_clear_flag(caller_channel, CF_PROXY_MEDIA);
</del><ins>+                if (!zstr(proxy_media)) {
+                        if (switch_true(proxy_media)) {
+                                switch_channel_set_flag(caller_channel, CF_PROXY_MEDIA);
+                        } else if (switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA)) {
+                                switch_channel_clear_flag(caller_channel, CF_PROXY_MEDIA);
+                        }
</ins><span class="cx">                 }
</span><del>-                
-                if (switch_true(bypass_media)) {
-                        switch_channel_set_flag(caller_channel, CF_PROXY_MODE);
-                } else {
-                        switch_channel_clear_flag(caller_channel, CF_PROXY_MODE);
</del><ins>+
+                if (!zstr(bypass_media)) {
+                        if (switch_true(bypass_media)) {
+                                switch_channel_set_flag(caller_channel, CF_PROXY_MODE);
+                        } else if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)) {
+                                switch_ivr_media(switch_core_session_get_uuid(session), SMF_NONE);
+                        }
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 switch_channel_set_variable(caller_channel, SWITCH_B_SDP_VARIABLE, NULL);
</span><del>-                
</del><ins>+
+
</ins><span class="cx">                 if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE) &amp;&amp; switch_channel_media_ready(caller_channel)) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, 
</span><span class="cx">                                                           &quot;Channel is already up, delaying proxy mode 'till both legs are answered.\n&quot;);
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>