mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
when closing websocket at end of call send ws code 1000
This commit is contained in:
@@ -18,6 +18,7 @@ class TaskHangup extends Task {
|
|||||||
await super.exec(cs);
|
await super.exec(cs);
|
||||||
try {
|
try {
|
||||||
await dlg.destroy({headers: this.headers});
|
await dlg.destroy({headers: this.headers});
|
||||||
|
cs._callReleased();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.logger.error(err, 'TaskHangup:exec - Error hanging up call');
|
this.logger.error(err, 'TaskHangup:exec - Error hanging up call');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,8 +165,9 @@ class WsRequestor extends BaseRequestor {
|
|||||||
this.logger.debug('WsRequestor:close closing socket');
|
this.logger.debug('WsRequestor:close closing socket');
|
||||||
try {
|
try {
|
||||||
if (this.ws) {
|
if (this.ws) {
|
||||||
this.ws.close();
|
this.ws.close(1000);
|
||||||
this.ws.removeAllListeners();
|
this.ws.removeAllListeners();
|
||||||
|
this.ws = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const [msgid, obj] of this.messagesInFlight) {
|
for (const [msgid, obj] of this.messagesInFlight) {
|
||||||
|
|||||||
Reference in New Issue
Block a user