[OpenSIPS-Devel] 2.4 new IP and Subnet comparison.

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Aug 9 09:48:31 EDT 2018


Hi Adam,

The right operand must be a static value, otherwise the script 
interpretor will have no idea that the values are and to do an IP-wise 
check.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
   http://opensips.org/training/OpenSIPS_Bootcamp_2018/

On 08/09/2018 04:35 PM, Adam Overbeeke wrote:
>
> Hi Bogdan,
>
> Thanks for confirming. I found out my error… embarrassing enough, I 
> was pulling the wrong tag and was running against 2.3.3…. my 
> apologies. After pulling the correct tag 2.4.1, I was able to retest 
> and confirm that Option 3 worked as expect. As a follow up question, 
> is it require that the CIDR ( eg. 10.10.10.0/24 ) be a static value in 
> the comparison or is it possible to convert a variable to a CIDR “type”.
>
> NOTE: Does not actually work - But here is an example of what I mean. 
> Or some means to convert a string “10.10.10.0/24” to the CIDR value in 
> the OPTION 3 ( 10.10.10.0/24 ).
>
>   $var(input_ip) = "10.10.10.10";
>
> $var(input_x) = "10.10.10.0";
>
> $var(input_y) = 24;
>
> $var(input_z) = $(var(input_x){ip.pton})/$var(input_y);
>
>   if ($var(input_ip) == $var(input_z))
>
>     xlog("matched\n");
>
> Thanks,
>
> Adam
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20180809/a2f8cca5/attachment.html>


More information about the Devel mailing list