Page 1 of 1

Phone registration logs

PostPosted: Tue Feb 24, 2015 10:22 am
by richardroi
Hello,

Where can I find the phone registration logs, wanted to see the logs of all phones registered and unregistered history ? Is there such a thing?

Thank you.

Re: Phone registration logs

PostPosted: Thu Feb 26, 2015 9:17 am
by mav2287
Go to the command line and put in the following
Code: Select all
grep 'Registered SIP' /var/log/asterisk/messages
That will go through your log and only show you all the lines where "Registered SIP" appeared in the log. Keep in mind that is only going to show within the time frame the log has. For example when I ran it I only had back to Feb 1, because that is the start of my log on that server. This can also be used to get just about anything you want out of a log just change out 'Registered SIP' for whatever you are looking for. In my case you are using something other than SIP phones you can change SIP out for IAX or whaterver you are looking for. Using just Registered all by itself brings up all kinds of log items that are not phones.

You can also use
Code: Select all
grep --after-context=1 --before-context=1 'Registered SIP' /var/log/asterisk/messages
In this case it will give you the line prior to the search phrase in the log and the line after the search phrase in the log. This is useful if you looking for an event and you are looking for cause and result. You can just change the 1's to however many lines you want before the search result "--before-context" or however many you want after the search result "--after-context"

Hope this helps!

Re: Phone registration logs

PostPosted: Tue Mar 03, 2015 9:26 am
by richardroi
Thank you.
Where can i find the script responsible for the logging?