Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Asterisk: How to send SIP DEBUG to a file

Posted on 2006-11-22
6
Medium Priority
?
7,069 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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'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.

 
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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 …
Hey there Heard about jingle, the add on for XMPP that enables point to point audio between two XMPP clients. No server config necessary. Actually quite a cool feature. However, how good is it if you can not use those voice capabilities to do a P…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

715 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