mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-19 04:17:44 +00:00
bugfixes for queue events
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
"jsx": false,
|
"jsx": false,
|
||||||
"modules": false
|
"modules": false
|
||||||
},
|
},
|
||||||
"ecmaVersion": 2018
|
"ecmaVersion": 2020
|
||||||
},
|
},
|
||||||
"plugins": ["promise"],
|
"plugins": ["promise"],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
|||||||
@@ -192,6 +192,10 @@ class CallSession extends Emitter {
|
|||||||
return this.constructor.name === 'SmsCallSession';
|
return this.constructor.name === 'SmsCallSession';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get webhook_secret() {
|
||||||
|
return this.accountInfo?.account?.webhook_secret;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check for speech credentials for the specified vendor
|
* Check for speech credentials for the specified vendor
|
||||||
* @param {*} vendor - google or aws
|
* @param {*} vendor - google or aws
|
||||||
@@ -784,7 +788,8 @@ class CallSession extends Emitter {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.logger.info({accountSid: this.accountSid, webhook: r[0]}, 'performQueueWebhook: webhook found');
|
this.logger.info({accountSid: this.accountSid, webhook: r[0]}, 'performQueueWebhook: webhook found');
|
||||||
this.queueEventHookRequestor = new Requestor(this.logger, r[0]);
|
this.queueEventHookRequestor = new Requestor(this.logger, this.accountSid,
|
||||||
|
r[0], this.webhook_secret);
|
||||||
this.queueEventHook = r[0];
|
this.queueEventHook = r[0];
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -8,14 +8,15 @@ const CallSession = require('./call-session');
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
class ConfirmCallSession extends CallSession {
|
class ConfirmCallSession extends CallSession {
|
||||||
constructor({logger, application, dlg, ep, tasks, callInfo}) {
|
constructor({logger, application, dlg, ep, tasks, callInfo, accountInfo}) {
|
||||||
super({
|
super({
|
||||||
logger,
|
logger,
|
||||||
application,
|
application,
|
||||||
srf: dlg.srf,
|
srf: dlg.srf,
|
||||||
callSid: dlg.callSid,
|
callSid: dlg.callSid,
|
||||||
tasks,
|
tasks,
|
||||||
callInfo
|
callInfo,
|
||||||
|
accountInfo
|
||||||
});
|
});
|
||||||
this.dlg = dlg;
|
this.dlg = dlg;
|
||||||
this.ep = ep;
|
this.ep = ep;
|
||||||
|
|||||||
@@ -346,6 +346,7 @@ class TaskEnqueue extends Task {
|
|||||||
dlg,
|
dlg,
|
||||||
ep: cs.ep,
|
ep: cs.ep,
|
||||||
callInfo: cs.callInfo,
|
callInfo: cs.callInfo,
|
||||||
|
accountInfo: cs.accountInfo,
|
||||||
tasks: tasksToRun
|
tasks: tasksToRun
|
||||||
});
|
});
|
||||||
await this._playSession.exec();
|
await this._playSession.exec();
|
||||||
|
|||||||
Reference in New Issue
Block a user