Documentation |
Documentation.Interface-Events-1-8 HistoryHide minor edits - Show changes to output August 05, 2013, at 04:22 PM
by
- Changed line 4 from:
[- Page for other versions: [[Interface-Events|devel]] [[Interface-Events-1-9|1.9]] 1.8 old versions: [[Interface-Events-1-7|1.7]] -] to:
(:allVersions Interface-Events 1.8 :) May 29, 2013, at 01:09 PM
by
- Deleted line 12:
Changed lines 15-72 from:
!!!! Overview to:
!!!! Overview In order to notify an external application about OpenSIPS internal events, the '''Event Interface''' provides the following functions: # manages exported events # manages subscriptions from different applications # exports generic functions to raise an event (regardless the transport protocol used) # communicates with different transport protocols to send the events More detailed information about '''OpenSIPS Event Interface''' can be found in the [[Documentation.Tutorials-EventInterface-1-8| Event Interface Tutorial]]. ---- !!!! 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 [[Documentation.Interface-CoreEvents-1-8 | here]]. * '''Modules events''' - events triggered by each module, when loaded. Each module can export zero, one or more events. Details can be found in the [[Documentation.Modules-1-8 | documentation page]] of each module. * '''Custom events''' - triggered from script using the [[Documentation.Script-CoreFunctions-1-8#raise_event | 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. Multiple transport modules can be loaded simultaneously in order to provide different ways of notifications. Available transport protocols are : * [[http://www.opensips.org/html/docs/modules/1.8.x/event_datagram | event_datagram ]] - sends Datagrams over UDP or UNIX sockets * [[http://www.opensips.org/html/docs/modules/1.8.x/event_rabbitmq | event_rabbitmq ]] - sends an AMQP message to a RabbitMQ server 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 You can subscribe for an event either at startup (using the [[Documentation.Script-CoreFunctions-1-9#subscribe_event | subscribe_event()]] command in the script) or during runtime, using the [[Interface-CoreMI-1-8#event_subscribe | 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, using the [[Documentation.Script-CoreFunctions-1-8#subscribe_event | subscribe_event()]] command: [@ startup_route { subscribe_event("E_SCRIPT_CUSTOM_EVENT", "rabbitmq:127.0.0.1/opensips"); } @] Then, in order to trigger the event from the script, call the [[Documentation.Script-CoreFunctions-1-8#raise_event | raise_event()]] command when needed: [@ .... raise_event("E_SCRIPT_CUSTOM_EVENT"); # raises an event without any parameters ... @] May 29, 2013, at 11:29 AM
by
- Added lines 1-16:
!!!!!Documentation -> [[Documentation.Manuals|Manuals]] -> [[Documentation.Manual-1-8|Manual 1.8]] -> Events Interface (:title Events Interface - ver 1.8 :) ---- [- Page for other versions: [[Interface-Events|devel]] [[Interface-Events-1-9|1.9]] 1.8 old versions: [[Interface-Events-1-7|1.7]] -] \\ || %color=#185662%[+'''Events Interface v1.8'''+]%% || ||[[Interface-CoreMI-1-8|Prev]] || [[Interface-CoreEvents-1-8|Next]]|| ---- The '''Events Interface''' is an OpenSIPS interface that provides different ways to notify external applications about certain events triggered inside OpenSIPS. !!!! Overview |