sipgo
sipgo copied to clipboard
Gracefully shutting down or restarting SIP server
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.