Re: [SR-Users] Regular exepression issue in permissions module
Hi, On Fri, 2018-02-09 at 14:27 +0100, Daniel-Constantin Mierla wrote: > > On 09.02.18 14:19, Paulo Ferreira wrote: > > On Fri, 2018-02-09 at 13:36 +0100, Daniel-Constantin Mierla wrote: > > > Hello, > > > > > > > > > On 09.02.18 12:25, Paulo Ferreira wrote: > > > > Hi list, > > > > I'm testing permissions module with kamailio 5.1.1 and I was > > > > struggling > > > > with regular expressions in trusted requests part of module. > > > > > > > > I noticed that 9[0-9]{4} doesn't work as expected so I had to > > > > change it > > > > for 9[0-9][0-9][0-9][0-9] to work. > > > > > > > > Is it supposed to be like that? > > > > > > > > Is there other way in this module to simplify the expression > > > > since > > > > it > > > > is not accepting the POSIX way? > > > > > > > > > > it should be postfix regexp, at a matter of fact, the input is > > > passed > > > to > > > the regexp implementation in libc, it is not written from scratch > > > by > > > kamailio. I have seen in the past some situations that a regexp > > > didn't > > > work as expect on various versions of operating systems. > > > > > > Can you try and see if 9([0-9]){4} works? > > > > I tried and didn't work. > > > > > Otherwise, try with debug=3 in kamailio.cfg and see if you can > > > spot > > > some > > > useful debug messages. > > > > I tried before attempting to discover what was wrong with the > > expression and no useful messages regarding this. > > > > Can you try in kamailio.cfg: > > $var(x) = "912345678"; > if($var(x) =~ "9[0-9]{4}") { > xlog("regexp matched\n"); > } > > Same regexp library is used. If this one works, then loading the > value > from trusted might have some issues. Worked as expected: kamailio[22093]: ERROR:
Re: [SR-Users] Regular exepression issue in permissions module
On 09.02.18 14:19, Paulo Ferreira wrote: > On Fri, 2018-02-09 at 13:36 +0100, Daniel-Constantin Mierla wrote: >> Hello, >> >> >> On 09.02.18 12:25, Paulo Ferreira wrote: >>> Hi list, >>> I'm testing permissions module with kamailio 5.1.1 and I was >>> struggling >>> with regular expressions in trusted requests part of module. >>> >>> I noticed that 9[0-9]{4} doesn't work as expected so I had to >>> change it >>> for 9[0-9][0-9][0-9][0-9] to work. >>> >>> Is it supposed to be like that? >>> >>> Is there other way in this module to simplify the expression since >>> it >>> is not accepting the POSIX way? >>> >> it should be postfix regexp, at a matter of fact, the input is passed >> to >> the regexp implementation in libc, it is not written from scratch by >> kamailio. I have seen in the past some situations that a regexp >> didn't >> work as expect on various versions of operating systems. >> >> Can you try and see if 9([0-9]){4} works? > I tried and didn't work. > >> Otherwise, try with debug=3 in kamailio.cfg and see if you can spot >> some >> useful debug messages. > I tried before attempting to discover what was wrong with the > expression and no useful messages regarding this. > Can you try in kamailio.cfg: $var(x) = "912345678"; if($var(x) =~ "9[0-9]{4}") { xlog("regexp matched\n"); } Same regexp library is used. If this one works, then loading the value from trusted might have some issues. Cheers, Daniel -- Daniel-Constantin Mierla www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Regular exepression issue in permissions module
On Fri, 2018-02-09 at 13:36 +0100, Daniel-Constantin Mierla wrote: > Hello, > > > On 09.02.18 12:25, Paulo Ferreira wrote: > > Hi list, > > I'm testing permissions module with kamailio 5.1.1 and I was > > struggling > > with regular expressions in trusted requests part of module. > > > > I noticed that 9[0-9]{4} doesn't work as expected so I had to > > change it > > for 9[0-9][0-9][0-9][0-9] to work. > > > > Is it supposed to be like that? > > > > Is there other way in this module to simplify the expression since > > it > > is not accepting the POSIX way? > > > > it should be postfix regexp, at a matter of fact, the input is passed > to > the regexp implementation in libc, it is not written from scratch by > kamailio. I have seen in the past some situations that a regexp > didn't > work as expect on various versions of operating systems. > > Can you try and see if 9([0-9]){4} works? I tried and didn't work. > > Otherwise, try with debug=3 in kamailio.cfg and see if you can spot > some > useful debug messages. I tried before attempting to discover what was wrong with the expression and no useful messages regarding this. Regards, Paulo > > Cheers, > Daniel > -- --- Paulo Ferreira VoIP@RCTS - Área de Infraestruturas Aplicacionaisz FCCN http://www.fccn.pt/ Av. do Brasil, n.º 101 1700-066 Lisboa - Portugal Telefone|Phone: +351 218440100; Fax: +351 218472167 Aviso de Confidencialidade/Disclaimer Esta mensagem é exclusivamente destinada ao seu destinatário, podendo conter informação CONFIDENCIAL, cuja divulgação está expressamente vedada nos termos da lei. Caso tenha rececionado indevidamente esta mensagem,solicitamos-lhe que nos comunique esse mesmo facto por esta via ou para o telefone +351 218440100 devendo apagar o seu conteúdo de imediato. This message is intended exclusively for its addressee. It may contain CONFIDENTIAL information protected by law. If this message has been received by error, please notify us via e-mail or by telephone +351 218440100 and delete it immediately. signature.asc Description: This is a digitally signed message part ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Re: [SR-Users] Regular exepression issue in permissions module
Hello, On 09.02.18 12:25, Paulo Ferreira wrote: > Hi list, > I'm testing permissions module with kamailio 5.1.1 and I was struggling > with regular expressions in trusted requests part of module. > > I noticed that 9[0-9]{4} doesn't work as expected so I had to change it > for 9[0-9][0-9][0-9][0-9] to work. > > Is it supposed to be like that? > > Is there other way in this module to simplify the expression since it > is not accepting the POSIX way? > it should be postfix regexp, at a matter of fact, the input is passed to the regexp implementation in libc, it is not written from scratch by kamailio. I have seen in the past some situations that a regexp didn't work as expect on various versions of operating systems. Can you try and see if 9([0-9]){4} works? Otherwise, try with debug=3 in kamailio.cfg and see if you can spot some useful debug messages. Cheers, Daniel -- Daniel-Constantin Mierla www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users