SIP Registration log

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

SIP Registration log

Postby klept24 » Tue Feb 24, 2015 3:49 pm

Hi,

Is it possible in CLI to show only the SIP Registration when a phone is being registered or being unregistered. Or any script showing only the SIP Registration.

Thanks!
klept24
 
Posts: 14
Joined: Wed Jan 14, 2015 11:25 am

Re: SIP Registration log

Postby mav2287 » Thu Feb 26, 2015 9:25 am

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!
ViciBox5.x86_64-5.0.3.preload from .iso upgraded to 13.1 | VERSION: 2.10-444c BUILD: 150129-0828 | 1.8.32.2-vici | Dual Server | No Digium/Sangoma Hardware | No Extra Software After Installation | Intel twin quad core 3Ghz Xeon chips | 32gb of RAM
mav2287
 
Posts: 256
Joined: Thu Oct 03, 2013 6:47 pm

Re: SIP Registration log

Postby klept24 » Tue Mar 03, 2015 9:26 am

Do you have any idea of what script that is responsible for generating the logs on /var/log/asterisk/full, because we need to insert it to database for reporting purposes.

Thanks
klept24
 
Posts: 14
Joined: Wed Jan 14, 2015 11:25 am

Re: SIP Registration log

Postby mav2287 » Tue Mar 10, 2015 3:56 pm

Not sure I think it takes place on the asterisk side.
ViciBox5.x86_64-5.0.3.preload from .iso upgraded to 13.1 | VERSION: 2.10-444c BUILD: 150129-0828 | 1.8.32.2-vici | Dual Server | No Digium/Sangoma Hardware | No Extra Software After Installation | Intel twin quad core 3Ghz Xeon chips | 32gb of RAM
mav2287
 
Posts: 256
Joined: Thu Oct 03, 2013 6:47 pm

Re: SIP Registration log

Postby williamconley » Tue Mar 10, 2015 4:32 pm

klept24 wrote:Do you have any idea of what script that is responsible for generating the logs on /var/log/asterisk/full, because we need to insert it to database for reporting purposes.

Thanks

/etc/asterisk/logger.conf

you can create a new log with any content in it that you like (by category, of course, not down to which events occur)

when we're curious about this, we run a 5 minute script that checks this way:

Code: Select all
asterisk -rx "sip show registry"

and/or
Code: Select all
asterisk -rx "sip show peers"

performing this in php and then parsing the resulting array for specific entries is fairly easy. we have a watch script that does this and creates DB entries every 5 minutes just before another script checks to see if everyone who belongs in that table is there (and sends an email if one disappears, and a text message if they aren't back within six minutes, allowing for reboots).
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: SIP Registration log

Postby richardroi » Thu Mar 12, 2015 8:00 am

Hi Sir William, any chance of sharing the script?

Thank you.
ViciBox v.5.0.2-130807 | BUILD: 130809-1410 | SVN Version: 2019 | Asterisk: 1.8.23-vici
64bit Single Server/ ISO Preload Install
Inbound/Blended
richardroi
 
Posts: 373
Joined: Mon Mar 21, 2011 7:20 pm

Re: SIP Registration log

Postby williamconley » Thu Mar 12, 2015 12:52 pm

This one is proprietary (has some information in it that's rather sensitive ...). And there's more than one script involved (two scripts and a table). But they are tiny scripts. We may be able to remove the sensitive data and post them at some point. Or perhaps pieces of them if you can't quite complete yours without problems.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: SIP Registration log

Postby richardroi » Thu Mar 12, 2015 1:31 pm

Thank you sir William.
ViciBox v.5.0.2-130807 | BUILD: 130809-1410 | SVN Version: 2019 | Asterisk: 1.8.23-vici
64bit Single Server/ ISO Preload Install
Inbound/Blended
richardroi
 
Posts: 373
Joined: Mon Mar 21, 2011 7:20 pm


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 67 guests