Rpt showvars XXXXX is pulled from what file?

Where are these variables being pulled from?

To clarify, I would imagine the variables referred to are variables of the program app.rpt.c, but what I can not imagine is that when these variables change it is not logged somewhere. So if it is could anyone point me in the nearest direction?

If this is not output to a log file of some sort, it would require a modification of app.rpt.c around the 7600 line range correct?

Please correct me if I’m wrong, but it seems like your solution to many data gathering tasks is to grep the log file. Given that assumption, I have to say there are better ways to gather data from Asterisk/app_rpt, specially for real time data such as those from the showvars command. Those change so often that a log file would grow rapidly and possibly fill disk or ram disk.

Asterisk has an elegant mechanism to not only access data but to also send commands. It’s called the AMI. Here is one of the many sites documenting the AMI.

Allmon2 access data via the AMI. See the server.php script for an example of how to open a socket, login and collect data from the AMI. Here is a C program example. This might seem complex but it’s a whole lot simpler than modifying app_rpt.c and and much more practical than logging this data.

I’m willing to help you get started down the right path. Please post any questions you might have.

Thank you, I appreciate that, and will post for sure.

I have been reading on AMI for a couple weeks but have not messed with it yet. The reason I was looking at the log first is because I didn’t want to load down a system with tons of little scripts, but with MQTT it barely pings the resources so far.

I am currently using the asterisk command flagged as such:
sudo /usr/sbin/asterisk -rx "iax2 show netstats"
capturing the output as a variable, parsing the variable (this is where I think AMI could save on resources) then publishing said variable to an MQTT server in the cloud. Locally I am subscribed to said MQTT topic and the whole round trip time is about 80ms.

My vision is to make all the data accessible, not just from on my node or even from within my local network. If using MQTT all the data that you pull in using Allmon2 could be read in near real time on anything from custom apps and website widgets on down to LCD’s with attached ESP32’s. Imagine a $3 Arduino, with 4 little buttons to toggle a connect/diconnect to your favorite 4 nodes. I want the node controllable and readable outside the confines of a browser and DTMF.

I have a socket connection to the MQTT server on my phone and the image below is fed straight from the node to the MQTT server.

The message looks like a clock on my phone every second it updates every second. If it is fast enough for the clock, all the other stats will be plenty quick enough I think.

But your assumption was correct, of that I am guilty. Very bad habit I am trying to explore ways of breaking. When I first started learning to manipulate data it was in a world where people didn’t like to share much and logs almost always gave me allllllllmost enough, even if not getting all that I wanted and a few seconds behind real time. So bash, grep, awk and sed are often my crutch and go to toolbox when I first start looking at finding a solution to see if an idea could even be viable. You’ve got a keen eye Tim!

AMI has no apparent impact on performance. Even when running Allmon2 under Apache on Pi node there is no noticeable performance impact. I don’t know MQTT but I found this git repo which might be of interest to you.