summaryrefslogtreecommitdiff
path: root/include/asterisk/sdp_options.h
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2017-02-07 09:50:52 -0600
committerMark Michelson <mmichelson@digium.com>2017-02-17 09:23:12 -0600
commit8af634255542672806304fdafd1612dcfc9f35b1 (patch)
tree4b91305e8601379be0cf719125d5535e2d5a4b6c /include/asterisk/sdp_options.h
parent0b5a17082be78be17c5191d86f806936dcdc7d61 (diff)
Add initial SDP options.
This is step one of adding an SDP API: defining some configurable settings for SDPs. This is based on options that are currently supported in Asterisk. Change-Id: I1ede91aafed403b12a9ccdfb91a88389baa7e5d7
Diffstat (limited to 'include/asterisk/sdp_options.h')
-rw-r--r--include/asterisk/sdp_options.h155
1 files changed, 155 insertions, 0 deletions
diff --git a/include/asterisk/sdp_options.h b/include/asterisk/sdp_options.h
new file mode 100644
index 000000000..52f6f5545
--- /dev/null
+++ b/include/asterisk/sdp_options.h
@@ -0,0 +1,155 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2017, 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 _ASTERISK_SDP_OPTIONS_H
+#define _ASTERISK_SDP_OPTIONS_H
+
+struct ast_sdp_options;
+
+/*!
+ * \since 15.0.0
+ * \brief Allocate a new SDP options structure.
+ *
+ * This will heap-allocate an SDP options structure and
+ * initialize it to a set of default values.
+ *
+ * \retval NULL Allocation failure
+ * \retval non-NULL Newly allocated SDP options
+ */
+struct ast_sdp_options *ast_sdp_options_alloc(void);
+
+/*!
+ * \since 15.0.0
+ * \brief Free an SDP options structure.
+ *
+ * \note This only needs to be called if an error occurs between
+ * options allocation and a call to ast_sdp_state_alloc()
+ * Otherwise, the SDP state will take care of freeing the
+ * options for you.
+ *
+ * \param options The options to free
+ */
+void ast_sdp_options_free(struct ast_sdp_options *options);
+
+/*!
+ * \brief ICE options
+ *
+ * This is an enum because it is predicted that this eventually
+ * support a TRICKLE-ICE option.
+ */
+enum ast_sdp_options_ice {
+ /*! ICE is not enabled on this session */
+ AST_SDP_ICE_DISABLED,
+ /*! Standard ICE is enabled on this session */
+ AST_SDP_ICE_ENABLED_STANDARD,
+};
+
+/*!
+ * \since 15.0.0
+ * \brief Set ICE options
+ *
+ * The default is AST_SDP_ICE_DISABLED
+ */
+int ast_sdp_options_set_ice(struct ast_sdp_options *options,
+ enum ast_sdp_options_ice ice_setting);
+
+/*!
+ * \since 15.0.0
+ * \brief Retrieve ICE options
+ */
+enum ast_sdp_options_ice ast_sdp_options_get_ice(const struct ast_sdp_options *options);
+
+/*!
+ * \since 15.0.0
+ * \brief Enable or disable telephone events.
+ *
+ * A non-zero value indicates telephone events are enabled.
+ * A zero value indicates telephone events are disabled.
+ *
+ * The default is 0
+ */
+int ast_sdp_options_set_telephone_event(struct ast_sdp_options *options,
+ int telephone_event_enabled);
+
+/*!
+ * \since 15.0.0
+ * \brief Retrieve telephone event setting.
+ *
+ * \retval 0 Telephone events are currently disabled.
+ * \retval non-zero Telephone events are currently enabled.
+ */
+int ast_sdp_options_get_telephone_event(const struct ast_sdp_options *options);
+
+/*!
+ * \brief Representation of the SDP
+ *
+ * Users of the SDP API set the representation based on what they
+ * natively handle. This indicates the type of SDP that the API expects
+ * when being given an SDP, and it indicates the type of SDP that the API
+ * returns when asked for one.
+ */
+enum ast_sdp_options_repr {
+ /*! SDP is represented as a string */
+ AST_SDP_REPR_STRING,
+ /*! SDP is represented as a pjmedia_sdp_session */
+ AST_SDP_REPR_PJMEDIA,
+};
+
+/*!
+ * \since 15.0.0
+ * \brief Set the SDP representation
+ *
+ * The default is AST_SDP_REPR_STRING
+ */
+int ast_sdp_options_set_repr(struct ast_sdp_options *options,
+ enum ast_sdp_options_repr repr);
+
+/*!
+ * \since 15.0.0
+ * \brief Get the SDP representation
+ */
+enum ast_sdp_options_repr ast_sdp_options_get_repr(const struct ast_sdp_options *options);
+
+/*!
+ * \brief SDP encryption options
+ */
+enum ast_sdp_options_encryption {
+ /*! No encryption */
+ AST_SDP_ENCRYPTION_DISABLED,
+ /*! SRTP SDES encryption */
+ AST_SDP_ENCRYPTION_SRTP_SDES,
+ /*! DTLS encryption */
+ AST_SDP_ENCRYPTION_DTLS,
+};
+
+/*!
+ * \since 15.0.0
+ * \brief Set the SDP encryption
+ *
+ * The default is AST_SDP_ENCRYPTION_DISABLED
+ */
+int ast_sdp_options_set_encryption(struct ast_sdp_options *options,
+ enum ast_sdp_options_encryption encryption);
+
+/*!
+ * \since 15.0.0
+ * \brief Get the SDP encryption
+ */
+enum ast_sdp_options_encryption ast_sdp_options_get_encryption(const struct ast_sdp_options *options);
+
+#endif /* _ASTERISK_SDP_OPTIONS_H */