mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
allow pause/resume background listen with silence/blank (#1300)
* allow pause/resume background listen with silence/blank * wip * wip * wip * wip * update drachtio-fsmrf version
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const Task = require('./task');
|
||||
const {TaskName, TaskPreconditions, ListenEvents, ListenStatus} = require('../utils/constants');
|
||||
const {TaskName, TaskPreconditions, ListenEvents, ListenStatus} = require('../utils/constants.json');
|
||||
const makeTask = require('./make_task');
|
||||
const moment = require('moment');
|
||||
const MAX_PLAY_AUDIO_QUEUE_SIZE = 10;
|
||||
@@ -103,9 +103,12 @@ class TaskListen extends Task {
|
||||
this.notifyTaskDone();
|
||||
}
|
||||
|
||||
async updateListen(status) {
|
||||
async updateListen(status, silence = false) {
|
||||
if (!this.killed && this.ep && this.ep.connected) {
|
||||
const args = this._bugname ? [this._bugname] : [];
|
||||
const args = [
|
||||
...(this._bugname ? [this._bugname] : []),
|
||||
...(status === ListenStatus.Pause ? ([silence]) : []),
|
||||
];
|
||||
this.logger.info(`TaskListen:updateListen status ${status}`);
|
||||
switch (status) {
|
||||
case ListenStatus.Pause:
|
||||
|
||||
Reference in New Issue
Block a user