[SR-Users] Regular Expression Evaluation

Mack Hendricks mack at dopensource.com
Wed Sep 16 22:16:48 CEST 2020


Hey Fred and all,

That solved my problem…now I know to use POSIX format..Thanks again!

> On Sep 9, 2020, at 4:18 PM, Fred Posner <fred at palner.com> wrote:
> 
> I had an extra 10 in there ;)
> 
> if ((is_method("INVITE")) && 
> ($rd =~ "10\.10\.[[:digit:]]+\.[[:digit:]]+")) {
> 
> or
> 
> if ((is_method("INVITE")) && 
> ($rd =~ "10\.10\.[0-9]+\.[0-9]+")) {
> 
> --fred
> 
> On Wed, 2020-09-09 at 16:15 -0400, Fred Posner wrote:
>> I would try:
>> 
>> if(uri=~"10\.10\.10\.[[:digit:]]+\.[[:digit:]]+")
>> 
>> or
>> 
>> if(uri=~"10\.10\.10\.[0-9]+\.[0-9]+")
>> 
>> --fred
>> 
>> On Wed, 2020-09-09 at 15:53 -0400, Alex Balashov wrote:
>>> The answer to the question as posed would also be interesting,
>>> however. 
>>> It seems to me it should work.
>>> 
>>> On 9/9/20 3:34 PM, Mack Hendricks wrote:
>>>> I already run into issues with this.  If I want to only execute
>>>> a
>>>> statement if it’s an INVITE with a request domain of 10.10.*.*
>>>> how
>>>> do I format?  Below is what I have.   I always have to play with
>>>> it a bit.   Looking to get a better understanding.  The regular
>>>> expression tester I’m using states that it’s valid.  What am I
>>>> doing wrong?
>>>> 
>>>>  if ((is_method("INVITE")) && ($rd =~ "10\.10\..+")) {
>>>> 
>>>>                 # Do something
>>>>                 xlog("fix got a 10.10 address");
>>>> 
>>>>         }
>>>> 
>>>> Thanks
>>>> _______________________________________________
>>>> Kamailio (SER) - Users Mailing List
>>>> sr-users at lists.kamailio.org
>>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>> 
>>> 
>>> 
> 
> 
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users




More information about the sr-users mailing list