int pv_get_ht_cell_expire(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { str htname; ht_pv_t *hpv; unsigned int now; hpv = (ht_pv_t*)param->pvn.u.dname; if(hpv->ht==NULL) { hpv->ht = ht_get_table(&hpv->htname); if(hpv->ht==NULL) return pv_get_null(msg, param, res); } if(pv_printf_s(msg, hpv->pve, &htname)!=0) { LM_ERR("cannot get $ht name\n"); return -1; } if(ht_get_cell_expire(hpv->ht, &htname, &now)!=0) return pv_get_null(msg, param, res); /* integer */ return pv_get_uintval(msg, param, res, now); }
int ht_api_get_cell_expire(str *hname, str *name, unsigned int *val) { ht_t* ht; ht = ht_get_table(hname); if(ht==NULL) return -1; return ht_get_cell_expire(ht, name, val); }