summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-09-20 17:22:41 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-09-20 17:22:41 +0000
commitda5944fc56482949ba04aad6ab33275b5031f75d (patch)
tree16b3832a037e0d62af11751c418fef1afabd7fc4 /include/asterisk
parentafa6b8f320bfe73d8d6a1478c32ef7790e7c950f (diff)
Named call pickup groups. Fixes, missing functionality, and improvements.
* ASTERISK-20383 Missing named call pickup group features: CHANNEL(callgroup) - Need CHANNEL(namedcallgroup) CHANNEL(pickupgroup) - Need CHANNEL(namedpickupgroup) Pickup() - Needs to also select from named pickup groups. * ASTERISK-20384 Using the pickupexten, the pickup channel selection could fail even though there was a call it could have picked up. In a call pickup race when there are multiple calls to pickup and two extensions try to pickup a call, it is conceivable that the loser will not pick up any call even though it could have picked up the next oldest matching call. Regression because of the named call pickup group feature. * See ASTERISK-20386 for the implementation improvements. These are the changes in channel.c and channel.h. * Fixed some locking issues in CHANNEL(). (closes issue ASTERISK-20383) Reported by: rmudgett (closes issue ASTERISK-20384) Reported by: rmudgett (closes issue ASTERISK-20386) Reported by: rmudgett Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/2112/ ........ Merged revisions 373220 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/channel.h17
-rw-r--r--include/asterisk/features.h10
2 files changed, 13 insertions, 14 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 67e1d4c7c..b60c8ad00 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -999,17 +999,6 @@ 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
@@ -2454,20 +2443,20 @@ 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 */
+/*! \brief Create an ast_namedgroups set with group names from comma separated string */
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 ---*/
+/*! \brief Print named call groups and named pickup groups */
char *ast_print_namedgroups(struct ast_str **buf, struct ast_namedgroups *groups);
/*!
diff --git a/include/asterisk/features.h b/include/asterisk/features.h
index 42dc57fba..1619d54c4 100644
--- a/include/asterisk/features.h
+++ b/include/asterisk/features.h
@@ -183,6 +183,16 @@ int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct as
*/
int ast_can_pickup(struct ast_channel *chan);
+/*!
+ * \brief Find a pickup channel target by group.
+ *
+ * \param chan channel that initiated pickup.
+ *
+ * \retval target on success. The returned channel is locked and reffed.
+ * \retval NULL on error.
+ */
+struct ast_channel *ast_pickup_find_by_group(struct ast_channel *chan);
+
/*! \brief Pickup a call */
int ast_pickup_call(struct ast_channel *chan);