summaryrefslogtreecommitdiff
path: root/include/asterisk/res_pjsip_exten_state.h
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2013-07-30 18:14:50 +0000
committerMark Michelson <mmichelson@digium.com>2013-07-30 18:14:50 +0000
commit735b30ad71110c2a51404cb8686bbe3cf14b630c (patch)
tree76b1f10135c1b7f210e576be1359539de7e3476c /include/asterisk/res_pjsip_exten_state.h
parent895c8e0d2c97cd04299f3f179e99d8a3873c06c6 (diff)
The large GULP->PJSIP renaming effort.
The general gist is to have a clear boundary between old SIP stuff and new SIP stuff by having the word "SIP" for old stuff and "PJSIP" for new stuff. Here's a brief rundown of the changes: * The word "Gulp" in dialstrings, functions, and CLI commands is now "PJSIP" * chan_gulp.c is now chan_pjsip.c * Function names in chan_gulp.c that were "gulp_*" are now "chan_pjsip_*" * All files that were "res_sip*" are now "res_pjsip*" * The "res_sip" directory is now "res_pjsip" * Files in the "res_pjsip" directory that began with "sip_*" are now "pjsip_*" * The configuration file is now "pjsip.conf" instead of "res_sip.conf" * The module info for all PJSIP-related files now uses "PJSIP" instead of "SIP" * CLI and AMI commands created by Asterisk's PJSIP modules now have "pjsip" as the starting word instead of "sip" git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/res_pjsip_exten_state.h')
-rw-r--r--include/asterisk/res_pjsip_exten_state.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/include/asterisk/res_pjsip_exten_state.h b/include/asterisk/res_pjsip_exten_state.h
new file mode 100644
index 000000000..62662f930
--- /dev/null
+++ b/include/asterisk/res_pjsip_exten_state.h
@@ -0,0 +1,94 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2013, Digium, Inc.
+ *
+ * Kevin Harwell <kharwell@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 _RES_SIP_EXTEN_STATE_H
+#define _RES_SIP_EXTEN_STATE_H
+
+#include "asterisk/stringfields.h"
+#include "asterisk/linkedlists.h"
+
+#include "asterisk/pbx.h"
+#include "asterisk/presencestate.h"
+
+
+/*!
+ * \brief Contains information pertaining to extension/device state changes.
+ */
+struct ast_sip_exten_state_data {
+ /*! The extension of the current state change */
+ const char *exten;
+ /*! The extension state of the change */
+ enum ast_extension_states exten_state;
+ /*! The presence state of the change */
+ enum ast_presence_state presence_state;
+ /*! Current device state information */
+ struct ao2_container *device_state_info;
+};
+
+/*!
+ * \brief Extension state provider.
+ */
+struct ast_sip_exten_state_provider {
+ /*! The name of the event this provider registers for */
+ const char *event_name;
+ /*! Type of the body, ex: "application" */
+ const char *type;
+ /*! Subtype of the body, ex: "pidf+xml" */
+ const char *subtype;
+ /*! Type/Subtype together - ex: application/pidf+xml */
+ const char *body_type;
+ /*! Subscription handler to be used and associated with provider */
+ struct ast_sip_subscription_handler *handler;
+
+ /*!
+ * \brief Create the body text of a NOTIFY request.
+ *
+ * Implementors use this to create body information within the given
+ * ast_str. That information is then added to the NOTIFY request.
+ *
+ * \param data Current extension state changes
+ * \param local URI of the dialog's local party, e.g. 'from'
+ * \param remote URI of the dialog's remote party, e.g. 'to'
+ * \param body_text Out parameter used to populate the NOTIFY msg body
+ * \retval 0 Successfully created the body's text
+ * \retval -1 Failed to create the body's text
+ */
+ int (*create_body)(struct ast_sip_exten_state_data *data, const char *local,
+ const char *remote, struct ast_str **body_text);
+
+ /*! Next item in the list */
+ AST_LIST_ENTRY(ast_sip_exten_state_provider) next;
+};
+
+/*!
+ * \brief Registers an extension state provider.
+ *
+ * \param obj An extension state provider
+ * \retval 0 Successfully registered the extension state provider
+ * \retval -1 Failed to register the extension state provider
+ */
+int ast_sip_register_exten_state_provider(struct ast_sip_exten_state_provider *obj);
+
+/*!
+ * \brief Unregisters an extension state provider.
+ *
+ * \param obj An extension state provider
+ */
+void ast_sip_unregister_exten_state_provider(struct ast_sip_exten_state_provider *obj);
+
+#endif