Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Asterisk: How to send SIP DEBUG to a file

Posted on 2006-11-22
6
Medium Priority
?
7,206 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 600 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 1400 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

916 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