Documentation |
Documentation -> Manuals -> Manual 1.7 -> Events InterfacePages for other versions: devel 3.5 3.4 Older versions: 3.3 3.2 3.1 3.0 2.4 2.3 2.2 2.1 1.11 1.10 1.9 1.8 1.7
The Events Interface is an OpenSIPS interface that provides different ways to notify external applications about certain events triggered inside OpenSIPS. OverviewIn order to notify an external application about OpenSIPS internal events, the Event Interface provides the following functions:
EventsThere are several types of events that can be exported by OpenSIPS:
Transport ProtocolsExternal 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):
An external application can subscribe to any of the exported module and can be notified using any of the loaded transport modules/protocols. Events SubscriptionCurrently, an external application can only subscribe to an event using the event_subscribe MI command. ExamplesIn 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 ... |