<!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][15159] </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=15159">15159</a></dd>
<dt>Author</dt> <dd>anthm</dd>
<dt>Date</dt> <dd>2009-10-14 14:26:10 -0500 (Wed, 14 Oct 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>delay update till after media has been confirmed to prevent SOA race in sip</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcincludeswitch_channelh">freeswitch/trunk/src/include/switch_channel.h</a></li>
<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_channelc">freeswitch/trunk/src/switch_channel.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_ivr_bridgec">freeswitch/trunk/src/switch_ivr_bridge.c</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunksrcincludeswitch_channelh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_channel.h (15158 => 15159)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_channel.h        2009-10-14 14:58:45 UTC (rev 15158)
+++ freeswitch/trunk/src/include/switch_channel.h        2009-10-14 19:26:10 UTC (rev 15159)
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx"> #define switch_channel_media_ready(_channel) switch_channel_test_ready(_channel, SWITCH_TRUE)
</span><span class="cx"> #define switch_channel_up(_channel) (switch_channel_get_state(_channel) < CS_HANGUP)
</span><span class="cx"> #define switch_channel_down(_channel) (switch_channel_get_state(_channel) >= CS_HANGUP)
</span><ins>+#define switch_channel_media_ack(_channel) (!switch_channel_test_cap(_channel, CC_MEDIA_ACK) || switch_channel_test_flag(_channel, CF_MEDIA_ACK))
</ins><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, switch_channel_t *other_channel, switch_channel_state_t want_state);
</span><span class="cx"> SWITCH_DECLARE(void) switch_channel_wait_for_state_timeout(switch_channel_t *other_channel, switch_channel_state_t want_state, uint32_t timeout);
</span><span class="lines">@@ -297,6 +298,10 @@
</span><span class="cx"> SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag_t flag);
</span><span class="cx"> SWITCH_DECLARE(void) switch_channel_set_flag_recursive(switch_channel_t *channel, switch_channel_flag_t flag);
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(void) switch_channel_set_cap(switch_channel_t *channel, switch_channel_cap_t cap);
+SWITCH_DECLARE(void) switch_channel_clear_cap(switch_channel_t *channel, switch_channel_cap_t cap);
+SWITCH_DECLARE(uint32_t) switch_channel_test_cap(switch_channel_t *channel, switch_channel_cap_t cap);
+
</ins><span class="cx"> /*!
</span><span class="cx"> \brief Set given flag(s) on a given channel's bridge partner
</span><span class="cx"> \param channel channel to derive the partner channel to set flag on
</span></span></pre></div>
<a id="freeswitchtrunksrcincludeswitch_typesh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_types.h (15158 => 15159)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_types.h        2009-10-14 14:58:45 UTC (rev 15158)
+++ freeswitch/trunk/src/include/switch_types.h        2009-10-14 19:26:10 UTC (rev 15159)
</span><span class="lines">@@ -867,6 +867,12 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> typedef enum {
</span><ins>+        CC_MEDIA_ACK = 1,
+        /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
+        CC_FLAG_MAX
+} switch_channel_cap_t;
+
+typedef enum {
</ins><span class="cx">         CF_ANSWERED = 1,
</span><span class="cx">         CF_OUTBOUND,
</span><span class="cx">         CF_EARLY_MEDIA,
</span><span class="lines">@@ -906,6 +912,7 @@
</span><span class="cx">         CF_TIMESTAMP_SET,
</span><span class="cx">         CF_ORIGINATOR,
</span><span class="cx">         CF_XFER_ZOMBIE,
</span><ins>+        CF_MEDIA_ACK,
</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 (15158 => 15159)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c        2009-10-14 14:58:45 UTC (rev 15158)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c        2009-10-14 19:26:10 UTC (rev 15159)
</span><span class="lines">@@ -1289,43 +1289,45 @@
</span><span class="cx">                                         number = tech_pvt->caller_profile->destination_number;
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (switch_strlen_zero(tech_pvt->last_sent_callee_id_name) || strcmp(tech_pvt->last_sent_callee_id_name, name) ||
-                                        switch_strlen_zero(tech_pvt->last_sent_callee_id_number) || strcmp(tech_pvt->last_sent_callee_id_number, number)) {
</del><ins>+                                if (!switch_channel_test_flag(channel, CF_ANSWERED)) {
+                                        switch_channel_set_variable(channel, "sip_callee_id_name", name);
+                                        switch_channel_set_variable(channel, "sip_callee_id_number", number);
+                                } else {
+                                        if (switch_strlen_zero(tech_pvt->last_sent_callee_id_name) || strcmp(tech_pvt->last_sent_callee_id_name, name) ||
+                                                switch_strlen_zero(tech_pvt->last_sent_callee_id_number) || strcmp(tech_pvt->last_sent_callee_id_number, number)) {
</ins><span class="cx">                                         
</span><del>-                                        if (ua && switch_stristr("snom", ua)) {
-                                                snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", name, number);
-                                                nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
-                                                                 TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
-                                                                 SIPTAG_PAYLOAD_STR(message), TAG_END());
-                                        } else if ((ua && (switch_stristr("polycom", ua) ||
-                                                                         switch_stristr("UPDATE", tech_pvt->x_actually_support_remote)))) {
-                                                snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", name, number);
-                                                nua_update(tech_pvt->nh,
-                                                                 TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),
-                                                                 TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
-                                                                 TAG_END());
-                                        }
</del><ins>+                                                if (ua && switch_stristr("snom", ua)) {
+                                                        snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", name, number);
+                                                        nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+                                                                         TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+                                                                         SIPTAG_PAYLOAD_STR(message), TAG_END());
+                                                } else if ((ua && (switch_stristr("polycom", ua) ||
+                                                                                 switch_stristr("UPDATE", tech_pvt->x_actually_support_remote)))) {
+                                                        snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", name, number);
+                                                        nua_update(tech_pvt->nh,
+                                                                         TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),
+                                                                         TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+                                                                         TAG_END());
+                                                }
</ins><span class="cx">
</span><del>-                                        tech_pvt->last_sent_callee_id_name = switch_core_session_strdup(tech_pvt->session, name);
-                                        tech_pvt->last_sent_callee_id_number = switch_core_session_strdup(tech_pvt->session, number);
</del><ins>+                                                tech_pvt->last_sent_callee_id_name = switch_core_session_strdup(tech_pvt->session, name);
+                                                tech_pvt->last_sent_callee_id_number = switch_core_session_strdup(tech_pvt->session, number);
</ins><span class="cx">                                         
</span><del>-                                        if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
-                                                const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
-                                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "SEND");
-                                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Name", name);
-                                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Number", number);
-                                                if (uuid) {
-                                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid);
</del><ins>+                                                if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
+                                                        const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "SEND");
+                                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Name", name);
+                                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Number", number);
+                                                        if (uuid) {
+                                                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid);
+                                                        }
+                                                        switch_channel_event_set_data(channel, event);
+                                                        switch_event_fire(&event);
</ins><span class="cx">                                                 }
</span><del>-                                                switch_channel_event_set_data(channel, event);
-                                                switch_event_fire(&event);
</del><ins>+                                        } else {
+                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Not sending same id again \"%s\" <%s>\n", name, number);
</ins><span class="cx">                                         }
</span><del>-                                } else {
-                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Not sending same id again \"%s\" <%s>\n", name, number);
</del><span class="cx">                                 }
</span><del>-
-
-
</del><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         switch_safe_free(arg);
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_sofiasofiac"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (15158 => 15159)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c        2009-10-14 14:58:45 UTC (rev 15158)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c        2009-10-14 19:26:10 UTC (rev 15159)
</span><span class="lines">@@ -603,12 +603,15 @@
</span><span class="cx">         case nua_r_cancel:
</span><span class="cx">         case nua_i_error:
</span><span class="cx">         case nua_i_active:
</span><del>-        case nua_i_ack:
</del><span class="cx">         case nua_i_terminated:
</span><span class="cx">         case nua_r_set_params:
</span><span class="cx">         case nua_i_prack:
</span><span class="cx">         case nua_r_prack:
</span><span class="cx">                 break;
</span><ins>+        case nua_i_ack:
+        case nua_r_ack:
+                if (channel) switch_channel_set_flag(channel, CF_MEDIA_ACK);
+                break;
</ins><span class="cx">         case nua_r_shutdown:
</span><span class="cx">                 if (status >= 200) su_root_break(profile->s_root);
</span><span class="cx">                 break;
</span><span class="lines">@@ -1021,6 +1024,7 @@
</span><span class="cx">                                  NUTAG_APPL_METHOD("REGISTER"),
</span><span class="cx">                                  NUTAG_APPL_METHOD("NOTIFY"),
</span><span class="cx">                                  NUTAG_APPL_METHOD("INFO"),
</span><ins>+                                 NUTAG_APPL_METHOD("ACK"),
</ins><span class="cx"> #ifdef MANUAL_BYE
</span><span class="cx">                                  NUTAG_APPL_METHOD("BYE"),
</span><span class="cx"> #endif
</span><span class="lines">@@ -3109,11 +3113,12 @@
</span><span class="cx">                         caller_profile->network_addr = switch_core_strdup(caller_profile->pool, network_ip);
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                switch_channel_clear_flag(channel, CF_REQ_MEDIA);
-                
</del><span class="cx">                 if ((status == 180 || status == 183 || status == 200)) {
</span><span class="cx">                         const char *x_actually_support;
</span><span class="cx">
</span><ins>+                        switch_channel_set_flag(channel, CF_MEDIA_ACK);
+                        switch_channel_clear_flag(channel, CF_REQ_MEDIA);
+
</ins><span class="cx">                         if ((x_actually_support = sofia_glue_get_unknown_header(sip, "X-Actually-Support"))) {
</span><span class="cx">                                 tech_pvt->x_actually_support_remote = switch_core_session_strdup(session, x_actually_support);
</span><span class="cx">                         }
</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 (15158 => 15159)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c        2009-10-14 14:58:45 UTC (rev 15158)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c        2009-10-14 19:26:10 UTC (rev 15159)
</span><span class="lines">@@ -521,6 +521,8 @@
</span><span class="cx">
</span><span class="cx">         tech_pvt->session = session;
</span><span class="cx">         tech_pvt->channel = switch_core_session_get_channel(session);
</span><ins>+        switch_channel_set_cap(tech_pvt->channel, CC_MEDIA_ACK);
+        
</ins><span class="cx">         switch_core_session_set_private(session, tech_pvt);
</span><span class="cx">
</span><span class="cx">         switch_snprintf(name, sizeof(name), "sofia/%s/%s", profile->name, channame);
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_channelc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_channel.c (15158 => 15159)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_channel.c        2009-10-14 14:58:45 UTC (rev 15158)
+++ freeswitch/trunk/src/switch_channel.c        2009-10-14 19:26:10 UTC (rev 15159)
</span><span class="lines">@@ -1,4 +1,3 @@
</span><del>-
</del><span class="cx"> /*
</span><span class="cx"> * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
</span><span class="cx"> * Copyright (C) 2005-2009, Anthony Minessale II <anthm@freeswitch.org>
</span><span class="lines">@@ -120,6 +119,7 @@
</span><span class="cx">         switch_channel_state_t state;
</span><span class="cx">         switch_channel_state_t running_state;
</span><span class="cx">         uint32_t flags[CF_FLAG_MAX];
</span><ins>+        uint32_t caps[CC_FLAG_MAX];
</ins><span class="cx">         uint8_t state_flags[CF_FLAG_MAX];
</span><span class="cx">         uint32_t private_flags;
</span><span class="cx">         uint32_t app_flags;
</span><span class="lines">@@ -841,6 +841,33 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+
+SWITCH_DECLARE(void) switch_channel_set_cap(switch_channel_t *channel, switch_channel_cap_t cap)
+{
+        switch_assert(channel);
+        switch_assert(channel->flag_mutex);
+
+        switch_mutex_lock(channel->flag_mutex);
+        channel->caps[cap] = 1;
+        switch_mutex_unlock(channel->flag_mutex);
+}
+
+SWITCH_DECLARE(void) switch_channel_clear_cap(switch_channel_t *channel, switch_channel_cap_t cap)
+{
+        switch_assert(channel != NULL);
+        switch_assert(channel->flag_mutex);
+
+        switch_mutex_lock(channel->flag_mutex);
+        channel->caps[cap] = 0;
+        switch_mutex_unlock(channel->flag_mutex);
+}
+
+SWITCH_DECLARE(uint32_t) switch_channel_test_cap(switch_channel_t *channel, switch_channel_cap_t cap)
+{
+        switch_assert(channel != NULL);
+        return channel->caps[cap] ? 1 : 0;
+}
+
</ins><span class="cx"> SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag_t flag)
</span><span class="cx"> {
</span><span class="cx">         switch_assert(channel);
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_ivr_bridgec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_ivr_bridge.c (15158 => 15159)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_ivr_bridge.c        2009-10-14 14:58:45 UTC (rev 15158)
+++ freeswitch/trunk/src/switch_ivr_bridge.c        2009-10-14 19:26:10 UTC (rev 15159)
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">         const char *silence_var, *var;
</span><span class="cx">         int silence_val = 0, bypass_media_after_bridge = 0;
</span><span class="cx">         const char *bridge_answer_timeout = NULL;
</span><del>-        int answer_timeout, sent_update = -50;
</del><ins>+        int answer_timeout, sent_update = 0;
</ins><span class="cx">         time_t answer_limit = 0;
</span><span class="cx">         
</span><span class="cx">
</span><span class="lines">@@ -184,6 +184,7 @@
</span><span class="cx">         chan_b = switch_core_session_get_channel(session_b);
</span><span class="cx">
</span><span class="cx">         ans_a = switch_channel_test_flag(chan_a, CF_ANSWERED);
</span><ins>+
</ins><span class="cx">         if ((originator = switch_channel_test_flag(chan_a, CF_BRIDGE_ORIGINATOR))) {
</span><span class="cx">                 pre_b = switch_channel_test_flag(chan_a, CF_EARLY_MEDIA);
</span><span class="cx">                 ans_b = switch_channel_test_flag(chan_b, CF_ANSWERED);
</span><span class="lines">@@ -397,12 +398,9 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 
</span><del>-
-                if (originator && sent_update < 0 && ans_a && ans_b) {
-                        if (!++sent_update) {
-                                switch_ivr_bridge_display(session_a, session_b);
-                                sent_update = 1;
-                        }
</del><ins>+                if (originator && !sent_update && ans_a && ans_b && switch_channel_media_ack(chan_a) && switch_channel_media_ack(chan_b)) {
+                        switch_ivr_bridge_display(session_a, session_b);
+                        sent_update = 1;
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx"> #ifndef SWITCH_VIDEO_IN_THREADS
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>