Troubleshooting Freeswitch

From FreeSWITCH Wiki

Jump to: navigation, search

You need not recompile with debug symbols or use a debugger to take these steps (for that, see Debugging Freeswitch)

Contents

Debug for the Impatient

From a Bash:

export TPORT_LOG=1

start freeswitch (e.g. /usr/local/freeswitch/bin/freeswitch)

press F8

this will produce quite of logs ready to be pasted into freeswitch pastebin http://pastebin.freeswitch.org/

Enabling SIP/Sofia Tracing

Stop FreeSwitch. At the bash shell prompt enter any subset of the following;

export SOFIA_DEBUG=9
export NUA_DEBUG=9
export NTA_DEBUG=9
export TPORT_DEBUG=9
export TPORT_LOG=1

Note: If you only want to see the SIP messages then use the TPORT_LOG export only.

For the full set of environment variables, see http://sofia-sip.sourceforge.net/refdocs/debug_logs.html

You don't have to rebuild sofia for these to work.

Restart FreeSwitch

Increase Debug Output

Edit console.conf.xml

<param name="log_event" value="DEBUG"/> 
<param name="all" value="DEBUG"/>

Edit switch.conf.xml (especially if you have lots of calls, reduce logging)

   <param name="loglevel" value="debug"/>


The possible values for value are (use only the text value in ""):

    "EMERG",
  1 "ALERT",
  2 "CRIT",
  3 "ERR",
  4 "WARNING",
  5 "NOTICE",
  6 "INFO",
  7 "DEBUG",
  0 "CONSOLE"


[what are the possible name values?]

You may also use the console API to set debug level on fs console

freeswitch@de> console loglevel [0-7] (numerical value as above)

And you can also set the levels of fsctl

freeswitch@de> fsctl loglevel [0-7] (numerical value as above)

Prevent logging output loss after segfaults

If you are developing something that is resulting in segfaults, you may have noticed that output is being lost making it more difficult to trace the problem.

The best way to combat this loss of logging statements is to turn on enabling crash protection.

Colorizing output

In console.conf.xml uncomment the color mode.

Enabling libedit

Whatever libedit is .. enable it via --enable-core-libedit-support argument to configure script.

Personal tools