<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19469">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_mixmonitor: Add option to delete files on exit.<br><br>Adds an option that allows MixMonitor to delete<br>its copy of any recording files before exiting.<br><br>This can be handy in conjunction with options<br>like m, which copy the file elsewhere, and the<br>original files may no longer be needed.<br><br>ASTERISK-30284 #close<br><br>Change-Id: Ida093679c67e300efc154a97b6d8ec0f104e581e<br>---<br>M apps/app_mixmonitor.c<br>A doc/CHANGES-staging/app_mixmonitor_delete.txt<br>2 files changed, 44 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/69/19469/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c</span><br><span>index a0eb1db..e2b9e8c 100644</span><br><span>--- a/apps/app_mixmonitor.c</span><br><span>+++ b/apps/app_mixmonitor.c</span><br><span>@@ -90,6 +90,11 @@</span><br><span>                                          <para>Play a periodic beep while this call is being recorded.</para></span><br><span>                                             <argument name="interval"><para>Interval, in seconds. Default is 15.</para></argument></span><br><span>                                     </option></span><br><span style="color: hsl(120, 100%, 40%);">+                                       <option name="d"></span><br><span style="color: hsl(120, 100%, 40%);">+                                             <para>Delete the recording file as soon as MixMonitor is done with it.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                             <para>For example, if you use the m option to dispatch the recording to a voicemail box,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                you can specify this option to delete the original copy of it afterwards.</para></span><br><span style="color: hsl(120, 100%, 40%);">+                                        </option></span><br><span>                                      <option name="v"></span><br><span>                                            <para>Adjust the <emphasis>heard</emphasis> volume by a factor of <replaceable>x</replaceable></span><br><span>                                                 (range <literal>-4</literal> to <literal>4</literal>)</para></span><br><span>@@ -407,6 +412,7 @@</span><br><span>     MUXFLAG_BEEP_STOP = (1 << 13),</span><br><span>         MUXFLAG_DEPRECATED_RWSYNC = (1 << 14),</span><br><span>         MUXFLAG_NO_RWSYNC = (1 << 15),</span><br><span style="color: hsl(120, 100%, 40%);">+  MUXFLAG_AUTO_DELETE = (1 << 16),</span><br><span> };</span><br><span> </span><br><span> enum mixmonitor_args {</span><br><span>@@ -427,6 +433,7 @@</span><br><span>     AST_APP_OPTION('a', MUXFLAG_APPEND),</span><br><span>         AST_APP_OPTION('b', MUXFLAG_BRIDGED),</span><br><span>        AST_APP_OPTION_ARG('B', MUXFLAG_BEEP, OPT_ARG_BEEP_INTERVAL),</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_APP_OPTION('d', MUXFLAG_AUTO_DELETE),</span><br><span>    AST_APP_OPTION('p', MUXFLAG_BEEP_START),</span><br><span>     AST_APP_OPTION('P', MUXFLAG_BEEP_STOP),</span><br><span>      AST_APP_OPTION_ARG('v', MUXFLAG_READVOLUME, OPT_ARG_READVOLUME),</span><br><span>@@ -860,6 +867,19 @@</span><br><span>              ast_debug(3, "No recipients to forward monitor to, moving on.\n");</span><br><span>         }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_test_flag(mixmonitor, MUXFLAG_AUTO_DELETE)) {</span><br><span style="color: hsl(120, 100%, 40%);">+         ast_debug(3, "Deleting our copies of recording files\n");</span><br><span style="color: hsl(120, 100%, 40%);">+           if (!ast_strlen_zero(fs_ext)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       ast_filedelete(mixmonitor->filename, fs_ext);</span><br><span style="color: hsl(120, 100%, 40%);">+              }</span><br><span style="color: hsl(120, 100%, 40%);">+             if (!ast_strlen_zero(fs_read_ext)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                  ast_filedelete(mixmonitor->filename_read, fs_ext);</span><br><span style="color: hsl(120, 100%, 40%);">+         }</span><br><span style="color: hsl(120, 100%, 40%);">+             if (!ast_strlen_zero(fs_write_ext)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 ast_filedelete(mixmonitor->filename_write, fs_ext);</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  mixmonitor_free(mixmonitor);</span><br><span> </span><br><span>     ast_module_unref(ast_module_info->self);</span><br><span>diff --git a/doc/CHANGES-staging/app_mixmonitor_delete.txt b/doc/CHANGES-staging/app_mixmonitor_delete.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..924c9c0</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/app_mixmonitor_delete.txt</span><br><span>@@ -0,0 +1,6 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: app_mixmonitor</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The d option for MixMonitor now allows deleting</span><br><span style="color: hsl(120, 100%, 40%);">+the original recording when MixMonitor exits,</span><br><span style="color: hsl(120, 100%, 40%);">+which can be useful when MixMonitor copies it</span><br><span style="color: hsl(120, 100%, 40%);">+somewhere else before exiting.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19469">change 19469</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/19469"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ida093679c67e300efc154a97b6d8ec0f104e581e </div>
<div style="display:none"> Gerrit-Change-Number: 19469 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>