diff --git a/lib/tasks/dial.js b/lib/tasks/dial.js index bc791ce1..0ab90d67 100644 --- a/lib/tasks/dial.js +++ b/lib/tasks/dial.js @@ -137,6 +137,7 @@ class TaskDial extends Task { get canReleaseMedia() { const keepAnchor = this.data.anchorMedia || + this.data.onHoldMusic || this.cs.isBackGroundListen || ANCHOR_MEDIA_ALWAYS || this.listenTask || @@ -611,6 +612,16 @@ class TaskDial extends Task { this.bridged = true; } + // We have all endpoint available, let set custom on hold Music + if (this.data.onHoldMusic) { + if (this.epOther) { + this.epOther.set({hold_music: `shout://${this.data.onHoldMusic.replace(/^https?:\/\//, '')}`}); + } + if (sd.ep) { + sd.ep.set({hold_music: `shout://${this.data.onHoldMusic.replace(/^https?:\/\//, '')}`}); + } + } + // ding! ding! ding! we have a winner await this._selectSingleDial(cs, sd); this._killOutdials(); // NB: order is important