Yeah, Sebastian is quite right. CANCELs do make for an especially challenging case, since they are hop-by-hop. Kamailio has to have some transaction state in order to have an idea of where to relay them.
A good business process is to have two Kamailio instances, tried by all gateways on all sides if the primary is unavailable (whether by means of SRV or just statically configured secondary gateway entries) and some option, set externally at runtime (for example, using $shv() shared variables), which causes Kamailio to refuse further calls. Existing calls would drain off the system, new calls would fail over to the other Kamailio, and then you can restart it.
On Thu, Jul 13, 2017 at 06:22:55PM +0000, Samuel F. wrote:
Thank you for the responses! As a follow up question, how do companies with large loads on their Kamailios handle restarts especially considering the CANCELs?
What is a good (business) process to restart a Kamailio without incurring any interruptions at all? What other components in the infrastructure would be in place and which ones are in use in the wild?
// Samuel
From: sr-users sr-users-bounces@lists.kamailio.org on behalf of Sebastian Damm damm@sipgate.de Sent: Thursday, July 13, 2017 2:39:39 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] What happens to calls when Kamailio restarts?
Hi,
On Wed, Jul 12, 2017 at 11:53 AM, Alex Balashov abalashov@evaristesys.com wrote:
All SIP messages passing through the proxy can be forwarded statelessly and based on properties of the SIP message alone.
There's one thing that could happen: Calls that get cancelled after a restart, could possibly keep on ringing on the far end. At least if you check for an active transaction in your kamailio config.
if (!t_check_trans()) { sl_send_reply("481", "Call/Transaction does not exist"); xlog("L_ERR", "CANCEL: found no matching transaction F=$fu T=$tu R=$ru\n"); return; }
And if you do some sort of random dispatching, CANCELs could end up on a different gateway.
But other than that, a restart shouldn't cause much trouble. Especially in-call requests get routed by Route headers only.
Regards, Sebastian
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users