aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk
diff options
context:
space:
mode:
authorrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2011-06-09 16:47:07 +0000
committerrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2011-06-09 16:47:07 +0000
commit017a892d868e1243953fd8f0db10aeae80f3241d (patch)
tree6132cd6991a104993a524ca957535c1f880b5bc8 /include/asterisk
parentad49525abc4706833fdfb4a75a18ff3c64241379 (diff)
Merged revisions 322749 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r322749 | rmudgett | 2011-06-09 11:31:53 -0500 (Thu, 09 Jun 2011) | 15 lines Remove potential deadlock in call pickup race. Deadlock is possible in ast_do_pickup() when holding the target channel lock and trying to get the chan channel lock. Also, holding the target lock when calling ast_channel_masquerade() is not a good idea because that routine does deadlock avoidance. * Removed the need to hold the target lock after marking the target with a datastore and getting the connected line data off of the target channel. * Moved can_pickup() to ast_can_pickup() in features.c. Now all the call pickup methods use the same basic call pickup availability check. Review: https://reviewboard.asterisk.org/r/1234/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@322750 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/features.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/include/asterisk/features.h b/include/asterisk/features.h
index 4ea941383..7e749f2e0 100644
--- a/include/asterisk/features.h
+++ b/include/asterisk/features.h
@@ -119,12 +119,28 @@ const char *ast_pickup_ext(void);
/*! \brief Bridge a call, optionally allowing redirection */
int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config);
+/*!
+ * \brief Test if a channel can be picked up.
+ *
+ * \param chan Channel to test if can be picked up.
+ *
+ * \note This function assumes that chan is locked.
+ *
+ * \return TRUE if channel can be picked up.
+ */
+int ast_can_pickup(struct ast_channel *chan);
+
/*! \brief Pickup a call */
int ast_pickup_call(struct ast_channel *chan);
/*!
- * \brief Pickup a call target
- * \note This function assumes that target is locked
+ * \brief Pickup a call target.
+ *
+ * \param chan channel that initiated pickup.
+ * \param target channel to be picked up.
+ *
+ * \note This function assumes that target is locked.
+ *
* \retval 0 on success.
* \retval -1 on failure.
*/