Asterisk - The Open Source Telephony Project GIT-master-2de1a68
max_forwards.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2015, Digium, Inc.
5 *
6 * Mark Michelson <mmichelson@digium.com>
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#ifndef MAX_FORWARDS_H
20#define MAX_FORWARDS_H
21
22struct ast_channel;
23
24/*!
25 * \brief Set the starting max forwards for a particular channel.
26 *
27 * \pre chan is locked
28 *
29 * \param starting_count The value to set the max forwards to.
30 * \param chan The channel on which to set the max forwards.
31 * \retval 0 Success
32 * \retval 1 Failure
33 */
34int ast_max_forwards_set(struct ast_channel *chan, int starting_count);
35
36/*!
37 * \brief Get the current max forwards for a particular channel.
38 *
39 * If the channel has not had max forwards set on it, then the channel
40 * will have the default max forwards set on it and that value will
41 * be returned.
42 *
43 * \pre chan is locked
44 *
45 * \param chan The channel to get the max forwards for.
46 * \return The current max forwards count on the channel
47 */
48int ast_max_forwards_get(struct ast_channel *chan);
49
50/*!
51 * \brief Decrement the max forwards count for a particular channel.
52 *
53 * If the channel has not had max forwards set on it, then the channel
54 * will have the default max forwards set on it and that value will
55 * not be decremented.
56 *
57 * \pre chan is locked
58 *
59 * \param chan The channel for which the max forwards value should be decremented
60 * \retval 0 Success
61 * \retval -1 Failure
62 */
64
65/*!
66 * \brief Reset the max forwards on a channel to its starting value.
67 *
68 * If the channel has not had max forwards set on it, then the channel
69 * will have the default max forwards set on it.
70 *
71 * \pre chan is locked.
72 *
73 * \param chan The channel on which to reset the max forwards count.
74 * \retval 0 Success
75 * \retval -1 Failure
76 */
77int ast_max_forwards_reset(struct ast_channel *chan);
78
79#endif /* MAX_FORWARDS_H */
int ast_max_forwards_decrement(struct ast_channel *chan)
Decrement the max forwards count for a particular channel.
Definition: max_forwards.c:135
int ast_max_forwards_get(struct ast_channel *chan)
Get the current max forwards for a particular channel.
Definition: max_forwards.c:121
int ast_max_forwards_set(struct ast_channel *chan, int starting_count)
Set the starting max forwards for a particular channel.
Definition: max_forwards.c:105
int ast_max_forwards_reset(struct ast_channel *chan)
Reset the max forwards on a channel to its starting value.
Definition: max_forwards.c:151
Main Channel structure associated with a channel.