initial WIP to remove freeswitch from media path when not recording or transcribing dial calls

This commit is contained in:
Dave Horton
2021-10-08 16:21:47 -04:00
parent bedf25c6a2
commit 9f158a8cf7
4 changed files with 55 additions and 8 deletions

View File

@@ -926,6 +926,17 @@ class CallSession extends Emitter {
};
}
async releaseMediaToSBC(remoteSdp) {
assert(this.dlg);
assert(this.dlg.connected);
assert(this.ep);
assert(typeof remoteSdp === 'string');
await this.dlg.modify(remoteSdp);
this.ep.destroy()
.then(() => this.ep = null)
.catch((err) => this.logger.error({err}, 'releaseMediaToSBC: Error destroying endpoint'));
}
/**
* Called any time call status changes. This method both invokes the
* call_status_hook callback as well as updates the realtime database