Module: kamailio Branch: 4.3 Commit: 7dd019826dccf6c3c5d2185faf331603b550f895 URL: https://github.com/kamailio/kamailio/commit/7dd019826dccf6c3c5d2185faf331603...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2015-12-17T09:33:05+01:00
app_python: readme regenerated
(cherry picked from commit f025df7a0ac292bd22304683dd976863311b53cd)
---
Modified: modules/app_python/README
---
Diff: https://github.com/kamailio/kamailio/commit/7dd019826dccf6c3c5d2185faf331603... Patch: https://github.com/kamailio/kamailio/commit/7dd019826dccf6c3c5d2185faf331603...
---
diff --git a/modules/app_python/README b/modules/app_python/README index 770b9f7..243f9cc 100644 --- a/modules/app_python/README +++ b/modules/app_python/README @@ -6,7 +6,7 @@ Edited by
Maxim Sobolev
- Copyright © 2010 Maxim Sobolev + Copyright © 2010 Maxim Sobolev __________________________________________________________________
Table of Contents @@ -27,7 +27,7 @@ Maxim Sobolev
4. Functions
- 4.1. python_exec(method [, mystr]) + 4.1. python_exec(method [, args])
List of Examples
@@ -54,13 +54,17 @@ Chapter 1. Admin Guide
4. Functions
- 4.1. python_exec(method [, mystr]) + 4.1. python_exec(method [, args])
1. Overview
This module allows executing Python scripts from config file, exporting functions to access the SIP message from Python.
+ For some basic examples of Python scripts that can be used with this + module, look at the files inside source tree located at + 'modules/app_python/python_examples/'. + 2. Dependencies
2.1. Kamailio Modules @@ -85,20 +89,22 @@ Chapter 1. Admin Guide
3.1. script_name (string)
- TBD. + The path to the fiel with Python code to be executed from configuration + file.
- Default value is â/usr/local/etc/sip-router/handler.pyâ. + Default value is "/usr/local/etc/kamailio/handler.py".
Example 1.1. Set script_name parameter ... -modparam("app_python", "script_name", "/usr/local/etc/sip-router/myscript.py") +modparam("app_python", "script_name", "/usr/local/etc/kamailio/myscript.py") ...
3.2. mod_init_function (string)
- TBD. + The Python function to be executed by this module when it is initialied + by Kamailio.
- Default value is âmod_initâ. + Default value is "mod_init".
Example 1.2. Set mod_init_function parameter ... @@ -107,9 +113,10 @@ modparam("app_python", "mod_init_function", "my_mod_init")
3.3. child_init_method (string)
- TBD. + The Python function to be executed by this module when a new worker + process (child) is initialied by Kamailio.
- Default value is âchild_initâ. + Default value is "child_init".
Example 1.3. Set child_init_method parameter ... @@ -118,14 +125,16 @@ modparam("app_python", "child_init_method", "my_child_init")
4. Functions
- 4.1. python_exec(method [, mystr]) + 4.1. python_exec(method [, args])
-4.1. python_exec(method [, mystr]) +4.1. python_exec(method [, args])
- TBD. + Execute the Python function with the name given by the parameter + 'method'. Optionally can be provided a second string with parameters to + be passed to the Python function.
Example 1.4. python_exec usage ... -python_exec("..."); -python_exec("...", "..."); +python_exec("my_python_function"); +python_exec("my_python_function", "my_params"); ...