<html><body><div style="font-family: lucida console,sans-serif; font-size: 12pt; color: #000000"><div>Hello Daniel,<br></div><div>Excellent, thank you.<br></div><div><br></div><div><br></div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Daniel-Constantin Mierla" <miconda@gmail.com><br><b>To: </b>"Kamailio (SER) - Users Mailing List" <sr-users@lists.sip-router.org><br><b>Sent: </b>Thursday, March 20, 2014 5:34:28 AM<br><b>Subject: </b>Re: [SR-Users] Hash table.<br><div><br></div>Hello,<br> <br> there is no geoip param for hatable module. If you want to put some values in a hash table at startup, either you configure htable to load records from database table or use event_route[htable:mod-init] to set values in hash table.<br> <br> For the later, define hatbale named blocked and then:<br> <br> event_route[htable:mod-init] {<br>    $sht(blocked=>TH) = 1;<br>    $sht(blocked=>IN) = 1;<br> }<br> <br> The check should be:<br> <br> if($sht(blocked=>$gip(src=>cc))==1) {<br>   # blocked country<br>   ...<br> }<br> <br> Cheers,<br> Daniel<br> <br><div class="moz-cite-prefix">On 20/03/14 05:57, Slava Bendersky wrote:<br></div><blockquote cite="mid:2045064421.6401955.1395291476386.JavaMail.zimbra@skillsearch.ca"><div style="font-family: lucida console,sans-serif; font-size:
        12pt; color: #000000" data-mce-style="font-family: lucida console,sans-serif; font-size: 12pt; color: #000000;"><div>Hello Everyone,<br></div><div>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.<br></div><div><br></div><div>#!ifdef WITH_GEOIP<br> route[GEOIP]<br>    geoip_match("$si", "src");<br>    if($gip(src=>cc)=="TH") {<br>      xlog("SIP message not from allowed customer (ip: $si) - drop it\n");<br>      send_reply("403", "Forbidden");<br>      exit;<br> }<br> #!endif<br></div><div><br></div><div>I though replace single value on restricted countries with</div><div><br></div><div>modparam("htable", "geoip", "country_code=>TH;")</div><div><div>modparam("htable", "geoip", "country_code=>IN;")</div><div><br></div></div><div>if($gip(src=>cc)=="$sht(geoip=>country_code)"); <br></div><div><br></div><div>but not sure if it good approach or which way to go. Any help thank you.<br></div><div><br></div><div>Slava.<br></div></div><br><fieldset class="mimeAttachmentHeader"></fieldset><br><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org" target="_blank" data-mce-href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" data-mce-href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre></blockquote><br><pre class="moz-signature">-- 
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com" target="_blank" data-mce-href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda" target="_blank" data-mce-href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda" target="_blank" data-mce-href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference - April 2-4, 2014, Berlin, Germany
<a class="moz-txt-link-freetext" href="http://www.kamailioworld.com" target="_blank" data-mce-href="http://www.kamailioworld.com">http://www.kamailioworld.com</a><br data-mce-bogus="1"></pre><br>_______________________________________________<br>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>sr-users@lists.sip-router.org<br>http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users<br></div><div><br></div></div></body></html>