99 char *data,
char *
buf,
size_t len)
103 char group[80] =
"", category[80] =
"";
119 if (gi->
chan != chan)
135 snprintf(buf, len,
"%d", count);
143 .
name =
"GROUP_COUNT",
149 const char *cmd,
char *data,
char *
buf,
153 char category[80] =
"";
161 snprintf(buf, len,
"%d", count);
169 .
name =
"GROUP_MATCH_COUNT",
176 char *data,
char *
buf,
size_t len)
189 if (gi->
chan != chan)
208 char *data,
const char *
value)
222 snprintf(grpcat,
sizeof(grpcat),
"%s@%s", value, data);
229 "Setting a group requires an argument (group name)\n");
241 char *data,
char *
buf,
size_t len)
244 char tmp1[1024] =
"";
245 char tmp2[1024] =
"";
253 if (gi->
chan != chan)
258 snprintf(tmp1,
sizeof(tmp1),
"%s %s@%s", tmp2, gi->
group, gi->
category);
260 snprintf(tmp1,
sizeof(tmp1),
"%s %s", tmp2, gi->
group);
263 snprintf(tmp1,
sizeof(tmp1),
"%s@%s", gi->
group, gi->
category);
265 snprintf(tmp1,
sizeof(tmp1),
"%s", gi->
group);
277 .
name =
"GROUP_LIST",
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
struct ast_group_info * ast_app_group_list_head(void)
Get the head of the group count list.
static struct ast_custom_function group_count_function
static struct ast_custom_function group_match_count_function
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
static struct ast_custom_function group_function
static int group_function_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
#define ast_strlen_zero(foo)
General Asterisk PBX channel definitions.
Data structure associated with a custom dialplan function.
static struct ast_custom_function group_list_function
static int group_function_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
static int group_match_count_function_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
Core PBX routines and definitions.
struct ast_channel * chan
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static int unload_module(void)
int ast_app_group_list_unlock(void)
Unlock the group count list.
static int load_module(void)
int ast_app_group_split_group(const char *data, char *group, int group_max, char *category, int category_max)
Split a group string into group and category, returning a default category if none is provided...
int ast_app_group_match_get_count(const char *groupmatch, const char *category)
Get the current channel count of all groups that match the specified pattern and category.
int ast_app_group_list_rdlock(void)
Read Lock the group count list.
static int group_list_function_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
const char * ast_channel_name(const struct ast_channel *chan)
struct ast_group_info::@248 group_list
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
static int group_count_function_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define ast_custom_function_register(acf)
Register a custom function.
int ast_app_group_set_channel(struct ast_channel *chan, const char *data)
Set the group for a channel, splitting the provided data into group and category, if specified...
int ast_app_group_get_count(const char *group, const char *category)
Get the current channel count of the specified group and category.