Hi
I'm still looking for a better way to tell Kamailio that we want to enter 'maintenance' and STAY in maintenance after a restart.
Maintenance is: Reject all messages without totag with 503 to prevent creating new dialogues.
I could use a shared pv and the use kamcmd pv.shvSet to toggle it.
But when kamailio is restarted, that pv is also reset to it's initial state. Not good, if I want to make sure the node stays in maintenance mode after a restart as for example after pushing a config change via ansible.
So what comes to my mind is to check for the presence of a file.
something like:
route[CHECK_MAINTENANCE] { if (!has_totag() && is_method("INVITE")) { if (file_exist("/etc/kamailio/maintenance.flag")) { xlog("L_ERR", "Maintenance flag present! Rejecting INVITE\n"); t_send_reply("503", "Maintenance mode - no new calls accepted"); exit; } } }
Mit freundlichen Grüssen
-Benoît Panizzon-