[svn-commits] mjordan: trunk r410651 - in /trunk: ./ res/stasis/app.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Mar 16 15:27:31 CDT 2014


Author: mjordan
Date: Sun Mar 16 15:27:28 2014
New Revision: 410651

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=410651
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)
........

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

Modified:
    trunk/   (props changed)
    trunk/res/stasis/app.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/res/stasis/app.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/stasis/app.c?view=diff&rev=410651&r1=410650&r2=410651
==============================================================================
--- trunk/res/stasis/app.c (original)
+++ trunk/res/stasis/app.c Sun Mar 16 15:27:28 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 svn-commits mailing list