[asterisk-users] Any api (agi/ari/ami) equivalent of "core show calls"?

Jonathan H lardconcepts at gmail.com
Sat Jun 13 04:11:28 CDT 2020

I'm parsing ` sudo asterisk -rx "core show calls" | grep active | head -c 1
` as an external call from within the Asterisk dialplan then passing it to
agi, but this seems really hacky and ugly.

However, I cannot find any ARI/AGI/AMI function (or global variable I can
get with agi) which shows me this.

Any ideas?!?

In case it helps and you're wondering why...
I need to ensure that a MusicOnHold stream is only running when there's a
caller on hold and listening.
To do that, I need to rewrite and reload the moh.conf file when the caller
hangs up IF there are no other callers (ie there's just 1 active call as
the caller hangs up), and then  rewrite and reload again when there's a new
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20200613/ddfe212f/attachment.html>

More information about the asterisk-users mailing list