stasis/app.c: Add some extra debugging for subscription counts

Events are sent to a connected ARI application based on the things that ARI
application cares about. These subscriptions can be set up implicitly - such
as when that ARI application creates a new object - or explicitly, via the
application resource's subscription operations. Debugging *why* something was
being sent to an application - or why something was not being sent to an
application - was a bit tricky, as there was no debug information for the
subscriptions.

This patch adds some debug level 3 statements that show the subscription counts
for applications. (Level 3 was chosen as it matches the verbose level 3
statements elsewhere)
........

Merged revisions 410650 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matthew Jordan
2014-03-16 20:27:28 +00:00
parent a0a51a65e0
commit 2c5484c869

View File

@@ -970,6 +970,7 @@ int app_subscribe_channel(struct stasis_app *app, struct ast_channel *chan)
}
++forwards->interested;
ast_debug(3, "Channel '%s' is %d interested in %s\n", ast_channel_uniqueid(chan), forwards->interested, app->name);
return 0;
}
}
@@ -991,9 +992,12 @@ static int unsubscribe(struct stasis_app *app, const char *kind, const char *id)
app->name, kind, id);
return -1;
}
forwards->interested--;
if (--forwards->interested == 0) {
ast_debug(3, "%s '%s': is %d interested in %s\n", kind, id, forwards->interested, app->name);
if (forwards->interested == 0) {
/* No one is interested any more; unsubscribe */
ast_debug(3, "%s '%s' unsubscribed from %s\n", kind, id, app->name);
forwards_unsubscribe(forwards);
ao2_find(app->forwards, forwards,
OBJ_POINTER | OBJ_NOLOCK | OBJ_UNLINK |
@@ -1062,6 +1066,7 @@ int app_subscribe_bridge(struct stasis_app *app, struct ast_bridge *bridge)
}
++forwards->interested;
ast_debug(3, "Bridge '%s' is %d interested in %s\n", bridge->uniqueid, forwards->interested, app->name);
return 0;
}
}
@@ -1130,6 +1135,7 @@ int app_subscribe_endpoint(struct stasis_app *app, struct ast_endpoint *endpoint
}
++forwards->interested;
ast_debug(3, "Endpoint '%s' is %d interested in %s\n", ast_endpoint_get_id(endpoint), forwards->interested, app->name);
return 0;
}
}