'\" t .\" Title: ocf_heartbeat_kamailio .\" Author: ClusterLabs contributors (see the resource agent source for information about individual authors) .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 12/17/2020 .\" Manual: OCF resource agents .\" Source: resource-agents UNKNOWN .\" Language: English .\" .TH "OCF_HEARTBEAT_KAMAIL" "7" "12/17/2020" "resource-agents UNKNOWN" "OCF resource agents" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" ocf_heartbeat_kamailio \- Resource agent for Kamailio .SH "SYNOPSIS" .HP \w'\fBkamailio\fR\ 'u \fBkamailio\fR [start | stop | status | monitor | meta\-data | validate\-all] .SH "DESCRIPTION" .PP Resource agent for the Kamailio SIP proxy/registrar\&. Multiple instances are possible when using following parameter combinations: .PP Parameters for Kamailio instance 1: listen_address=192\&.168\&.159\&.128 monitoring_ip=192\&.168\&.159\&.128 proto=udptcp port=5060 .PP 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="" .PP Only one instance can be monitored via the command "kamctl monitor" because the kamctl tool of kamailio 4\&.x is not designed for multiple instances\&. Therefore, the provided kamctrlrc file path needs to be empty for instance 2, 3 \&.\&.\&. .PP 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="" .SH "SUPPORTED PARAMETERS" .PP \fBbinary\fR .RS 4 The kamailio binary .sp (optional, string, default "/usr/sbin/kamailio") .RE .PP \fBconffile\fR .RS 4 The kamailio configuration file name with full path\&. For example, "/etc/kamailio/kamailio\&.cfg" , which is the default value\&. Make sure to use unique names in case of having multiple instances\&. .sp (optional, string, default "/etc/kamailio/kamailio\&.cfg") .RE .PP \fBpidfile\fR .RS 4 The kamailio PID file\&. The directory used must be writable by kamailio process user\&. Be sure to use unique name for running more than one instance\&. Try to use absolute path names\&. If empty, resource agent create a unique directory from the resource instance name for the PID file and assign it to the process user\&. .sp (optional, string, default "/var/run/kamailio_RESOURCE_ID/kamailio\&.pid") .RE .PP \fBmonitoring_ip\fR .RS 4 SIP IP Address of the kamailio instance used for SIP OPTIONS polling monitoring\&. Usually the same IP address value as for parameter listen_address should be provided\&. .sp In order to respond with a 200 OK response to the SIP OOPTION requests, the kamailio\&.cfg file needs to contain following section: Note: The following "kamailio\&.cfg" code snippet is part of an XML section\&. Therefore it contains two & characters, which need to be replaced with two ampersand characters within "kamailio\&.cfg": .sp 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\en"); sl_send_reply("200", "Kamailio is alive"); exit; } .sp (optional, string, default "127\&.0\&.0\&.1") .RE .PP \fBlisten_address\fR .RS 4 SIP IP address the kamailio will listen on\&. .sp (required, string, no default) .RE .PP \fBport\fR .RS 4 SIP port for the kamailio instance\&. .sp (optional, string, default "5060") .RE .PP \fBextra_options\fR .RS 4 Extra options to add to kamailio start\&. .sp (optional, string, no default) .RE .PP \fBproto\fR .RS 4 The protocol used for SIP proto = udp|tcp|udptcp|conf_udp|conf_tcp|conf_udptcp\&. Using the options "conf_*" does not add any "\-l" parameters to the kamailio command, the "listen" parameters from kamailio\&.conf are used instead\&. The sipsak checks are performed depending what protocol is defined after the underscore\&. .sp (optional, string, default "udptcp") .RE .PP \fBsipsak\fR .RS 4 The installation path of the sipsak tool, which is used for monitoring Kamailio via SIP OPTIONS polling\&. .sp (optional, string, default "/usr/bin/sipsak") .RE .PP \fBkamctl\fR .RS 4 The installation path of the "kamctl" control tool\&. .sp (optional, string, default "/usr/bin/kamctl") .RE .PP \fBkamctlrc\fR .RS 4 The location of the "kamctlrc" file for the Kamailio instance\&. The file "kamctlrc" is the Kamailio configuration file for its "kamctl" control tool\&. .sp This parameter only needs to be provided in case of using multiple Kamailio server instances on a single cluster node: .sp In case that the parameter "kamctlrc" 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\&. .sp In case that the parameter "kamctlrc" is empty, the resource agent does not monitor the health state of the Kamailio server instance via the "kamctl" command\&. .sp 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\&. .sp Please refer to the long description of this resource agent for an example of parameter combinations in case that multiple instances are to be configured per cluster node\&. .sp (optional, string, default "/etc/kamailio/kamctlrc") .RE .PP \fBkamuser\fR .RS 4 The user account for kamailio process to run with\&. Uses the current user, if not specified or empty\&. There is no check, if running kamailio with the specified user account is possible\&. .sp (optional, string, no default) .RE .PP \fBkamgroup\fR .RS 4 The group for kamailio process to run with\&. Uses the current group, if not specified or empty\&. .sp (optional, string, no default) .RE .SH "SUPPORTED ACTIONS" .PP This resource agent supports the following actions (operations): .PP \fBstart\fR .RS 4 Starts the resource\&. Suggested minimum timeout: 60s\&. .RE .PP \fBstop\fR .RS 4 Stops the resource\&. Suggested minimum timeout: 30s\&. .RE .PP \fBstatus\fR .RS 4 Performs a status check\&. Suggested minimum timeout: 30s\&. Suggested interval: 10s\&. .RE .PP \fBmonitor\fR .RS 4 Performs a detailed status check\&. Suggested minimum timeout: 30s\&. Suggested interval: 10s\&. .RE .PP \fBmeta\-data\fR .RS 4 Retrieves resource agent metadata (internal use only)\&. Suggested minimum timeout: 5s\&. .RE .PP \fBvalidate\-all\fR .RS 4 Performs a validation of the resource configuration\&. Suggested minimum timeout: 5s\&. .RE .PP \fBnotify\fR .RS 4 Suggested minimum timeout: 5s\&. .RE .SH "EXAMPLE CRM SHELL" .PP The following is an example configuration for a kamailio resource using the \fBcrm\fR(8) shell: .sp .if n \{\ .RS 4 .\} .nf primitive p_kamailio ocf:heartbeat:kamailio \e params \e listen_address=\fIstring\fR \e op monitor timeout="30s" interval="10s" .fi .if n \{\ .RE .\} .SH "EXAMPLE PCS" .PP The following is an example configuration for a kamailio resource using \fBpcs\fR(8) .sp .if n \{\ .RS 4 .\} .nf pcs resource create p_kamailio ocf:heartbeat:kamailio \e listen_address=\fIstring\fR \e op monitor timeout="30s" interval="10s" .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \m[blue]\fB\%http://clusterlabs.org/\fR\m[] .SH "AUTHOR" .PP \fBClusterLabs contributors (see the resource agent source for information about individual authors)\fR