Browse code

app_python: readme regenerated

(cherry picked from commit f025df7a0ac292bd22304683dd976863311b53cd)
(cherry picked from commit 7dd019826dccf6c3c5d2185faf331603b550f895)

Daniel-Constantin Mierla authored on 03/12/2015 11:31:39
Showing 1 changed files
... ...
@@ -6,7 +6,7 @@ Edited by
6 6
 
7 7
 Maxim Sobolev
8 8
 
9
-   Copyright © 2010 Maxim Sobolev
9
+   Copyright � 2010 Maxim Sobolev
10 10
      __________________________________________________________________
11 11
 
12 12
    Table of Contents
... ...
@@ -27,7 +27,7 @@ Maxim Sobolev
27 27
 
28 28
         4. Functions
29 29
 
30
-              4.1. python_exec(method [, mystr])
30
+              4.1. python_exec(method [, args])
31 31
 
32 32
    List of Examples
33 33
 
... ...
@@ -54,13 +54,17 @@ Chapter 1. Admin Guide
54 54
 
55 55
    4. Functions
56 56
 
57
-        4.1. python_exec(method [, mystr])
57
+        4.1. python_exec(method [, args])
58 58
 
59 59
 1. Overview
60 60
 
61 61
    This module allows executing Python scripts from config file, exporting
62 62
    functions to access the SIP message from Python.
63 63
 
64
+   For some basic examples of Python scripts that can be used with this
65
+   module, look at the files inside source tree located at
66
+   'modules/app_python/python_examples/'.
67
+
64 68
 2. Dependencies
65 69
 
66 70
    2.1. Kamailio Modules
... ...
@@ -85,20 +89,22 @@ Chapter 1. Admin Guide
85 89
 
86 90
 3.1. script_name (string)
87 91
 
88
-   TBD.
92
+   The path to the fiel with Python code to be executed from configuration
93
+   file.
89 94
 
90
-   Default value is “/usr/local/etc/sip-router/handler.py”.
95
+   Default value is "/usr/local/etc/kamailio/handler.py".
91 96
 
92 97
    Example 1.1. Set script_name parameter
93 98
 ...
94
-modparam("app_python", "script_name", "/usr/local/etc/sip-router/myscript.py")
99
+modparam("app_python", "script_name", "/usr/local/etc/kamailio/myscript.py")
95 100
 ...
96 101
 
97 102
 3.2. mod_init_function (string)
98 103
 
99
-   TBD.
104
+   The Python function to be executed by this module when it is initialied
105
+   by Kamailio.
100 106
 
101
-   Default value is “mod_init”.
107
+   Default value is "mod_init".
102 108
 
103 109
    Example 1.2. Set mod_init_function parameter
104 110
 ...
... ...
@@ -107,9 +113,10 @@ modparam("app_python", "mod_init_function", "my_mod_init")
107 113
 
108 114
 3.3. child_init_method (string)
109 115
 
110
-   TBD.
116
+   The Python function to be executed by this module when a new worker
117
+   process (child) is initialied by Kamailio.
111 118
 
112
-   Default value is “child_init”.
119
+   Default value is "child_init".
113 120
 
114 121
    Example 1.3. Set child_init_method parameter
115 122
 ...
... ...
@@ -118,14 +125,16 @@ modparam("app_python", "child_init_method", "my_child_init")
118 125
 
119 126
 4. Functions
120 127
 
121
-   4.1. python_exec(method [, mystr])
128
+   4.1. python_exec(method [, args])
122 129
 
123
-4.1.  python_exec(method [, mystr])
130
+4.1. python_exec(method [, args])
124 131
 
125
-   TBD.
132
+   Execute the Python function with the name given by the parameter
133
+   'method'. Optionally can be provided a second string with parameters to
134
+   be passed to the Python function.
126 135
 
127 136
    Example 1.4. python_exec usage
128 137
 ...
129
-python_exec("...");
130
-python_exec("...", "...");
138
+python_exec("my_python_function");
139
+python_exec("my_python_function", "my_params");
131 140
 ...