[asterisk-commits] mjordan: branch 12 r410650 - /branches/12/res/stasis/app.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Mar 16 15:20:26 CDT 2014
Author: mjordan
Date: Sun Mar 16 15:20:14 2014
New Revision: 410650
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=410650
Log:
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)
Modified:
branches/12/res/stasis/app.c
Modified: branches/12/res/stasis/app.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/stasis/app.c?view=diff&rev=410650&r1=410649&r2=410650
==============================================================================
--- branches/12/res/stasis/app.c (original)
+++ branches/12/res/stasis/app.c Sun Mar 16 15:20:14 2014
@@ -970,6 +970,7 @@
}
++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 @@
app->name, kind, id);
return -1;
}
-
- if (--forwards->interested == 0) {
+ forwards->interested--;
+
+ 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 @@
}
++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 @@
}
++forwards->interested;
+ ast_debug(3, "Endpoint '%s' is %d interested in %s\n", ast_endpoint_get_id(endpoint), forwards->interested, app->name);
return 0;
}
}
More information about the asterisk-commits
mailing list