Logging when extensions change state

Feb 1, 2017
38
3
8
108
I feel like the information I am after is probably all "in there" somewhere, because we have a Registrations table and we have Event Guard watching for failed logins.
I am interested in extensions change state, ie register, unregister or expire. But when I look in the logs, I don't see events like this.
What is populating the Registrations table? Can it emit a log when something changes?
The purpose of this is troubleshooting faulty connectivity and CPE. Right now if somebody asks me "was this extension online at this time?" I simply cannot answer the question.
 
  • Like
Reactions: ou812
Depending on the verbosity you've set the information is certainly available in the freeswitch logs, forwarding these to elasticserach makes troubleshooting a little easier for folks allergic to the commandline.
That being said, I'm also a fan of freeswitch_exporter which is more about metrics than logging, but can also be helpful in the scenario you described. The screenshot below is from grafana displaying metrics gathered from the freeswitch_exporter, while grafana isn't a neccessity it is more friendly to use than the prometheus UI. I've only chosen to expose the reg_user in the screenshot, but there's enough labels in there for the use case you stated. Each color denotes a different registration of user 9999999, if the datapoints disappear that means 9999999 is not registered.
Also a shameless self plug, I do offer monitored hosted PBX services at unheard of rates, and am considering working with third party resellers (reseller manages their customers, I deal with resellers. I love tech, not so much its users).

1749914163293.png
 
Is there a way to pipe the output of a fs_cli /event subscription? I have this:

Code:
/event plain CHANNEL_CREATE CHANNEL_DESTROY CUSTOM sofia::register sofia::unregister

but it produces a crazy amount of output, about 60 line for every event.
I can't do it with fs_cli -x , that just claims that /event is not a valid command.
The idea is to just leave this running, pipe it through grep to only pick out the fields I want and log it all to a file.
 
Last edited:
You need to subscribe to events and listen to register and unregister events, and then you can redirect them to save them in the DB (the easiest way). After you have this a simple web page that can display records from DB will do. You can then make it more sophisticated by adding some graphics or implementing Grafana as suggested by @PrettyBrutalXperience-Guy