Asterisk - The Open Source Telephony Project  18.5.0
pickup.h
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 1999 - 2013, Digium, Inc.
5  *
6  * Matt Jordan <[email protected]>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  */
18 
19 /*!
20  * \file
21  * \brief Call Pickup API
22  *
23  * Includes code and algorithms from the Zapata library.
24  *
25  */
26 
27 #ifndef _AST_PICKUP_H
28 #define _AST_PICKUP_H
29 
30 /*!
31  * \brief Test if a channel can be picked up.
32  *
33  * \param chan Channel to test if can be picked up.
34  *
35  * \note This function assumes that chan is locked.
36  *
37  * \return TRUE if channel can be picked up.
38  */
39 int ast_can_pickup(struct ast_channel *chan);
40 
41 /*!
42  * \brief Find a pickup channel target by group.
43  *
44  * \param chan channel that initiated pickup.
45  *
46  * \retval target on success. The returned channel is locked and reffed.
47  * \retval NULL on error.
48  */
50 
51 /*!
52  * \brief Pickup a call
53  *
54  * \param chan The channel that initiated the pickup
55  *
56  * \retval 0 on success
57  * \retval -1 on failure
58  */
59 int ast_pickup_call(struct ast_channel *chan);
60 
61 /*!
62  * \brief Pickup a call target.
63  *
64  * \param chan channel that initiated pickup.
65  * \param target channel to be picked up.
66  *
67  * \note This function assumes that target is locked.
68  *
69  * \retval 0 on success.
70  * \retval -1 on failure.
71  */
72 int ast_do_pickup(struct ast_channel *chan, struct ast_channel *target);
73 
74 /*!
75  * \brief accessor for call pickup message type
76  * \since 12.0.0
77  *
78  * \retval pointer to the stasis message type
79  * \retval NULL if not initialized
80  */
82 
83 /*!
84  * \brief Initialize pickup
85  *
86  * \retval 0 on success
87  * \retval non-zero on failure
88  */
89 int ast_pickup_init(void);
90 
91 #endif /* _AST_PICKUP_H */
Main Channel structure associated with a channel.
int ast_pickup_init(void)
Initialize pickup.
Definition: pickup.c:401
int ast_do_pickup(struct ast_channel *chan, struct ast_channel *target)
Pickup a call target.
Definition: pickup.c:302
struct stasis_message_type * ast_call_pickup_type(void)
accessor for call pickup message type
int ast_pickup_call(struct ast_channel *chan)
Pickup a call.
Definition: pickup.c:200
struct ast_channel * ast_pickup_find_by_group(struct ast_channel *chan)
Find a pickup channel target by group.
Definition: pickup.c:133
int ast_can_pickup(struct ast_channel *chan)
Test if a channel can be picked up.
Definition: pickup.c:77