<!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][15757] </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=15757">15757</a></dd>
<dt>Author</dt> <dd>anthm</dd>
<dt>Date</dt> <dd>2009-12-02 12:13:11 -0600 (Wed, 02 Dec 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>allow recursive broadcasting</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcincludeswitch_coreh">freeswitch/trunk/src/include/switch_core.h</a></li>
<li><a href="#freeswitchtrunksrcincludeswitch_typesh">freeswitch/trunk/src/include/switch_types.h</a></li>
<li><a href="#freeswitchtrunksrcmodapplicationsmod_dptoolsmod_dptoolsc">freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_core_sessionc">freeswitch/trunk/src/switch_core_session.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_ivr_asyncc">freeswitch/trunk/src/switch_ivr_async.c</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunksrcincludeswitch_coreh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_core.h (15756 => 15757)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_core.h        2009-12-02 18:07:09 UTC (rev 15756)
+++ freeswitch/trunk/src/include/switch_core.h        2009-12-02 18:13:11 UTC (rev 15757)
</span><span class="lines">@@ -826,12 +826,24 @@
</span><span class="cx">   \param session the current session
</span><span class="cx">   \param app the application's name
</span><span class="cx">   \param arg application arguments
</span><del>-  \warning Has to be called from the session's thread
</del><ins>+  \param flags pointer to a flags variable to set the applications flags to
</ins><span class="cx">   \return the application's return value
</span><span class="cx"> */
</span><del>-SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application(_In_ switch_core_session_t *session,
-                                                                                                                                                _In_ const char *app, _In_opt_z_ const char *arg);
</del><ins>+SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application_get_flags(_In_ switch_core_session_t *session,
+                                                                                                                                                                  _In_ const char *app, _In_opt_z_ const char *arg, _Out_ int32_t *flags);
+
+SWITCH_DECLARE(switch_status_t) switch_core_session_get_app_flags(const char *app, int32_t *flags);
+
</ins><span class="cx"> /*! 
</span><ins>+  \brief Execute an application on a session 
+  \param session the current session
+  \param app the application's name
+  \param arg application arguments
+  \return the application's return value
+*/
+#define switch_core_session_execute_application(_a, _b, _c) switch_core_session_execute_application_get_flags(_a, _b, _c, NULL)
+
+/*! 
</ins><span class="cx">   \brief Run a dialplan and execute an extension
</span><span class="cx">   \param session the current session
</span><span class="cx">   \param exten the interface of the application to execute
</span></span></pre></div>
<a id="freeswitchtrunksrcincludeswitch_typesh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_types.h (15756 => 15757)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_types.h        2009-12-02 18:07:09 UTC (rev 15756)
+++ freeswitch/trunk/src/include/switch_types.h        2009-12-02 18:13:11 UTC (rev 15757)
</span><span class="lines">@@ -943,6 +943,7 @@
</span><span class="cx">         CF_MEDIA_BRIDGE_TTL,
</span><span class="cx">         CF_BYPASS_MEDIA_AFTER_BRIDGE,
</span><span class="cx">         CF_LEG_HOLDING,
</span><ins>+        CF_BROADCAST_DROP_MEDIA,
</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 class="lines">@@ -983,7 +984,8 @@
</span><span class="cx"> typedef enum {
</span><span class="cx">         SAF_NONE = 0,
</span><span class="cx">         SAF_SUPPORT_NOMEDIA = (1 &lt;&lt; 0),
</span><del>-        SAF_ROUTING_EXEC = (1 &lt;&lt; 1)
</del><ins>+        SAF_ROUTING_EXEC = (1 &lt;&lt; 1),
+        SAF_MEDIA_TAP = (1 &lt;&lt; 2)
</ins><span class="cx"> } switch_application_flag_enum_t;
</span><span class="cx"> typedef uint32_t switch_application_flag_t;
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcmodapplicationsmod_dptoolsmod_dptoolsc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (15756 => 15757)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c        2009-12-02 18:07:09 UTC (rev 15756)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c        2009-12-02 18:13:11 UTC (rev 15757)
</span><span class="lines">@@ -2999,18 +2999,18 @@
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;unbind_meta_app&quot;, &quot;Unbind a key from an application&quot;, &quot;Unbind a key from an application&quot;, dtmf_unbind_function, 
</span><span class="cx">                                    UNBIND_SYNTAX, SAF_SUPPORT_NOMEDIA);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;intercept&quot;, &quot;intercept&quot;, &quot;intercept&quot;, intercept_function, INTERCEPT_SYNTAX, SAF_NONE);
</span><del>-        SWITCH_ADD_APP(app_interface, &quot;eavesdrop&quot;, &quot;eavesdrop on a uuid&quot;, &quot;eavesdrop on a uuid&quot;, eavesdrop_function, eavesdrop_SYNTAX, SAF_NONE);
-        SWITCH_ADD_APP(app_interface, &quot;three_way&quot;, &quot;three way call with a uuid&quot;, &quot;three way call with a uuid&quot;, three_way_function, threeway_SYNTAX, SAF_NONE);
</del><ins>+        SWITCH_ADD_APP(app_interface, &quot;eavesdrop&quot;, &quot;eavesdrop on a uuid&quot;, &quot;eavesdrop on a uuid&quot;, eavesdrop_function, eavesdrop_SYNTAX, SAF_MEDIA_TAP);
+        SWITCH_ADD_APP(app_interface, &quot;three_way&quot;, &quot;three way call with a uuid&quot;, &quot;three way call with a uuid&quot;, three_way_function, threeway_SYNTAX, SAF_MEDIA_TAP);
</ins><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;set_user&quot;, &quot;Set a User&quot;, &quot;Set a User&quot;, set_user_function, SET_USER_SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC );
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;stop_dtmf&quot;, &quot;stop inband dtmf&quot;, &quot;Stop detecting inband dtmf.&quot;, stop_dtmf_session_function, &quot;&quot;, SAF_NONE);
</span><del>-        SWITCH_ADD_APP(app_interface, &quot;start_dtmf&quot;, &quot;Detect dtmf&quot;, &quot;Detect inband dtmf on the session&quot;, dtmf_session_function, &quot;&quot;, SAF_NONE);
</del><ins>+        SWITCH_ADD_APP(app_interface, &quot;start_dtmf&quot;, &quot;Detect dtmf&quot;, &quot;Detect inband dtmf on the session&quot;, dtmf_session_function, &quot;&quot;, SAF_MEDIA_TAP);
</ins><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;stop_dtmf_generate&quot;, &quot;stop inband dtmf generation&quot;, &quot;Stop generating inband dtmf.&quot;,
</span><span class="cx">                                    stop_dtmf_session_generate_function, &quot;[write]&quot;, SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;start_dtmf_generate&quot;, &quot;Generate dtmf&quot;, &quot;Generate inband dtmf on the session&quot;, dtmf_session_generate_function, &quot;&quot;,
</span><span class="cx">                                    SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;stop_tone_detect&quot;, &quot;stop detecting tones&quot;, &quot;Stop detecting tones&quot;, stop_fax_detect_session_function, &quot;&quot;, SAF_NONE);
</span><del>-        SWITCH_ADD_APP(app_interface, &quot;fax_detect&quot;, &quot;Detect faxes&quot;, &quot;Detect fax send tone&quot;, fax_detect_session_function, &quot;&quot;, SAF_NONE);
-        SWITCH_ADD_APP(app_interface, &quot;tone_detect&quot;, &quot;Detect tones&quot;, &quot;Detect tones&quot;, tone_detect_session_function, &quot;&quot;, SAF_NONE);
</del><ins>+        SWITCH_ADD_APP(app_interface, &quot;fax_detect&quot;, &quot;Detect faxes&quot;, &quot;Detect fax send tone&quot;, fax_detect_session_function, &quot;&quot;, SAF_MEDIA_TAP);
+        SWITCH_ADD_APP(app_interface, &quot;tone_detect&quot;, &quot;Detect tones&quot;, &quot;Detect tones&quot;, tone_detect_session_function, &quot;&quot;, SAF_MEDIA_TAP);
</ins><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;echo&quot;, &quot;Echo&quot;, &quot;Perform an echo test against the calling channel&quot;, echo_function, &quot;&quot;, SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;park&quot;, &quot;Park&quot;, &quot;Park&quot;, park_function, &quot;&quot;, SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;park_state&quot;, &quot;Park State&quot;, &quot;Park State&quot;, park_state_function, &quot;&quot;, SAF_NONE);
</span><span class="lines">@@ -3023,14 +3023,14 @@
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;play_and_get_digits&quot;, &quot;Play and get Digits&quot;, &quot;Play and get Digits&quot;, 
</span><span class="cx">                                    play_and_get_digits_function, &quot;&lt;min&gt; &lt;max&gt; &lt;tries&gt; &lt;timeout&gt; &lt;terminators&gt; &lt;file&gt; &lt;invalid_file&gt; &lt;var_name&gt; &lt;regexp&gt;&quot;, SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;stop_record_session&quot;, &quot;Stop Record Session&quot;, STOP_SESS_REC_DESC, stop_record_session_function, &quot;&lt;path&gt;&quot;, SAF_NONE);
</span><del>-        SWITCH_ADD_APP(app_interface, &quot;record_session&quot;, &quot;Record Session&quot;, SESS_REC_DESC, record_session_function, &quot;&lt;path&gt; [+&lt;timeout&gt;]&quot;, SAF_NONE);
</del><ins>+        SWITCH_ADD_APP(app_interface, &quot;record_session&quot;, &quot;Record Session&quot;, SESS_REC_DESC, record_session_function, &quot;&lt;path&gt; [+&lt;timeout&gt;]&quot;, SAF_MEDIA_TAP);
</ins><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;record&quot;, &quot;Record File&quot;, &quot;Record a file from the channels input&quot;, record_function,
</span><span class="cx">                                    &quot;&lt;path&gt; [&lt;time_limit_secs&gt;] [&lt;silence_thresh&gt;] [&lt;silence_hits&gt;]&quot;, SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;preprocess&quot;, &quot;pre-process&quot;, &quot;pre-process&quot;, preprocess_session_function, &quot;&quot;, SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;stop_displace_session&quot;, &quot;Stop Displace File&quot;, &quot;Stop Displacing to a file&quot;, stop_displace_session_function, &quot;&lt;path&gt;&quot;,
</span><span class="cx">                                    SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;displace_session&quot;, &quot;Displace File&quot;, DISPLACE_DESC, displace_session_function, &quot;&lt;path&gt; [&lt;flags&gt;] [+time_limit_ms]&quot;,
</span><del>-                                   SAF_NONE);
</del><ins>+                                   SAF_MEDIA_TAP);
</ins><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;speak&quot;, &quot;Speak text&quot;, SPEAK_DESC, speak_function, &quot;&lt;engine&gt;|&lt;voice&gt;|&lt;text&gt;&quot;, SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, &quot;clear_speech_cache&quot;, &quot;Clear Speech Handle Cache&quot;, &quot;Clear Speech Handle Cache&quot;, clear_speech_cache_function, &quot;&quot;,
</span><span class="cx">                                    SAF_NONE);
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_core_sessionc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_core_session.c (15756 => 15757)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_core_session.c        2009-12-02 18:07:09 UTC (rev 15756)
+++ freeswitch/trunk/src/switch_core_session.c        2009-12-02 18:13:11 UTC (rev 15757)
</span><span class="lines">@@ -865,15 +865,27 @@
</span><span class="cx">         return status;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#define check_media(session)                                                                                        \
+        {                                                                                                                                        \
+                if (switch_channel_test_flag(session-&gt;channel, CF_BROADCAST_DROP_MEDIA)) { \
+                        switch_channel_clear_flag(session-&gt;channel, CF_BROADCAST_DROP_MEDIA); \
+                        switch_ivr_nomedia(session-&gt;uuid_str, SMF_REBRIDGE);                \
+                }                                                                                                                                \
+        }                                                                                                                                        \
+                
</ins><span class="cx"> SWITCH_DECLARE(uint32_t) switch_core_session_private_event_count(switch_core_session_t *session)
</span><span class="cx"> {
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><del>-
</del><ins>+        uint32_t count = 0;
+        
</ins><span class="cx">         if (!switch_channel_test_flag(channel, CF_EVENT_LOCK) &amp;&amp; session-&gt;private_event_queue) {
</span><del>-                return switch_queue_size(session-&gt;private_event_queue);
</del><ins>+                count = switch_queue_size(session-&gt;private_event_queue);
+                if (count == 0) {
+                        check_media(session);
+                }
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        return 0;
</del><ins>+        return count;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_private_event(switch_core_session_t *session, switch_event_t **event)
</span><span class="lines">@@ -889,6 +901,8 @@
</span><span class="cx">         if (session-&gt;private_event_queue) {
</span><span class="cx">                 if ((status = (switch_status_t) switch_queue_trypop(session-&gt;private_event_queue, &amp;pop)) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         *event = (switch_event_t *) pop;
</span><ins>+                } else {
+                        check_media(session);
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -905,6 +919,7 @@
</span><span class="cx">                 while ((status = (switch_status_t) switch_queue_trypop(session-&gt;private_event_queue, &amp;pop)) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         x++;
</span><span class="cx">                 }
</span><ins>+                check_media(session);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         return x;
</span><span class="lines">@@ -1420,9 +1435,30 @@
</span><span class="cx">         return session-&gt;app_log;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application(switch_core_session_t *session, const char *app, const char *arg)
</del><ins>+SWITCH_DECLARE(switch_status_t) switch_core_session_get_app_flags(const char *app, int32_t *flags)
</ins><span class="cx"> {
</span><span class="cx">         switch_application_interface_t *application_interface;
</span><ins>+        switch_status_t status = SWITCH_STATUS_FALSE;
+
+        switch_assert(flags);
+
+        *flags = 0;
+
+        if ((application_interface = switch_loadable_module_get_application_interface(app)) == 0) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Invalid Application %s\n&quot;, app);
+        } else if (application_interface-&gt;flags) {
+                *flags = application_interface-&gt;flags;
+                status = SWITCH_STATUS_SUCCESS;
+        }
+
+        return status;
+
+}
+
+SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application_get_flags(switch_core_session_t *session, const char *app, 
+                                                                                                                                                                  const char *arg, int32_t *flags)
+{
+        switch_application_interface_t *application_interface;
</ins><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">         
</span><span class="cx">         if (switch_channel_down(session-&gt;channel)) {
</span><span class="lines">@@ -1442,6 +1478,10 @@
</span><span class="cx">                 switch_goto_status(SWITCH_STATUS_FALSE, done);
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if (flags &amp;&amp; application_interface-&gt;flags) {
+                *flags = application_interface-&gt;flags;
+        }
+
</ins><span class="cx">         if (switch_channel_test_flag(session-&gt;channel, CF_PROXY_MODE) &amp;&amp; !switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA)) {
</span><span class="cx">                 switch_ivr_media(session-&gt;uuid_str, SMF_NONE);
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, &quot;Application %s Requires media on channel %s!\n&quot;,
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_ivr_asyncc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_ivr_async.c (15756 => 15757)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_ivr_async.c        2009-12-02 18:07:09 UTC (rev 15756)
+++ freeswitch/trunk/src/switch_ivr_async.c        2009-12-02 18:13:11 UTC (rev 15757)
</span><span class="lines">@@ -2662,7 +2662,6 @@
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(const char *uuid, const char *path, switch_media_flag_t flags)
</span><span class="cx"> {
</span><span class="cx">         switch_channel_t *channel;
</span><del>-        int nomedia;
</del><span class="cx">         switch_core_session_t *session, *master;
</span><span class="cx">         switch_event_t *event;
</span><span class="cx">         switch_core_session_t *other_session = NULL;
</span><span class="lines">@@ -2671,7 +2670,7 @@
</span><span class="cx">         char *cause = NULL;
</span><span class="cx">         char *mypath;
</span><span class="cx">         char *p;
</span><del>-        int custom = 0;
</del><ins>+        int app_flags = 0, nomedia = 1;
</ins><span class="cx"> 
</span><span class="cx">         switch_assert(path);
</span><span class="cx"> 
</span><span class="lines">@@ -2689,19 +2688,10 @@
</span><span class="cx">                 *p++ = '\0';
</span><span class="cx">                 *p++ = '\0';
</span><span class="cx">                 path = p;
</span><del>-                custom++;
</del><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!custom &amp;&amp; (switch_channel_test_flag(channel, CF_EVENT_PARSE))) {
-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, &quot;Channel [%s][%s] already broadcasting...broadcast aborted\n&quot;,
-                                                  switch_channel_get_name(channel), path);
-                switch_core_session_rwunlock(session);
-                switch_safe_free(mypath);                
-                return SWITCH_STATUS_FALSE;
-        }
-
-
-        if ((nomedia = switch_channel_test_flag(channel, CF_PROXY_MODE))) {
</del><ins>+        if (switch_channel_test_flag(channel, CF_PROXY_MODE)) {
+                nomedia = 1;
</ins><span class="cx">                 switch_ivr_media(uuid, SMF_REBRIDGE);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -2715,9 +2705,10 @@
</span><span class="cx">         if ((flags &amp; SMF_ECHO_BLEG) &amp;&amp; (other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
</span><span class="cx">                 &amp;&amp; (other_session = switch_core_session_locate(other_uuid))) {
</span><span class="cx">                 if ((flags &amp; SMF_EXEC_INLINE)) {
</span><del>-                        switch_core_session_execute_application(other_session, app, path);
</del><ins>+                        switch_core_session_execute_application_get_flags(other_session, app, path, &amp;app_flags);
</ins><span class="cx">                         nomedia = 0;
</span><span class="cx">                 } else {
</span><ins>+                        switch_core_session_get_app_flags(app, &amp;app_flags);
</ins><span class="cx">                         if (switch_event_create(&amp;event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, &quot;call-command&quot;, &quot;execute&quot;);
</span><span class="cx">                                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, &quot;execute-app-name&quot;, app);
</span><span class="lines">@@ -2735,21 +2726,20 @@
</span><span class="cx">                                 switch_core_session_queue_private_event(other_session, &amp;event);
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-
</del><ins>+                
</ins><span class="cx">                 switch_core_session_rwunlock(other_session);
</span><span class="cx">                 master = other_session;
</span><span class="cx">                 other_session = NULL;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (switch_stristr(&quot;record&quot;, app)) {
</del><ins>+        if ((app_flags &amp; SAF_MEDIA_TAP)) {
</ins><span class="cx">                 nomedia = 0;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-
</del><span class="cx">         if ((flags &amp; SMF_ECHO_ALEG)) {
</span><span class="cx">                 if ((flags &amp; SMF_EXEC_INLINE)) {
</span><del>-                        switch_core_session_execute_application(session, app, path);
</del><span class="cx">                         nomedia = 0;
</span><ins>+                        switch_core_session_execute_application(session, app, path);
</ins><span class="cx">                 } else {
</span><span class="cx">                         if (switch_event_create(&amp;event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, &quot;call-command&quot;, &quot;execute&quot;);
</span><span class="lines">@@ -2764,20 +2754,12 @@
</span><span class="cx">                                         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, &quot;hold-bleg&quot;, &quot;true&quot;);
</span><span class="cx">                                 }
</span><span class="cx">                                 switch_core_session_queue_private_event(session, &amp;event);
</span><ins>+                                if (nomedia) switch_channel_set_flag(channel, CF_BROADCAST_DROP_MEDIA);
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 master = session;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (nomedia) {
-                if (switch_event_create(&amp;event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, &quot;call-command&quot;, &quot;nomedia&quot;);
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, &quot;nomedia-uuid&quot;, uuid);
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, &quot;event-lock&quot;, &quot;true&quot;);
-                        switch_core_session_queue_private_event(master, &amp;event);
-                }
-        }
-
</del><span class="cx">         if (cause) {
</span><span class="cx">                 if (switch_event_create(&amp;event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, &quot;call-command&quot;, &quot;execute&quot;);
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>