OCF_HEARTBEAT_KAMAIL(7)
β¨ ocf_heartbeat_kamailio(7) β¨
okay bestie, welcome to the Kamailio resource agent manual β the page header up top literally reads OCF_HEARTBEAT_KAMAIL(7), and it's from the OCF resource agents crew. Let's get into it π
πΈ NAME πΈ
ocf_heartbeat_kamailio β the resource agent for Kamailio. that's it, that's the name. slay.
π SYNOPSIS π
kamailio [start | stop | status | monitor | meta-data | validate-all]
π¦ DESCRIPTION π¦
It's a resource agent for the Kamailio SIP proxy/registrar. and here's the tea: you can run multiple instances as long as you set the parameters up right. the combos look like this π
Parameters for Kamailio instance 1:
listen_address=192.168.159.128 monitoring_ip=192.168.159.128 proto=udptcp port=5060
Parameters for Kamailio instance 2:
listen_address=192.168.159.128 monitoring_ip=192.168.159.128 proto=udp port=5070 conffile=/etc/kamailio/kamailio2.cfg kamctlrc=""
ngl this next part matters: only one instance can be monitored via the command kamctl monitor, because the kamctl tool of kamailio 4.x was simply not designed for multiple instances. so the kamctlrc file path needs to be empty for instance 2, 3, β¦ β no exceptions, periodt.
Parameters for a third Kamailio instance:
listen_address=192.168.159.128 monitoring_ip=192.168.159.128 proto=tcp port=5080 conffile=/etc/kamailio/kamailio3.cfg kamctlrc=""
π SUPPORTED PARAMETERS π
binaryβ the kamailio binary itself. (optional, string, default"/usr/sbin/kamailio")conffileβ the kamailio configuration file name, with the full path. for example"/etc/kamailio/kamailio.cfg", which is also the default value. if you're running multiple instances, make sure those names are unique or it's gonna be chaos. (optional, string, default"/etc/kamailio/kamailio.cfg")pidfileβ the kamailio PID file. the directory you point at has to be writable by the kamailio process user, okay? and if you're running more than one instance, use a unique name. try to use absolute path names. if it's empty, the resource agent creates a unique directory from the resource instance name for the PID file and assigns it to the process user. (optional, string, default"/var/run/kamailio_RESOURCE_ID/kamailio.pid")monitoring_ipβ the SIP IP address of the kamailio instance, used for SIP OPTIONS polling monitoring. usually you should give the same IP address value as thelisten_addressparameter. (optional, string, default"127.0.0.1")
to respond with a 200 OK response to the SIP OOPTION requests, the kamailio.cfg file needs to contain the following section. note: the following "kamailio.cfg" code snippet is part of an XML section, so it contains two & characters, which need to be replaced with two ampersand characters within "kamailio.cfg":
if (is_method("OPTIONS") && (=~"sip:monitor@.*")) { ## ## If the
method is an OPTIONS we are simply going to respond ## with a 200
OK. # xlog("L_INFO", "Method is an OPTIONS, probably just
monitoring\n"); sl_send_reply("200", "Kamailio is alive"); exit; }
listen_addressβ the SIP IP address the kamailio will listen on. (required, string, no default) π this one's required, bestie, no default, no skipping.portβ the SIP port for the kamailio instance. (optional, string, default"5060")extra_optionsβ extra options to add to kamailio start. (optional, string, no default)protoβ the protocol used for SIP:proto = udp|tcp|udptcp|conf_udp|conf_tcp|conf_udptcp. using the"conf_*"options does not add any"-l"parameters to the kamailio command β the"listen"parameters fromkamailio.confare used instead. the sipsak checks are performed depending on what protocol is defined after the underscore. (optional, string, default"udptcp")sipsakβ the installation path of thesipsaktool, which is used for monitoring Kamailio via SIP OPTIONS polling. (optional, string, default"/usr/bin/sipsak")kamctlβ the installation path of the"kamctl"control tool. (optional, string, default"/usr/bin/kamctl")kamctlrcβ the location of the"kamctlrc"file for the Kamailio instance. thekamctlrcfile is the Kamailio configuration file for its"kamctl"control tool. (optional, string, default"/etc/kamailio/kamctlrc")
this parameter only needs to be provided in case of using multiple Kamailio server instances on a single cluster node:
- in case the
"kamctlrc"parameter is not empty, this resource agent monitors the health state of the Kamailio server via the command"kamctl monitor 1". this setting is recommended in case of using a single Kamailio server instance. β - in case the
"kamctlrc"parameter is empty, the resource agent does not monitor the health state of the Kamailio server instance via the"kamctl"command.
please note that the "kamctl" control command of Kamailio 4.x does not support running multiple Kamailio instances on one host. nevertheless this resource agent does allow multiple Kamailio instances per host. the result of the "kamctl" limitation in terms of number of Kamailio server instances is that the health check via "kamctl monitor 1" can be configured for a single Kamailio instance only. π
please refer to the long description of this resource agent for an example of parameter combinations in case multiple instances are to be configured per cluster node.
kamuserβ the user account for the kamailio process to run with. uses the current user if not specified or empty. there is no check whether running kamailio with the specified user account is actually possible. π (optional, string, no default)kamgroupβ the group for the kamailio process to run with. uses the current group if not specified or empty. (optional, string, no default)
π SUPPORTED ACTIONS π
this resource agent supports the following actions (operations):
startβ starts the resource. suggested minimum timeout:60s.stopβ stops the resource. suggested minimum timeout:30s.statusβ performs a status check. suggested minimum timeout:30s. suggested interval:10s.monitorβ performs a detailed status check. suggested minimum timeout:30s. suggested interval:10s.meta-dataβ retrieves resource agent metadata (internal use only). suggested minimum timeout:5s.validate-allβ performs a validation of the resource configuration. suggested minimum timeout:5s.notifyβ suggested minimum timeout:5s.
π«Ά EXAMPLE CRM SHELL π«Ά
here's an example config for a kamailio resource using the crm(8) shell:
primitive p_kamailio ocf:heartbeat:kamailio \
params \
listen_address=string \
op monitor timeout="30s" interval="10s"
π EXAMPLE PCS π
and here's the same vibe but using pcs(8):
pcs resource create p_kamailio ocf:heartbeat:kamailio \
listen_address=string \
op monitor timeout="30s" interval="10s"
π SEE ALSO π
β AUTHOR β
ClusterLabs contributors (see the resource agent source for information about individual authors) β love them, they ate π
and that's the whole page, bestie! this little icon was brought to you byresource-agents, versionUNKNOWN, dated04/08/2026. iykyk πβ¨
π¦ where this page comes from
- fedora 43: resource-agents 4.18.0-1.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: resource-agents 4.18.0-1.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms