Exemplo n.º 1
0
static inline int w_rl_change_counter(struct sip_msg *_m, str *name, int dec)
{
	if (w_rl_set_count(*name, dec)) {
		LM_ERR("cannot find any pipe named %.*s\n", name->len, name->s);
		return -1;
	}
	return 1;
}
Exemplo n.º 2
0
struct mi_root* mi_reset_pipe(struct mi_root* cmd_tree, void* param)
{
	struct mi_node *node;

	if (!(node = cmd_tree->node.kids))
		return init_mi_tree( 400, MI_MISSING_PARM_S, MI_MISSING_PARM_LEN);

	if (w_rl_set_count(node->value, 0))
		return init_mi_tree( 400, MI_BAD_PARM_S, MI_BAD_PARM_LEN);

	return init_mi_tree( 200, MI_OK_S, MI_OK_LEN);
}
Exemplo n.º 3
0
static inline int w_rl_change_counter(struct sip_msg *_m, char *_n, int  dec)
{
	str name;

	if (!_n || fixup_get_svalue(_m, (gparam_p)_n, &name) < 0) {
		LM_ERR("cannot retrieve identifier\n");
		return -1;
	}
	if (w_rl_set_count(name, dec)) {
		LM_ERR("cannot find any pipe named %.*s\n", name.len, name.s);
		return -1;
	}
	return 1;
}