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
This commit is contained in:
Kinsey Moore
2013-06-13 13:46:40 +00:00
parent 4f84e48028
commit b51b437bf3
8 changed files with 253 additions and 89 deletions

View File

@@ -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;