summaryrefslogtreecommitdiff
path: root/include/asterisk/stasis_message_router.h
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-01-12 22:07:01 +0000
committerMatthew Jordan <mjordan@digium.com>2014-01-12 22:07:01 +0000
commitf8aaf585a39d496479eb8a4e55f2e327d02b37ca (patch)
treecd9926c9fd134466c6ec6adee3ec7392e4aac754 /include/asterisk/stasis_message_router.h
parent60ed8159a10b6eed56095dd52cf17c039cd2275c (diff)
stasis: Add methods to allow for synchronous publishing to subscriber
This patch adds an API call to Stasis that allows a publisher to publish a stasis message that will not return until a specific subscriber handles the message. Since a subscriber can have their own forwarding topic which orders messages from many topics, this allows a publisher who knows of that subscriber to synchronize to that subscriber regardless of the forwarding relationships between topics. This is of particular use for dialplan applications that need to synchronize on a particular subscriber's handling of a message. (issue ASTERISK-22884) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3099/ ........ Merged revisions 405311 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405313 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/stasis_message_router.h')
-rw-r--r--include/asterisk/stasis_message_router.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/asterisk/stasis_message_router.h b/include/asterisk/stasis_message_router.h
index 3209adb16..613a2bd7f 100644
--- a/include/asterisk/stasis_message_router.h
+++ b/include/asterisk/stasis_message_router.h
@@ -93,6 +93,24 @@ void stasis_message_router_unsubscribe_and_join(
int stasis_message_router_is_done(struct stasis_message_router *router);
/*!
+ * \brief Publish a message to a message router's subscription synchronously
+ *
+ * \param router Router
+ * \param message The \ref stasis message
+ *
+ * This should be used when a message needs to be published synchronously to
+ * the underlying subscription created by a message router. This is analagous
+ * to \ref stasis_publish_sync.
+ *
+ * Note that the caller will be blocked until the thread servicing the message
+ * on the message router's subscription completes handling of the message.
+ *
+ * \since 12.1.0
+ */
+void stasis_message_router_publish_sync(struct stasis_message_router *router,
+ struct stasis_message *message);
+
+/*!
* \brief Add a route to a message router.
*
* A particular \a message_type may have at most one route per \a router. If