mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-02-13 01:39:26 +00:00
support listen verb support bidirectionalAudioSampleRate (#695)
* support listen verb support bidirectionalAudioSampleRate * ưip * update verb spec and drachtio fsmrf * fix listen failing testcase * fix review comment * update freeswitch test image * update freeswitch teset image --------- Co-authored-by: Dave Horton <daveh@beachdognet.com>
This commit is contained in:
@@ -8,6 +8,10 @@ const DTMF_SPAN_NAME = 'dtmf';
|
|||||||
class TaskListen extends Task {
|
class TaskListen extends Task {
|
||||||
constructor(logger, opts, parentTask) {
|
constructor(logger, opts, parentTask) {
|
||||||
super(logger, opts);
|
super(logger, opts);
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
* use bidirectionalAudio.enabled
|
||||||
|
*/
|
||||||
this.disableBidirectionalAudio = opts.disableBidirectionalAudio;
|
this.disableBidirectionalAudio = opts.disableBidirectionalAudio;
|
||||||
this.preconditions = TaskPreconditions.Endpoint;
|
this.preconditions = TaskPreconditions.Endpoint;
|
||||||
|
|
||||||
@@ -25,6 +29,15 @@ class TaskListen extends Task {
|
|||||||
this.results = {};
|
this.results = {};
|
||||||
this.playAudioQueue = [];
|
this.playAudioQueue = [];
|
||||||
this.isPlayingAudioFromQueue = false;
|
this.isPlayingAudioFromQueue = false;
|
||||||
|
this.bidirectionalAudio = {
|
||||||
|
enabled: this.disableBidirectionalAudio === true ? false : true,
|
||||||
|
...(this.data['bidirectionalAudio']),
|
||||||
|
};
|
||||||
|
|
||||||
|
// From drachtio-version 3.0.40, forkAudioStart will send empty bugname, metadata together with
|
||||||
|
// bidirectionalAudio params that cause old version of freeswitch missunderstand between bugname and
|
||||||
|
// bidirectionalAudio params
|
||||||
|
this._bugname = 'audio_fork';
|
||||||
|
|
||||||
if (this.transcribe) this.transcribeTask = makeTask(logger, {'transcribe': opts.transcribe}, this);
|
if (this.transcribe) this.transcribeTask = makeTask(logger, {'transcribe': opts.transcribe}, this);
|
||||||
}
|
}
|
||||||
@@ -133,7 +146,8 @@ class TaskListen extends Task {
|
|||||||
mixType: this.mixType,
|
mixType: this.mixType,
|
||||||
sampling: this.sampleRate,
|
sampling: this.sampleRate,
|
||||||
...(this._bugname && {bugname: this._bugname}),
|
...(this._bugname && {bugname: this._bugname}),
|
||||||
metadata
|
metadata,
|
||||||
|
bidirectionalAudio: this.bidirectionalAudio || {}
|
||||||
});
|
});
|
||||||
this.recordStartTime = moment();
|
this.recordStartTime = moment();
|
||||||
if (this.maxLength) {
|
if (this.maxLength) {
|
||||||
@@ -153,7 +167,7 @@ class TaskListen extends Task {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* support bi-directional audio */
|
/* support bi-directional audio */
|
||||||
if (!this.disableBidirectionalAudio) {
|
if (this.bidirectionalAudio.enabled) {
|
||||||
ep.addCustomEventListener(ListenEvents.PlayAudio, this._onPlayAudio.bind(this, ep));
|
ep.addCustomEventListener(ListenEvents.PlayAudio, this._onPlayAudio.bind(this, ep));
|
||||||
}
|
}
|
||||||
ep.addCustomEventListener(ListenEvents.KillAudio, this._onKillAudio.bind(this, ep));
|
ep.addCustomEventListener(ListenEvents.KillAudio, this._onKillAudio.bind(this, ep));
|
||||||
|
|||||||
14
package-lock.json
generated
14
package-lock.json
generated
@@ -31,7 +31,7 @@
|
|||||||
"bent": "^7.3.12",
|
"bent": "^7.3.12",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"deepcopy": "^2.1.0",
|
"deepcopy": "^2.1.0",
|
||||||
"drachtio-fsmrf": "^3.0.39",
|
"drachtio-fsmrf": "^3.0.40",
|
||||||
"drachtio-srf": "^4.5.31",
|
"drachtio-srf": "^4.5.31",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"express-validator": "^7.0.1",
|
"express-validator": "^7.0.1",
|
||||||
@@ -6091,9 +6091,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/drachtio-fsmrf": {
|
"node_modules/drachtio-fsmrf": {
|
||||||
"version": "3.0.39",
|
"version": "3.0.40",
|
||||||
"resolved": "https://registry.npmjs.org/drachtio-fsmrf/-/drachtio-fsmrf-3.0.39.tgz",
|
"resolved": "https://registry.npmjs.org/drachtio-fsmrf/-/drachtio-fsmrf-3.0.40.tgz",
|
||||||
"integrity": "sha512-ATpmm3HA6Skp9R8Kt12Jc9g7BV5nZqRSHJsPEQF7AMhRtrEIrSC1GsMEIqwGTCH/wO4lBRh0+gXTtDuVFBCsVg==",
|
"integrity": "sha512-Mlteu/e1fa1Y4ClkVehMGnto+AKp5NhgIgwKSkFlaCi7Xl8qOqK5IbzgHyPZ2pDE2q7euieNGo+vtB2dUMIIog==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"camel-case": "^4.1.2",
|
"camel-case": "^4.1.2",
|
||||||
"debug": "^2.6.9",
|
"debug": "^2.6.9",
|
||||||
@@ -16183,9 +16183,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"drachtio-fsmrf": {
|
"drachtio-fsmrf": {
|
||||||
"version": "3.0.39",
|
"version": "3.0.40",
|
||||||
"resolved": "https://registry.npmjs.org/drachtio-fsmrf/-/drachtio-fsmrf-3.0.39.tgz",
|
"resolved": "https://registry.npmjs.org/drachtio-fsmrf/-/drachtio-fsmrf-3.0.40.tgz",
|
||||||
"integrity": "sha512-ATpmm3HA6Skp9R8Kt12Jc9g7BV5nZqRSHJsPEQF7AMhRtrEIrSC1GsMEIqwGTCH/wO4lBRh0+gXTtDuVFBCsVg==",
|
"integrity": "sha512-Mlteu/e1fa1Y4ClkVehMGnto+AKp5NhgIgwKSkFlaCi7Xl8qOqK5IbzgHyPZ2pDE2q7euieNGo+vtB2dUMIIog==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"camel-case": "^4.1.2",
|
"camel-case": "^4.1.2",
|
||||||
"debug": "^2.6.9",
|
"debug": "^2.6.9",
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
"bent": "^7.3.12",
|
"bent": "^7.3.12",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"deepcopy": "^2.1.0",
|
"deepcopy": "^2.1.0",
|
||||||
"drachtio-fsmrf": "^3.0.39",
|
"drachtio-fsmrf": "^3.0.40",
|
||||||
"drachtio-srf": "^4.5.31",
|
"drachtio-srf": "^4.5.31",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"express-validator": "^7.0.1",
|
"express-validator": "^7.0.1",
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
freeswitch:
|
freeswitch:
|
||||||
image: drachtio/drachtio-freeswitch-mrf:0.6.2
|
image: drachtio/drachtio-freeswitch-mrf:0.7.3
|
||||||
restart: always
|
restart: always
|
||||||
command: freeswitch --rtp-range-start 20000 --rtp-range-end 20100
|
command: freeswitch --rtp-range-start 20000 --rtp-range-end 20100
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user