Discussion:
[SR-Users] Kamailio reading an external configuration file from the main config.
p***@public.gmane.org
2014-09-16 14:49:54 UTC
Permalink
Is there any way that i can create a list of ips for kamailio to compare
and do something, for example create an authorize list of ips on txt that
it can read for each invite that i receive than check a variable against
that list.

for example do a search $si on the external text file and if match do
something if it doesn't then continue the route downwards.

I am trying to create a list of banned ips but don't want to do it on the
firewall since i want to log all the bad ips and added to the list and do
something every time i receive a packed from any of the ips on the list.
is that possible with kamailio , is there any module i can use to cook this
configuration ?

Thank you

Julian
Daniel-Constantin Mierla
2014-09-17 07:20:36 UTC
Permalink
Hello,
Post by p***@public.gmane.org
Is there any way that i can create a list of ips for kamailio to
compare and do something, for example create an authorize list of ips
on txt that it can read for each invite that i receive than check a
variable against that list.
for example do a search $si on the external text file and if match do
something if it doesn't then continue the route downwards.
the permissions module has this functionality -- you need to store the
addresses in 'address' table in database. It hsould work with db_text as
well (or sqlite).

Then you can have the comparison done statically in kamailio.cfg, but
any change will require the restart.

Another options it to add the ips in a hash table, then you can
add/remove items in it via rpc/mi commands. See htable module.
Post by p***@public.gmane.org
I am trying to create a list of banned ips but don't want to do it on
the firewall since i want to log all the bad ips and added to the list
and do something every time i receive a packed from any of the ips on
the list.
is that possible with kamailio , is there any module i can use to cook
this configuration ?
This is possible, as said before, up to you what option -- look at
permissions+db_text(or db_sqlite) or htable.

Cheers,
Daniel
Post by p***@public.gmane.org
Thank you
Julian
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany
Loading...