Copyright © 2012 www.opensips-solutions.com
Table of Contents
List of Examples
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).
'xmlrpc:' host ':' port ':' method
'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.
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)”.
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)”.
This is an example of an event raised by the pike module when it decides an ip should be blocked:
Example 1.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>