2

We have people in our office that use softphones to connect to our Asterisk system. The softphones are online when they are in the office, and offline when they are not. So the Reachable/UNREACHABLE notices in the log are an accurate enough representation for us to determine when someone is "logged in" or "logged out."

I want to build a reporting system to generate how long users were available, but I'm not sure of the best way to get the data.

I could poll the logs; run a cron job occasionally that would parse through the log looking for these occurrences, and then log them. I don't particularly care for this option, but will use it if it's the only one available.

Ideally, Asterisk would have some sort of event or trigger that I could tie into that would kick off some script that I'd write which would log the event into a database. Is there anything like that? My searches haven't revealed anything.

Nick Coons
  • 387
  • 4
  • 16
  • We use a customized icinga plugin to monitor sip trunks. Are you interested in setting up a complete monitoring system for this? – dkwiebe Mar 16 '14 at 18:51
  • Not particularly.. I'd rather hand-build something to periodically parse the logs. – Nick Coons Mar 16 '14 at 19:45

1 Answers1

2

I've not tried it, and its effectively a special case of polling the logs (but made easier). Why not run "Fail2Ban" with a custom rule searching for "UNREACHABLE" and "Reachable" responses combined with a script to automatically update your database.

davidgo
  • 6,222
  • 3
  • 23
  • 41