<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
Hello Henning,</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
I can't get any result different from "500 - Invalid Parameters", no matter what (nonsense) I enter</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<span>       kamcmd mtree.match siteId 49241531075212 <span>0</span></span></div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<span><span><span><span>      </span> kamcmd mtree.match siteId 49241531075212 <span>
2</span></span></span></span><br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<span><span>      </span> kamcmd mtree.match siteId 49241531075212 <span>77</span></span><br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<span>      </span> kamcmd mtree.match siteId 4924153 77</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<span>      </span> kamcmd mtree.match siteId <br>
<div><span>      </span> kamcmd mtree.match <br>
</div>
<div><span>      </span> kamcmd mtree.match 1 2 3<br>
</div>
<span></span></div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
Looking at mtree_mod.c<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<span>void rpc_mtree_match(rpc_t* rpc, void* ctx)<br>
</span>
<div>{<br>
</div>
<div>        str tname = STR_NULL;<br>
</div>
<div>        str tomatch = STR_NULL;<br>
</div>
<div>        int mode = -1;<br>
</div>
<div><br>
</div>
<div>        m_tree_t *tr;<br>
</div>
<div><br>
</div>
<div>        if(!mt_defined_trees())<br>
</div>
<div>        {<br>
</div>
<div>                rpc->fault(ctx, 500, "Empty tree list.");<br>
</div>
<div>                return;<br>
</div>
<div>        }<br>
</div>
<div><br>
</div>
<div>        if (rpc->scan(ctx, ".SSd", &tname, &tomatch, &mode) < 3) {<br>
</div>
<div>                rpc->fault(ctx, 500, "Invalid Parameters");<br>
</div>
<div>                return;<br>
</div>
<div>        }<br>
</div>
<div><br>
</div>
<div>        if (mode !=0 && mode != 2) {<br>
</div>
<div>                rpc->fault(ctx, 500, "Invalid parameter 'mode'");<br>
</div>
<div>                return;<br>
</div>
<div>        }</div>
<div>        ....<br>
</div>
<span></span><br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
I would guess that something is going wrong in rpc->scan() but so far I had no time to dig in.</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
Debug log (-dddd) doesnt help me</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<span> 6(25280) DEBUG: ctl [../../core/io_wait.h:377]: io_watch_add(): DBG: io_watch_add(0x7f4fbaba82a0, 15, 3, 0x55f396f76000), fd_no=1<br>
</span>
<div> 6(25280) DEBUG: ctl [io_listener.c:442]: handle_new_connect(): handle_stream read: new connection (1) on /var/run/kamailio//kamailio_ctl<br>
</div>
<div> 6(25280) DEBUG: ctl [io_listener.c:495]: handle_stream_read(): handle_stream read: eof on /var/run/kamailio//kamailio_ctl<br>
</div>
<div> 6(25280) DEBUG: ctl [../../core/io_wait.h:599]: io_watch_del(): DBG: io_watch_del (0x7f4fbaba82a0, 15, -1, 0x10) fd_no=2 called<br>
</div>
<span></span><br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
Regards,</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
Volker<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div><br>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Henning Westerholt <hw@skalatan.de><br>
<b>Sent:</b> Tuesday, June 2, 2020 16:15<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br>
<b>Cc:</b> Volker Denneberg <v.denneberg@m3connect.de><br>
<b>Subject:</b> RE: kamcmd mtree.match</font>
<div> </div>
</div>
<div lang="DE">
<div class="x_WordSection1">
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="">Hello Volker,</span></p>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style=""> </span></p>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="" lang="EN-GB">the error message you‘ve got from the command looks like the generic error that is returned if the number or type of parameters do not match. Did you managed to get a match from the kamcmd command at all?</span></p>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="" lang="EN-GB"> </span></p>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="" lang="EN-GB">Further hints might be also visible in the kamailio log file.</span></p>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="" lang="EN-GB"> </span></p>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="" lang="EN-GB">Cheers,</span></p>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="" lang="EN-GB"> </span></p>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="" lang="EN-GB">Henning</span></p>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="" lang="EN-GB"> </span></p>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="" lang="EN-GB">-- </span></p>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="" lang="EN-GB">Henning Westerholt – </span><span style=""><a href="https://skalatan.de/blog/"><span style="color:#0563C1" lang="EN-GB">https://skalatan.de/blog/</span></a></span><span style="" lang="EN-GB"></span></p>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="" lang="EN-GB">Kamailio services – </span><span style=""><a href="https://gilawa.com/"><span style="color:#0563C1" lang="EN-GB">https://gilawa.com</span></a></span><span style="">
<span lang="EN-GB"></span></span></p>
</div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;">
<span style="" lang="EN-GB"> </span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> <b>On Behalf Of </b>Volker Denneberg<br>
<b>Sent:</b> Sunday, May 31, 2020 12:03 AM<br>
<b>To:</b> sr-users@lists.kamailio.org<br>
<b>Subject:</b> [SR-Users] kamcmd mtree.match</p>
</div>
</div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
 </p>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">Hi,</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">given this mtree</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black"> </span></p>
</div>
<div>
<blockquote>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">kamcmd mtree.list siteId</span></p>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">{</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">        tname: siteId</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">        tprefix: 00492419697994</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">        tvalue: {</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">                00492419697994 2388</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">        }</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">}</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">{</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">        tname: siteId</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">        tprefix: 492415310752</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">        tvalue: {</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">                492415310752 2388</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">        }</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">}</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black"> </span></p>
</div>
</blockquote>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">i wonder why this lookup fails:</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black"> </span></p>
</div>
<blockquote>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">kamcmd mtree.match siteId 49241531075212 0</span></p>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">error: 500 - Invalid Parameters</span></p>
</div>
</blockquote>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">My expectation was that 2nd tprefix should match.</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">I am using
</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">        modparam("mtree", "db_table", "mtrees")        
</span></p>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">        modparam("mtree", "char_list", "0123456789+")  
</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">        modparam("mtree", "mt_tree_type", 0)            # payload type for tree data : string</span></p>
</div>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
<span style="font-size:10.0pt; font-family:"Courier New"; color:black">Thanks in advance,</span></p>
</div>
<p class="x_MsoNormal" style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri", sans-serif;margin-left:35.4pt">
Volker </p>
</div>
</div>
</div>
</body>
</html>