
xlog Module

Elena-Ramona Modroiu

   Voice Sistem

Edited by

Elena-Ramona Modroiu

   Copyright © 2003 FhG FOKUS
     _________________________________________________________

   Table of Contents
   1. User's Guide

        1.1. Overview
        1.2. Implemented Specifiers
        1.3. Dependencies

              1.3.1. SER Modules
              1.3.2. External Libraries or Applications

        1.4. Exported Parameters

              1.4.1. buf_size (integer)

        1.5. Exported Functions

              1.5.1. xlog(level, format)
              1.5.2. xdbg(format)

   2. Developer's Guide
   3. Frequently Asked Questions

   List of Examples
   1-1. Set buf_size parameter
   1-2. xlog usage
   1-3. xdbg usage
     _________________________________________________________

Chapter 1. User's Guide

1.1. Overview

   This module provides the possibility to print user formatted
   log or debug messages from SER scripts, similar to printf
   function but now a specifier is replaced with a part of the
   SIP request. Section 1.2 shows what can be printed out.
     _________________________________________________________

1.2. Implemented Specifiers

     * %% : '%'
     * %ci : call-id
     * %cs : cseq
     * %ct : contact header
     * %fu : 'From' uri
     * %ft : 'From' tag
     * %is : IP source address
     * %mb : whole SIP message buffer
     * %mf : flags set for current SIP request
     * %mi : SIP message id
     * %ml : SIP message length
     * %pp : process id (pid)
     * %rm : request's method
     * %ru : request's r-uri
     * %rr : reply's reason
     * %rs : reply's status
     * %tu : 'To' uri
     * %tt : 'To' tag
     * %Ts : unix time stamp
     * %Tf : string formatted time
     * %ua : User agent header field
     * %{name[N]} : print the body of the Nth header identified
       by 'name'. If [N] is omitted then the body of the first
       header is printed. The first header is got when N=0, for
       the second N=1, a.s.o. To print the last header of that
       type, use -1, no other negative values are supported now.
       No white spaces are allowed inside the specifier (before
       }, before or after {, [, ] symbols).
       The module should identify most of compact header names
       (the ones recognized by ser which should be all at this
       moment), if not, the compact form has to be specified
       explicitely. It is recommended to use dedicated specifiers
       for headers (e.g., %ua for user agent header), if they are
       available -- they are faster.
     _________________________________________________________

1.3. Dependencies

1.3.1. SER Modules

   The following modules must be loaded before this module:

     * No dependencies on other SER modules.
     _________________________________________________________

1.3.2. External Libraries or Applications

   The following libraries or applications must be installed
   before running SER with this module loaded:

     * None.
     _________________________________________________________

1.4. Exported Parameters

1.4.1. buf_size (integer)

   Maximum size of the log message.

   Default value is 4096. 

   Example 1-1. Set buf_size parameter
...
modparam("xlog", "buf_size", 8192)
...
     _________________________________________________________

1.5. Exported Functions

1.5.1. xlog(level, format)

   Print a formated message using LOG function.

   Meaning of the parameters is as follows:

     * level - The level that will be used in LOG function. It
       can be:
          + L_ALERT
          + L_CRIT
          + L_ERR
          + L_WARN
          + L_NOTICE
          + L_INFO
          + L_DBG
       What really matters is the third letter of the value.
     * format - The formatted string to be printed.

   Example 1-2. xlog usage
...
xlog("L_ERR", "time [%Tf] method <%rm> r-uri <%ru> 2nd via <%{via[1]}>\
n");
...
     _________________________________________________________

1.5.2. xdbg(format)

   Print a formatted message using DBG function.

   Meaning of the parameters is as follows:

     * format - The formatted string to be printed.

   Example 1-3. xdbg usage
...
xdbg("time [%Tf] method <%rm> r-uri <%ru>\n");
...
     _________________________________________________________

Chapter 2. Developer's Guide

   The module does not provide any sort of API to use in other
   SER modules.
     _________________________________________________________

Chapter 3. Frequently Asked Questions

   3.1. Where can I find more about SER?
   3.2. Where can I post a question about this module?
   3.3. How can I report a bug?

   3.1. Where can I find more about SER?

   Take a look at http://iptel.org/ser.

   3.2. Where can I post a question about this module?

   First at all check if your question was already answered on
   one of our mailing lists:

     * http://mail.iptel.org/mailman/listinfo/serusers
     * http://mail.iptel.org/mailman/listinfo/serdev

   E-mails regarding any stable version should be sent to
   <serusers@iptel.org> and e-mail regarding development versions
   or CVS snapshots should be send to <serdev@iptel.org>.

   If you want to keep the mail private, send it to
   <ramona@voice-system.ro>.

   3.3. How can I report a bug?

   Please follow the guidelines provided at:
   http://iptel.org/ser/bugs and send me a mail with cc to one of
   the SER mailing lists.
