mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +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
|
||||
*/
|
||||
async mute(callSid, doMute) {
|
||||
if (doMute && !this.epOther && !this.ep) {
|
||||
this.logger.info('Dial:mute re-anchoring media so we can mute');
|
||||
await this.reAnchorMedia(this.callSession, this.sd);
|
||||
this.epOther.bridge(this.ep);
|
||||
}
|
||||
if (!this.epOther || !this.ep) return this.logger.info('Dial:mute: no paired endpoint found');
|
||||
const parentCall = callSid !== this.callSid;
|
||||
const dlg = parentCall ? this.callSession.dlg : this.dlg;
|
||||
const hdr = `${doMute ? 'mute' : 'unmute'} call leg`;
|
||||
try {
|
||||
const parentCall = callSid !== this.callSid;
|
||||
const ep = parentCall ? this.epOther : this.ep;
|
||||
await ep[doMute ? 'mute' : 'unmute']();
|
||||
this.logger.debug(`Dial:mute ${doMute ? 'muted' : 'unmuted'} ${parentCall ? 'parentCall' : 'childCall'}`);
|
||||
|
||||
/* release media once mute is over, if we can */
|
||||
if (!doMute && this.canReleaseMedia) this._releaseMedia(this.callSession, this.sd);
|
||||
/* let rtpengine do the mute / unmute */
|
||||
await dlg.request({
|
||||
method: 'INFO',
|
||||
headers: {
|
||||
'X-Reason': hdr
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
this.logger.error(err, 'Dial:mute error');
|
||||
this.logger.info({err}, `Dial:mute - ${hdr} error`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user