[Home]

Summary:ASTERISK-26173: func_cdr: CDR function does not permit empty values to be assigned
Reporter:gkloepfer (gkloepfer)Labels:
Date Opened:2016-07-05 13:06:00Date Closed:2017-05-08 18:22:39
Priority:MinorRegression?Yes
Status:Closed/CompleteComponents:Functions/func_cdr
Versions:13.7.0 13.9.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Will affect all operating systems and platforms (see description).Attachments:
Description:As of at least 13.7.0 (probably affects earlier releases), function CDR (func_cdr.c) does not allow empty values to be assigned to any CDR variables.  This was permitted in earlier Asterisk releases (11.x, for example, allowed this behavior).  Attempting to assign an empty value from the dialplan, as in:

{noformat}
same => n,Set(CDR(final_ganyid)=${myvariable})
{noformat}

will fail if the variable $\{myvariable} is empty (or if the assignment is purposely blank) with a message such as:

{noformat}
[Jul  5 10:57:20] WARNING[2875]: func_cdr.c:352 cdr_write_callback: CDR requires a value (CDR(variable)=value)
{noformat}

In func_cdr.c (cdr_write_callback) this is due to the following code:

{code:title=func_cdr.c}
       if (ast_strlen_zero(payload->value)) {
               ast_log(AST_LOG_WARNING, "%s requires a value (%s(variable)=value)\n)",
                       payload->cmd, payload->cmd);
               return;
       }
{code}
Comments:By: Asterisk Team (asteriskteam) 2016-07-05 13:06:01.595-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Friendly Automation (friendly-automation) 2017-05-08 18:22:40.371-0500

Change 5586 merged by Joshua Colp:
func_cdr: Allow empty value for CDR dialplan function.

[https://gerrit.asterisk.org/5586|https://gerrit.asterisk.org/5586]

By: Friendly Automation (friendly-automation) 2017-05-08 18:23:02.978-0500

Change 5587 merged by Joshua Colp:
func_cdr: Allow empty value for CDR dialplan function.

[https://gerrit.asterisk.org/5587|https://gerrit.asterisk.org/5587]

By: Friendly Automation (friendly-automation) 2017-05-08 18:36:37.824-0500

Change 5588 merged by Joshua Colp:
func_cdr: Allow empty value for CDR dialplan function.

[https://gerrit.asterisk.org/5588|https://gerrit.asterisk.org/5588]