Debugging in Yate

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Debug using msgsniff module)
Line 17: Line 17:
 
This module allows controlling Yate using a simple [http://en.wikipedia.org/wiki/Telnet telnet] client.  
 
This module allows controlling Yate using a simple [http://en.wikipedia.org/wiki/Telnet telnet] client.  
  
Use telnet in console:
+
==== Debug modules in Yate====
  
telnet localhost 5038
 
To:
 
 
* enable debugging and to increase the level of debugging:
 
* enable debugging and to increase the level of debugging:
  
Line 30: Line 28:
 
* to colorize the output in console:
 
* to colorize the output in console:
 
  color on
 
  color on
 +
 +
* see the status of modules use command:
 +
status
 +
 +
* view logs in console:
 +
logview
 +
 +
==== Debug external scripts ====
  
 
* see output for scripts by setting in PHP script:
 
* see output for scripts by setting in PHP script:
  Yate::Debug(true);
+
  Yate::Output(true);
  
 
* stop/start a script, useful when changers are done in a script to reload the code in Yate:
 
* stop/start a script, useful when changers are done in a script to reload the code in Yate:
Line 39: Line 45:
 
  external start scriptname.php
 
  external start scriptname.php
  
* see the status of modules use command:
 
status
 
 
* view logs in console:
 
logview
 
  
 
=== Debug using [[Debugging_and,_or_Investigation_of_messages|msgsniff]] module===
 
=== Debug using [[Debugging_and,_or_Investigation_of_messages|msgsniff]] module===
Line 49: Line 50:
 
The module will dump the Yate messages to output console or log into file.
 
The module will dump the Yate messages to output console or log into file.
  
This module is loaded but not started by default. To start this module you must enable it in yate.conf as you can see below.
+
By default this module should be loaded but not started. To start this module use the telnet command or configure when yate starts.
  
* First enable the module in yate.conf:  
+
====Load module msgsniff====
 +
 
 +
Enable module in yate.conf:  
  
 
  [general]
 
  [general]
  msgsniff=yes
+
  msgsniff=no
 
  modload=no
 
  modload=no
 
  ;Don't forget to load the sniffer module if modload parameter value is 'no'.
 
  ;Don't forget to load the sniffer module if modload parameter value is 'no'.
Line 61: Line 64:
 
  rmanager.yate=yes
 
  rmanager.yate=yes
 
  msgsniff.yate=yes
 
  msgsniff.yate=yes
 +
 +
====Start msgsniff====
  
 
* Start Yate with logging:
 
* Start Yate with logging:
Line 74: Line 79:
 
  ;and disabled with:
 
  ;and disabled with:
 
  sniffer off
 
  sniffer off
 +
 +
====Use filters with msgsniff====
  
 
* Filters can be applied  by specifying regex to match in telnet:  
 
* Filters can be applied  by specifying regex to match in telnet:  
Line 86: Line 93:
 
  ; Example for a filter matching all chan.Anything messages and engine.halt:
 
  ; Example for a filter matching all chan.Anything messages and engine.halt:
 
  filtersniff=^\(chan\.\|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.
  
  

Revision as of 17:32, 15 May 2013

This page purpose is to show you the methods of debugging in Yate. You can use logging in a file at startup or modules like rmanager to see debug output in telnet client or msgsniff to dump the Yate messages to output console or log into file.

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.

Debug modules in Yate

  • enable debugging and to increase the level of debugging:
telnet localhost 5038
debug on 
debug level 10
debug sip level 10
  • to colorize the output in console:
color on
  • see the status of modules use command:
status
  • view logs in console:
logview

Debug external scripts

  • see output for scripts by setting in PHP script:
Yate::Output(true);
  • stop/start a script, useful when changers are done in a script to reload the code 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.


See also

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers