Functions
tcp_conid_alive(conid)
Check the state of a TCP or WS connection ID
Meaning of the parameters is as follows:
conid (optional): the Kamailio internal
connection id (as in the $conid pseudovariable).
Retuns values:
1: Connection is OK
-1: Connection has errors, does not exist or is about to be closed)
tcp_conid_alive usage
tcp_conid_state(conid)
Check the state of a TCP or WS connection ID
Meaning of the parameters is as follows:
conid (optional): the Kamailio internal
connection id (as in the $conid pseudovariable).
Retuns values:
1: Connection is OK
2: Socket is accepting incoming connections
3: Socket is setting up outgoing connection
-1: Connection does not exist (or was closed)
-2: Socket has reached EOF
-3: Socket error has occured. Connection will likely close.
-4: Socket is in unknow bad state. Connection will likely close.
tcp_conid_state usage
tcp_keepalive_enable([conid], idle, count, interval)
Enables keepalive on a TCP connection.
Meaning of the parameters is as follows:
conid (optional): the kamailio internal
connection id on which TCP keepalive will be enabled. If no parameter
is given, the keepalive mechanism will be enabled on the current message
source connection.
idle (seconds): the time before the first
keepalive packet is sent out.
count: number of non-acked keepalive before
reseting the connection.
interval (seconds): time between two keepalive
probes.
Retuns 1 on success, -1 on failure.
tcp_keepalive_enable usage
tcp_keepalive_disable([conid])
Disables keepalive on a TCP connection.
Meaning of the parameters is as follows:
conid (optional): the kamailio internal
connection id on which TCP keepalive will be disabled. If no parameter
is given, the keepalive mechanism will be disabled on the current message
source connection.
Retuns 1 on success, -1 on failure.
tcp_keepalive_disable usage
tcp_set_connection_lifetime([conid], lifetime)
Sets the connection lifetime of a connection (TCP).
Meaning of the parameters is as follows:
conid (optional): the kamailio internal
connection id on which to set the new lifetime. If no parameter
is given, it will be set on the current message source connection.
lifetime (seconds): the new connection lifetime.
Retuns 1 on success, -1 on failure.
tcp_set_connection_lifetime usage
tcp_enable_closed_event([conid])
Explicitly enables the "tcp:closed" event route
on a TCP connection.
Meaning of the parameters is as follows:
conid (optionnal): the kamailio internal
connection id. If no parameter
is given, it will be enabled on the current message source connection.
Retuns 1 on success, -1 on failure.
tcp_set_closed_event usage