mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-22 01:27:55 +00:00
mute/unmute now handled by rtpengine
This commit is contained in:
@@ -212,22 +212,19 @@ class TaskDial extends Task {
|
|||||||
* mute or unmute one side of the call
|
* mute or unmute one side of the call
|
||||||
*/
|
*/
|
||||||
async mute(callSid, doMute) {
|
async mute(callSid, doMute) {
|
||||||
if (doMute && !this.epOther && !this.ep) {
|
const parentCall = callSid !== this.callSid;
|
||||||
this.logger.info('Dial:mute re-anchoring media so we can mute');
|
const dlg = parentCall ? this.callSession.dlg : this.dlg;
|
||||||
await this.reAnchorMedia(this.callSession, this.sd);
|
const hdr = `${doMute ? 'mute' : 'unmute'} call leg`;
|
||||||
this.epOther.bridge(this.ep);
|
|
||||||
}
|
|
||||||
if (!this.epOther || !this.ep) return this.logger.info('Dial:mute: no paired endpoint found');
|
|
||||||
try {
|
try {
|
||||||
const parentCall = callSid !== this.callSid;
|
/* let rtpengine do the mute / unmute */
|
||||||
const ep = parentCall ? this.epOther : this.ep;
|
await dlg.request({
|
||||||
await ep[doMute ? 'mute' : 'unmute']();
|
method: 'INFO',
|
||||||
this.logger.debug(`Dial:mute ${doMute ? 'muted' : 'unmuted'} ${parentCall ? 'parentCall' : 'childCall'}`);
|
headers: {
|
||||||
|
'X-Reason': hdr
|
||||||
/* release media once mute is over, if we can */
|
}
|
||||||
if (!doMute && this.canReleaseMedia) this._releaseMedia(this.callSession, this.sd);
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.logger.error(err, 'Dial:mute error');
|
this.logger.info({err}, `Dial:mute - ${hdr} error`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user