mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
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/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@405311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -261,6 +261,16 @@ int stasis_message_router_is_done(struct stasis_message_router *router)
|
||||
return stasis_subscription_is_done(router->subscription);
|
||||
}
|
||||
|
||||
void stasis_message_router_publish_sync(struct stasis_message_router *router,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
ast_assert(router != NULL);
|
||||
|
||||
ao2_bump(router);
|
||||
stasis_publish_sync(router->subscription, message);
|
||||
ao2_cleanup(router);
|
||||
}
|
||||
|
||||
int stasis_message_router_add(struct stasis_message_router *router,
|
||||
struct stasis_message_type *message_type,
|
||||
stasis_subscription_cb callback, void *data)
|
||||
|
Reference in New Issue
Block a user