event_virtual Module


Table of Contents

1. Admin Guide
1.1. Overview
1.2. Virtual socket syntax
1.3. Dependencies
1.3.1. OpenSIPS Modules
1.4. External Libraries or Applications
1.5. Exported Parameters
1.5.1. failover_timeout (integer)
1.6. Exported Functions
1.7. Example
2. Contributors
2.1. By Commit Statistics
2.2. By Commit Activity
3. Documentation
3.1. Contributors

List of Tables

2.1. Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
2.2. Most recently active contributors(1) to this module

List of Examples

1.1. Setting the failover_timeout parameter
1.2. Virtual socket

Chapter 1. Admin Guide

1.1. Overview

The event_virtual module provides the possibility to have multiple external applications, using different transport protocols, subscribed to the OpenSIPS Event Interface as a single virtual subscriber, for a specific event. When an event is triggered, the event_virtual module notifies the specified transport modules using one of the following policies:

  • PARALLEL - all subscribers (applications) are notified at once

  • FAILOVER - for every event raised, try to notify the subscribers, in the order in which they are given, until the first successful notification. A failed subscriber is skipped for further notifications until the failover_timeout passes. For some transport modules (event_jsonrpc, event_xmlrpc, event_rabbitmq), in order to properly detect a failure when raising an event, you have to configure synchronous operation through the sync_mode module parameter of the respective module.

  • ROUND-ROBIN - for every event raised, notify the subscribers alternatively, in the order in which they are given (for each raised event notify a different subscriber)

Only one expire value can be used (for the whole virtual subscription), and not one for each individual subscriber.

1.2. Virtual socket syntax

virtual:policy subscriber_1 [[subscriber_2] ...]

Meanings:

  • virtual: - informs the Event Interface that the events sent to this subscriber should be handled by the event_virtual module

  • policy - subscriber notification policy, can have one of the following values: 'PARALLEL', 'FAILOVER', 'ROUND-ROBIN' (with the behaviour described above)

    • !! Important: Policies must always be specified as uppercase strings!

  • subscriber_1 - use the socket syntax for this specific subscriber (eg. "rabbitmq:guest:guest@127.0.0.1:5672/pike")

1.3. Dependencies

1.3.1. OpenSIPS Modules

The following modules must be loaded before this module:

The OpenSIPS event modules which implement the transport protocols used by the subscribers.

1.4. External Libraries or Applications

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

  • none

1.5. Exported Parameters

1.5.1. failover_timeout (integer)

The minimum duration in seconds that a failed subscriber is skipped for further notifications. This parameter only affects the FAILOVER policy.

Default value is 30.

NOTE: This parameter is only available since OpenSIPS 3.0.1

Example 1.1. Setting the failover_timeout parameter

...
modparam("event_virtual", "failover_timeout", 5)
...
	

1.6. Exported Functions

No exported functions to be used in the configuration file.

1.7. Example

Example 1.2. Virtual socket

The sockets of the subscribers may be separated by any number of spaces or tabs:


	virtual:PARALLEL rabbitmq:guest:guest@127.0.0.1:5672/pike flatstore:/var/log/opensips_proxy.log


Chapter 2. Contributors

2.1. By Commit Statistics

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

 NameDevScoreCommitsLines ++Lines --
1. Vlad Patrascu (@rvlad-patrascu)18989266
2. Liviu Chircu (@liviuchircu)643234
3. Razvan Crainea (@razvancrainea)6442
4. Bogdan-Andrei Iancu (@bogdan-iancu)3132
5. Peter Lemenkov (@lemenkov)3111

(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

2.2. By Commit Activity

Table 2.2. Most recently active contributors(1) to this module

 NameCommit Activity
1. Vlad Patrascu (@rvlad-patrascu)Jul 2015 - Oct 2019
2. Razvan Crainea (@razvancrainea)Aug 2015 - Sep 2019
3. Bogdan-Andrei Iancu (@bogdan-iancu)Apr 2019 - Apr 2019
4. Peter Lemenkov (@lemenkov)Jun 2018 - Jun 2018
5. Liviu Chircu (@liviuchircu)May 2016 - Jun 2018

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

Chapter 3. Documentation

3.1. Contributors

Last edited by: Vlad Patrascu (@rvlad-patrascu), Peter Lemenkov (@lemenkov), Liviu Chircu (@liviuchircu).

Documentation Copyrights:

Copyright © 2015 www.opensips-solutions.com