event_xmlrpc Module


Table of Contents

1. Admin Guide
1.1. Overview
1.2. XMLRPC socket syntax
1.3. Dependencies
1.3.1. OpenSIPS Modules
1.3.2. External Libraries or Applications
1.4. Exported Parameters
1.4.1. use_struct_param (integer)
1.4.2. sync_mode (integer)
1.5. Exported Functions
1.6. 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. Set use_struct_param parameter
1.2. Set sync_mode parameter
1.3. E_PIKE_BLOCKED event
1.4. XMLRPC socket

Chapter1.Admin Guide

1.1.Overview

This module is an implementation of an XMLRPC client used to notify XMLRPC servers whenever certain notifications are raised by OpenSIPS. It acts as a transport layer for the Event Notification Interface.

Basicly, the module executes a remote procedure call when an event is raised from OpenSIPS's script, core or modules using the Event Interface.

In order to be notified, an XMLRPC server has to subscribe for a certain event provided by OpenSIPS. This can be done using the generic MI Interface (event_subscribe function) or from OpenSIPS script (subscribe_event core function).

1.2.XMLRPC socket syntax

'xmlrpc:' host ':' port ':' method

Meanings:

  • 'xmlrpc:' - informs the Event Interface that the events sent to this subscriber should be handled by the event_xmlrpc module.

  • host - host name of the XMLRPC server.

  • port - port of the XMLRPC server.

  • method - method called remotely by the XMLRPC client.

    NOTE: the client does not wait for a response from the XMLRPC server.

1.3.Dependencies

1.3.1.OpenSIPS Modules

The following modules must be loaded before this module:

  • none.

1.3.2.External Libraries or Applications

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

  • none

1.4.Exported Parameters

1.4.1.use_struct_param (integer)

When raising an event, pack the name and value of the parameters in a XMLRPC structure. This provides an easier way for some XMLRPC server implementations to interpret the parameters. Set it to zero to disable or to non-zero to enable it.

Default value is 0 (disabled).

Example1.1.Set use_struct_param parameter

...
modparam("event_xmlrpc", "use_struct_param", 1)
...

1.4.2.sync_mode (integer)

Specifies whether an event raise operates synchronous or asynchronous relative to the process where the raise is triggered.In synchronous mode the process waits for the status of the raise from the actual worker process.In asynchronous mode the process continues its operation without receiving any confirmation.

Default value is 0 (asynchronous).

Example1.2.Set sync_mode parameter

...
modparam("event_xmlrpc", "sync_mode", 1)
...

1.5.Exported Functions

No function exported to be used from configuration file.

1.6.Example

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

Example1.3.E_PIKE_BLOCKED event



POST /RPC2 HTTP/1.1.
Host: 127.0.0.1:8081.
Connection: close.
User-Agent: OpenSIPS XMLRPC Notifier.
Content-type: text/xml.
Content-length: 240.
		.
<?xml version="1.0"?>
<methodCall>
	<methodName>e_dummy_h</methodName>
	<params>
		<param>
			<value><string>E_MY_EVENT</string></value>
		</param>
		<param>
			<name>ip</name>
			<value><string>192.168.2.11</string></value>
		</param>
	</params>
</methodCall>


Example1.4.XMLRPC socket


	# calls the 'block_ip' function
	xmlrpc:127.0.0.1:8080:block_ip


Chapter2.Contributors

2.1.By Commit Statistics

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

NameDevScoreCommitsLines ++Lines --
1. Razvan Crainea (@razvancrainea)2716122938
2. Liviu Chircu (@liviuchircu)866230
3. Vlad Patrascu (@rvlad-patrascu)6315310
4. Ionut Ionita (@ionutrazvanionita)3110328
5. Ryan Bullock (@rrb3942)2180
6. Bogdan-Andrei Iancu (@bogdan-iancu)2110
7. Maksym Sobolyev (@sobomax)2110

(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

Table2.2.Most recently active contributors(1) to this module

NameCommit Activity
1. Liviu Chircu (@liviuchircu)Oct 2013 - Jun 2018
2. Razvan Crainea (@razvancrainea)May 2012 - Aug 2017
3. Vlad Patrascu (@rvlad-patrascu)Jul 2015 - May 2017
4. Maksym Sobolyev (@sobomax)Feb 2017 - Feb 2017
5. Ionut Ionita (@ionutrazvanionita)Jan 2016 - Jan 2016
6. Bogdan-Andrei Iancu (@bogdan-iancu)Oct 2014 - Oct 2014
7. Ryan Bullock (@rrb3942)Jan 2013 - Jan 2013

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

Chapter3.Documentation

3.1.Contributors

Last edited by: Liviu Chircu (@liviuchircu), Vlad Patrascu (@rvlad-patrascu), Razvan Crainea (@razvancrainea).

Documentation Copyrights:

Copyright 2012 www.opensips-solutions.com