[SR-Users] Hash table.

Slava Bendersky volga629 at networklab.ca
Thu Mar 20 05:57:56 CET 2014


Hello Everyone, 
I am trying set hash table for geoip and put countries code which is not a customers. Currently I have working as static for single country code. 

#!ifdef WITH_GEOIP 
route[GEOIP] 
geoip_match("$si", "src"); 
if($gip(src=>cc)=="TH") { 
xlog("SIP message not from allowed customer (ip: $si) - drop it\n"); 
send_reply("403", "Forbidden"); 
exit; 
} 
#!endif 

I though replace single value on restricted countries with 

modparam("htable", "geoip", "country_code=>TH;") 
modparam("htable", "geoip", "country_code=>IN;") 

if($gip(src=>cc)=="$sht(geoip=>country_code)"); 

but not sure if it good approach or which way to go. Any help thank you. 

Slava. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140320/9d151701/attachment.html>


More information about the sr-users mailing list