event_route Module
     __________________________________________________________

   Table of Contents

   1. Admin Guide

        1.1. Overview
        1.2. ROUTE events parameters
        1.3. EVENT_ROUTE usage
        1.4. EVENT_ROUTE socket syntax
        1.5. Dependencies

              1.5.1. OpenSIPS Modules
              1.5.2. External Libraries or Applications

        1.6. Exported Parameters
        1.7. Exported Functions

   2. Frequently Asked Questions
   3. Contributors

        3.1. By Commit Statistics
        3.2. By Commit Activity

   4. Documentation

        4.1. Contributors

   List of Tables

   3.1. Top contributors by DevScore^(1), authored commits^(2) and
          lines added/removed^(3)

   3.2. Most recently active contributors^(1) to this module

   List of Examples

   1.1. EVENT_ROUTE usage

Chapter 1. Admin Guide

1.1. Overview

   This module provides a simple way for capturing and handling
   directly in the OpenSIPS script of different events triggered
   through the OpenSIPS Event Interface

   If you want to capture and handle a certian event, you need to
   define a dedicated route (event_route) into the OpenSIPS
   script, route having as name the name/code of the desired
   event. The route is triggered (and executed) by the module when
   the corresponding event is raised by the OpenSIPS

   NOTE that the triggered event_route is run asyncronus (and in a
   different process) in regards to the code or process that
   generated the actual event.

   NOTE that inside the event_route you should NOT rely on
   anything more than the content provide by the event itself (see
   below variable). DO NOT assume to have access to any other
   variable or context, not even to a SIP message.

1.2. ROUTE events parameters

   In order to retrieve the parameters of an event, the
   $param(name) variable has to be used. It's name can be the
   parameter's name, or, if an integer is specified, its index
   inside the parameter's list.

   Example:
xlog("first parameters is $param(1)\n");
xlog("Pike Blocking IP is $param(ip)\n");

   NOTE: An event may be triggered within a different event,
   leading to nested processing. This function will retrieve the
   parameters of the currently processed event.

   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. EVENT_ROUTE usage

   In order to handle the E_PIKE_BLOCKED event, the following
   snippet can be used:

   Example 1.1. EVENT_ROUTE usage
        event_route[E_PIKE_BLOCKED] {
                xlog("IP $param(ip) has been blocked\n");
        }

1.4. EVENT_ROUTE socket syntax

   As the OpenSIPS Event Interface requires, the event_route
   module uses a specific socket syntax:

   'route:' event_name

   Example:

   route:E_PIKE_BLOCKED

1.5. Dependencies

1.5.1. OpenSIPS Modules

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

1.5.2. External Libraries or Applications

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

1.6. Exported Parameters

   The module does not export parameters to be used in
   configuration script.

1.7. Exported Functions

   The function does not export any function.

Chapter 2. Frequently Asked Questions

   2.1.

   Can I declare more routes for handling the same event?

   No, only a single event_route can be used for a particular
   event.

   2.2.

   What happened with the “fetch_event_params()” function?

   This function has been dropped starting with OpenSIPS 3.0. Its
   functionality has been replaced by the “$param(name)” variable.

   2.3.

   Where can I find more about OpenSIPS?

   Take a look at https://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.

Chapter 3. Contributors

3.1. By Commit Statistics

   Table 3.1. Top contributors by DevScore^(1), authored
   commits^(2) and lines added/removed^(3)
     Name DevScore Commits Lines ++ Lines --
   1. Razvan Crainea (@razvancrainea) 40 25 993 317
   2. Bogdan-Andrei Iancu (@bogdan-iancu) 18 9 142 400
   3. Liviu Chircu (@liviuchircu) 14 12 29 49
   4. Ionut Ionita (@ionutrazvanionita) 8 5 138 51
   5. Vlad Patrascu (@rvlad-patrascu) 7 5 14 5
   6. Ovidiu Sas (@ovidiusas) 7 2 384 9
   7. Maksym Sobolyev (@sobomax) 5 3 18 16
   8. Ionel Cerghit (@ionel-cerghit) 3 1 5 6
   9. Peter Lemenkov (@lemenkov) 3 1 1 1
   10. Vlad Paiu (@vladpaiu) 2 1 1 0

   All remaining contributors: Walter Doekes (@wdoekes).

   (1) DevScore = author_commits + author_lines_added /
   (project_lines_added / project_commits) + author_lines_deleted
   / (project_lines_deleted / project_commits)

   (2) including any documentation-related commits, excluding
   merge commits. Regarding imported patches/code, we do our best
   to count the work on behalf of the proper owner, as per the
   "fix_authors" and "mod_renames" arrays in
   opensips/doc/build-contrib.sh. If you identify any
   patches/commits which do not get properly attributed to you,
   please submit a pull request which extends "fix_authors" and/or
   "mod_renames".

   (3) ignoring whitespace edits, renamed files and auto-generated
   files

3.2. By Commit Activity

   Table 3.2. Most recently active contributors^(1) to this module
                      Name                   Commit Activity
   1.  Liviu Chircu (@liviuchircu)         Mar 2014 - Apr 2025
   2.  Razvan Crainea (@razvancrainea)     Dec 2012 - Apr 2024
   3.  Vlad Patrascu (@rvlad-patrascu)     May 2017 - Jun 2023
   4.  Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - May 2023
   5.  Maksym Sobolyev (@sobomax)          Feb 2021 - Feb 2023
   6.  Peter Lemenkov (@lemenkov)          Jun 2018 - Jun 2018
   7.  Vlad Paiu (@vladpaiu)               Jun 2016 - Jun 2016
   8.  Ionel Cerghit (@ionel-cerghit)      Jun 2015 - Jun 2015
   9.  Ionut Ionita (@ionutrazvanionita)   Oct 2014 - Oct 2014
   10. Ovidiu Sas (@ovidiusas)             Jul 2014 - Jul 2014

   All remaining contributors: Walter Doekes (@wdoekes).

   (1) including any documentation-related commits, excluding
   merge commits

Chapter 4. Documentation

4.1. Contributors

   Last edited by: Razvan Crainea (@razvancrainea), Bogdan-Andrei
   Iancu (@bogdan-iancu), Peter Lemenkov (@lemenkov), Liviu Chircu
   (@liviuchircu), Ionut Ionita (@ionutrazvanionita), Ovidiu Sas
   (@ovidiusas).

   Documentation Copyrights:

   Copyright © 2012 www.opensips-solutions.com
