summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-04-17 15:58:13 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2015-04-17 15:58:13 -0500
commit8435a0cdff848f77ff55e709a393ea96635e5b19 (patch)
tree5d785a134dd42fe013f924a30ffc1be6189840d9 /include
parentbb347fa594e195c79cbda45cb55fde3e72f90f9c (diff)
parentaae45acbda1f6100cd9de816855166a32b991ce0 (diff)
Merge "Detect potential forwarding loops based on count."
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/global_datastores.h6
-rw-r--r--include/asterisk/max_forwards.h78
2 files changed, 78 insertions, 6 deletions
diff --git a/include/asterisk/global_datastores.h b/include/asterisk/global_datastores.h
index 16267a894..2946ede84 100644
--- a/include/asterisk/global_datastores.h
+++ b/include/asterisk/global_datastores.h
@@ -26,14 +26,8 @@
#include "asterisk/channel.h"
-extern const struct ast_datastore_info dialed_interface_info;
extern const struct ast_datastore_info secure_call_info;
-struct ast_dialed_interface {
- AST_LIST_ENTRY(ast_dialed_interface) list;
- char interface[1];
-};
-
struct ast_secure_call_store {
unsigned int signaling:1;
unsigned int media:1;
diff --git a/include/asterisk/max_forwards.h b/include/asterisk/max_forwards.h
new file mode 100644
index 000000000..3130b4b64
--- /dev/null
+++ b/include/asterisk/max_forwards.h
@@ -0,0 +1,78 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2015, Digium, Inc.
+ *
+ * Mark Michelson <mmichelson@digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+#ifndef MAX_FORWARDS_H
+
+struct ast_channel;
+
+/*!
+ * \brief Set the starting max forwards for a particular channel.
+ *
+ * \pre chan is locked
+ *
+ * \param starting_count The value to set the max forwards to.
+ * \param chan The channel on which to set the max forwards.
+ * \retval 0 Success
+ * \retval 1 Failure
+ */
+int ast_max_forwards_set(struct ast_channel *chan, int starting_count);
+
+/*!
+ * \brief Get the current max forwards for a particular channel.
+ *
+ * If the channel has not had max forwards set on it, then the channel
+ * will have the default max forwards set on it and that value will
+ * be returned.
+ *
+ * \pre chan is locked
+ *
+ * \param chan The channel to get the max forwards for.
+ * \return The current max forwards count on the channel
+ */
+int ast_max_forwards_get(struct ast_channel *chan);
+
+/*!
+ * \brief Decrement the max forwards count for a particular channel.
+ *
+ * If the channel has not had max forwards set on it, then the channel
+ * will have the default max forwards set on it and that value will
+ * not be decremented.
+ *
+ * \pre chan is locked
+ *
+ * \chan The channel for which the max forwards value should be decremented
+ * \retval 0 Success
+ * \retval -1 Failure
+ */
+int ast_max_forwards_decrement(struct ast_channel *chan);
+
+/*!
+ * \brief Reset the max forwards on a channel to its starting value.
+ *
+ * If the channel has not had max forwards set on it, then the channel
+ * will have the default max forwards set on it.
+ *
+ * \pre chan is locked.
+ *
+ * \param chan The channel on which to reset the max forwards count.
+ * \retval 0 Success
+ * \retval -1 Failure
+ */
+int ast_max_forwards_reset(struct ast_channel *chan);
+
+#endif /* MAX_FORWARDS_H */