Exemple #1
0
static int ht_reset_by_name(str *hname)
{
	ht_t *ht;
	ht = ht_get_table(hname);
	if(ht==NULL) {
		LM_ERR("cannot get hash table [%.*s]\n", hname->len, hname->s);
		return -1;
	}
	if(ht_reset_content(ht)<0)
		return -1;
	return 0;

}
Exemple #2
0
static int ht_reset(struct sip_msg* msg, char* htname, char* foo)
{
	ht_t *ht;
	str sname;

	if(fixup_get_svalue(msg, (gparam_t*)htname, &sname)<0 || sname.len<=0)
	{
		LM_ERR("cannot get hash table name\n");
		return -1;
	}
	ht = ht_get_table(&sname);
	if(ht==NULL)
	{
		LM_ERR("cannot get hash table [%.*s]\n", sname.len, sname.s);
		return -1;
	}
	if(ht_reset_content(ht)<0)
		return -1;
	return 1;
}