From 96daad8ea14a9f2238e71629de5203d71fbdf0ff Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Thu, 12 Jan 2023 16:04:30 -0500 Subject: [PATCH] bugfix: fix ref error on this.req.locals.account.disable_cdrs --- .eslintrc.json | 2 +- lib/call-session.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 03e3cfe..fecc21e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,7 +8,7 @@ "jsx": false, "modules": false }, - "ecmaVersion": 2018 + "ecmaVersion": 2020 }, "plugins": ["promise"], "rules": { diff --git a/lib/call-session.js b/lib/call-session.js index 160f0ff..dd5966f 100644 --- a/lib/call-session.js +++ b/lib/call-session.js @@ -384,7 +384,10 @@ class CallSession extends Emitter { else if (this.req.locals.registration) trunk = 'user'; else trunk = 'sipUri'; } - if (!this.req.locals.account.disable_cdrs) { + if (this.req.locals.account?.disable_cdrs) { + this.logger.debug('cdrs disabled for this account'); + } + else { this.req.locals.cdr = { ...initCdr(this.req.srf, inv), service_provider_sid: this.req.locals.service_provider_sid,