<div dir="ltr">Hi,<div><br></div><div>I think its the order you apply the ACL, first permit some, then deny any?</div><div><br></div><div>Vitalie.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 9, 2021 at 1:58 PM Mihai Cezar <<a href="mailto:cezar@mokalife.ro">cezar@mokalife.ro</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I have an issue with filtering on the asterisk side, my requests are:<br>
UsersPhones(bria) -> Kamailio -> Asterisk -> Sip Trunk Out.<br>
<br>
The goal is to manage a new layer of protection ( IP filtering / Whitelisting ).<br>
When I try to compile a list of Whitelisted IP in sip.conf I get this error:<br>
<br>
NOTICE[205]: acl.c:748 ast_apply_acl: SIP contact ACL: Rejecting<br>
'145.72.23.45' due to a failure to pass ACL '(BASELINE)'<br>
WARNING[205]: chan_sip.c:17061 parse_register_contact: Domain<br>
'<a href="http://5.12.16.2:48669" rel="noreferrer" target="_blank">5.12.16.2:48669</a>' disallowed by contact ACL (violating IP<br>
145.72.23.45)<br>
WARNING[205]: chan_sip.c:17933 register_verify: Registration denied<br>
because of contact ACL<br>
<br>
The IP 145.72.23.45, is the proxy kamailio and if I added it to<br>
sip.conf it works, but so does every ip afterwards.<br>
<br>
I tried with contactpermit also with permit, the result is the same as<br>
long as I permit the proxy ip it works. Is there something that I can<br>
do on the asterisk side to activate this filtering Or there is<br>
something that I can do in Kamailio so it will forward the realip ?<br>
<br>
contactdeny=<a href="http://0.0.0.0/0.0.0.0" rel="noreferrer" target="_blank">0.0.0.0/0.0.0.0</a><br>
contactpermit=<a href="http://145.72.23.45/32" rel="noreferrer" target="_blank">145.72.23.45/32</a><br>
contactpermit=<a href="http://5.12.16.2/32" rel="noreferrer" target="_blank">5.12.16.2/32</a><br>
<br>
<br>
Thanks in advance,<br>
<br>
__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
  * <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
  * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>