when closing websocket at end of call send ws code 1000

This commit is contained in:
Dave Horton committed 2023-01-22 12:47:18 -05:00
1 parent db3d0504f1
commit 990d0a7bca
2 files changed
+3 -1

No files matched your search

+1
View File
@@ -18,6 +18,7 @@ class TaskHangup extends Task {
await super.exec(cs);
try {
await dlg.destroy({headers: this.headers});
cs._callReleased();
} catch (err) {
this.logger.error(err, 'TaskHangup:exec - Error hanging up call');
}
+2 -1
View File
@@ -165,8 +165,9 @@ class WsRequestor extends BaseRequestor {
this.logger.debug('WsRequestor:close closing socket');
try {
if (this.ws) {
this.ws.close();
this.ws.close(1000);
this.ws.removeAllListeners();
this.ws = null;
}
for (const [msgid, obj] of this.messagesInFlight) {