Module: sip-router
Branch: master
Commit: dfccb6d5b1e1ae7eeca85007157ccced97c7f2e5
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=dfccb6d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon May 26 15:55:22 2014 +0200
app_perl: added documentation for perl_destroy_func parameter
---
modules/app_perl/README | 32 +++++++++++++++++++++++-------
modules/app_perl/doc/app_perl_admin.xml | 19 ++++++++++++++++++
2 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/modules/app_perl/README b/modules/app_perl/README
index ce1a530..b8c7562 100644
--- a/modules/app_perl/README
+++ b/modules/app_perl/README
@@ -28,6 +28,7 @@ Bastian Friedrich
5.1. filename (string)
5.2. modpath (string)
5.3. reset_cycles (int)
+ 5.4. perl_destroy_func (string)
6. Functions
@@ -194,10 +195,11 @@ Bastian Friedrich
1.1. Set filename parameter
1.2. Set modpath parameter
1.3. Set reset_cycles parameter
- 1.4. perl_exec_simple() usage
- 1.5. perl_exec() usage
- 1.6. app_perl.set_reset_cycles usage
- 1.7. app_perl.get_reset_cycles usage
+ 1.4. Set perl_destroy_func parameter
+ 1.5. perl_exec_simple() usage
+ 1.6. perl_exec() usage
+ 1.7. app_perl.set_reset_cycles usage
+ 1.8. app_perl.get_reset_cycles usage
Chapter 1. Admin Guide
@@ -216,6 +218,7 @@ Chapter 1. Admin Guide
5.1. filename (string)
5.2. modpath (string)
5.3. reset_cycles (int)
+ 5.4. perl_destroy_func (string)
6. Functions
@@ -335,6 +338,7 @@ if (perl_exec("ldap_alias")) {
5.1. filename (string)
5.2. modpath (string)
5.3. reset_cycles (int)
+ 5.4. perl_destroy_func (string)
5.1. filename (string)
@@ -383,6 +387,18 @@ modparam("app_perl", "modpath",
"/usr/local/lib/kamailio/perl/")
modparam("app_perl", "reset_cycles", 100000)
...
+5.4. perl_destroy_func (string)
+
+ The name of Perl function to be executed before the interpreter is
+ re-initialized (reset -- see reset_cycles parameter) at runtime. This
+ could be useful to clean global variables or file descriptors from the
+ Perl script.
+
+ Example 1.4. Set perl_destroy_func parameter
+...
+modparam("app_perl", "perl_destroy_func",
"my_perl_destroy")
+...
+
6. Functions
6.1. perl_exec_simple(func, [param])
@@ -401,7 +417,7 @@ modparam("app_perl", "reset_cycles", 100000)
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
ONREPLY_ROUTE and BRANCH_ROUTE.
- Example 1.4. perl_exec_simple() usage
+ Example 1.5. perl_exec_simple() usage
...
if (method=="INVITE") {
perl_exec_simple("dosomething", "on invite messages");
@@ -420,7 +436,7 @@ if (method=="INVITE") {
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
ONREPLY_ROUTE and BRANCH_ROUTE.
- Example 1.5. perl_exec() usage
+ Example 1.6. perl_exec() usage
...
if (perl_exec("ldapalias")) {
...
@@ -437,7 +453,7 @@ if (perl_exec("ldapalias")) {
Set the value of the reset_cycle. The command has one integer
parameter.
- Example 1.6. app_perl.set_reset_cycles usage
+ Example 1.7. app_perl.set_reset_cycles usage
...
kamcmd app_perl.set_reset_cycles 20000
...
@@ -446,7 +462,7 @@ kamcmd app_perl.set_reset_cycles 20000
Return the value of the reset_cycle.
- Example 1.7. app_perl.get_reset_cycles usage
+ Example 1.8. app_perl.get_reset_cycles usage
...
kamcmd app_perl.get_reset_cycles
...
diff --git a/modules/app_perl/doc/app_perl_admin.xml
b/modules/app_perl/doc/app_perl_admin.xml
index 1b377b5..1d85cb7 100644
--- a/modules/app_perl/doc/app_perl_admin.xml
+++ b/modules/app_perl/doc/app_perl_admin.xml
@@ -220,6 +220,25 @@ modparam("app_perl", "reset_cycles", 100000)
</programlisting>
</example>
</section>
+
+ <section id="app_perl.p.perl_destroy_func">
+ <title><varname>perl_destroy_func</varname> (string)</title>
+ <para>
+ The name of Perl function to be executed before the interpreter is
+ re-initialized (reset -- see reset_cycles parameter) at runtime.
+ This could be useful to clean global variables or file descriptors
+ from the Perl script.
+ </para>
+ <example>
+ <title>Set <varname>perl_destroy_func</varname>
parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("app_perl", "perl_destroy_func",
"my_perl_destroy")
+...
+</programlisting>
+ </example>
+ </section>
+
</section>
<section>