LCC: add conference hold and unhold actions

This commit is contained in:
Dave Horton
2021-09-22 07:39:44 -04:00
parent 3cd4c399d4
commit 862405c232
8 changed files with 173 additions and 39 deletions

View File

@@ -1,6 +1,7 @@
const Task = require('./task');
const {TaskName, TaskPreconditions} = require('../utils/constants');
const bent = require('bent');
const { v4: uuidv4 } = require('uuid');
class TaskMessage extends Task {
constructor(logger, opts) {
@@ -8,13 +9,11 @@ class TaskMessage extends Task {
this.preconditions = TaskPreconditions.None;
this.payload = {
message_sid: this.data.message_sid,
message_sid: this.data.message_sid || uuidv4(),
provider: this.data.provider,
to: this.data.to,
from: this.data.from,
cc: this.data.cc,
text: this.data.text,
media: this.data.media
text: this.data.text
};
}
@@ -30,7 +29,7 @@ class TaskMessage extends Task {
let payload = this.payload;
await super.exec(cs);
try {
const {getSBC, getSmpp, dbHelpers} = srf.locals;
const {getSmpp, dbHelpers} = srf.locals;
const {lookupSmppGateways} = dbHelpers;
this.logger.info(`looking up gateways for account_sid: ${accountSid}`);
@@ -50,13 +49,14 @@ class TaskMessage extends Task {
};
}
else {
//TMP: smpp only at the moment, need to add http back in
/*
this.logger.info({gw, accountSid, provider: this.payload.provider},
'Message:exec - no smpp gateways found to send message');
relativeUrl = 'v1/outboundSMS';
const sbcAddress = getSBC();
if (sbcAddress) url = `http://${sbcAddress}:3000/`;
//TMP: smpp only at the moment, need to add http back in
*/
return res.sendStatus(404);
}
if (url) {