Solved

Asterisk: How to send SIP DEBUG to a file

Posted on 2006-11-22
6
6,382 Views
Last Modified: 2012-08-14
I am trying to solve a problem on an Asterisk server that is receiving a lot of calls through SIP. Most of the calls get through ok and are routed to an IVR as they are supposed to be. However, from time to time there are calls that fail to connect. We cannot determine if the call has reached the Asterisk box or if the point of failure is earlier. The obvious solution would be to run with SIP DEBUG enabled, but this only seems to display the debug info on the console screen. Is there a way to redirect the SIP DEBUG information to a file so I can examine the file hours later and look for messages relating to failed calls. Ideally I would want to locate messages in the file that were saved at a particular time of day, but the messages generated by Asterisk do not contain a time stamp.

Any sensible suggestions welcome, but it will not be sufficient to copy and paste the debug info from the console screen because there is too much generated. The operating system is Red Hat Linux ES 4.
0
Comment
Question by:feptias
  • 3
  • 2
6 Comments
 
LVL 22

Assisted Solution

by:Reid Palmeira
Reid Palmeira earned 150 total points
ID: 18000434
hm, you can't just pipe the info from the console to a text file? that would seem to me the easiest way.

some other options here: http://www.voip-info.org/wiki-Asterisk+debugging
0
 
LVL 25

Accepted Solution

by:
kode99 earned 350 total points
ID: 18000552
If you look in the /etc/asterisk/logger.conf file you can control loggin to file of anything that comes up on the console.

Here's a bit of info - it is fairly straightforward and the default file explains most of it anyway.

http://www.automated.it/asterisk/lah-3-6-05_5.html 
0
 
LVL 19

Author Comment

by:feptias
ID: 18001522
Many thanks for the suggestions - they look good. Unfortunately, I have other committments today, so will post a response later.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 19

Author Comment

by:feptias
ID: 18006816
rpalmeira22:
> "you can't just pipe the info from the console to a text file?"

My skills with Linux are somewhat limited and although I understand in principle about piping, I would not know what to try in this case. The Asterisk CLI console is a terminal session where I can type commands such as "sip debug" and it displays responses or information on the screen. If there was some way to capture the output (or even the entire session) to a file then that would probably be sufficient. Can this be done easily in Linux? If so, how?

kode99:
I have just been looking at the logger.conf file and it is not immediately obvious which option might capture the sip debug messages without capturing a whole lot of other debug messages that I probably don't want, but I am going to test the options one by one to get a better understanding of what they do.
0
 
LVL 25

Expert Comment

by:kode99
ID: 18010445
You best bet would be to use the 'sip debug peer' or 'sip debug ip' if you know the problem is coming from a particular user/location to narrow down the sip debug information you get.  The log file will also have date/time's in it.

Basically you just add a line,  

<filename> => debug    <-message type to put in the log file

Probably be wise to include errors and warnings too.  So
mydebuglog => notice,warning,error,debug

If you understand the sip information well enough you could use a lower verbosity for the messages.  Cut down the log file size but might not be so good if you catch the problem but dont have clear enough log entries.  




 
0
 
LVL 19

Author Comment

by:feptias
ID: 18010860
I got the solution I needed by editing the logging.conf file as follows:

dateformat=%F %T
messages => error,verbose

I deliberately didn't want to include warnings.

When logger.conf was set like that, then all the output showing the SIP packets that is displayed when you specify "sip debug" on the CLI, was also sent to the log file /var/log/asterisk/messages.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Although VoiceOver IP has been around for a while, internet connections have only recently become fast enough to provide good call quality. Now, VoIP has become a real option for businesses looking at ways to improve their business model. In this ar…
Every year the snow affects people and businesses. According to the Federation of Small Businesses (FSB), in 2009, UK businesses lost an estimated £1.2bn (http://news.bbc.co.uk/1/hi/business/7864804.stm) because of bad weather. This article was c…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question