mi_datagram Module

Andreea-Ancuta Onofrei

   voice-system.ro

Edited by

Andreea-Ancuta Onofrei

   Copyright © 2007 voice-system.ro
     __________________________________________________________

   Table of Contents
   1. User's Guide

        1.1. Overview
        1.2. DATAGRAM command syntax
        1.3. Dependencies

              1.3.1. OpenSER Modules
              1.3.2. External Libraries or Applications

        1.4. Exported Parameters

              1.4.1. socket_name (string)
              1.4.2. children_count (string)
              1.4.3. unix_socket_mode (integer)
              1.4.4. unix_socket_group (integer) unix_socket_group
                      (string)

              1.4.5. unix_socket_user (integer) unix_socket_group
                      (string)

              1.4.6. socket_timeout (integer)
              1.4.7. reply_indent (string)

        1.5. Exported Functions
        1.6. Example

   2. Developer's Guide
   3. Frequently Asked Questions

   List of Examples
   1-1. Set socket_name parameter
   1-2. Set children_count parameter
   1-3. Set unix_socket_mode parameter
   1-4. Set unix_socket_group parameter
   1-5. Set unix_socket_user parameter
   1-6. Set socket_timeout parameter
   1-7. Set reply_ident parameter
   1-8. DATAGRAM request
     __________________________________________________________

Chapter 1. User's Guide

1.1. Overview

   This is a module which provides a UNIX/UDP SOCKET transport
   layer implementation for the Management Interface.
     __________________________________________________________

1.2. DATAGRAM command syntax

   The external commands issued via DATAGRAM interface must follow
   the following syntax:

     * request = first_line (argument '\n')*
     * first_line = ':'command_name':''\n'
     * argument = (arg_name '::' (arg_value)? ) | (arg_value)
     * arg_name = not-quoted_string
     * arg_value = not-quoted_string | '"' string '"'
     * not-quoted_string = string - {',",\n,\r}
     __________________________________________________________

1.3. Dependencies

1.3.1. OpenSER Modules

   The following modules must be loaded before this module:

     * No dependencies on other OpenSER modules.
     __________________________________________________________

1.3.2. External Libraries or Applications

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

     * none
     __________________________________________________________

1.4. Exported Parameters

1.4.1. socket_name (string)

   The name of a UNIX SOCKET or an IP address. The UNIX datagram
   or UDP socket will be created using this parameter in order to
   read the external commands. Both IPv4 and IPv6 are supported.

   Default value is NONE.

   Example 1-1. Set socket_name parameter
...
modparam("mi_datagram", "socket_name", "/tmp/openser.sock")
...
modparam("mi_datagram", "socket_name", "udp:192.168.2.133:8080")
...
     __________________________________________________________

1.4.2. children_count (string)

   The number of child processes to be created. Each child process
   will be a datagram server.

   Default value is 1.

   Example 1-2. Set children_count parameter
...
modparam("mi_datagram", "children_count", 3)
...
     __________________________________________________________

1.4.3. unix_socket_mode (integer)

   Permission to be used for creating the listening UNIX datagram
   socket. Not necessary for a UDP socket. It follows the UNIX
   conventions.

   Default value is 0660 (rw-rw----).

   Example 1-3. Set unix_socket_mode parameter
...
modparam("mi_datagram", "unix_socket_mode", 0600)
...
     __________________________________________________________

1.4.4. unix_socket_group (integer) unix_socket_group (string)

   Group to be used for creating the listening UNIX socket.

   Default value is the inherited one.

   Example 1-4. Set unix_socket_group parameter
...
modparam("mi_datagram", "unix_socket_group", 0)
modparam("mi_datagram", "unix_socket_group", "root")
...
     __________________________________________________________

1.4.5. unix_socket_user (integer) unix_socket_group (string)

   User to be used for creating the listening UNIX socket.

   Default value is the inherited one.

   Example 1-5. Set unix_socket_user parameter
...
modparam("mi_datagram", "unix_socket_user", 0)
modparam("mi_datagram", "unix_socket_user", "root")
...
     __________________________________________________________

1.4.6. socket_timeout (integer)

   The reply will expire after trying to sent it for
   socket_timeout miliseconds.

   Default value is 2000.

   Example 1-6. Set socket_timeout parameter
...
modparam("mi_datagram", "socket_timeout", 2000)
...
     __________________________________________________________

1.4.7. reply_indent (string)

   Strings to be used for line indentation. As the MI data
   structure is tree oriendeted, the depth level will printed as
   identation.

   Default value is ""\t" (TAB)".

   Example 1-7. Set reply_ident parameter
...
modparam("mi_datagram", "reply_ident", "    ")
...
     __________________________________________________________

1.5. Exported Functions

   No function exported to be used from configuration file.
     __________________________________________________________

1.6. Example

   This is an example showing the DATAGRAM format for the
   "get_statistics dialog: tm:" MI commad: response.

   Example 1-8. DATAGRAM request
:get_statistics:\n
dialog:\n
tm:\n
     __________________________________________________________

Chapter 2. Developer's Guide

   The module does not provide any API to use in other OpenSER
   modules.
     __________________________________________________________

Chapter 3. Frequently Asked Questions

   3.1. Both UNIX and UDP type of socket can be created
          simultaneusly?

   3.2. Is there a limit in the datagram request's size?
   3.3. Where can I find more about OpenSER?
   3.4. Where can I post a question about this module?
   3.5. How can I report a bug?

   3.1. Both UNIX and UDP type of socket can be created
   simultaneusly?

   This version supports only one kind of socket at a time. If
   there are more than one value set for socket_name the last one
   will take effect.

   3.2. Is there a limit in the datagram request's size?

   The maximum length of a datagram request or reply is 65457
   bytes.

   3.3. Where can I find more about OpenSER?

   Take a look at http://www.openser.org/.

   3.4. 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:

     * User Mailing List -
       http://lists.openser.org/cgi-bin/mailman/listinfo/users
     * Developer Mailing List -
       http://lists.openser.org/cgi-bin/mailman/listinfo/devel

   E-mails regarding any stable OpenSER release should be sent to
   <users@lists.openser.org> and e-mails regarding development
   versions should be sent to <devel@lists.openser.org>.

   If you want to keep the mail private, send it to
   <team@lists.openser.org>.

   3.5. How can I report a bug?

   Please follow the guidelines provided at:
   http://sourceforge.net/tracker/?group_id=139143.
