sipgo icon indicating copy to clipboard operation
sipgo copied to clipboard

Gracefully shutting down or restarting SIP server

Open yallxe opened this issue 6 months ago • 1 comments

In sipgo, what is the way to perform a proper restart of a SIP server? The problem I'm focusing is basically whenever I restart my service, there might be some in-progress transactions that I would prefer to finish before shutting down. I also don't want any new transactions to start during the shutdown process, because obviously how do I shutdown then.

The solution I came up to this moment is having a mutex that would be locked whenever there is a SIGTERM (or whatever signal ctrl+c triggers), and on an incoming request just return and destroy the transaction.

However not only it sounds like a terrible idea, but also I'm not sure how to wait until no active transactions are left.

Thank you very much for the library, would be glad to receive some help.

yallxe avatar Aug 06 '24 13:08 yallxe