Hi Gang
We are still having massive issues on how to safely reload kamailio after config changes when using the dialog module and DMQ.
If there are active dialogues, kamailio corrupts them on a restart even when using MySQL as dialog backend.
As we use two core nodes for redundancy, I am looking for a way to gracefully restart kamailio.
I am considering adding some key in a hash table or anything else I can reload on runtime to indicate to kamailio not to accept any new calls (effectively rejecting Invites without To-Tag with 503 causing the registrar or IC peer to hopefully resend the invite to the other node).
Then wait, until no more dialogues are active, so kamailio can safely be restarted.
My Issue now: How can I find out, one specific node does not have any active dialogues?
'kamcmd dlg.stats_active' returns the count of all DMQ synced nodes, not of the local one.
And suggestions or any other ideas how I can 'reload' the kamailio config without disrupting active dialogues?
My last resort would be to look into the database: modparam("dialog", "h_id_start", -1) # Use server_id modparam("dialog", "h_id_step", 2)
So odd/even H_ID should tell me the number per node. But I see a lot of orphan dialogues hanging around in the database not being cleaned so I guess that will not be reliable at all.
Yes, I know I will get the question: 'Why do you need to restart kamailio that often'.
We have started production on our kamailio based TSP platform. And of course, despite a LOT of testing beforehand, there is always some issue that pops up. At the moment, I have to implement a config change about once or twice a week to fix some new minor issues.
I hope, somewhen in the future we will hopefully have a stable config which will last for several months, but at the moment this is the situation.