|
Thanks for the patch. We will test it out and merge it.
Best Regards
Samir Doshi
iNextrix Technologies Pvt. Ltd.
http://www.inextrix.com
Disclaimer:
The information contained in this communication is confidential and may be
legally privileged. It is intended solely for the use of the individual or
entity to whom it is addressed and others authorised to receive it. If you
are not the intended recipient you are hereby notified that any disclosure,
copying, distribution or taking action in reliance of the contents of this
information is strictly prohibited and may be unlawful.
On Wed, Feb 22, 2017 at 8:44 PM, Neurotec Tecnologia S.A.S <
notifications@github.com> wrote:
> hi when we register a ip settings for example, 89.80.70.0/24 this not
> allow calls from 89.80.70.55 for example.
>
> this was our fast solution on astpp.functions.lua:
>
> replace
>
> local query = "SELECT "..TBL_IP_MAP..".*, (SELECT number FROM "..TBL_USERS.." where id=accountid AND status=0 AND deleted=0) AS account_code FROM "..TBL_IP_MAP.." WHERE SUBSTRING( ip, 1, CHAR_LENGTH( ip ) -3 ) = \"" .. params:getHeader('Hunt-Network-Addr').. "\" AND prefix IN (NULL,'') OR SUBSTRING( ip, 1, CHAR_LENGTH( ip ) -3 ) = \"" .. params:getHeader('Hunt-Network-Addr').. "\" AND \"" .. destination_number .. "\" RLIKE prefix ORDER BY LENGTH(prefix) DESC LIMIT 1"
>
> with
>
> local query = "SELECT "..TBL_IP_MAP..".*, (SELECT number FROM "..TBL_USERS.." where id=accountid AND status=0 AND deleted=0) AS account_code FROM "..TBL_IP_MAP.." WHERE INET_ATON(\"" .. params:getHeader('Hunt-Network-Addr').. "\") = ((0xFFFFFFFF & (-1 << 32 - SUBSTRING_INDEX(ip, '/',-1))) & INET_ATON(SUBSTRING_INDEX(ip,'/',1))) OR SUBSTRING( ip, 1, CHAR_LENGTH( ip ) -3 ) = \"" .. params:getHeader('Hunt-Network-Addr').. "\" AND prefix IN (NULL,'') OR SUBSTRING( ip, 1, CHAR_LENGTH( ip ) -3 ) = \"" .. params:getHeader('Hunt-Network-Addr').. "\" AND \"" .. destination_number .. "\" RLIKE prefix ORDER BY LENGTH(prefix) DESC LIMIT 1"
>
> thanks for you work
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/iNextrix/ASTPP/issues/184>, or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AA6gcUMzfP1ESAsjOLoxeKA3UlzxjFwWks5rfFDCgaJpZM4MIxOi>
> .
>
|