Module: sip-router Branch: master Commit: bd8b01b9e236f9b3dbf20a4c3a153057dc8daa52 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bd8b01b9...
Author: Juha Heinanen jh@tutpro.com Committer: Juha Heinanen jh@tutpro.com Date: Thu Aug 18 20:04:32 2011 +0300
modules/mtree: added new mode to mt_match()
- Added mode=2 to mt_match() call that instead of setting value of longest matching prefix to a pv, sets values of all matching prefixes to an avp so that value of longest matching prefix is in avp index 0.
---
modules/mtree/README | 67 ++++++++++++++++++++++++++++--------- modules/mtree/doc/mtree.xml | 14 ++++++++ modules/mtree/doc/mtree_admin.xml | 25 ++++++++++++-- modules/mtree/mtree.c | 53 ++++++++++++++++++++++++++++- modules/mtree/mtree_mod.c | 17 +++++++++- 5 files changed, 154 insertions(+), 22 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=bd8b...
Hi!
Eagerly I was interested in the mtree module (never used it before) and read the README few times but I'm still not sure if I understand it correctly. IMO the documentation is poor - maybe someone who uses and understand the module can improve the README. I.e. an example might be quite useful.
"This module loads data indexed by prefixes from database and returns associated string or precompiled value."
What is a precompiled value?
Also it find it strange that "mode" is either 2 or not 2. So, mode=1 is the same as mode=5? Usually it is something like mode=1: ...., mode=2: .....
Thanks Klaus
On 18.08.2011 19:47, Juha Heinanen wrote:
Module: sip-router Branch: master Commit: bd8b01b9e236f9b3dbf20a4c3a153057dc8daa52 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bd8b01b9...
Author: Juha Heinanenjh@tutpro.com Committer: Juha Heinanenjh@tutpro.com Date: Thu Aug 18 20:04:32 2011 +0300
modules/mtree: added new mode to mt_match()
- Added mode=2 to mt_match() call that instead of setting value of longest matching prefix to a pv, sets values of all matching prefixes to an avp so that value of longest matching prefix is in avp index 0.
modules/mtree/README | 67 ++++++++++++++++++++++++++++--------- modules/mtree/doc/mtree.xml | 14 ++++++++ modules/mtree/doc/mtree_admin.xml | 25 ++++++++++++-- modules/mtree/mtree.c | 53 ++++++++++++++++++++++++++++- modules/mtree/mtree_mod.c | 17 +++++++++- 5 files changed, 154 insertions(+), 22 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=bd8b...
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Klaus Darilion writes:
Eagerly I was interested in the mtree module (never used it before) and read the README few times but I'm still not sure if I understand it correctly. IMO the documentation is poor - maybe someone who uses and understand the module can improve the README. I.e. an example might be quite useful.
klaus,
i had the same problem with readme and asked questions about it.
"This module loads data indexed by prefixes from database and returns associated string or precompiled value."
What is a precompiled value?
may be it refers to integer value of type 1 mtrees, which are not documented in readme, but which daniel referred to.
Also it find it strange that "mode" is either 2 or not 2. So, mode=1 is the same as mode=5? Usually it is something like mode=1: ...., mode=2: .....
it seemed to me that modes 0 and 1 (corresponding to types 0 and 1 of mtrees) were already "reserved" in the code, although not used. therefore i chose mode 2 for the case where values of all matching prefixes are added to an an avp.
i still need to add mtrees table schema. i don't know if mtree schema is also needed.
-- juha
On 19.08.2011 06:23, Juha Heinanen wrote:
Klaus Darilion writes:
Eagerly I was interested in the mtree module (never used it before) and read the README few times but I'm still not sure if I understand it correctly. IMO the documentation is poor - maybe someone who uses and understand the module can improve the README. I.e. an example might be quite useful.
klaus,
i had the same problem with readme and asked questions about it.
"This module loads data indexed by prefixes from database and returns associated string or precompiled value."
What is a precompiled value?
may be it refers to integer value of type 1 mtrees, which are not documented in readme, but which daniel referred to.
Also it find it strange that "mode" is either 2 or not 2. So, mode=1 is the same as mode=5? Usually it is something like mode=1: ...., mode=2: .....
it seemed to me that modes 0 and 1 (corresponding to types 0 and 1 of mtrees) were already "reserved" in the code, although not used. therefore i chose mode 2 for the case where values of all matching prefixes are added to an an avp.
In mode 2, how are the values added? Will every matching entry be added as an AVP so that there is an AVP-Array, or will there be just one AVP, with all the values joined together?
Klaus
Klaus Darilion writes:
In mode 2, how are the values added? Will every matching entry be added as an AVP so that there is an AVP-Array, or will there be just one AVP, with all the values joined together?
i tried to tell that in README:
If 'mtree' consists of string values (mtree type = 0) and value of 'mode' is 2, sets values of all matching prefixes to avp specified by pv_values parameter so that value of longest matching prefix is in avp index 0.
i.e., the avp is an array.
-- juha