use CDR API calls instead of re-implementing them (bug #4726)