Hello,

On 3/4/13 11:48 AM, Ian French wrote:
Hey List,
              I'm looking at an article by Daniel,

http://by-miconda.blogspot.ie/2010/10/best-of-new-in-kamailio-310-5-geoip-api.html. In it he's uses the below to block source IP addresses by country,How could this be used to block multiple country sources?? I've tried a couple of things aleardy but have failed

geoip_match("$si", "src");
if($gip(src=>cc)=="CA") {
   xlog("SIP message from Canada (ip: $si) - drop it\n");

   send_reply("403", "Forbidden");
   exit;
}

just make an OR expression:

if($gip(src=>cc)=="CA" || $gip(src=>cc)=="DE" || $gip(src=>cc)=="FR") {

Just as an alternative example, you can use sqlops to make a db query and check againts a list stored in a database table.

Cheers,
Daniel

--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, April 16-17, 2013, Berlin
 - http://conference.kamailio.com -

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to