Module: kamailio
Branch: master
Commit: e3e6471b114b2358c20cbc9a60ee745ac1bce162
URL: https://github.com/kamailio/kamailio/commit/e3e6471b114b2358c20cbc9a60ee745…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2020-10-14T16:16:29+02:00
modules: readme files regenerated - pv ... [skip ci]
---
Modified: src/modules/pv/README
---
Diff: https://github.com/kamailio/kamailio/commit/e3e6471b114b2358c20cbc9a60ee745…
Patch: https://github.com/kamailio/kamailio/commit/e3e6471b114b2358c20cbc9a60ee745…
---
diff --git a/src/modules/pv/README b/src/modules/pv/README
index 0af232eeda..a6702afa12 100644
--- a/src/modules/pv/README
+++ b/src/modules/pv/README
@@ -475,7 +475,8 @@ xavp_params_implode("x", "$var(out)");
the tokens, the supported mode right now is 't', which trims the white
spaces around the value.
- The fourth parameter is the name of the xavp to hold the tokens.
+ The fourth parameter is the name of the root xavp to hold the tokens in
+ fields named 'v' and indexed from 0.
The values are stored as string type.
@@ -485,10 +486,10 @@ xavp_params_implode("x", "$var(out)");
...
xavp_slist_explode("a=b; c=d;", "=;", "t", "x");
# results in:
-# $xavp(x[0]) = "a";
-# $xavp(x[1]) = "b";
-# $xavp(x[2]) = "c";
-# $xavp(x[3]) = "d";
+# $xavp(x[0]=>v[0]) = "a";
+# $xavp(x[0]=>v[1]) = "b";
+# $xavp(x[0]=>v[2]) = "c";
+# $xavp(x[0]=>v[3]) = "d";
...
4.11. xavp_child_seti(rname, cname, ival)
Module: kamailio
Branch: master
Commit: d2c444c58b8f6f084f27e0129dc0cf02dfb6f7ba
URL: https://github.com/kamailio/kamailio/commit/d2c444c58b8f6f084f27e0129dc0cf0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-10-14T16:13:19+02:00
pv: docs - reflect use of xavp fields for tokens by xavp_slist_explode()
---
Modified: src/modules/pv/doc/pv_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/d2c444c58b8f6f084f27e0129dc0cf0…
Patch: https://github.com/kamailio/kamailio/commit/d2c444c58b8f6f084f27e0129dc0cf0…
---
diff --git a/src/modules/pv/doc/pv_admin.xml b/src/modules/pv/doc/pv_admin.xml
index 3967b38234..61df878c3a 100644
--- a/src/modules/pv/doc/pv_admin.xml
+++ b/src/modules/pv/doc/pv_admin.xml
@@ -438,7 +438,8 @@ xavp_params_implode("x", "$var(out)");
the white spaces around the value.
</para>
<para>
- The fourth parameter is the name of the xavp to hold the tokens.
+ The fourth parameter is the name of the root xavp to hold the tokens
+ in fields named 'v' and indexed from 0.
</para>
<para>
The values are stored as string type.
@@ -452,10 +453,10 @@ xavp_params_implode("x", "$var(out)");
...
xavp_slist_explode("a=b; c=d;", "=;", "t", "x");
# results in:
-# $xavp(x[0]) = "a";
-# $xavp(x[1]) = "b";
-# $xavp(x[2]) = "c";
-# $xavp(x[3]) = "d";
+# $xavp(x[0]=>v[0]) = "a";
+# $xavp(x[0]=>v[1]) = "b";
+# $xavp(x[0]=>v[2]) = "c";
+# $xavp(x[0]=>v[3]) = "d";
...
</programlisting>
</example>
Module: kamailio
Branch: master
Commit: df63402a57a7ef6da0d2eb3f88ee68c116c38549
URL: https://github.com/kamailio/kamailio/commit/df63402a57a7ef6da0d2eb3f88ee68c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-10-14T15:55:29+02:00
pv: docs for xvp_slist_explode()
---
Modified: src/modules/pv/doc/pv_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/df63402a57a7ef6da0d2eb3f88ee68c…
Patch: https://github.com/kamailio/kamailio/commit/df63402a57a7ef6da0d2eb3f88ee68c…
---
diff --git a/src/modules/pv/doc/pv_admin.xml b/src/modules/pv/doc/pv_admin.xml
index 8b4b0aa309..3967b38234 100644
--- a/src/modules/pv/doc/pv_admin.xml
+++ b/src/modules/pv/doc/pv_admin.xml
@@ -413,6 +413,49 @@ $xavp(x[0]=>c) = "d";
$xavp(x[0]=>a) = "b";
xavp_params_implode("x", "$var(out)");
# results in: $var(out) is "a=b;c=d;e=f;"
+...
+ </programlisting>
+ </example>
+ </section>
+ <section id="pv.f.xavp_slist_explode">
+ <title>
+ <function moreinfo="none">xavp_slist_explode(slist, sep, mode, xname)</function>
+ </title>
+ <para>
+ Breaks a string list in tokens by separators and stores them
+ in XAVPs. Note that is not storing empty values.
+ </para>
+ <para>
+ The first parameter has to be a string (static or with variables).
+ </para>
+ <para>
+ The second parameter has to contain separator characters (they
+ can be many).
+ </para>
+ <para>
+ The third parameter is mode, controlling the behaviour of extracting
+ the tokens, the supported mode right now is 't', which trims
+ the white spaces around the value.
+ </para>
+ <para>
+ The fourth parameter is the name of the xavp to hold the tokens.
+ </para>
+ <para>
+ The values are stored as string type.
+ </para>
+ <para>
+ Function can be used from ANY ROUTE.
+ </para>
+ <example>
+ <title><function>xavp_slist_explode</function> usage</title>
+ <programlisting format="linespecific">
+...
+xavp_slist_explode("a=b; c=d;", "=;", "t", "x");
+# results in:
+# $xavp(x[0]) = "a";
+# $xavp(x[1]) = "b";
+# $xavp(x[2]) = "c";
+# $xavp(x[3]) = "d";
...
</programlisting>
</example>
Hii,I am trying to use pstn_route module for the first time, and i want to route the invite to specific pstn server based on its prefix.I have loaded the module & setup the DB, and it's giving error saying route name (from DB) is not defined after adding the a prefix into DB table., and there were no errors when DB table is empty.Not sure how to defined it, or i dont know what did i miss. Please help.
#### CONFIG ##########loadmodule "prefix_route.so"modparam("prefix_route", "db_url", "mysql://xxxxx:xxxxx@localhost/kamailioDB")modparam("prefix_route", "db_table", "new_prefix_route")
#PSTN Routing table contains if (!prefix_route("+44")) { xlog("L_INFO", "+44 prefix didnt match with prefix_route DB\n"); }
########## DB####MariaDB [kamailio]> select * from new_prefix_route;Empty set (0.00 sec)
MariaDB [kamailio]> exit;##########
Kamailio looks good untill here, no errors..
# Now i have added a prefix into sql DBINSERT INTO new_prefix_route VALUES ("+44", "10.10.1.1:5060", "route for this prefix");###########Error log after adding a prefix into new_prefix_route table & restart of kamailio
0(5802) CRITICAL: prefix_route [prefix_route.c:72]: add_route(): route name '10.10.1.1:5060' is not defined 0(5802) NOTICE: prefix_route [prefix_route.c:170]: pr_db_load(): Total prefix routes loaded: 1 0(5802) ERROR: prefix_route [prefix_route.c:174]: pr_db_load(): error flushing tree 0(5802) CRITICAL: prefix_route [prefix_route.c:212]: mod_init(): db load failed
I have tried a "name" instead of IP (though i dont know how to convert that "name" into a IP:Port), But i am still getting same error using "name" instead of IP:port @ route field in DB.
Please help.