Ejemplo n.º 1
0
int cw_app_group_set_channel(struct cw_channel *chan, char *data)
{
	int res=0;
	char group[80] = "";
	char category[80] = "";

	if (!cw_app_group_split_group(data, group, sizeof(group), category, sizeof(category))) {
		pbx_builtin_setvar_helper(chan, category, group);
	} else
		res = -1;

	return res;
}
Ejemplo n.º 2
0
static char *group_count_function_read(struct cw_channel *chan, int argc, char **argv, char *buf, size_t len) 
{
	int count = -1;
	char group[80] = "", category[80] = "";
	
	cw_app_group_split_group(argv[0], group, sizeof(group), category, sizeof(category));

        if ((count = cw_app_group_get_count(group, category)) == -1)
                cw_log(LOG_NOTICE, "No group could be found for channel '%s'\n", chan->name);
        else
                snprintf(buf, len, "%d", count);

	return buf;
}
Ejemplo n.º 3
0
static char *group_match_count_function_read(struct cw_channel *chan, int argc, char **argv, char *buf, size_t len) 
{
	int count;
	char group[80] = "";
	char category[80] = "";

	cw_app_group_split_group(argv[0], group, sizeof(group), category, sizeof(category));

	if (!cw_strlen_zero(group)) {
		count = cw_app_group_match_get_count(group, category);
		snprintf(buf, len, "%d", count);
	}

	return buf;
}