Hello<br>
<br>
not sure what you want to accomplish, but in case it might help this is how<br>
we use the mtree module.<br>
Our 3 columns are: partition, prefix, route<br>
Partition is just a name that defines a group, this is done inside the<br>
script before calling mt_match (via a table lookup for instance). Let&#39;s say<br>
if a call comes from ip x we assign it to partition 400; if it comes from ip<br>
y we assign it to partition 401. Each partition is a different tree.<br>
Consider these entries in the tree table:<br>
400,123456,A<br>
401,123456,A<br>
401,1234567,B<br>
<br>
Let&#39;s say both x and y send a call with $rU 1234567; mt_match will return A<br>
for ip x, and B for ip y; we use that information for taking further routing<br>
decisions. A common situation might be: x has a unique route for a whole<br>
country while y has that entry but has more defined routes for more specific<br>
area codes inside that country. The column route could also be for instance<br>
the setid of a group of gw&#39;s for the dispatcher module, etc...<br>
<br>
Regards<br>
<br>
Javi<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Message: 3<br>
&gt; Date: Tue, 14 Jun 2011 14:27:53 +0200<br>
&gt; From: I?aki Baz Castillo &lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;<br>
&gt; Subject: Re: [SR-Users] Use of mtree module having multiple trees in<br>
&gt;        the     same table<br>
&gt; To: &quot;SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -<br>
&gt;        Users   Mailing List&quot; &lt;<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>&gt;<br>
&gt; Message-ID: &lt;<a href="mailto:BANLkTim8h563kUy0YT9pTgOSXJ6W4Qf6ww@mail.gmail.com">BANLkTim8h563kUy0YT9pTgOSXJ6W4Qf6ww@mail.gmail.com</a>&gt;<br>
&gt; Content-Type: text/plain; charset=UTF-8<br>
&gt;<br>
&gt; 2011/6/13 jose luis millan &lt;<a href="mailto:doctore96@gmail.com">doctore96@gmail.com</a>&gt;:<br>
&gt; &gt; I wonder if anyone could help me understanding how can I use this<br>
&gt; &gt; module in a scenario where multiple mtrees are defined behind the same<br>
&gt; &gt; database table.<br>
&gt; &gt;<br>
&gt; &gt; I can&#39;t guess how to speficy to &#39;mt_match&#39; the mtree I want to match<br>
&gt; &gt; against, since the &#39;mtree&#39; module parameter defines a specific memory<br>
&gt; &gt; tree based on a specific table, but not based on a specific &#39;tname&#39;<br>
&gt; &gt; value.<br>
&gt;<br>
&gt; Indeed we have a table with these colums:<br>
&gt;<br>
&gt; - prefix:    string to identify number destination. This is the regex<br>
&gt; column.<br>
&gt; - id_zone:  integer, points to other table. This is the value column.<br>
&gt; - scope:    integer, can be 0 or 1.<br>
&gt;<br>
&gt; So wee need two instances of mtree:<br>
&gt; 1) those rows with scope 0.<br>
&gt; 2) those rows with scope 1.<br>
&gt;<br>
&gt; Is it possible with current mtree module? or maybe we&#39;d do better by<br>
&gt; creating two views of the table (one for entries with scope 0 and<br>
&gt; another for entries with scope 1)?<br>
&gt;<br>
&gt; Thanks a lot.<br>
&gt;<br>
&gt; --<br>
&gt; I?aki Baz Castillo<br>
&gt; &lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.sip-router.org/pipermail/sr-users/attachments/20110616/b928cbd3/attachment.htm" target="_blank">http://lists.sip-router.org/pipermail/sr-users/attachments/20110616/b928cbd3/attachment.htm</a>&gt;<br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">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 73, Issue 47<br>
****************************************<br>
</blockquote><br></div><br>