Hi, Andrey.
for PCRE there is module http://kamailio.org/docs/modules/devel/modules/regex.html and this should works
modparam("regex", "pcre_caseless", 1) .... if (pcre_match("$mb", " $shtitval(i1)")) { .... }
also with POSIX if ($mb =~ $shtitval(i1) ){ }
2018-01-31 14:42 GMT+03:00 Andrey Deykunov deykunov@gmail.com:
Hi,
I have an htable containing some black list words (i.e. user IDs or phone models). To find matches of the words in every message I use the following script:
sht_iterator_start("i1", "black_list"); while(sht_iterator_next("i1")) { if ( search($shtitval(i1)) ) { // do something } } sht_iterator_end("i1");
How can I modify search($shtitval(i1)) to get case insensitive matching?
The example below does not work:
sht_iterator_start("i1", "black_list"); while(sht_iterator_next("i1")) { $var(re) = $shtitval(i1) + "/i"; if ( search($var(re)) ) { // do something } } sht_iterator_end("i1");
Other possible modifications of $var(re) aren't working too.
Thanks, Andrey
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users