It is possible to get active calls by ARI?

hi

each incoming call goes through by GROUP() function to count incoming calls by connected trunks. Question is how i can by ARI get this counters?

Have you tried using the channel get variable route[1] or the global variable route[2] to execute the dialplan function[3] to get the count?

[1] Asterisk 18 Channels REST API - Asterisk Project - Asterisk Project Wiki
[2] Asterisk 18 Asterisk REST API - Asterisk Project - Asterisk Project Wiki
[3] Asterisk 18 Function_GROUP_COUNT - Asterisk Project - Asterisk Project Wiki

hi,

i tried but without any sucess. probaly i have to write script which will execute ‘group show channels’ and parse results of execution

What does “without any sucess” mean? What request did you try? What was the result?

i tried :
curl login:password@localhost:8088/ari/asterisk/variable/route
{“message”:“Resource not found”}
also curl login:password@localhost:8088/ari/channels/1627941481.4/variable/route
{“message”:“Resource not found”}
and your sugestion about application GROUP_COUNT will be ok but it is exist in dialplan only

Dialplan functions can be used from ARI the same way dialplan variables can. It’s easiest to use the https://ari.asterisk.org/ site for testing, and “Resource not found” means that either the module responsible for such things is not loaded, or your URL is wrong.

ok, i am dumb. could you provide example how to execute NOOP application by ARI?
at this moment I’m able to list all existed channels but still no idea how to execute any dialplan application for get any results

assuming that the url is http::localhost/ari/…?api_key=login:password (it that shows swagger)

You can’t execute dialplan applications such as NoOp through ARI. You can use the variable route to get the value of dialplan variables, and dialplan functions. Such as:

/channels/1234.1/variable?variable=GROUP_COUNT(testing)

In Swagger you would use the variable route and for the name of the variable you would use GROUP_COUNT(name of group)

YEAH. Now it makes sense. THANK YOU A LOT !

so this same way for asterisk core should also works?

/ari/asterisk/variable?variable=GROUP_COUNT(testing)

Yes, although I haven’t tested that specifically. It may require a channel to be present. Some dialplan functions require channels, some don’t.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.