Browse code

dispatcher: documentation for event_callback parameter

Daniel-Constantin Mierla authored on 04/04/2017 12:35:03
Showing 1 changed files
... ...
@@ -869,6 +869,34 @@ modparam("dispatcher", "force_dst", 1)
869 869
  </programlisting>
870 870
  		</example>
871 871
 	</section>
872
+	<section id="dispatcher.p.event_callback">
873
+		<title><varname>event_callback</varname> (str)</title>
874
+		<para>
875
+			The name of the function in the kemi configuration file (embedded
876
+			scripting language such as Lua, Python, ...) to be executed instead
877
+			of event_route[...] blocks. The function receives a string parameter
878
+			with the name of the event.
879
+		</para>
880
+		<para>
881
+		<emphasis>
882
+			Default value is 'empty' (no function is executed for events).
883
+		</emphasis>
884
+		</para>
885
+		<example>
886
+		<title>Set <varname>event_callback</varname> parameter</title>
887
+		<programlisting format="linespecific">
888
+...
889
+modparam("dispatcher", "event_callback", "ksr_dispatcher_event")
890
+...
891
+-- event callback function implemented in Lua
892
+function ksr_dispatcher_event(evname)
893
+	KSR.info("===== dispatcher module triggered event: " .. evname .. "\n");
894
+	return 1;
895
+end
896
+...
897
+</programlisting>
898
+		</example>
899
+	</section>
872 900
 
873 901
 	</section>
874 902