Skip to content

Commit

Permalink
Add reregisterForMessages method and fix deleting from verbs once unr…
Browse files Browse the repository at this point in the history
…egistered
  • Loading branch information
dualtone-tony committed May 16, 2024
1 parent d8ce54a commit f3e1945
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
17 changes: 2 additions & 15 deletions lib/drachtio-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,25 +470,12 @@ class DrachtioAgent extends Emitter {

this.mapServer.forEach((obj, socket) => {
if (obj.authenticated) {
this.unrouteVerbs(socket) ;
this.wp.send(socket, 'remove_route|' + verb) ;
this.verbs.delete(verb) ;
}
});
}

unrouteVerbs(socket) {
this.verbs.forEach((obj, verb) => {
if (obj.sent === false) {
return ;
}

obj = {
sent: false,
acknowledged: false,
rid: this.wp.send(socket, 'remove_route|' + verb)
} ;
});
}

disconnect(socket) {
const sock = socket || this._getDefaultSocket();
debugSocket(`disconnect: removing socket ${sockPort(sock)}`);
Expand Down
4 changes: 4 additions & 0 deletions lib/srf.js
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,10 @@ class Srf extends Emitter {
this._app.client.removeRoute(sipVerb) ;
}

reregisterForMessages(sipVerb) {
this._app.client.route(sipVerb) ;
}

_b2bRequestWithinDialog(dlg, req, res, proxyRequestHeaders, proxyResponseHeaders, callback) {
callback = callback || noop ;
let headers = {} ;
Expand Down

0 comments on commit f3e1945

Please sign in to comment.