Suppressing CDR records

I have a situation where for certain calls, I wish to suppress the creation of CDR records, specifically when I unpark a call. So in the context where my unparking is routed, I do the following:

  exten => _7XX, n, NoOp(=-=-=- ${EXTEN}@${CONTEXT} -=-=-=)
  exten => _7XX, n, ResetCDR()
  exten => _7XX, n, NoCDR()
  ; following this is the unparking and bookkeeping
  exten => _7XX, n, Hangup()

  exten => h, 1, Goto(handlers, hangup, 1)

  exten => hangup, 1, NoOp(=-=-=- ${EXTEN}@${CONTEXT} -=-=-=)
  exten => hangup, n, ResetCDR(w)
  exten => hangup, n, NoCDR()

I would thing that calling ResetCDR and NoCDR during the unpark would have prevented a CDR record from getting created, but this is not the case. Are there are other CDR oriented functions I should be using.

Try with NoCDR

I did. At the very beginning of call-unpark I do:

  exten => _7XX, n, ResetCDR()
  exten => _7XX, n, NoCDR()

Should I be using certain options? I figured doing ResetCDR without the w parameters would clear everything out, but I guess not.

I tested this on my dial plan and work.
exten => _2.,1,Answer()

I removed the ResetCDR() call and now it only generates one CDR record. It’s odd, but it works.

[quote] -= Info about application ‘ResetCDR’ =-

Resets the Call Data Record.

This application causes the Call Data Record to be reset.


w: Store the current CDR record before resetting it.
a: Store any stacked records.
v: Save CDR variables.
e: Enable CDR only (negate effects of NoCDR).

[See Also]
ForkCDR(), NoCDR()