mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
bugfix: config was not properly enabling amd when configured
This commit is contained in:
@@ -26,7 +26,7 @@ class TaskConfig extends Task {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (this.bargeIn.sticky) this.autoEnable = true;
|
if (this.bargeIn.sticky) this.autoEnable = true;
|
||||||
this.preconditions = (this.bargeIn.enable || this.record?.action) ?
|
this.preconditions = (this.bargeIn.enable || this.record?.action || this.data.amd) ?
|
||||||
TaskPreconditions.Endpoint :
|
TaskPreconditions.Endpoint :
|
||||||
TaskPreconditions.None;
|
TaskPreconditions.None;
|
||||||
}
|
}
|
||||||
@@ -54,13 +54,20 @@ class TaskConfig extends Task {
|
|||||||
return `${this.name}{${phrase.join(',')}`;
|
return `${this.name}{${phrase.join(',')}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
async exec(cs) {
|
async exec(cs, {ep}) {
|
||||||
await super.exec(cs);
|
await super.exec(cs);
|
||||||
|
|
||||||
if (this.data.amd) {
|
if (this.data.amd) {
|
||||||
this.startAmd = cs.startAmd;
|
this.startAmd = cs.startAmd;
|
||||||
this.stopAmd = cs.stopAmd;
|
this.stopAmd = cs.stopAmd;
|
||||||
this.on('amd', this._onAmdEvent.bind(this, cs));
|
this.on('amd', this._onAmdEvent.bind(this, cs));
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.ep = ep;
|
||||||
|
this.startAmd(cs, ep, this, this.data.amd);
|
||||||
|
} catch (err) {
|
||||||
|
this.logger.info({err}, 'Config:exec - Error calling startAmd');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.hasSynthesizer) {
|
if (this.hasSynthesizer) {
|
||||||
@@ -133,6 +140,7 @@ class TaskConfig extends Task {
|
|||||||
|
|
||||||
async kill(cs) {
|
async kill(cs) {
|
||||||
super.kill(cs);
|
super.kill(cs);
|
||||||
|
if (this.ep && this.stopAmd) this.stopAmd(this.ep, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onAmdEvent(cs, evt) {
|
_onAmdEvent(cs, evt) {
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ const clearChannels = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const clearFiles = () => {
|
const clearFiles = () => {
|
||||||
const {logger} = require('../..');
|
//const {logger} = require('../..');
|
||||||
const out = execSync('find /tmp -name "*.mp3" -mtime +2 -exec rm {} \\;');
|
/*const out = */ execSync('find /tmp -name "*.mp3" -mtime +2 -exec rm {} \\;');
|
||||||
logger.debug({out}, 'clearFiles: command output');
|
//logger.debug({out}, 'clearFiles: command output');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user