I’m trying to figure out if my ARI based code is properly cleaning up after itself. My code creates bridges, channels, and playback resources. In simple tests it works fine (I check ws messages), but I would like to load test my code, in which case manually trying to reconcile all of the websocket messages is too much to do.
Is there an Asterisk CLI command that will show all bridges, channels, and resources in existence, so that I can see what is left over after my program runs? There is nothing else running on this test PBX, so it should only be my own leftovers.
I recall seeing some ARI commands to list resources, but I’m hoping not to have to write a program to check my program. A simple CLI command (or maybe if someone has prewritten a bash script) that would be fantastic.
For CLI commands, core show channels and bridge show all should give you what you want. There are also two equivalent AMI commands CoreShowChannels and BridgeList. If you have the internal HTTP server enabled, you can invoke them via curl using the rawman URI…
curl -c cookies http://localhost:8088/rawman?action=login&username=test&secret=test
curl -b cookies http://localhost:8088/rawman?action=CoreShowChannels
curl -b cookies http://localhost:8088/rawman?action=BridgeList
You need the -c and -b options because the login action returns a cookie for authentication.
Besides invoking CLI commands with asterisk -rx, you can also invoke any CLI command via AMI with the Command action…
curl -c cookies http://localhost:8088/rawman?action=login&username=test&secret=test
curl -b cookies http://localhost:8088/rawman?action=Command&command=Core+Show+Channels
curl -b cookies http://localhost:8088/rawman?action=Command&command=Bridge+Show+all
Not exactly deprecated. The page you reference does say “may be removed in the future” but there are no plans to do so. The code that provides that functionality is a tiny part of the manager and has been working fine for almost 20 years so there’s no reason to remove it. Even if we did find a reason, there’d be lots of advanced notice.