event_datagram Module

Razvan Crainea

   OpenSIPS Solutions

Edited by

Razvan Crainea

   Copyright © 2011 www.opensips-solutions.com
     __________________________________________________________

   Table of Contents

   1. Admin Guide

        1.1. Overview
        1.2. DATAGRAM events syntax
        1.3. DATAGRAM socket syntax
        1.4. Dependencies

              1.4.1. OpenSIPS Modules
              1.4.2. External Libraries or Applications

        1.5. Exported Parameters
        1.6. Exported Functions
        1.7. Example

   2. Frequently Asked Questions

   List of Examples

   1.1. E_PIKE_BLOCKED event
   1.2. UNIX socket
   1.3. UDP socket

Chapter 1. Admin Guide

1.1. Overview

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

1.2. DATAGRAM events syntax

   The raised events will follow the following grammar:
     * event = event_name (argument '\n')*
     * event_name = non-quoted_string'\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}

   The event name can contain any non-quoted string character, but
   it is recommended to follow the syntax:
   E_MODULE_NAME_EXTRA_NAME

1.3. DATAGRAM socket syntax

   There are two types of sockets used by this module, based on
   the sockets type. An UNIX socket should follow this syntax:

   ['unix:'] unix_socket_path

   An UDP socket should follow this syntax:

   'udp:' address ':' port

1.4. Dependencies

1.4.1. OpenSIPS Modules

   The following modules must be loaded before this module:
     * No dependencies on other OpenSIPS modules.

1.4.2. External Libraries or Applications

   The following libraries or applications must be installed
   before running OpenSIPS with this module loaded:
     * none

1.5. Exported Parameters

   No parameter exported by this module.

1.6. Exported Functions

   No function exported to be used from configuration file.

1.7. Example

   This is an example of an event raised by the pike module when
   it decides an ip should be blocked:

   Example 1.1. E_PIKE_BLOCKED event

E_PIKE_BLOCKED
ip::192.168.2.11


   Example 1.2. UNIX socket

unix:/tmp/opensips_event.sock


   Example 1.3. UDP socket

udp:127.0.0.1:8081


Chapter 2. Frequently Asked Questions

   2.1.

       Both UNIX and UDP type of socket can be used to notify the
       events?

       Yes, you can use the both types.

   2.2.

       What is the maximum lenght of a datagram event?

       The maximum length of a datagram event is 65457 bytes.

   2.3.

       Where can I find more about OpenSIPS?

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

   2.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.opensips.org/cgi-bin/mailman/listinfo/users
         * Developer Mailing List -
           http://lists.opensips.org/cgi-bin/mailman/listinfo/devel

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

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

   2.5.

       How can I report a bug?

       Please follow the guidelines provided at:
       https://github.com/OpenSIPS/opensips/issues.
