mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
feat: record all calls (#352)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * fix jslint * fix * wip * wip * wip * wip * wip * wip * wip * wip * fix: add file ext * fix: record format * fix outbound * update to drachtio-fsmrf with support for multiple recording streams on a call * enable DTMF during background listen recording * fix merge commit --------- Co-authored-by: Dave Horton <daveh@beachdognet.com>
This commit is contained in:
@@ -26,6 +26,9 @@ router.post('/', async(req, res) => {
|
||||
const restDial = makeTask(logger, {'rest:dial': req.body});
|
||||
restDial.appJson = app_json;
|
||||
const {lookupAccountDetails, lookupCarrierByPhoneNumber, lookupCarrier} = dbUtils(logger, srf);
|
||||
const {
|
||||
lookupAppBySid
|
||||
} = srf.locals.dbHelpers;
|
||||
const {getSBC, getFreeswitch} = srf.locals;
|
||||
const sbcAddress = getSBC();
|
||||
if (!sbcAddress) throw new Error('no available SBCs for outbound call creation');
|
||||
@@ -41,6 +44,9 @@ router.post('/', async(req, res) => {
|
||||
const account = await lookupAccountBySid(req.body.account_sid);
|
||||
const accountInfo = await lookupAccountDetails(req.body.account_sid);
|
||||
const callSid = uuidv4();
|
||||
const application = req.body.application_sid ? await lookupAppBySid(req.body.application_sid) : null;
|
||||
const record_all_calls = account.record_all_calls || (application && application.record_all_calls);
|
||||
const recordOutputFormat = account.record_format || 'mp3';
|
||||
|
||||
opts.headers = {
|
||||
...opts.headers,
|
||||
@@ -49,7 +55,8 @@ router.post('/', async(req, res) => {
|
||||
'X-Call-Sid': callSid,
|
||||
'X-Account-Sid': accountSid,
|
||||
...(req.body?.application_sid && {'X-Application-Sid': req.body.application_sid}),
|
||||
...(restDial.fromHost && {'X-Preferred-From-Host': restDial.fromHost})
|
||||
...(restDial.fromHost && {'X-Preferred-From-Host': restDial.fromHost}),
|
||||
...(record_all_calls && {'X-Record-All-Calls': recordOutputFormat})
|
||||
};
|
||||
|
||||
switch (target.type) {
|
||||
|
||||
Reference in New Issue
Block a user