Module: sip-router Branch: master Commit: bd93ff3ab2fe36bc9a4dd3b1e59398d6f63095ea URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bd93ff3a...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Wed Feb 10 19:26:07 2010 +0100
app_python: added skeleton for docs
- needs to be filled in
---
modules/app_python/README | 104 ++++++++++++++++++++ modules/app_python/doc/Makefile | 4 + modules/app_python/doc/app_python.xml | 34 +++++++ modules/app_python/doc/app_python_admin.xml | 141 +++++++++++++++++++++++++++ 4 files changed, 283 insertions(+), 0 deletions(-)
diff --git a/modules/app_python/README b/modules/app_python/README new file mode 100644 index 0000000..0253212 --- /dev/null +++ b/modules/app_python/README @@ -0,0 +1,104 @@ +app_python Module + +Maxim Sobolev + +Edited by + +Maxim Sobolev + + Copyright � 2010 Maxim Sobolev + __________________________________________________________________ + + Table of Contents + + 1. Admin Guide + + 1.1. Overview + 1.2. Dependencies + + 1.2.1. Kamailio Modules + 1.2.2. External Libraries or Applications + + 1.3. Exported Parameters + + 1.3.1. script_name (string) + 1.3.2. mod_init_function (string) + 1.3.3. child_init_method (string) + + 1.4. Exported Functions + + 1.4.1. python_exec(method [, mystr]) + + List of Examples + + 1.1. Set script_name parameter + 1.2. Set mod_init_function parameter + 1.3. Set child_init_method parameter + 1.4. python_exec usage + +Chapter 1. Admin Guide + +1.1. Overview + + This module allows executing Python scripts from config file, exporting + functions to access the SIP message from Python. + +1.2. Dependencies + +1.2.1. Kamailio Modules + + The following modules must be loaded before this module: + * none. + +1.2.2. External Libraries or Applications + + The following libraries or applications must be installed before + running Kamailio with this module loaded: + * python-dev - Python devel library. + +1.3. Exported Parameters + +1.3.1. script_name (string) + + TBD. + + Default value is "/usr/local/etc/sip-router/handler.py". + + Example 1.1. Set script_name parameter +... +modparam("app_python", "script_name", "/usr/local/etc/sip-router/myscript.py") +... + +1.3.2. mod_init_function (string) + + TBD. + + Default value is "mod_init". + + Example 1.2. Set mod_init_function parameter +... +modparam("app_python", "mod_init_function", "my_mod_init") +... + +1.3.3. child_init_method (string) + + TBD. + + Default value is "child_init". + + Example 1.3. Set child_init_method parameter +... +modparam("app_python", "child_init_method", "my_child_init") +... + +1.4. Exported Functions + +1.4.1. python_exec(method [, mystr]) + + TBD. + + Example 1.4. python_exec usage +... +python_exec("..."); +python_exec("...", "..."); +... diff --git a/modules/app_python/doc/Makefile b/modules/app_python/doc/Makefile new file mode 100644 index 0000000..1792355 --- /dev/null +++ b/modules/app_python/doc/Makefile @@ -0,0 +1,4 @@ +docs = app_python.xml + +docbook_dir = ../../../docbook +include $(docbook_dir)/Makefile.module diff --git a/modules/app_python/doc/app_python.xml b/modules/app_python/doc/app_python.xml new file mode 100644 index 0000000..462a5cf --- /dev/null +++ b/modules/app_python/doc/app_python.xml @@ -0,0 +1,34 @@ +<?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; + +]> + +<book xmlns:xi="http://www.w3.org/2001/XInclude"> + <bookinfo> + <title>app_python Module</title> + <productname class="trade">&kamailioname;</productname> + <authorgroup> + <author> + <firstname>Maxim</firstname> + <surname>Sobolev</surname> + </author> + <editor> + <firstname>Maxim</firstname> + <surname>Sobolev</surname> + </editor> + </authorgroup> + <copyright> + <year>2010</year> + <holder>Maxim Sobolev</holder> + </copyright> + </bookinfo> + <toc></toc> + + <xi:include href="app_python_admin.xml"/> + +</book> diff --git a/modules/app_python/doc/app_python_admin.xml b/modules/app_python/doc/app_python_admin.xml new file mode 100644 index 0000000..4a9f694 --- /dev/null +++ b/modules/app_python/doc/app_python_admin.xml @@ -0,0 +1,141 @@ +<?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>Exported 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>Exported 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> +