summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2013-07-01 13:16:09 +0000
committerKinsey Moore <kmoore@digium.com>2013-07-01 13:16:09 +0000
commit909ee4bfb9180a87e02504acb47f27b47cb5adea (patch)
tree5405f0116ec4b490e55afa5251ac0f230f1f8e5d /include/asterisk
parent68b3bce8b8f66be36f9d01a5796a65d52c83ef35 (diff)
Refactor extraneous channel events
This change removes JitterBufStats, ChannelReload, and ChannelUpdate and refactors the following events to travel over Stasis-Core: * LocalBridge * DAHDIChannel * AlarmClear * SpanAlarmClear * Alarm * SpanAlarm * DNDState * MCID * SIPQualifyPeerDone * SessionTimeout Review: https://reviewboard.asterisk.org/r/2627/ (closes issue ASTERISK-21476) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/json.h12
-rw-r--r--include/asterisk/stasis.h26
2 files changed, 38 insertions, 0 deletions
diff --git a/include/asterisk/json.h b/include/asterisk/json.h
index 43b4b5cf5..61685fd9f 100644
--- a/include/asterisk/json.h
+++ b/include/asterisk/json.h
@@ -906,6 +906,18 @@ struct ast_json_payload {
*/
struct ast_json_payload *ast_json_payload_create(struct ast_json *json);
+struct ast_party_id;
+/*!
+ * \brief Construct an ast_party_id as JSON.
+ * \since 12.0.0
+ *
+ * \param party The party ID to represent as JSON.
+ *
+ * \return JSON object with \c name, \c number and \c subaddress objects
+ * for those that are valid in the party ID
+ */
+struct ast_json *ast_json_party_id(struct ast_party_id *party);
+
/*!@}*/
#endif /* _ASTERISK_JSON_H */
diff --git a/include/asterisk/stasis.h b/include/asterisk/stasis.h
index 19ebb41c9..fd51cf51d 100644
--- a/include/asterisk/stasis.h
+++ b/include/asterisk/stasis.h
@@ -736,6 +736,32 @@ void stasis_log_bad_type_access(const char *name);
}
/*!
+ * \brief Boiler-plate removing macro for defining local message types.
+ *
+ * \code
+ * STASIS_MESSAGE_TYPE_DEFN_LOCAL(ast_foo_type,
+ * .to_ami = foo_to_ami,
+ * .to_json = foo_to_json,
+ * );
+ * \endcode
+ *
+ * \param name Name of message type.
+ * \param ... Virtual table methods for messages of this type.
+ * \since 12
+ */
+#define STASIS_MESSAGE_TYPE_DEFN_LOCAL(name, ...) \
+ static struct stasis_message_vtable _priv_ ## name ## _v = { \
+ __VA_ARGS__ \
+ }; \
+ static struct stasis_message_type *_priv_ ## name; \
+ static struct stasis_message_type *name(void) { \
+ if (_priv_ ## name == NULL) { \
+ stasis_log_bad_type_access(#name); \
+ } \
+ return _priv_ ## name; \
+ }
+
+/*!
* \brief Boiler-plate removing macro for initializing message types.
*
* \code