Browse code

xhttp: documented event_callback parameter

Daniel-Constantin Mierla authored on 17/04/2017 06:15:36
Showing 1 changed files
... ...
@@ -156,6 +156,33 @@ modparam("xhttp", "url_match", "^/sip/")
156 156
 </programlisting>
157 157
 		</example>
158 158
 	</section>
159
+	<section id="xhttp.p.event_callback">
160
+		<title><varname>event_callback</varname> (str)</title>
161
+		<para>
162
+			The name of the function in the kemi configuration file (embedded
163
+			scripting language such as Lua, Python, ...) to be executed instead
164
+			of event_route[xhttp:request] block.
165
+		</para>
166
+		<para>
167
+			The function has one string parameter with the value "xhttp:request".
168
+		</para>
169
+		<para>
170
+		<emphasis>
171
+			Default value is 'empty' (no function is executed for events).
172
+		</emphasis>
173
+		</para>
174
+		<example>
175
+		<title>Set <varname>event_callback</varname> parameter</title>
176
+		<programlisting format="linespecific">
177
+...
178
+modparam("xhttp", "event_callback", "ksr_xhttp_event")
179
+...
180
+-- event callback function implemented in Lua
181
+function ksr_xhttp_event(evname)
182
+	KSR.info("===== xhttp module triggered event: " .. evname .. "\n");
183
+	return 1;
184
+end
185
+...
159 186
 	</section>
160 187
 
161 188
 	<section>