<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19746">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_cdr: Remove deprecated application and option.<br><br>This removes the deprecated NoCDR application, which<br>was deprecated in Asterisk 12, having long been fully<br>superseded by the CDR_PROP function.<br><br>The deprecated e option to ResetCDR is also removed<br>for the same reason.<br><br>ASTERISK-30371 #close<br><br>Change-Id: Id9ed094d8e4baf98bcbc610035c2295bfafe9ec0<br>---<br>M apps/app_cdr.c<br>M apps/app_forkcdr.c<br>A doc/UPGRADE-staging/app_cdr.txt<br>3 files changed, 27 insertions(+), 76 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/46/19746/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_cdr.c b/apps/app_cdr.c</span><br><span>index 3e52302..6929088 100644</span><br><span>--- a/apps/app_cdr.c</span><br><span>+++ b/apps/app_cdr.c</span><br><span>@@ -38,26 +38,6 @@</span><br><span> #include "asterisk/stasis_message_router.h"</span><br><span> </span><br><span> /*** DOCUMENTATION</span><br><span style="color: hsl(0, 100%, 40%);">- <application name="NoCDR" language="en_US"></span><br><span style="color: hsl(0, 100%, 40%);">-           <synopsis></span><br><span style="color: hsl(0, 100%, 40%);">-                        Tell Asterisk to not maintain a CDR for this channel.</span><br><span style="color: hsl(0, 100%, 40%);">-           </synopsis></span><br><span style="color: hsl(0, 100%, 40%);">-               <syntax /></span><br><span style="color: hsl(0, 100%, 40%);">-                <description></span><br><span style="color: hsl(0, 100%, 40%);">-                     <para>This application will tell Asterisk not to maintain a CDR for</span><br><span style="color: hsl(0, 100%, 40%);">-                       the current channel. This does <emphasis>NOT</emphasis> mean that</span><br><span style="color: hsl(0, 100%, 40%);">-                   information is not tracked; rather, if the channel is hung up no</span><br><span style="color: hsl(0, 100%, 40%);">-                        CDRs will be created for that channel.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                     <para>If a subsequent call to ResetCDR occurs, all non-finalized</span><br><span style="color: hsl(0, 100%, 40%);">-                  CDRs created for the channel will be enabled.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                      <note><para>This application is deprecated. Please use the CDR_PROP</span><br><span style="color: hsl(0, 100%, 40%);">-                 function to disable CDRs on a channel.</para></note></span><br><span style="color: hsl(0, 100%, 40%);">-                </description></span><br><span style="color: hsl(0, 100%, 40%);">-            <see-also></span><br><span style="color: hsl(0, 100%, 40%);">-                        <ref type="application">ResetCDR</ref></span><br><span style="color: hsl(0, 100%, 40%);">-                    <ref type="function">CDR_PROP</ref></span><br><span style="color: hsl(0, 100%, 40%);">-               </see-also></span><br><span style="color: hsl(0, 100%, 40%);">-       </application></span><br><span>         <application name="ResetCDR" language="en_US"></span><br><span>             <synopsis></span><br><span>                     Resets the Call Data Record.</span><br><span>@@ -68,10 +48,6 @@</span><br><span>                                    <option name="v"></span><br><span>                                            <para>Save the CDR variables during the reset.</para></span><br><span>                                    </option></span><br><span style="color: hsl(0, 100%, 40%);">-                                 <option name="e"></span><br><span style="color: hsl(0, 100%, 40%);">-                                               <para>Enable the CDRs for this channel only (negate</span><br><span style="color: hsl(0, 100%, 40%);">-                                               effects of NoCDR).</para></span><br><span style="color: hsl(0, 100%, 40%);">-                                 </option></span><br><span>                              </optionlist></span><br><span>                  </parameter></span><br><span>           </syntax></span><br><span>@@ -84,21 +60,14 @@</span><br><span>                        current time.</para></span><br><span>                   <para>3. All variables are wiped from the CDR. Note that this step</span><br><span>                     can be prevented with the <literal>v</literal> option.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                 <para>On the other hand, if the <literal>e</literal> option is</span><br><span style="color: hsl(0, 100%, 40%);">-                        specified, the effects of the NoCDR application will be lifted. CDRs</span><br><span style="color: hsl(0, 100%, 40%);">-                    will be re-enabled for this channel.</para></span><br><span style="color: hsl(0, 100%, 40%);">-                       <note><para>The <literal>e</literal> option is deprecated. Please</span><br><span style="color: hsl(0, 100%, 40%);">-                       use the CDR_PROP function instead.</para></note></span><br><span>                 </description></span><br><span>                 <see-also></span><br><span>                     <ref type="application">ForkCDR</ref></span><br><span style="color: hsl(0, 100%, 40%);">-                     <ref type="application">NoCDR</ref></span><br><span>                    <ref type="function">CDR_PROP</ref></span><br><span>            </see-also></span><br><span>    </application></span><br><span>  ***/</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static const char nocdr_app[] = "NoCDR";</span><br><span> static const char resetcdr_app[] = "ResetCDR";</span><br><span> </span><br><span> enum reset_cdr_options {</span><br><span>@@ -109,7 +78,6 @@</span><br><span> </span><br><span> AST_APP_OPTIONS(resetcdr_opts, {</span><br><span>         AST_APP_OPTION('v', AST_CDR_FLAG_KEEP_VARS),</span><br><span style="color: hsl(0, 100%, 40%);">-    AST_APP_OPTION('e', AST_CDR_FLAG_DISABLE_ALL),</span><br><span> });</span><br><span> </span><br><span> STASIS_MESSAGE_TYPE_DEFN_LOCAL(appcdr_message_type);</span><br><span>@@ -118,10 +86,6 @@</span><br><span> struct app_cdr_message_payload {</span><br><span>  /*! The name of the channel to be manipulated */</span><br><span>     const char *channel_name;</span><br><span style="color: hsl(0, 100%, 40%);">-       /*! Disable the CDR for this channel */</span><br><span style="color: hsl(0, 100%, 40%);">- unsigned int disable:1;</span><br><span style="color: hsl(0, 100%, 40%);">- /*! Re-enable the CDR for this channel */</span><br><span style="color: hsl(0, 100%, 40%);">-       unsigned int reenable:1;</span><br><span>     /*! Reset the CDR */</span><br><span>         unsigned int reset:1;</span><br><span>        /*! If reseting the CDR, keep the variables */</span><br><span>@@ -141,24 +105,9 @@</span><br><span>                return;</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   if (payload->disable) {</span><br><span style="color: hsl(0, 100%, 40%);">-              if (ast_cdr_set_property(payload->channel_name, AST_CDR_FLAG_DISABLE_ALL)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 ast_log(AST_LOG_WARNING, "Failed to disable CDRs on channel %s\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                            payload->channel_name);</span><br><span style="color: hsl(0, 100%, 40%);">-              }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       if (payload->reenable) {</span><br><span style="color: hsl(0, 100%, 40%);">-             if (ast_cdr_clear_property(payload->channel_name, AST_CDR_FLAG_DISABLE_ALL)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                       ast_log(AST_LOG_WARNING, "Failed to enable CDRs on channel %s\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                             payload->channel_name);</span><br><span style="color: hsl(0, 100%, 40%);">-              }</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    if (payload->reset) {</span><br><span>             if (ast_cdr_reset(payload->channel_name, payload->keep_variables)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                      ast_log(AST_LOG_WARNING, "Failed to reset CDRs on channel %s\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                              payload->channel_name);</span><br><span style="color: hsl(120, 100%, 40%);">+                    ast_log(AST_LOG_WARNING, "Failed to reset CDRs on channel %s\n", payload->channel_name);</span><br><span>                }</span><br><span>    }</span><br><span> }</span><br><span>@@ -204,10 +153,6 @@</span><br><span>        payload->channel_name = ast_channel_name(chan);</span><br><span>   payload->reset = 1;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      if (ast_test_flag(&flags, AST_CDR_FLAG_DISABLE_ALL)) {</span><br><span style="color: hsl(0, 100%, 40%);">-              payload->reenable = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    if (ast_test_flag(&flags, AST_CDR_FLAG_KEEP_VARS)) {</span><br><span>             payload->keep_variables = 1;</span><br><span>      }</span><br><span>@@ -215,21 +160,6 @@</span><br><span>     return publish_app_cdr_message(chan, payload);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static int nocdr_exec(struct ast_channel *chan, const char *data)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">-       RAII_VAR(struct app_cdr_message_payload *, payload,</span><br><span style="color: hsl(0, 100%, 40%);">-             ao2_alloc(sizeof(*payload), NULL), ao2_cleanup);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        if (!payload) {</span><br><span style="color: hsl(0, 100%, 40%);">-         return -1;</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       payload->channel_name = ast_channel_name(chan);</span><br><span style="color: hsl(0, 100%, 40%);">-      payload->disable = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        return publish_app_cdr_message(chan, payload);</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> static int unload_module(void)</span><br><span> {</span><br><span>       RAII_VAR(struct stasis_message_router *, router, ast_cdr_message_router(), ao2_cleanup);</span><br><span>@@ -238,7 +168,6 @@</span><br><span>               stasis_message_router_remove(router, appcdr_message_type());</span><br><span>         }</span><br><span>    STASIS_MESSAGE_TYPE_CLEANUP(appcdr_message_type);</span><br><span style="color: hsl(0, 100%, 40%);">-       ast_unregister_application(nocdr_app);</span><br><span>       ast_unregister_application(resetcdr_app);</span><br><span>    return 0;</span><br><span> }</span><br><span>@@ -253,10 +182,8 @@</span><br><span>        }</span><br><span> </span><br><span>        res |= STASIS_MESSAGE_TYPE_INIT(appcdr_message_type);</span><br><span style="color: hsl(0, 100%, 40%);">-   res |= ast_register_application_xml(nocdr_app, nocdr_exec);</span><br><span>  res |= ast_register_application_xml(resetcdr_app, resetcdr_exec);</span><br><span style="color: hsl(0, 100%, 40%);">-       res |= stasis_message_router_add(router, appcdr_message_type(),</span><br><span style="color: hsl(0, 100%, 40%);">-                                  appcdr_callback, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+      res |= stasis_message_router_add(router, appcdr_message_type(), appcdr_callback, NULL);</span><br><span> </span><br><span>  if (res) {</span><br><span>           unload_module();</span><br><span>diff --git a/apps/app_forkcdr.c b/apps/app_forkcdr.c</span><br><span>index a906fc9..9e4c9ae 100644</span><br><span>--- a/apps/app_forkcdr.c</span><br><span>+++ b/apps/app_forkcdr.c</span><br><span>@@ -87,7 +87,7 @@</span><br><span>            </description></span><br><span>                 <see-also></span><br><span>                     <ref type="function">CDR</ref></span><br><span style="color: hsl(0, 100%, 40%);">-                    <ref type="application">NoCDR</ref></span><br><span style="color: hsl(120, 100%, 40%);">+                     <ref type="function">CDR_PROP</ref></span><br><span>                    <ref type="application">ResetCDR</ref></span><br><span>                 </see-also></span><br><span>    </application></span><br><span>diff --git a/doc/UPGRADE-staging/app_cdr.txt b/doc/UPGRADE-staging/app_cdr.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..114f0ad</span><br><span>--- /dev/null</span><br><span>+++ b/doc/UPGRADE-staging/app_cdr.txt</span><br><span>@@ -0,0 +1,6 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: app_cdr</span><br><span style="color: hsl(120, 100%, 40%);">+Master-Only: True</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The previously deprecated NoCDR application has been removed.</span><br><span style="color: hsl(120, 100%, 40%);">+Additionally, the previously deprecated 'e' option to the ResetCDR</span><br><span style="color: hsl(120, 100%, 40%);">+application has been removed.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19746">change 19746</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/+/19746"/><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: Id9ed094d8e4baf98bcbc610035c2295bfafe9ec0 </div>
<div style="display:none"> Gerrit-Change-Number: 19746 </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>