[SR-Users] kamcmd mtree.match
Volker Denneberg
v.denneberg at m3connect.de
Wed Jun 3 23:32:23 CEST 2020
Hello Henning,
you hit the point. With prefix s:
kamcmd mtree.match siteId s:49241531075267 0
is working. Thank you very much!
Volker
________________________________
From: Henning Westerholt <hw at skalatan.de>
Sent: Wednesday, June 3, 2020 21:03
To: Volker Denneberg <v.denneberg at m3connect.de>; Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
Subject: RE: kamcmd mtree.match
Hello Volker,
have you tried with the prefix “s” as suggested on the list:
kamcmd mtree.match siteId s:49241531075212 0
Cheers,
Henning
--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com<https://gilawa.com/>
From: Volker Denneberg <v.denneberg at m3connect.de>
Sent: Wednesday, June 3, 2020 8:56 PM
To: Henning Westerholt <hw at skalatan.de>; Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
Subject: Re: kamcmd mtree.match
Hello Henning,
I can't get any result different from "500 - Invalid Parameters", no matter what (nonsense) I enter
kamcmd mtree.match siteId 49241531075212 0
kamcmd mtree.match siteId 49241531075212 2
kamcmd mtree.match siteId 49241531075212 77
kamcmd mtree.match siteId 4924153 77
kamcmd mtree.match siteId
kamcmd mtree.match
kamcmd mtree.match 1 2 3
Looking at mtree_mod.c
void rpc_mtree_match(rpc_t* rpc, void* ctx)
{
str tname = STR_NULL;
str tomatch = STR_NULL;
int mode = -1;
m_tree_t *tr;
if(!mt_defined_trees())
{
rpc->fault(ctx, 500, "Empty tree list.");
return;
}
if (rpc->scan(ctx, ".SSd", &tname, &tomatch, &mode) < 3) {
rpc->fault(ctx, 500, "Invalid Parameters");
return;
}
if (mode !=0 && mode != 2) {
rpc->fault(ctx, 500, "Invalid parameter 'mode'");
return;
}
....
I would guess that something is going wrong in rpc->scan() but so far I had no time to dig in.
Debug log (-dddd) doesnt help me
6(25280) DEBUG: ctl [../../core/io_wait.h:377]: io_watch_add(): DBG: io_watch_add(0x7f4fbaba82a0, 15, 3, 0x55f396f76000), fd_no=1
6(25280) DEBUG: ctl [io_listener.c:442]: handle_new_connect(): handle_stream read: new connection (1) on /var/run/kamailio//kamailio_ctl
6(25280) DEBUG: ctl [io_listener.c:495]: handle_stream_read(): handle_stream read: eof on /var/run/kamailio//kamailio_ctl
6(25280) DEBUG: ctl [../../core/io_wait.h:599]: io_watch_del(): DBG: io_watch_del (0x7f4fbaba82a0, 15, -1, 0x10) fd_no=2 called
Regards,
Volker
________________________________
From: Henning Westerholt <hw at skalatan.de<mailto:hw at skalatan.de>>
Sent: Tuesday, June 2, 2020 16:15
To: Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>>
Cc: Volker Denneberg <v.denneberg at m3connect.de<mailto:v.denneberg at m3connect.de>>
Subject: RE: kamcmd mtree.match
Hello Volker,
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?
Further hints might be also visible in the kamailio log file.
Cheers,
Henning
--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com<https://gilawa.com/>
From: sr-users <sr-users-bounces at lists.kamailio.org<mailto:sr-users-bounces at lists.kamailio.org>> On Behalf Of Volker Denneberg
Sent: Sunday, May 31, 2020 12:03 AM
To: sr-users at lists.kamailio.org<mailto:sr-users at lists.kamailio.org>
Subject: [SR-Users] kamcmd mtree.match
Hi,
given this mtree
kamcmd mtree.list siteId
{
tname: siteId
tprefix: 00492419697994
tvalue: {
00492419697994 2388
}
}
{
tname: siteId
tprefix: 492415310752
tvalue: {
492415310752 2388
}
}
i wonder why this lookup fails:
kamcmd mtree.match siteId 49241531075212 0
error: 500 - Invalid Parameters
My expectation was that 2nd tprefix should match.
I am using
modparam("mtree", "db_table", "mtrees")
modparam("mtree", "char_list", "0123456789+")
modparam("mtree", "mt_tree_type", 0) # payload type for tree data : string
Thanks in advance,
Volker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200603/304a8a7f/attachment.html>
More information about the sr-users
mailing list