[asterisk-commits] dlee: branch dlee/ASTERISK-22514-stasis-silgen r402841 - in /team/dlee/ASTERI...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Nov 15 08:52:12 CST 2013
Author: dlee
Date: Fri Nov 15 08:52:10 2013
New Revision: 402841
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402841
Log:
Merged revisions 402817-402838 from http://svn.asterisk.org/svn/asterisk/branches/12
Modified:
team/dlee/ASTERISK-22514-stasis-silgen/ (props changed)
team/dlee/ASTERISK-22514-stasis-silgen/main/cel.c
team/dlee/ASTERISK-22514-stasis-silgen/res/res_stasis.c
Propchange: team/dlee/ASTERISK-22514-stasis-silgen/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Nov 15 08:52:10 2013
@@ -1,1 +1,1 @@
-/branches/12:1-402815
+/branches/12:1-402840
Modified: team/dlee/ASTERISK-22514-stasis-silgen/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22514-stasis-silgen/main/cel.c?view=diff&rev=402841&r1=402840&r2=402841
==============================================================================
--- team/dlee/ASTERISK-22514-stasis-silgen/main/cel.c (original)
+++ team/dlee/ASTERISK-22514-stasis-silgen/main/cel.c Fri Nov 15 08:52:10 2013
@@ -1363,11 +1363,14 @@
cel_report_event(localone, AST_CEL_LOCAL_OPTIMIZE, NULL, extra, NULL);
}
-static void destroy_subscriptions(void)
+static void destroy_routes(void)
{
stasis_message_router_unsubscribe_and_join(cel_state_router);
cel_state_router = NULL;
-
+}
+
+static void destroy_subscriptions(void)
+{
ao2_cleanup(cel_aggregation_topic);
cel_aggregation_topic = NULL;
ao2_cleanup(cel_topic);
@@ -1381,6 +1384,7 @@
static void ast_cel_engine_term(void)
{
+ destroy_routes();
destroy_subscriptions();
aco_info_destroy(&cel_cfg_info);
@@ -1400,8 +1404,6 @@
*/
static int create_subscriptions(void)
{
- int ret = 0;
-
cel_aggregation_topic = stasis_topic_create("cel_aggregation_topic");
if (!cel_aggregation_topic) {
return -1;
@@ -1439,6 +1441,16 @@
if (!cel_cel_forwarder) {
return -1;
}
+
+ return 0;
+}
+
+/*!
+ * \brief Create the Stasis message router and routes for CEL
+ */
+static int create_routes(void)
+{
+ int ret = 0;
cel_state_router = stasis_message_router_create(cel_aggregation_topic);
if (!cel_state_router) {
@@ -1550,7 +1562,11 @@
}
}
- if (ast_cel_check_enabled() && create_subscriptions()) {
+ if (create_subscriptions()) {
+ return -1;
+ }
+
+ if (ast_cel_check_enabled() && create_routes()) {
return -1;
}
@@ -1570,11 +1586,11 @@
is_enabled = ast_cel_check_enabled();
if (!was_enabled && is_enabled) {
- if (create_subscriptions()) {
+ if (create_routes()) {
return -1;
}
} else if (was_enabled && !is_enabled) {
- destroy_subscriptions();
+ destroy_routes();
}
ast_verb(3, "CEL logging %sabled.\n", is_enabled ? "en" : "dis");
@@ -1636,9 +1652,9 @@
is_enabled = ast_cel_check_enabled();
if (!was_enabled && is_enabled) {
- create_subscriptions();
+ create_routes();
} else if (was_enabled && !is_enabled) {
- destroy_subscriptions();
+ destroy_routes();
}
}
}
Modified: team/dlee/ASTERISK-22514-stasis-silgen/res/res_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22514-stasis-silgen/res/res_stasis.c?view=diff&rev=402841&r1=402840&r2=402841
==============================================================================
--- team/dlee/ASTERISK-22514-stasis-silgen/res/res_stasis.c (original)
+++ team/dlee/ASTERISK-22514-stasis-silgen/res/res_stasis.c Fri Nov 15 08:52:10 2013
@@ -704,6 +704,7 @@
RAII_VAR(struct app *, app, NULL, ao2_cleanup);
RAII_VAR(struct stasis_app_control *, control, NULL, control_unlink);
+ struct ast_bridge *last_bridge = NULL;
int res = 0;
ast_assert(chan != NULL);
@@ -745,7 +746,6 @@
RAII_VAR(struct ast_frame *, f, NULL, ast_frame_dtor);
int r;
int command_count;
- struct ast_bridge *last_bridge = NULL;
struct ast_bridge *bridge = NULL;
/* Check to see if a bridge absorbed our hangup frame */
More information about the asterisk-commits
mailing list