<!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 << 0),
</span><del>-        SAF_ROUTING_EXEC = (1 << 1)
</del><ins>+        SAF_ROUTING_EXEC = (1 << 1),
+        SAF_MEDIA_TAP = (1 << 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, "unbind_meta_app", "Unbind a key from an application", "Unbind a key from an application", dtmf_unbind_function,
</span><span class="cx">                                  UNBIND_SYNTAX, SAF_SUPPORT_NOMEDIA);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "intercept", "intercept", "intercept", intercept_function, INTERCEPT_SYNTAX, SAF_NONE);
</span><del>-        SWITCH_ADD_APP(app_interface, "eavesdrop", "eavesdrop on a uuid", "eavesdrop on a uuid", eavesdrop_function, eavesdrop_SYNTAX, SAF_NONE);
-        SWITCH_ADD_APP(app_interface, "three_way", "three way call with a uuid", "three way call with a uuid", three_way_function, threeway_SYNTAX, SAF_NONE);
</del><ins>+        SWITCH_ADD_APP(app_interface, "eavesdrop", "eavesdrop on a uuid", "eavesdrop on a uuid", eavesdrop_function, eavesdrop_SYNTAX, SAF_MEDIA_TAP);
+        SWITCH_ADD_APP(app_interface, "three_way", "three way call with a uuid", "three way call with a uuid", three_way_function, threeway_SYNTAX, SAF_MEDIA_TAP);
</ins><span class="cx">         SWITCH_ADD_APP(app_interface, "set_user", "Set a User", "Set a User", set_user_function, SET_USER_SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC );
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "stop_dtmf", "stop inband dtmf", "Stop detecting inband dtmf.", stop_dtmf_session_function, "", SAF_NONE);
</span><del>-        SWITCH_ADD_APP(app_interface, "start_dtmf", "Detect dtmf", "Detect inband dtmf on the session", dtmf_session_function, "", SAF_NONE);
</del><ins>+        SWITCH_ADD_APP(app_interface, "start_dtmf", "Detect dtmf", "Detect inband dtmf on the session", dtmf_session_function, "", SAF_MEDIA_TAP);
</ins><span class="cx">         SWITCH_ADD_APP(app_interface, "stop_dtmf_generate", "stop inband dtmf generation", "Stop generating inband dtmf.",
</span><span class="cx">                                  stop_dtmf_session_generate_function, "[write]", SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "start_dtmf_generate", "Generate dtmf", "Generate inband dtmf on the session", dtmf_session_generate_function, "",
</span><span class="cx">                                  SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "stop_tone_detect", "stop detecting tones", "Stop detecting tones", stop_fax_detect_session_function, "", SAF_NONE);
</span><del>-        SWITCH_ADD_APP(app_interface, "fax_detect", "Detect faxes", "Detect fax send tone", fax_detect_session_function, "", SAF_NONE);
-        SWITCH_ADD_APP(app_interface, "tone_detect", "Detect tones", "Detect tones", tone_detect_session_function, "", SAF_NONE);
</del><ins>+        SWITCH_ADD_APP(app_interface, "fax_detect", "Detect faxes", "Detect fax send tone", fax_detect_session_function, "", SAF_MEDIA_TAP);
+        SWITCH_ADD_APP(app_interface, "tone_detect", "Detect tones", "Detect tones", tone_detect_session_function, "", SAF_MEDIA_TAP);
</ins><span class="cx">         SWITCH_ADD_APP(app_interface, "echo", "Echo", "Perform an echo test against the calling channel", echo_function, "", SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "park", "Park", "Park", park_function, "", SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "park_state", "Park State", "Park State", park_state_function, "", SAF_NONE);
</span><span class="lines">@@ -3023,14 +3023,14 @@
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "play_and_get_digits", "Play and get Digits", "Play and get Digits",
</span><span class="cx">                                  play_and_get_digits_function, "<min> <max> <tries> <timeout> <terminators> <file> <invalid_file> <var_name> <regexp>", SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "stop_record_session", "Stop Record Session", STOP_SESS_REC_DESC, stop_record_session_function, "<path>", SAF_NONE);
</span><del>-        SWITCH_ADD_APP(app_interface, "record_session", "Record Session", SESS_REC_DESC, record_session_function, "<path> [+<timeout>]", SAF_NONE);
</del><ins>+        SWITCH_ADD_APP(app_interface, "record_session", "Record Session", SESS_REC_DESC, record_session_function, "<path> [+<timeout>]", SAF_MEDIA_TAP);
</ins><span class="cx">         SWITCH_ADD_APP(app_interface, "record", "Record File", "Record a file from the channels input", record_function,
</span><span class="cx">                                  "<path> [<time_limit_secs>] [<silence_thresh>] [<silence_hits>]", SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "preprocess", "pre-process", "pre-process", preprocess_session_function, "", SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "stop_displace_session", "Stop Displace File", "Stop Displacing to a file", stop_displace_session_function, "<path>",
</span><span class="cx">                                  SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "displace_session", "Displace File", DISPLACE_DESC, displace_session_function, "<path> [<flags>] [+time_limit_ms]",
</span><del>-                                 SAF_NONE);
</del><ins>+                                 SAF_MEDIA_TAP);
</ins><span class="cx">         SWITCH_ADD_APP(app_interface, "speak", "Speak text", SPEAK_DESC, speak_function, "<engine>|<voice>|<text>", SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "clear_speech_cache", "Clear Speech Handle Cache", "Clear Speech Handle Cache", clear_speech_cache_function, "",
</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->channel, CF_BROADCAST_DROP_MEDIA)) { \
+                        switch_channel_clear_flag(session->channel, CF_BROADCAST_DROP_MEDIA); \
+                        switch_ivr_nomedia(session->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) && session->private_event_queue) {
</span><del>-                return switch_queue_size(session->private_event_queue);
</del><ins>+                count = switch_queue_size(session->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->private_event_queue) {
</span><span class="cx">                 if ((status = (switch_status_t) switch_queue_trypop(session->private_event_queue, &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->private_event_queue, &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->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, "Invalid Application %s\n", app);
+        } else if (application_interface->flags) {
+                *flags = application_interface->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->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 && application_interface->flags) {
+                *flags = application_interface->flags;
+        }
+
</ins><span class="cx">         if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) && !switch_test_flag(application_interface, SAF_SUPPORT_NOMEDIA)) {
</span><span class="cx">                 switch_ivr_media(session->uuid_str, SMF_NONE);
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Application %s Requires media on channel %s!\n",
</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 && (switch_channel_test_flag(channel, CF_EVENT_PARSE))) {
-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Channel [%s][%s] already broadcasting...broadcast aborted\n",
-                                                 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 & SMF_ECHO_BLEG) && (other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
</span><span class="cx">                 && (other_session = switch_core_session_locate(other_uuid))) {
</span><span class="cx">                 if ((flags & 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, &app_flags);
</ins><span class="cx">                         nomedia = 0;
</span><span class="cx">                 } else {
</span><ins>+                        switch_core_session_get_app_flags(app, &app_flags);
</ins><span class="cx">                         if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
</span><span class="cx">                                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", app);
</span><span class="lines">@@ -2735,21 +2726,20 @@
</span><span class="cx">                                 switch_core_session_queue_private_event(other_session, &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("record", app)) {
</del><ins>+        if ((app_flags & 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 & SMF_ECHO_ALEG)) {
</span><span class="cx">                 if ((flags & 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(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
</span><span class="lines">@@ -2764,20 +2754,12 @@
</span><span class="cx">                                         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hold-bleg", "true");
</span><span class="cx">                                 }
</span><span class="cx">                                 switch_core_session_queue_private_event(session, &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(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "nomedia");
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "nomedia-uuid", uuid);
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-lock", "true");
-                        switch_core_session_queue_private_event(master, &event);
-                }
-        }
-
</del><span class="cx">         if (cause) {
</span><span class="cx">                 if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>