123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <?xml version="1.0" encoding='ISO-8859-1'?>
- <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
- "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
- <!-- Include general documentation entities -->
- <!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
- %docentities;
- ]>
- <!-- Module User's Guide -->
- <chapter>
-
- <title>&adminguide;</title>
-
- <section>
- <title>Overview</title>
- <para>
- This module allows executing Python scripts from config file,
- exporting functions to access the SIP message from Python.
- </para>
- </section>
- <section>
- <title>Dependencies</title>
- <section>
- <title>&kamailio; Modules</title>
- <para>
- The following modules must be loaded before this module:
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>none</emphasis>.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- <section>
- <title>External Libraries or Applications</title>
- <para>
- The following libraries or applications must be installed before running
- &kamailio; with this module loaded:
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>python-dev</emphasis> - Python devel library.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
- <section>
- <title>Parameters</title>
- <section>
- <title><varname>script_name</varname> (string)</title>
- <para>
- TBD.
- </para>
- <para>
- <emphasis>
- Default value is <quote>/usr/local/etc/sip-router/handler.py</quote>.
- </emphasis>
- </para>
- <example>
- <title>Set <varname>script_name</varname> parameter</title>
- <programlisting format="linespecific">
- ...
- modparam("app_python", "script_name", "/usr/local/etc/sip-router/myscript.py")
- ...
- </programlisting>
- </example>
- </section>
- <section>
- <title><varname>mod_init_function</varname> (string)</title>
- <para>
- TBD.
- </para>
- <para>
- <emphasis>
- Default value is <quote>mod_init</quote>.
- </emphasis>
- </para>
- <example>
- <title>Set <varname>mod_init_function</varname> parameter</title>
- <programlisting format="linespecific">
- ...
- modparam("app_python", "mod_init_function", "my_mod_init")
- ...
- </programlisting>
- </example>
- </section>
- <section>
- <title><varname>child_init_method</varname> (string)</title>
- <para>
- TBD.
- </para>
- <para>
- <emphasis>
- Default value is <quote>child_init</quote>.
- </emphasis>
- </para>
- <example>
- <title>Set <varname>child_init_method</varname> parameter</title>
- <programlisting format="linespecific">
- ...
- modparam("app_python", "child_init_method", "my_child_init")
- ...
- </programlisting>
- </example>
- </section>
- </section>
-
- <section>
- <title>Functions</title>
- <section>
- <title>
- <function moreinfo="none">python_exec(method [, mystr])</function>
- </title>
- <para>
- TBD.
- </para>
- <example>
- <title><function>python_exec</function> usage</title>
- <programlisting format="linespecific">
- ...
- python_exec("...");
- python_exec("...", "...");
- ...
- </programlisting>
- </example>
- </section>
-
- </section>
-
- </chapter>
|