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:
@@ -21,15 +21,17 @@ class InboundCallSession extends CallSession {
|
||||
this.req = req;
|
||||
this.res = res;
|
||||
|
||||
req.on('cancel', () => {
|
||||
this._notifyCallStatusChange({callStatus: CallStatus.NoAnswer, sipStatus: 487});
|
||||
this._callReleased();
|
||||
});
|
||||
req.once('cancel', this._onCancel.bind(this));
|
||||
|
||||
this.on('callStatusChange', this._notifyCallStatusChange.bind(this));
|
||||
this._notifyCallStatusChange({callStatus: CallStatus.Trying, sipStatus: 100});
|
||||
}
|
||||
|
||||
_onCancel() {
|
||||
this._notifyCallStatusChange({callStatus: CallStatus.NoAnswer, sipStatus: 487});
|
||||
this._callReleased();
|
||||
}
|
||||
|
||||
_onTasksDone() {
|
||||
if (!this.res.finalResponseSent) {
|
||||
if (this._mediaServerFailure) {
|
||||
@@ -45,6 +47,7 @@ class InboundCallSession extends CallSession {
|
||||
this.res.send(603);
|
||||
}
|
||||
}
|
||||
this.req.removeAllListeners('cancel');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,6 +59,7 @@ class InboundCallSession extends CallSession {
|
||||
this.emit('callStatusChange', {callStatus: CallStatus.Completed, duration});
|
||||
this.logger.debug('InboundCallSession: caller hung up');
|
||||
this._callReleased();
|
||||
this.req.removeAllListeners('cancel');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user