Documentation

Documentation.Interface-Events-1-7 History

Hide minor edits - Show changes to markup

August 05, 2013, at 03:22 PM by 109.99.235.212 -
Changed line 4 from:

Page for other versions: devel 1.9 1.8 old versions: 1.7

to:

(:allVersions Interface-Events 1.7 :)

May 29, 2013, at 12:16 PM by razvancrainea -
Changed lines 13-14 from:
to:

Changed lines 17-67 from:

Overview

to:

Overview

In order to notify an external application about OpenSIPS internal events, the Event Interface provides the following functions:

  1. manages exported events
  2. manages subscriptions from different applications
  3. exports generic functions to raise an event (regardless the transport protocol used)
  4. sends the event packed in a datagram

Events

There are several types of events that can be exported by OpenSIPS:

  • Core events - internal events that trigger changes of OpenSIPS core/global behavior. A full list of exported core events can be found here.
  • Modules events - events triggered by each module, when loaded. Each module can export zero, one or more events.
  • Custom events - triggered from script using the raise_event() command.

Transport Protocols

External applications can be notified about the events triggered using various transport protocols. While the interface itself is provided by OpenSIPS core, each transport protocol is implemented by a separate OpenSIPS module. Currently, in this version there is only one transport protocol available (but many others pending):

  • event_datagram - sends Datagrams over UDP or UNIX sockets

An external application can subscribe to any of the exported module and can be notified using any of the loaded transport modules/protocols.


Events Subscription

Currently, an external application can only subscribe to an event using the event_subscribe MI command.


Examples

In order to configure a RabbbitMQ server to be notified when a custom event is triggered, first you have to subscribe it to the event through MI, by sending a event_subscribe command.

    # opensipsctl fifo event_subscribe E_SCRIPT_CUSTOM_EVENT udp:127.0.0.1:8888

Then, in order to trigger the event from the script, call the raise_event() command when needed:

   ....
   raise_event("E_SCRIPT_CUSTOM_EVENT");     # raises an event without any parameters
   ...
May 29, 2013, at 10:30 AM by 109.99.235.212 -
Added lines 1-16:
Documentation -> Manuals -> Manual 1.7 -> Events Interface

(:title Events Interface - ver 1.7 :)


Page for other versions: devel 1.9 1.8 old versions: 1.7


Events Interface v1.7
PrevNext

The Events Interface is an OpenSIPS interface that provides different ways to notify external applications about certain events triggered inside OpenSIPS.

Overview


Page last modified on August 05, 2013, at 03:22 PM