Am I leaking memory in ARI

As I play with learning the ARI, I’m creating lots of bridges and calls, and then my test program stops.

What happens to all of these bridges/calls I create? Do they remain until next Asterisk restart?

A recent call to create a channel got back a 401 error with {“message”:“out of memory”}…am I causing that or is something else going on?

I’m experimenting with my home asterisk server, so I can safely reboot it if needed. Just wondering

If you don’t clean them up yourself (or in the case of channels they don’t hang up) then they remain. It’s up to your ARI application to manage them.

Bridges particularly: it’s way too easy to leave these lying around if your code crashes, for example.

Ok, so I have to monitor for either channel (in the bridge) hanging up. And once one (of the two) parties hangs up, I have to destroy the bridge.

Do I have to destroy the two channels too, or is that handled automatically by destroying the bridge?