static int geoip_match(struct sip_msg *msg, gparam_t *target, gparam_t *pvname) { str tomatch; str pvclass; if(msg==NULL) { LM_ERR("received null msg\n"); return -1; } if(fixup_get_svalue(msg, target, &tomatch)<0) { LM_ERR("cannot get the address\n"); return -1; } if(fixup_get_svalue(msg, pvname, &pvclass)<0) { LM_ERR("cannot get the pv class\n"); return -1; } geoip_pv_reset(&pvclass); return geoip_update_pv(&tomatch, &pvclass); }
static int geoip_match(sip_msg_t *msg, str *tomatch, str *pvclass) { geoip_pv_reset(pvclass); return geoip_update_pv(tomatch, pvclass); }