mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
clean up some retainers
This commit is contained in:
@@ -632,7 +632,7 @@ class CallSession extends Emitter {
|
||||
try {
|
||||
if (!this.ms) this.ms = this.getMS();
|
||||
const ep = await this.ms.createEndpoint({remoteSdp: this.req.body});
|
||||
ep.cs = this;
|
||||
//ep.cs = this;
|
||||
this.ep = ep;
|
||||
ep.set({
|
||||
hangup_after_bridge: false,
|
||||
@@ -716,14 +716,15 @@ class CallSession extends Emitter {
|
||||
/**
|
||||
* Hang up the call and free the media endpoint
|
||||
*/
|
||||
async _clearResources() {
|
||||
_clearResources() {
|
||||
for (const resource of [this.dlg, this.ep]) {
|
||||
try {
|
||||
if (resource && resource.connected) await resource.destroy();
|
||||
} catch (err) {
|
||||
this.logger.error(err, 'CallSession:_clearResources error');
|
||||
if (resource && resource.connected) {
|
||||
resource.destroy()
|
||||
.catch((err) => this.logger.error(err, 'CallSession:_clearResources error'));
|
||||
}
|
||||
}
|
||||
this.dlg = null;
|
||||
this.ep = null;
|
||||
|
||||
// remove any temporary tts files that were created (audio is still cached in redis)
|
||||
for (const path of this.tmpFiles) {
|
||||
|
||||
Reference in New Issue
Block a user