32 #include "asterisk/module.h"
101 char *data,
char *buf,
size_t len)
105 char group[80] =
"", category[80] =
"";
121 if (gi->
chan != chan)
137 snprintf(buf, len,
"%d", count);
145 .
name =
"GROUP_COUNT",
151 const char *cmd,
char *data,
char *buf,
156 char category[80] =
"";
163 snprintf(buf, len,
"%d", count);
171 .
name =
"GROUP_MATCH_COUNT",
178 char *data,
char *buf,
size_t len)
191 if (gi->
chan != chan)
210 char *data,
const char *
value)
224 snprintf(grpcat,
sizeof(grpcat),
"%s@%s", value, data);
231 "Setting a group requires an argument (group name)\n");
243 char *data,
char *buf,
size_t len)
246 char tmp1[1024] =
"";
247 char tmp2[1024] =
"";
255 if (gi->
chan != chan)
260 snprintf(tmp1,
sizeof(tmp1),
"%s %s@%s", tmp2, gi->
group, gi->
category);
262 snprintf(tmp1,
sizeof(tmp1),
"%s %s", tmp2, gi->
group);
265 snprintf(tmp1,
sizeof(tmp1),
"%s@%s", gi->
group, gi->
category);
267 snprintf(tmp1,
sizeof(tmp1),
"%s", gi->
group);
279 .
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.
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...
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.
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_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...
General Asterisk PBX channel definitions.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
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
struct ast_group_info * ast_app_group_list_head(void)
Get the head of the group count list.
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static int unload_module(void)
const ast_string_field name
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
static int load_module(void)
int ast_app_group_list_unlock(void)
Unlock 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.
struct ast_group_info::@157 group_list
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
int ast_app_group_get_count(const char *group, const char *category)
Get the current channel count of the specified group and category.
#define ASTERISK_GPL_KEY
The text the key() function should return.
static int group_count_function_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
int ast_app_group_list_rdlock(void)
Read Lock the group count list.
#define ast_custom_function_register(acf)
Register a custom function.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.