Solved

Asterisk: How to send SIP DEBUG to a file

Posted on 2006-11-22
6
6,300 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
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.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

861 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now