فهرست منبع

tls: docs for event_route[tls:connection-out] and event_callback param

Daniel-Constantin Mierla 8 سال پیش
والد
کامیت
cb7810c939
3فایلهای تغییر یافته به همراه59 افزوده شده و 3 حذف شده
  1. 31 0
      src/modules/tls/doc/params.xml
  2. 3 3
      src/modules/tls/doc/rpc.xml
  3. 25 0
      src/modules/tls/doc/tls.xml

+ 31 - 0
src/modules/tls/doc/params.xml

@@ -1164,5 +1164,36 @@ modparam("tls", "config", "/usr/local/etc/kamailio/tls.cfg")
 	    </programlisting>
 	</example>
 	</section>
+	<section id="tls.p.event_callback">
+		<title><varname>event_callback</varname> (str)</title>
+		<para>
+			The name of the function in the kemi configuration file (embedded
+			scripting language such as Lua, Python, ...) to be executed instead
+			of event_route[...] blocks specific for tls module.
+		</para>
+		<para>
+			The function has one string parameter, the value is the name of
+			the event_route block, respectively "tls:connection-out".
+		</para>
+		<para>
+		<emphasis>
+			Default value is 'empty' (no function is executed for events).
+		</emphasis>
+		</para>
+		<example>
+		<title>Set <varname>event_callback</varname> parameter</title>
+		<programlisting format="linespecific">
+...
+modparam("tls", "event_callback", "ksr_tls_event")
+...
+-- event callback function implemented in Lua
+function ksr_tls_event(evname)
+	KSR.info("===== tls module triggered event: " .. evname .. "\n");
+	return 1;
+end
+...
+</programlisting>
+	    </example>
+	</section>
 
 </section>

+ 3 - 3
src/modules/tls/doc/rpc.xml

@@ -15,8 +15,8 @@
 	<section id="tls.r.tls.info">
 		<title><function>tls.info</function></title>
 		<para>
-			List internal information related to the TLS module in 
-			a short list - max connections, open connections and the 
+			List internal information related to the TLS module in
+			a short list - max connections, open connections and the
 			write queue size.
 		</para>
 		<para>Parameters: </para>
@@ -53,7 +53,7 @@
 	<section id="tls.r.tls.reload">
 		<title><function>tls.reload</function></title>
 		<para>
-			Reload the external TLS configuration file (aka tls.cfg). It does not reload 
+			Reload the external TLS configuration file (aka tls.cfg). It does not reload
 			modparam() parameters. Note that existing active TLS connections are not
 			terminated and they continue to use the old certificates. The new configuration
 			will be used for new connections.

+ 25 - 0
src/modules/tls/doc/tls.xml

@@ -275,6 +275,31 @@ make -C modules/tls extra_defs="-DTLS_WR_DEBUG -DTLS_RD_DEBUG"
 	<xi:include href="functions.xml"/>
 	<xi:include href="rpc.xml"/>
 	<xi:include href="history.xml"/>
+
+	<section id="tls.event_routes">
+		<title>Event Routes</title>
+		<section id="tls.evrt.connection_out">
+		<title>event_route[tls:connection-out]</title>
+		<para>
+			Event route to be executed when a TLS connection is opened by
+			&kamailio;. If drop() is executed in the event route, then the
+			data is no longer sent over the connection.
+		</para>
+	<example>
+	    <title>Use of <varname>event_route[tls:connection-out]</varname></title>
+	    <programlisting>
+...
+event_route[tls:connection-out] {
+  if($sndto(ip)=="1.2.3.4") {
+    drop;
+  }
+}
+...
+	    </programlisting>
+	</example>
+
+		</section>
+	</section>
 	</chapter>
 </book>