Inconsistent CDR behavior on Asterisk 14.6?

One of the call flows we use executes a Dial with multiple endpoints which generates a CDR entry for each of the endpoints dialed. I would like to be able to run:


on each of the channels created and have the custom ‘extension’ field populated in our CDR database. I’ve have attempted to accomplish this via a predialer, option b(set-cdr-extension,s,1) to the Dial() application, where:

exten => s,1,Set(CDR(extension)=${CUT(DIALEDPEERNUMBER,-,1)})
  same => n,return

This functions as expected for the extension that has answers the call, but the custom CDR field is not populated on CDR entries where the disposition != ANSWERED.

I’ve tried running these calls through Local/ channels both with and without optimizing the Local/ channels away, and tried running the Set(CDR()) in every potential location (predialer, after the Dial() application fails, and before the Dial() in the Local/ context).

If I run the Set(CDR()) before the Dial application it will set the value in our CDR as the same value for each record. It appears that something about the disposition of the calls controls whether it honors Set(CDR()) when called as a predialer in the Dial Application.

Is this expected behavior for the new CDR system introduced in asterisk12, or is this unintended behavior I should create a bug report for?

Thanks ahead of time!

1 Like