[sr-dev] git:master:921c2f6a: websocket: documentation for event_callback parameter

Daniel-Constantin Mierla miconda at gmail.com
Fri Aug 4 15:11:22 CEST 2017


Module: kamailio
Branch: master
Commit: 921c2f6a53108ac4ddc3e262a479a46650412bce
URL: https://github.com/kamailio/kamailio/commit/921c2f6a53108ac4ddc3e262a479a46650412bce

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-08-04T15:10:50+02:00

websocket: documentation for event_callback parameter

---

Modified: src/modules/websocket/doc/websocket_admin.xml

---

Diff:  https://github.com/kamailio/kamailio/commit/921c2f6a53108ac4ddc3e262a479a46650412bce.diff
Patch: https://github.com/kamailio/kamailio/commit/921c2f6a53108ac4ddc3e262a479a46650412bce.patch

---

diff --git a/src/modules/websocket/doc/websocket_admin.xml b/src/modules/websocket/doc/websocket_admin.xml
index c887c05158..055498862e 100644
--- a/src/modules/websocket/doc/websocket_admin.xml
+++ b/src/modules/websocket/doc/websocket_admin.xml
@@ -445,6 +445,37 @@ modparam("websocket", "verbose_list", 1)
 </programlisting>
 		</example>
 	</section>
+	<section id="websocket.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 websocket module.
+		</para>
+		<para>
+			The function has one string parameter, the value is the name of
+			the event_route block, respectively "websocket:closed".
+		</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("websocket", "event_callback", "ksr_websocket_event")
+...
+-- event callback function implemented in Lua
+function ksr_websocket_event(evname)
+	KSR.info("===== websocket module triggered event: " .. evname .. "\n");
+	return 1;
+end
+...
+</programlisting>
+	    </example>
+	</section>
 
 	</section>
 




More information about the sr-dev mailing list