[SR-Users] mtree question

Daniel-Constantin Mierla miconda at gmail.com
Mon Aug 15 23:55:18 CEST 2011


Hello,

some more comments/confirmations:

On 8/12/11 11:31 PM, Javier Gallart wrote:
> Hi Juha
>
> based on my experience with the mtree module:
>
> -mt_match() will match the longest prefix in the tree, in your case 00358
* yes, longest prefix is matched

> -mt_ignore_duplicates makes sense when loading the data in the DB to 
> the memory. There could be duplicate entries in the db and with that 
> directive you tell kamailio how to handle that situation

* indeed, duplicated are ignored in such mode, otherwise loading the 
records from db will throw error in duplicate prefixes.

> -I don't know about mt_tree_type...(never needed to test it)

* this is intended to control the behavior of the tree data and matching 
mode. The default one is 0, match longest prefix and the associated data 
with the prefix is a string. This is complete implementation.

There is actually a second mode, 1, intended to have the data as two 
integers separated by colon, like 'weight:value' iirc. The matching of 
any part of the prefix that has data associated with will add 'value' 
into a list of avps ordered by 'weight'. Since it was not really tested 
and the implementation might not be full -- due to lack of time at that 
moment and plans to migrate to use xavp for proper internal 
representation -- it was left undocumented. I should review this mode soon.

Other types of trees may be added in the future in order to optimize the 
data in the nodes for runtime usage.

Cheers,
Daniel

>
> Hope it helps
>
> Regards
>
> Javi
>
>     ------------------------------
>
>     Message: 2
>     Date: Fri, 12 Aug 2011 10:10:29 +0300
>     From: Juha Heinanen <jh at tutpro.com <mailto:jh at tutpro.com>>
>     Subject: [SR-Users] mtree question
>     To: sr-users at lists.sip-router.org
>     <mailto:sr-users at lists.sip-router.org>
>     Message-ID: <20036.53733.20652.518606 at sip.test.fi
>     <mailto:20036.53733.20652.518606 at sip.test.fi>>
>     Content-Type: text/plain; charset=us-ascii
>
>     after reading mtree readme, it is not clear to me if mt_match()
>     matches
>     to longest or any matching prefix in the three.  for example, if i
>     have
>     tree with prefixes 00 and 00358 and string to be matched is
>     0035892345670, will mt_match() set pv to value associated with 00 or
>     00358?  also, if mt_ignore_duplicates is set, will 00358 be considered
>     as duplicate of 00 or just prefixes that are exactly same.  finally,
>     what are possible mt_tree_type values and what types they stand for?
>
>     -- juha
>
>
>
>     ------------------------------
>
>     _______________________________________________
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20110815/dda96249/attachment.htm>


More information about the sr-users mailing list