Module: kamailio
Branch: master
Commit: 01664d1d82dcfe952fce29033b4fcd5e44cf2319
URL: https://github.com/kamailio/kamailio/commit/01664d1d82dcfe952fce29033b4fcd5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-05-31T12:05:01+02:00
core: parse via - fixed whitespacing
---
Modified: src/core/parser/parse_via.h
---
Diff: https://github.com/kamailio/kamailio/commit/01664d1d82dcfe952fce29033b4fcd5…
Patch: https://github.com/kamailio/kamailio/commit/01664d1d82dcfe952fce29033b4fcd5…
---
diff --git a/src/core/parser/parse_via.h b/src/core/parser/parse_via.h
index fca486e358..e4957961f1 100644
--- a/src/core/parser/parse_via.h
+++ b/src/core/parser/parse_via.h
@@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -32,11 +32,11 @@
struct sip_msg;
/* via param types
- * WARNING: keep in sync with parse_via.c FIN_HIDDEN...
+ * WARNING: keep in sync with parse_via.c FIN_HIDDEN...
* and with tm/sip_msg.c via_body_cloner
*/
enum {
- PARAM_HIDDEN=230, PARAM_TTL, PARAM_BRANCH,
+ PARAM_HIDDEN=230, PARAM_TTL, PARAM_BRANCH,
PARAM_MADDR, PARAM_RECEIVED, PARAM_RPORT, PARAM_I, PARAM_ALIAS,
#ifdef USE_COMP
PARAM_COMP,
@@ -60,12 +60,12 @@ typedef struct via_param {
/* Format: name/version/transport host:port;params comment */
- /* WARNING: keep in sync with tm/sip_msg.c via_body_cloner */
-typedef struct via_body {
+/* WARNING: keep in sync with tm/sip_msg.c via_body_cloner */
+typedef struct via_body {
int error;
str hdr; /* Contains "Via" or "v" */
str name;
- str version;
+ str version;
str transport;
str host;
short proto; /* transport */
@@ -80,7 +80,7 @@ typedef struct via_body {
struct via_param* param_lst; /* list of parameters*/
struct via_param* last_param; /*last via parameter, internal use*/
- /* shortcuts to "important" params*/
+ /* shortcuts to "important" params*/
struct via_param* branch;
str tid; /* transaction id, part of branch */
struct via_param* received;
@@ -90,8 +90,8 @@ typedef struct via_body {
#ifdef USE_COMP
struct via_param* comp; /* see rfc3486 */
#endif
- struct via_body* next; /* pointer to next via body string if
- compact via or null */
+ struct via_body* next; /* pointer to next via body string
+ if compact via or null */
} via_body_t;
The mtree_mod.c file has three pv param settings that is not documented in the README
https://kamailio.org/docs/modules/devel/modules/mtree.html
* pv_dstid
* pv_count
* pv_weight
I see that pv_dstid and pv_weight is set in the code.
I can't really guess what they are, so I can't add docs myself...
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2750
Module: kamailio
Branch: master
Commit: 07643b70aa8e80551105ae99a5d2340798167669
URL: https://github.com/kamailio/kamailio/commit/07643b70aa8e80551105ae99a5d2340…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-05-29T15:31:53+02:00
mtree: docs for pv_dstid, pv_weight and pv_count
- GH #2750
---
Modified: src/modules/mtree/doc/mtree_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/07643b70aa8e80551105ae99a5d2340…
Patch: https://github.com/kamailio/kamailio/commit/07643b70aa8e80551105ae99a5d2340…
---
diff --git a/src/modules/mtree/doc/mtree_admin.xml b/src/modules/mtree/doc/mtree_admin.xml
index 10e69a30a0..7465226efb 100644
--- a/src/modules/mtree/doc/mtree_admin.xml
+++ b/src/modules/mtree/doc/mtree_admin.xml
@@ -139,10 +139,19 @@ modparam("mtree", "db_table", "mtrees")
</listitem>
<listitem>
<para>
- type - the type of tree elements (0 = string, 2 = integer).
- It is valid only when the (tprefix, tvalue) pairs are loaded
+ type - the type of tree elements (0 = string, 1 = d:w, 2 = integer).
+ None-zero is valid only when the (tprefix, tvalue) pairs are loaded
(not for multi-column values).
</para>
+ <para>
+ When the type is 1, the value in database has to be two integers
+ separated by colon, the first one (d - dstid) will be stored in
+ pv_dstid AVP and the second (w - weight) will be stored in
+ pv_weight AVP. If in the matching records are many with the same
+ dstid, it will keep only the one with the longest prefix. Then
+ the records are ordered by the weight and stored in the specified
+ AVPs. The number of stored records is saved in pv_count variable.
+ </para>
</listitem>
<listitem>
<para>
@@ -318,6 +327,67 @@ modparam("mtree", "pv_values", "$avp(mtvals)")
</example>
</section>
+ <section>
+ <title><varname>pv_dstid</varname> (string)</title>
+ <para>
+ The AVP name where to store the first integer value when tree type is 1.
+ </para>
+ <para>
+ <emphasis>
+ Default value is <quote>$avp(tdstid)</quote>.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>pv_dstid</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("mtree", "pv_dstid", "$var(dstid)")
+...
+</programlisting>
+ </example>
+ </section>
+
+ <section>
+ <title><varname>pv_weight</varname> (string)</title>
+ <para>
+ The AVP name where to store the second integer value when tree type is 1.
+ </para>
+ <para>
+ <emphasis>
+ Default value is <quote>$avp(tweight)</quote>.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>pv_weight</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("mtree", "pv_dstid", "$var(weight)")
+...
+</programlisting>
+ </example>
+ </section>
+
+ <section>
+ <title><varname>pv_count</varname> (string)</title>
+ <para>
+ The PV spec where to store the count of matched values when tree type
+ is 1. It can be any writable PV.
+ </para>
+ <para>
+ <emphasis>
+ Default value is <quote>$avp(tcount)</quote>.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>pv_count</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("mtree", "pv_count", "$var(count)")
+...
+</programlisting>
+ </example>
+ </section>
+
<section>
<title><varname>mt_tree_type</varname> (integer)</title>
<para>
@@ -389,8 +459,8 @@ modparam("mtree", "mt_allow_duplicates", 1)
</title>
<para>
Match 'pv' value against 'mtree'. If 'mtree' type is 0 or 2 and value
- of 'mode' is NOT 2, sets a value of the longest matching prefix to
- pseudo variable specified by pv_value parameter. If 'mtree' type is
+ of 'mode' is NOT 2, sets associated value of the longest matching prefix
+ to pseudo variable specified by pv_value parameter. If 'mtree' type is
0 or 2 and value of 'mode' is 2, sets values of all matching prefixes
to avp specified by pv_values parameter so that a value of longest
matching prefix is in avp index 0. Parameter 'mode' can be an integer