This will do it:
if ($rU=~"^(\+?1)?(8(00|44|55|66|77|88))[2-9][0-9][0-9][0-9][0-9][0-9][0-9]$") {
xlog("L_INFO", "Tollfree call: $rU");
}
-ovidiu
On Sat, Feb 11, 2023 at 12:37 PM Nathan Stratton <[email protected]> wrote:
>
> I am having an issue matching toll-free. I tested my regex on regex101.com,
> and it looks good, but it does not match my if statement. Am I doing
> something wrong?
>
> if (method=="INVITE") {
> xlog("L_INFO", "Checking Routes $rU");
> if ($rU=~"^(\+?1)?(8(00|44|55|66|77|88)[2-9]\d{6})$") {
> xlog("L_INFO", "Tollfree call");
> };
> };
>
> Logs show "<script>: Checking Routes +18002211212" so I don't get why it does
> not match.
>
> ><>
> Nathan Stratton
> Founder, CTO
> Vocinity, Inc.
>
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to [email protected]
> Important: keep the mailing list in the recipients, do not reply only to the
> sender!
> Edit mailing list options or unsubscribe:
--
VoIP Embedded, Inc.
http://www.voipembedded.com
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the
sender!
Edit mailing list options or unsubscribe: