diff options
author | Kinsey Moore <kmoore@digium.com> | 2013-06-13 13:46:40 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2013-06-13 13:46:40 +0000 |
commit | b51b437bf3d47111451117dc0a04faa6356ba30c (patch) | |
tree | fe2e14e54829aaaa2ddc7b14dc0041badf36a5cb /main/parking.c | |
parent | 4f84e48028b8f21babd26b7f0b8c1d375f1c356c (diff) |
Refactor CEL bridge events on top of Stasis-Core
This pulls bridge-related CEL event triggers out of the code in which
they were residing and pulls them into cel.c where they are now
triggered by changes in bridge snapshots. To get access to the
Stasis-Core parking topic in cel.c, the Stasis-Core portions of parking
init have been pulled into core Asterisk init.
This also adds a new CEL event (AST_CEL_BRIDGE_TO_CONF) that indicates
a two-party bridge has transitioned to a multi-party conference. The
reverse cannot occur in CEL terms even though it may occur in actuality
and two party bridges which receive a AST_CEL_BRIDGE_TO_CONF will be
treated as multi-party conferences for the duration of the bridge.
Review: https://reviewboard.asterisk.org/r/2563/
(closes issue ASTERISK-21564)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/parking.c')
-rw-r--r-- | main/parking.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/main/parking.c b/main/parking.c index a7cd0ba54..fa1c4d88a 100644 --- a/main/parking.c +++ b/main/parking.c @@ -33,6 +33,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/bridging.h" #include "asterisk/parking.h" #include "asterisk/channel.h" +#include "asterisk/_private.h" /*! \brief Message type for parked calls */ STASIS_MESSAGE_TYPE_DEFN(ast_parked_call_type); @@ -46,19 +47,27 @@ static ast_park_blind_xfer_fn ast_park_blind_xfer_func = NULL; /*! \brief Function Callback for handling a bridge channel trying to park itself */ static ast_bridge_channel_park_fn ast_bridge_channel_park_func = NULL; -void ast_parking_stasis_init(void) -{ - STASIS_MESSAGE_TYPE_INIT(ast_parked_call_type); - parking_topic = stasis_topic_create("ast_parking"); -} - -void ast_parking_stasis_disable(void) +static void parking_stasis_cleanup(void) { STASIS_MESSAGE_TYPE_CLEANUP(ast_parked_call_type); ao2_cleanup(parking_topic); parking_topic = NULL; } +int ast_parking_stasis_init(void) +{ + if (STASIS_MESSAGE_TYPE_INIT(ast_parked_call_type)) { + return -1; + } + + parking_topic = stasis_topic_create("ast_parking"); + if (!parking_topic) { + return -1; + } + ast_register_cleanup(parking_stasis_cleanup); + return 0; +} + struct stasis_topic *ast_parking_topic(void) { return parking_topic; |