Module: kamailio
Branch: master
Commit: 472782d2f094b1971543b4d0c3733058d9086d78
URL:
https://github.com/kamailio/kamailio/commit/472782d2f094b1971543b4d0c373305…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-05-17T08:16:12+02:00
cfgutils: added more to docs for route exists functions
---
Modified: modules/cfgutils/README
Modified: modules/cfgutils/doc/cfgutils_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/472782d2f094b1971543b4d0c373305…
Patch:
https://github.com/kamailio/kamailio/commit/472782d2f094b1971543b4d0c373305…
---
diff --git a/modules/cfgutils/README b/modules/cfgutils/README
index 8948d05..b634eaf 100644
--- a/modules/cfgutils/README
+++ b/modules/cfgutils/README
@@ -542,7 +542,8 @@ unlock("$rU");
4.17. check_route_exists(route)
- Check if a route block exists
+ Check if a route block exists. It returns true (1) on found and false
+ on not found or error.
Parameters:
@@ -553,7 +554,7 @@ unlock("$rU");
Example 1.21. check_route_exists() usage
...
-if(check_route_exists("FROGJUMP") {
+if(check_route_exists("JUMP") {
$var(jumping_frogs) = 1;
};
...
@@ -563,6 +564,9 @@ if(check_route_exists("FROGJUMP") {
Execute a routing block only if it is defined. If it's not defined,
silently move to the next action in the configuration script.
+ It returns the code of last action in the route block, if that exists,
+ or false if the route doesn't exists or was an error executing it.
+
Parameters:
"name" of a route block in the config file, like
"route[FROGJUMP]"
@@ -572,7 +576,9 @@ if(check_route_exists("FROGJUMP") {
Example 1.22. route_if_exists() usage
...
-route_if_exists("PRESENCE_SANTA_CLAUS");
+if(route_if_exists("JUMP")) {
+ exit;
+}
...
4.19. core_hash(string1, string2, size)
diff --git a/modules/cfgutils/doc/cfgutils_admin.xml
b/modules/cfgutils/doc/cfgutils_admin.xml
index 0266ab5..3e22fba 100644
--- a/modules/cfgutils/doc/cfgutils_admin.xml
+++ b/modules/cfgutils/doc/cfgutils_admin.xml
@@ -529,7 +529,8 @@ unlock("$rU");
<section id="cfgutils.f.check_route_exists">
<title><function
moreinfo="none">check_route_exists(route)</function></title>
<para>
- Check if a route block exists
+ Check if a route block exists. It returns true (1) on found and false on
+ not found or error.
</para>
<para>Parameters:</para>
<para>
@@ -543,7 +544,7 @@ unlock("$rU");
<title><function
moreinfo="none">check_route_exists()</function> usage</title>
<programlisting format="linespecific">
...
-if(check_route_exists("FROGJUMP") {
+if(check_route_exists("JUMP") {
$var(jumping_frogs) = 1;
};
...
@@ -556,6 +557,10 @@ if(check_route_exists("FROGJUMP") {
Execute a routing block only if it is defined. If it's not defined, silently
move to the next action in the configuration script.
</para>
+ <para>
+ It returns the code of last action in the route block, if that exists, or
+ false if the route doesn't exists or was an error executing it.
+ </para>
<para>Parameters:</para>
<para>
<quote>name</quote> of a route block in the config file, like
<quote>route[FROGJUMP]</quote>
@@ -568,7 +573,9 @@ if(check_route_exists("FROGJUMP") {
<title><function
moreinfo="none">route_if_exists()</function> usage</title>
<programlisting format="linespecific">
...
-route_if_exists("PRESENCE_SANTA_CLAUS");
+if(route_if_exists("JUMP")) {
+ exit;
+}
...
</programlisting>
</example>