[OpenSIPS-Devel] Proposal for change in permissions module
Saúl Ibarra Corretgé
saul at ag-projects.com
Tue Sep 27 13:59:05 CEST 2011
Hi Bogdan,
On Sep 27, 2011, at 1:36 PM, Bogdan-Andrei Iancu wrote:
> Hi Saúl,
>
> if in the check_address() you use group "0", it will search in all groups - group "0" is a kind of wild card. Will this help you ?
>
Nope. Let me explain the case a bit better: lets say I have some sort of ACL mechanism, so that only the listed IP addresses are allowed to send traffic. In order to allow traffic from everywhere I'd have to either not do the check or add 0.0.0.0/0 as a value so that it matches everything.
If I'd have a -2 return code I could do something like this:
check_address(...)
switch ($retcode) {
case -2:
# There was no ACL, so I choose to allow it anyway
...
break;
case -1:
# No match
sl_send_reply("403", "Get out!");
exit;
default:
# All is good
....
}
Does it make more sense now?
Regards,
--
Saúl Ibarra Corretgé
AG Projects
More information about the Devel
mailing list