Selaa lähdekoodia

tcpops: documentation for tcp_get_conid()

Daniel-Constantin Mierla 7 vuotta sitten
vanhempi
commit
9cc9785cef
1 muutettua tiedostoa jossa 35 lisäystä ja 0 poistoa
  1. 35 0
      src/modules/tcpops/doc/functions.xml

+ 35 - 0
src/modules/tcpops/doc/functions.xml

@@ -259,4 +259,39 @@ event_route[tcp:closed] {
 ]]></programlisting>
                 </example>
         </section>
+	<section id="tcpops.f.tcp_get_conid">
+		<title>
+			<function>tcp_get_conid(hostport, pvname)</function>
+		</title>
+		<para>
+			Get the connection id based on target host:port. The connection id
+			is set in the variable named by pvname parameter.
+		</para>
+		<para>Meaning of the parameters is as follows:</para>
+		<itemizedlist>
+			<listitem>
+				<para><emphasis>hostport</emphasis> - target "host:port" address,
+				the port can be ommited (default to 5060) and the parameter can
+				contain variables.
+				</para>
+			</listitem>
+			<listitem>
+				<para><emphasis>pvname</emphasis> - target variable name.
+				</para>
+			</listitem>
+		</itemizedlist>
+		<para>Return values:</para>
+		<para>1: connection was found</para>
+		<para>-1: connection was not found or an error occured</para>
+		<example>
+			<title><function>tcp_get_conid</function> usage</title>
+			<programlisting><![CDATA[
+...
+	if(tcp_conid_alive("127.0.0.1:5060", "$var(conid)")) {
+		xlog("connection id is: $var(conid)\n");
+	}
+...
+			]]></programlisting>
+		</example>
+	</section>
 </section>