Skip to content

Commit

Permalink
geoip: return continent id via contid attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Mar 11, 2015
1 parent 3b5633d commit 1ace8a1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/geoip/geoip_pv.c
Expand Up @@ -212,6 +212,11 @@ int pv_parse_geoip_name(pv_spec_p sp, str *in)
gpv->type = 12;
else goto error;
break;
case 6:
if(strncmp(pvs.s, "contid", 6)==0)
gpv->type = 13;
else goto error;
break;
default:
goto error;
}
Expand Down Expand Up @@ -349,6 +354,11 @@ int pv_get_geoip(struct sip_msg *msg, pv_param_t *param,
return pv_get_null(msg, param, res);
return pv_get_sintval(msg, param, res,
gpv->item->r.record->metro_code);
case 13: /* contid */
if(gpv->item->r.record==NULL)
return pv_get_null(msg, param, res);
return pv_geoip_get_strzval(msg, param, res,
gpv->item->r.record->continent_code);
default: /* cc */
if(gpv->item->r.record==NULL)
return pv_get_null(msg, param, res);
Expand Down

0 comments on commit 1ace8a1

Please sign in to comment.