Yes, the regex use to be slow in older kamailio versions (< 4.x) but since version 4.x with new pcre lib it has improved alot, even on high load production servers (~2k+ CPS) in my own experience.

Nevertheless, i see that key has special char '+', which may be interfering with number matching. So, it is likely a bug.

Have you checked without '+' sign in keys? Do you get same results?


Sent from my Huawei P40 5G phone


-------- Original message --------
From: Brooks Bridges <bbridges@call48.com>
Date: Fri, 29 Oct 2021, 08:31
To: "Kamailio (SER) - Users Mailing List" <sr-users@lists.kamailio.org>
Subject: Re: [SR-Users] htable shtcn expressions
That was my understanding of how it should work as well, however in my testing it does not appear to be working that way.

e.g. if there is a key of "+18884441111” in my dataset and I do $shtcn(htablename=>~%8884441111) I get a count of 0.

As far as regex, I am trying to avoid that as I was told many years ago that regex is inherently slow when compared to other operations in Kamailio.  I was told this by someone I trust as an authority, and since this is a quite high volume system (greater than 1500 requests per second at peak load), every millisecond matters.


From: ‪M S‬ <shaheryarkh@gmail.com>
Sent: Thursday, October 28, 2021 5:16 PM
To: Brooks Bridges; Kamailio (SER) - Users Mailing List
Subject: Re:[SR-Users] htable shtcn expressions

Per my understanding, the left prefix match means the name "starts with" given prefix, while the right prefix match means the name "ends with" given prefix.

$sht(a=>aac) = 1;
$sht(a=>abc) = 1;
$sht(a=>acc) = 1;
$sht(a=>adc) = 1;

...

// both will produce same output
xlog("$shtcn(a=>a.*)");
xlog("$shtcn(a=>%~a)");

// both will produce same output
xlog("$shtcn(a=>.*c)");
xlog("$shtcn(a=>~%c)");

I usually use regex whenever possible and avoid these fancy derivatives to keep things simple and easy to understand in kamailio config.

Hope this helps.

--
Muhammad Shahzad Shafi
Tel: +49 176 99 83 10 85


Sent from my Huawei P40 5G phone


-------- Original message --------
From: Brooks Bridges <bbridges@call48.com>
Date: Thu, 28 Oct 2021, 23:26
To: "Kamailio (SER) - Users Mailing List" <sr-users@lists.kamailio.org>
Subject: [SR-Users] htable shtcn expressions
Referring to the expressions outlined at http://www.kamailio.org/wiki/cookbooks/5.4.x/pseudovariables#shtcn_htable_exp , is there any additional documentation or examples floating around that further explains how the right and left prefix matching works?  The rest of them are pretty clear, but I'm having troubles with these and can't get them working like I would expect them to work.
Confidentiality Notice: This e-mail, and any attachment to it, contains privileged and confidential information intended only for the use of the individual(s) or entity named on the e-mail. If the reader of this e-mail is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that reading this e-mail is strictly prohibited. If you have received this e-mail in error, please immediately return it to the sender and delete it from your system.

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Confidentiality Notice: This e-mail, and any attachment to it, contains privileged and confidential information intended only for the use of the individual(s) or entity named on the e-mail. If the reader of this e-mail is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that reading this e-mail is strictly prohibited. If you have received this e-mail in error, please immediately return it to the sender and delete it from your system.