summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2012-08-07 12:46:36 +0000
committerMatthew Jordan <mjordan@digium.com>2012-08-07 12:46:36 +0000
commit5c4578f4ad9af0d13638ec72a2bc141227ec8b3c (patch)
tree77427fe11562062a59774f755a23ffc82c5cbff5 /include
parent096baa0897f556b2de6bfb8fa0acc09a504e39a4 (diff)
Add named callgroups/pickupgroups
This patch adds named calledgroups/pickupgroups to Asterisk. Named groups are implemented in parallel to the existing numbered callgroup/pickupgroup implementation. However, unlike the existing implementation, which is limited to a maximum of 64 defined groups, the number of defined groups allowed for named callgroups/pickupgroups is effectively unlimited. Named groups are configured with the keywords "namedcallgroup" and "namedpickupgroup". This corresponds to the numbered group definitions of "callgroup" and "pickupgroup". Note that as the implementation of named groups coexists with the existing numbered implementation, a defined named group of "4" does not equate to numbered group 4. Support for the named groups has been added to the SIP, DAHDI, and mISDN channel drivers. Review: https://reviewboard.asterisk.org/r/2043 Uploaded by: Guenther Kelleter(license #6372) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/channel.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 13d3f1f29..e8785cfe3 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -973,6 +973,17 @@ enum channelreloadreason {
CHANNEL_ACL_RELOAD,
};
+
+/*! \brief Structure to handle ao2-container for named groups */
+struct namedgroup_entry {
+ /*! string representation of group */
+ char *name;
+
+ /*! pre-built hash of groupname string */
+ unsigned int hash;
+};
+
+
/*!
* \note None of the datastore API calls lock the ast_channel they are using.
* So, the channel should be locked before calling the functions that
@@ -2417,9 +2428,22 @@ static inline enum ast_t38_state ast_channel_get_t38_state(struct ast_channel *c
ast_group_t ast_get_group(const char *s);
-/*! \brief print call- and pickup groups into buffer */
+/*! \brief Print call- and pickup groups into buffer */
char *ast_print_group(char *buf, int buflen, ast_group_t group);
+/*! \brief Opaque struct holding a namedgroups set, i.e. a set of group names */
+struct ast_namedgroups;
+
+/*! \brief Create an ast_namedgroups set with group name from comma separated string s */
+struct ast_namedgroups *ast_get_namedgroups(const char *s);
+struct ast_namedgroups *ast_unref_namedgroups(struct ast_namedgroups *groups);
+struct ast_namedgroups *ast_ref_namedgroups(struct ast_namedgroups *groups);
+/*! \brief Return TRUE if group a and b contain at least one common groupname */
+int ast_namedgroups_intersect(struct ast_namedgroups *a, struct ast_namedgroups *b);
+
+/*! \brief Print named call groups and named pickup groups ---*/
+char *ast_print_namedgroups(struct ast_str **buf, struct ast_namedgroups *groups);
+
/*!
* \brief Convert enum channelreloadreason to text string for manager event
* \param reason The reason for reload (manager, cli, start etc)
@@ -3768,6 +3792,8 @@ void ast_channel_redirecting_set(struct ast_channel *chan, struct ast_party_redi
void ast_channel_dtmf_tv_set(struct ast_channel *chan, struct timeval *value);
void ast_channel_whentohangup_set(struct ast_channel *chan, struct timeval *value);
void ast_channel_varshead_set(struct ast_channel *chan, struct varshead *value);
+struct timeval ast_channel_creationtime(struct ast_channel *chan);
+void ast_channel_creationtime_set(struct ast_channel *chan, struct timeval *value);
/* List getters */
struct ast_hangup_handler_list *ast_channel_hangup_handlers(struct ast_channel *chan);
@@ -3780,6 +3806,10 @@ ast_group_t ast_channel_callgroup(const struct ast_channel *chan);
void ast_channel_callgroup_set(struct ast_channel *chan, ast_group_t value);
ast_group_t ast_channel_pickupgroup(const struct ast_channel *chan);
void ast_channel_pickupgroup_set(struct ast_channel *chan, ast_group_t value);
+struct ast_namedgroups *ast_channel_named_callgroups(const struct ast_channel *chan);
+void ast_channel_named_callgroups_set(struct ast_channel *chan, struct ast_namedgroups *value);
+struct ast_namedgroups *ast_channel_named_pickupgroups(const struct ast_channel *chan);
+void ast_channel_named_pickupgroups_set(struct ast_channel *chan, struct ast_namedgroups *value);
/* Alertpipe accessors--the "internal" functions for channel.c use only */
typedef enum {