Hello,
the new debugger module can be used to do runtime debugging of SIP
Router config file, in similar manner of gdb. The module is controlled
via the RPC interface, therefore investigation can be done from a remote
site. That makes it very handy to use with sercmd as well.
One features is to print a log message for each action executed in the
config for a SIP message, showing the execution path. The option can be
enabled/disabled per process.
The other one is step by step execution of config file. When a SIP
message message comes it, SIP Router process will stop at first action
and wait for commands, like: execute the action, evaluate a
pseduo-variable, print to syslog a pseudo-variable, remove the
breakpoints and continue execution without interruption, ... See the
readme for more:
http://sip-router.org/docbook/sip-router/branch/master/modules/debugger/deb…
It is still some stuff to complete, some known issues to remove, but the
module is usable and may help some of you to troubleshoot migrations
from older versions to 3.0 (use master branch until your config is
updated and running fine, then use it with stable 3.0).
Hope is going to be useful and waiting for feedback to improve. Of
course, contributions are most welcome!
Cheers,
Daniel
--
Daniel-Constantin Mierla
eLearning class for Kamailio 3.0.0
Starting Feb 8, 2010
* http://www.asipto.com/
Module: sip-router
Branch: master
Commit: bb7dceb00c840b195e986333180bbd7b5c9e7f12
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bb7dceb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Feb 4 00:11:59 2010 +0100
debugger: new module for interactive cfg debugging
- print config execution path of a SIP message to logs
- interactive debugging for config, similar to gdb
- step-by-step execution of each action in the config file
- the SIP router process stops at cfg actions and waits for RPC commands
to go to next one, evaluate a pseudo-variable, continue execution, etc.
- see README for more details
---
modules/debugger/Makefile | 12 +
modules/debugger/README | 325 +++++++++++++
modules/debugger/debugger_api.c | 786 +++++++++++++++++++++++++++++++
modules/debugger/debugger_api.h | 37 ++
modules/debugger/debugger_mod.c | 140 ++++++
modules/debugger/doc/Makefile | 4 +
modules/debugger/doc/debugger.xml | 36 ++
modules/debugger/doc/debugger_admin.xml | 400 ++++++++++++++++
8 files changed, 1740 insertions(+), 0 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=bb7…
Module: sip-router
Branch: master
Commit: c4505aab3b2a945de126b617902382554837df3a
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c4505aa…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Feb 4 20:50:36 2010 +0100
debugger: removed completed task from to-do
- fixed the description of inner command for dbg.bp
---
modules/debugger/README | 8 ++------
modules/debugger/doc/debugger_admin.xml | 12 ++----------
2 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/modules/debugger/README b/modules/debugger/README
index 4b4149f..e0b8a1f 100644
--- a/modules/debugger/README
+++ b/modules/debugger/README
@@ -282,8 +282,8 @@ if($si=="10.0.0.10")
Name: dbg.bp
Parameters:
- * _cmd_ : inner command can be 'on' or 'off' to enable or disable the
- tracing for one or all processe.
+ * _cmd_ : inner command, see next section for the list of available
+ values.
* _pid_ : pid for which to apply the inner command. If it missing,
then will be applied for all processes.
* _params_ : extra params specific for each inner command.
@@ -393,10 +393,6 @@ sercmd> dbg.bp move 10481
7. To-do
The 'MUSTS' and ideas of what can be done:
- * many internal parameters not yet exported to cfg: log level for
- printed messages, log facility, sleep time while waiting at
- breakpoint, number of iterations to wait for response from SIP
- router process ... they are now global variables inside module.
* Complete breakpoint setting and usage on specific lines.
* Make the output more human friendly - text can be used instead of
integer values for some fields such as state. Also, for some
diff --git a/modules/debugger/doc/debugger_admin.xml b/modules/debugger/doc/debugger_admin.xml
index c65851e..b774bdf 100644
--- a/modules/debugger/doc/debugger_admin.xml
+++ b/modules/debugger/doc/debugger_admin.xml
@@ -317,8 +317,8 @@ if($si=="10.0.0.10")
</para>
<para>Parameters:</para>
<itemizedlist>
- <listitem><para>_cmd_ : inner command can be 'on' or 'off' to
- enable or disable the tracing for one or all processe.</para>
+ <listitem><para>_cmd_ : inner command, see next section for
+ the list of available values.</para>
</listitem>
<listitem><para>_pid_ : pid for which to apply the inner command.
If it missing, then will be applied for all processes.</para>
@@ -477,14 +477,6 @@ sercmd> dbg.bp move 10481
</para>
<itemizedlist>
<listitem>
- <para>many internal parameters not yet exported to cfg:
- log level for printed messages, log facility, sleep time while
- waiting at breakpoint, number of iterations to wait for response
- from SIP router process ... they are now global variables inside
- module.
- </para>
- </listitem>
- <listitem>
<para>
Complete breakpoint setting and usage on specific lines.
</para>
Hi,
few details about the new module mqueue. It provides a generic message
queue for SIP Router inter process communication. Items in the queue are
pairs of (key, value), both string. The items are consumed in the order
they were added in the queue (first in first out).
More details at:
http://sip-router.org/docbook/sip-router/branch/master/modules/mqueue/mqueu…http://sip-router.org/wiki/cookbooks/pseudo-variables/devel#mqueue_module_p…
The module is handy to use for time consuming and/or blocking operations
(eg, email notifications). Not to hold the SIP worker process, you can
add an item in a queue that is going to be consumed by another process
(like timer processes created via rtimer module).
Best regards,
Ramona