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.
It is not implemented, but you can close all transactions from TransactionLayer, and just have some server handler tracking. You may want todo extra for Call Sessions
@emiago But the monitoring of the port has not stopped,I am trying to implement a dynamic SIP service, so I need it to be able to disable port usage.
Hi @gswy . Stopping listeners is possible, but I believe I need to understand more. For example depending on protocol behind gracefull shutdown can be better implemented.