<div dir="ltr"><div>hi,</div>
<div> </div>
<div>what do you think about the Dialplan module? it can probably do the trick as well...</div>
<div> </div>
<div>cheers,<br><br></div>
<div class="gmail_quote">On Fri, Feb 17, 2012 at 10:18 AM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
<div text="#000000" bgcolor="#FFFFFF">Hello, 
<div class="im"><br><br>On 2/16/12 2:51 PM, Javier Gallart wrote: 
<blockquote type="cite">Hello Uri 
<div><br></div>
<div>I had similar needs and I found the ndb_redis module more suited for that type of task. Instead of a tree you have a hash like this: tname tprefix tvalue. If you do a hget nts <span>$avp(DID) and you get a not null value you have found your exact match. It works very  well for me and the time it takes for that &quot;query&quot; is barely noticeable. Of course redis does not address items like persistence, etc the same way a rdbms does.</span></div>
</blockquote><br></div>for hash tables in config, the alternative is using htable module. Then the selection is done on exact match, no prefix matching. mtree is suitable for storing keys that are composed from a limited set of characters (like numbers, 0-9 digits only), otherwise becomes too memory consuming. For keys that are composed from any character and need exact match, hash table structures are more suitable, no matter if it is via htable module or something else like redis.<br>
<br>Cheers,<br>Daniel<br><br>
<blockquote type="cite">
<div>
<div class="h5">
<div><span>Hope it helps.</span></div>
<div><span><br></span></div>
<div><span>Regards</span></div>
<div><span><br></span></div>
<div><span>Javi</span></div>
<div><br>
<div class="gmail_quote">On Thu, Feb 16, 2012 at 12:00 PM, <span dir="ltr">&lt;<a href="mailto:sr-users-request@lists.sip-router.org" target="_blank">sr-users-request@lists.sip-router.org</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">Send sr-users mailing list submissions to<br>       <a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<br>To subscribe or unsubscribe via the World Wide Web, visit<br>       <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>       <a href="mailto:sr-users-request@lists.sip-router.org" target="_blank">sr-users-request@lists.sip-router.org</a><br><br>You can reach the person managing the list at<br>
       <a href="mailto:sr-users-owner@lists.sip-router.org" target="_blank">sr-users-owner@lists.sip-router.org</a><br><br>When replying, please edit your Subject line so it is more specific<br>than &quot;Re: Contents of sr-users digest...&quot;<br>
<br><br>Today&#39;s Topics:<br><br>  1. how to match exact string value in mtree (Uri Shacked)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Thu, 16 Feb 2012 12:54:50 +0200<br>
From: Uri Shacked &lt;<a href="mailto:ushacked@gmail.com" target="_blank">ushacked@gmail.com</a>&gt;<br>Subject: [SR-Users] how to match exact string value in mtree<br>To: &quot;SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -<br>
       Users   Mailing List&quot; &lt;<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>&gt;<br>Message-ID:<br>       &lt;CAMMbDhTFNXAE-K88=<a href="mailto:AeMjO7AnA_QJV3Ajj3AH-AxemXN3ze6HQ@mail.gmail.com" target="_blank">AeMjO7AnA_QJV3Ajj3AH-AxemXN3ze6HQ@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br><br>Hi,<br><br>I am using Mtree to match prefix numbers, some of them starts with 0 or<br>characters like D for example.<br>so, the mtree param is like this:<br>
<br>modparam(&quot;mtree&quot;, &quot;db_url&quot;, CFGDB)<br>modparam(&quot;mtree&quot;, &quot;mtree&quot;, &quot;name=nts;dbtable=service_numbers_view;type=0;&quot;)<br>modpmodparam(&quot;mtree&quot;, &quot;char_list&quot;, &quot;0123456789*+#YMDabcdefgh&quot;)<br>
modparam(&quot;mtree&quot;, &quot;pv_value&quot;, &quot;$avp(mtval)&quot;)<br>modparam(&quot;mtree&quot;, &quot;pv_values&quot;, &quot;$avp(mtvals)&quot;)<br><br>The thing is, that i tried all:<br><br>if(!mt_match(&quot;nts&quot;, &quot;$avp(DID)&quot;,&quot;1&quot;))<br>
if(!mt_match(&quot;nts&quot;, &quot;$avp(DID)&quot;,&quot;2&quot;))<br>if(!mt_match(&quot;nts&quot;, &quot;$avp(DID)&quot;,&quot;0&quot;))<br><br>and lets say i have the both prefix in the nts mtree:<br>09555<br>09555333<br>
<br>And the prefix i search for is  $avp(DID)=09555444<br><br>I allwasy get the 09555 because it is the longest match.<br>I need exact match.....<br><br>how do i do that?<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.sip-router.org/pipermail/sr-users/attachments/20120216/9d2eb778/attachment.html" target="_blank">http://lists.sip-router.org/pipermail/sr-users/attachments/20120216/9d2eb778/attachment.html</a>&gt;<br>
<br>------------------------------<br><br>_______________________________________________<br>sr-users mailing list<br><a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br><a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br><br>End of sr-users Digest, Vol 81, Issue 40<br>****************************************<br></blockquote></div><br></div><br>
<fieldset></fieldset> <br></div></div><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888"></font></span></blockquote><span class="HOEnZb"><font color="#888888"><br><pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com/" target="_blank">http://www.asipto.com</a>
<a href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a> -- <a href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a></pre></font></span></div></blockquote></div>
<br></div>