Debugging in Yate
(→Frequently asked question when debugging) |
|||
Line 159: | Line 159: | ||
Q1: How you see if a module is loaded or not? | Q1: How you see if a module is loaded or not? | ||
− | A1: Give '''status''' command from telnet, this will list all modules that are loaded in that moment. | + | A1: Give '''status''' command from telnet, this will list all modules that are loaded in that moment. If module is not listed, then it's not loaded. |
Revision as of 15:54, 16 May 2013
In Yate there are several ways to debug issues and check status of the various modules. The status output is different, depending on the module investigated.
The first step for debugging yate is to log output in a file. Yate also offers modules like rmanager to see debug output in telnet client or msgsniff to dump the Yate messages to output console or log into file. When debbuging the output of sniffer you have to know that messages are displayed twice, once they are emitted and when they are handled(or not).
Contents |
Debug logged in file
At startup Yate can be started with logging in a file so that you can see the errors in the specified file.
To increase the visible debug level you have to add -v option more than once to the command line or to service start script:
yate -vvvvv -l logfile -d -s -r
To see what all the other options are please run
yate --help
Debug using rmanager module
This module allows controlling Yate using a simple telnet client.
When we say to control Yate from console that means that remotely logged you can:
- start/stop/restart Yate
- debug the modules
- start/stop calls
Debug modules in Yate
Reloads module configuration files:
- reload [plugin]
Restarts the engine:
- restart [now]
Stops the engine with optionally provided exit code:
- stop [exitcode]
Controls the modules loaded in the Telephony Engine:
- module {{load|reload} modulefile|unload modulename|list}
Show or change debugging level globally or per module:
- debug [module] [level|on|off]
Example: Enable debugging and increase the level of debugging:
telnet localhost 5038 debug on debug level 10 debug sip level 10
Colorize the output in console:
- color [on|off]
Shows status of all or selected modules or channels
- status [overview] [modulename]
Example: Show status module accfile
status accfile %%+status:accfile name=accfile,type=misc;users=2;line_1=outcalls_1,line_2=outcalls_2 %%-status
The output is different depending on the module that is investigated.
Show log of engine startup and initialization process:
- logview
Debug calls
Drops one or all active calls:
- drop {chan|*|all} [reason]
Execute an outgoing call:
- call chan target
Debug external scripts
Enable output in PHP scripts:
- Yate::Output(true);
Stop/start a script, useful when changes are done and you want to reload the new file in Yate:
- external stop scriptname.php
- external start scriptname.php
Debug using msgsniff module
The module will dump the Yate messages to output console or log into file.
By default this module should be loaded but not started. To start this module use the telnet command or configure when yate starts.
Load module msgsniff
Enable module in yate.conf:
[general] msgsniff=no modload=no ;Don't forget to load the sniffer module if modload parameter value is 'no'. [modules] ;for debugging yate rmanager.yate=yes msgsniff.yate=yes
Start msgsniff
- Start Yate with logging:
./run -vvvvv -l logfile
- Enable / Disable sniffer in telnet:
The module must be loaded so that you can use this commands from telnet:
telnet 0 5038 ;enable sniffer: sniffer on ;and disabled with: sniffer off
Use filters with msgsniff
- Filters can be applied by specifying regex to match in telnet:
sniffer filter ^\(chan\.\|engine\.halt$\)
- or in yate.conf:
[default] ; filtersniff: regexp: Default filter to apply to message sniffer at initialization ; If empty it will match all messages except engine.timer which is never displayed ; Example for a filter matching all chan.Anything messages and engine.halt: filtersniff=^\(chan\.\|engine\.halt$\)
Compiling Yate with xdebug, ddebug or debug
This is used by developers to test their code, to see information about creating specific objects or if some specific functions are called.
To compile with debug messages when compiling Yate you have to specify:
make xdebug make ddebug make debug
When compiling with xdebug, the ddebug messages are included but if ddebug is compiled, xdebug messages are not included.
When compiling with debug symbols of functions are added. This will allow creating a useful core file for debugging purpose.
Frequently asked question when debugging
Q1: How you see if a module is loaded or not?
A1: Give status command from telnet, this will list all modules that are loaded in that moment. If module is not listed, then it's not loaded.
Q2: How do I see if a script is running?
A2: Give command external from telnet, this will display all scripts running in that moment.
See also