Module: kamailio
Branch: 4.3
Commit: a350e33b3fe13e807a621d12325342c93c4ab706
URL: https://github.com/kamailio/kamailio/commit/a350e33b3fe13e807a621d12325342c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-12-17T09:34:54+01:00
outbound: adjusted log message for trying to import the api
- when module is not loaded, a messages with 'failed' was printed,
which could trigger an alert even for info level
(cherry picked from commit 700617c6b3707fba16001f82fab6ca0370b23acf)
---
Modified: modules/outbound/api.h
---
Diff: https://github.com/kamailio/kamailio/commit/a350e33b3fe13e807a621d12325342c…
Patch: https://github.com/kamailio/kamailio/commit/a350e33b3fe13e807a621d12325342c…
---
diff --git a/modules/outbound/api.h b/modules/outbound/api.h
index b8ed738..bc80589 100644
--- a/modules/outbound/api.h
+++ b/modules/outbound/api.h
@@ -51,7 +51,7 @@ inline static int ob_load_api(ob_api_t *pxb)
bind_ob_f bind_ob_exports;
if (!(bind_ob_exports = (bind_ob_f)find_export("bind_ob", 1, 0)))
{
- LM_INFO("Failed to import bind_ob\n");
+ LM_INFO("unable to import bind_ob - maybe module is not loaded\n");
return -1;
}
return bind_ob_exports(pxb);
Module: kamailio
Branch: 4.3
Commit: cf77d88069407512c7d2ff234607ab6e3fc9c784
URL: https://github.com/kamailio/kamailio/commit/cf77d88069407512c7d2ff234607ab6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-12-17T09:32:54+01:00
app_python: basic documentation for params and functions
- based on quick look at the code
(cherry picked from commit e2853a8ac22bc26d47153731f65479f03a756c52)
---
Modified: modules/app_python/doc/app_python_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/cf77d88069407512c7d2ff234607ab6…
Patch: https://github.com/kamailio/kamailio/commit/cf77d88069407512c7d2ff234607ab6…
---
diff --git a/modules/app_python/doc/app_python_admin.xml b/modules/app_python/doc/app_python_admin.xml
index 56aa4df..ef726c4 100644
--- a/modules/app_python/doc/app_python_admin.xml
+++ b/modules/app_python/doc/app_python_admin.xml
@@ -20,6 +20,11 @@
This module allows executing Python scripts from config file,
exporting functions to access the SIP message from Python.
</para>
+ <para>
+ 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/'.
+ </para>
</section>
<section>
<title>Dependencies</title>
@@ -56,18 +61,19 @@
<section>
<title><varname>script_name</varname> (string)</title>
<para>
- TBD.
+ The path to the fiel with Python code to be executed
+ from configuration file.
</para>
<para>
<emphasis>
- Default value is <quote>/usr/local/etc/sip-router/handler.py</quote>.
+ Default value is <quote>/usr/local/etc/kamailio/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")
+modparam("app_python", "script_name", "/usr/local/etc/kamailio/myscript.py")
...
</programlisting>
</example>
@@ -76,7 +82,8 @@ modparam("app_python", "script_name", "/usr/local/etc/sip-router/myscript.py")
<section>
<title><varname>mod_init_function</varname> (string)</title>
<para>
- TBD.
+ The Python function to be executed by this module when
+ it is initialied by &kamailio;.
</para>
<para>
<emphasis>
@@ -96,7 +103,8 @@ modparam("app_python", "mod_init_function", "my_mod_init")
<section>
<title><varname>child_init_method</varname> (string)</title>
<para>
- TBD.
+ The Python function to be executed by this module when
+ a new worker process (child) is initialied by &kamailio;.
</para>
<para>
<emphasis>
@@ -119,17 +127,19 @@ modparam("app_python", "child_init_method", "my_child_init")
<title>Functions</title>
<section>
<title>
- <function moreinfo="none">python_exec(method [, mystr])</function>
+ <function moreinfo="none">python_exec(method [, args])</function>
</title>
<para>
- 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.
</para>
<example>
<title><function>python_exec</function> usage</title>
<programlisting format="linespecific">
...
-python_exec("...");
-python_exec("...", "...");
+python_exec("my_python_function");
+python_exec("my_python_function", "my_params");
...
</programlisting>
</example>