Solved

Asterisk: How to send SIP DEBUG to a file

Posted on 2006-11-22
6
6,196 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I recently purchased a Bluetooth headset called the Music Jogger (model BSH10). The control buttons on it look like this: One of my goals is to use it as the microphone and speakers for Skype calls. In that respect, it works well. However, I …
As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 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

17 Experts available now in Live!

Get 1:1 Help Now