bugfix: fix ref error on this.req.locals.account.disable_cdrs

This commit is contained in:
Dave Horton
2023-01-12 16:04:30 -05:00
parent b68edf425d
commit 96daad8ea1
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
"jsx": false,
"modules": false
},
"ecmaVersion": 2018
"ecmaVersion": 2020
},
"plugins": ["promise"],
"rules": {
+4 -1
View File
@@ -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,