refactor dialer cdr functions