Module: kamailio
Branch: master
Commit: c49011c2cc63d35bca6904748da166814a792fc9
URL: 
https://github.com/kamailio/kamailio/commit/c49011c2cc63d35bca6904748da166814a792fc9

Author: Sergey Okhapkin <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2016-03-29T23:21:46+02:00

geoip2: Improve detection of addresses used by anonymous proxies

---

Modified: modules/geoip2/geoip2_pv.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/c49011c2cc63d35bca6904748da166814a792fc9.diff
Patch: 
https://github.com/kamailio/kamailio/commit/c49011c2cc63d35bca6904748da166814a792fc9.patch

---

diff --git a/modules/geoip2/geoip2_pv.c b/modules/geoip2/geoip2_pv.c
index 69bd719..e239d96 100644
--- a/modules/geoip2/geoip2_pv.c
+++ b/modules/geoip2/geoip2_pv.c
@@ -407,7 +407,11 @@ int pv_get_geoip2(struct sip_msg *msg, pv_param_t *param,
                                        return pv_get_null(msg, param, res);
                                if(MMDB_get_value(&gpv->item->r.record.entry, 
&entry_data,
                                        "country","iso_code", NULL
-                                       ) != MMDB_SUCCESS)
+                                       ) != MMDB_SUCCESS
+                                       && 
MMDB_get_value(&gpv->item->r.record.entry, &entry_data,
+                                               
"registered_country","iso_code", NULL
+                                               ) != MMDB_SUCCESS
+                                       )
                                        return pv_get_null(msg, param, res);
                                if(entry_data.has_data && entry_data.type == 
MMDB_DATA_TYPE_UTF8_STRING) {
                                        gpv->item->r.country.s = (char 
*)entry_data.utf8_string;


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to