mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2026-01-24 22:37:51 +00:00
Recording update (#229)
* new hasRecording flag on call info for setting recording URL in cdr * lint * use nullish coalescing for null response
This commit is contained in:
2
app.js
2
app.js
@@ -70,6 +70,7 @@ const {
|
||||
addKey,
|
||||
deleteKey,
|
||||
retrieveKey,
|
||||
retrieveHash,
|
||||
createSet,
|
||||
retrieveSet,
|
||||
addToSet,
|
||||
@@ -117,6 +118,7 @@ srf.locals = {...srf.locals,
|
||||
addKey,
|
||||
deleteKey,
|
||||
retrieveKey,
|
||||
retrieveHash,
|
||||
createSet,
|
||||
incrKey,
|
||||
decrKey,
|
||||
|
||||
@@ -66,6 +66,7 @@ class CallSession extends Emitter {
|
||||
this.decrKey = req.srf.locals.realtimeDbHelpers.decrKey;
|
||||
this.addKey = req.srf.locals.realtimeDbHelpers.addKey;
|
||||
this.retrieveKey = req.srf.locals.realtimeDbHelpers.retrieveKey;
|
||||
this.retrieveHash = req.srf.locals.realtimeDbHelpers.retrieveHash;
|
||||
|
||||
this._mediaPath = MediaPath.FullMedia;
|
||||
|
||||
@@ -491,7 +492,9 @@ class CallSession extends Emitter {
|
||||
this.req.locals.carrier :
|
||||
this.req.locals.originator;
|
||||
const application = await this.srf.locals.getApplicationBySid(application_sid);
|
||||
const isRecording = this.req.locals.account.record_all_calls || (application && application.record_all_calls);
|
||||
const {hasRecording} = await this.retrieveHash(`call:${this.account_sid}:${call_sid}`) ?? {};
|
||||
const isRecording = this.req.locals.account.record_all_calls ||
|
||||
(application && application.record_all_calls) || hasRecording;
|
||||
const day = new Date();
|
||||
let recording_url = `/Accounts/${this.account_sid}/RecentCalls/${call_sid}/record`;
|
||||
recording_url += `/${day.getFullYear()}/${(day.getMonth() + 1).toString().padStart(2, '0')}`;
|
||||
|
||||
Reference in New Issue
Block a user