Thu Apr 28 2011 17:13:54

Asterisk developer's documentation


event_defs.h File Reference

Generic event system. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ast_event_iterator
 supposed to be an opaque type More...

Defines

#define AST_EVENT_IE_MAX   AST_EVENT_IE_EID

Enumerations

enum  ast_event_ie_pltype {
  AST_EVENT_IE_PLTYPE_UNKNOWN = -1, AST_EVENT_IE_PLTYPE_EXISTS, AST_EVENT_IE_PLTYPE_UINT, AST_EVENT_IE_PLTYPE_STR,
  AST_EVENT_IE_PLTYPE_RAW
}
 

Payload types for event information elements.

More...
enum  ast_event_ie_type {
  AST_EVENT_IE_END = -1, AST_EVENT_IE_NEWMSGS = 0x01, AST_EVENT_IE_OLDMSGS = 0x02, AST_EVENT_IE_MAILBOX = 0x03,
  AST_EVENT_IE_UNIQUEID = 0x04, AST_EVENT_IE_EVENTTYPE = 0x05, AST_EVENT_IE_EXISTS = 0x06, AST_EVENT_IE_DEVICE = 0x07,
  AST_EVENT_IE_STATE = 0x08, AST_EVENT_IE_CONTEXT = 0x09, AST_EVENT_IE_EID = 0x0A
}
 

Event Information Element types.

More...
enum  ast_event_subscriber_res { AST_EVENT_SUB_NONE, AST_EVENT_SUB_EXISTS }
 

Results for checking for subscribers.

More...
enum  ast_event_type {
  AST_EVENT_ALL = 0x00, AST_EVENT_CUSTOM = 0x01, AST_EVENT_MWI = 0x02, AST_EVENT_SUB = 0x03,
  AST_EVENT_UNSUB = 0x04, AST_EVENT_DEVICE_STATE = 0x05, AST_EVENT_DEVICE_STATE_CHANGE = 0x06, AST_EVENT_TOTAL = 0x07
}
 

Event types.

More...

Detailed Description

Generic event system.

Author:
Russell Bryant <russell@digium.com>

Definition in file event_defs.h.


Define Documentation


Enumeration Type Documentation

Payload types for event information elements.

Enumerator:
AST_EVENT_IE_PLTYPE_UNKNOWN 
AST_EVENT_IE_PLTYPE_EXISTS 

Just check if it exists, not the value

AST_EVENT_IE_PLTYPE_UINT 

Unsigned Integer (Can be used for signed, too ...)

AST_EVENT_IE_PLTYPE_STR 

String

AST_EVENT_IE_PLTYPE_RAW 

Raw data, compared with memcmp

Definition at line 130 of file event_defs.h.

                         {
   AST_EVENT_IE_PLTYPE_UNKNOWN = -1,
   /*! Just check if it exists, not the value */
   AST_EVENT_IE_PLTYPE_EXISTS,
   /*! Unsigned Integer (Can be used for signed, too ...) */
   AST_EVENT_IE_PLTYPE_UINT,
   /*! String */
   AST_EVENT_IE_PLTYPE_STR,
   /*! Raw data, compared with memcmp */
   AST_EVENT_IE_PLTYPE_RAW,
};

Event Information Element types.

Enumerator:
AST_EVENT_IE_END 

Used to terminate the arguments to event functions

AST_EVENT_IE_NEWMSGS 

Number of new messages Used by: AST_EVENT_MWI Payload type: UINT.

AST_EVENT_IE_OLDMSGS 

Number of Used by: AST_EVENT_MWI Payload type: UINT.

AST_EVENT_IE_MAILBOX 

Mailbox name.

(mailbox[@context]) 

Used by: AST_EVENT_MWI Payload type: STR

AST_EVENT_IE_UNIQUEID 

Unique ID Used by: AST_EVENT_SUB, AST_EVENT_UNSUB Payload type: UINT.

AST_EVENT_IE_EVENTTYPE 

Event type Used by: AST_EVENT_SUB, AST_EVENT_UNSUB Payload type: UINT.

AST_EVENT_IE_EXISTS 

Hint that someone cares that an IE exists Used by: AST_EVENT_SUB Payload type: UINT (ast_event_ie_type)

AST_EVENT_IE_DEVICE 

Device Name Used by AST_EVENT_DEVICE_STATE_CHANGE Payload type: STR.

AST_EVENT_IE_STATE 

Generic State IE Used by AST_EVENT_DEVICE_STATE_CHANGE Payload type: UINT The actual state values depend on the event which this IE is a part of.

AST_EVENT_IE_CONTEXT 

Context IE Used by AST_EVENT_MWI Payload type: str.

AST_EVENT_IE_EID 

Entity ID Used by All events Payload type: RAW This IE indicates which server the event originated from.

Definition at line 56 of file event_defs.h.

                       {
   /*! Used to terminate the arguments to event functions */
   AST_EVENT_IE_END       = -1,

   /*! 
    * \brief Number of new messages
    * Used by: AST_EVENT_MWI 
    * Payload type: UINT
    */
   AST_EVENT_IE_NEWMSGS   = 0x01,
   /*! 
    * \brief Number of
    * Used by: AST_EVENT_MWI 
    * Payload type: UINT
    */
   AST_EVENT_IE_OLDMSGS   = 0x02,
   /*! 
    * \brief Mailbox name \verbatim (mailbox[@context]) \endverbatim
    * Used by: AST_EVENT_MWI 
    * Payload type: STR
    */
   AST_EVENT_IE_MAILBOX   = 0x03,
   /*! 
    * \brief Unique ID
    * Used by: AST_EVENT_SUB, AST_EVENT_UNSUB
    * Payload type: UINT
    */
   AST_EVENT_IE_UNIQUEID  = 0x04,
   /*! 
    * \brief Event type 
    * Used by: AST_EVENT_SUB, AST_EVENT_UNSUB
    * Payload type: UINT
    */
   AST_EVENT_IE_EVENTTYPE = 0x05,
   /*!
    * \brief Hint that someone cares that an IE exists
    * Used by: AST_EVENT_SUB
    * Payload type: UINT (ast_event_ie_type)
    */
   AST_EVENT_IE_EXISTS    = 0x06,
   /*!
    * \brief Device Name
    * Used by AST_EVENT_DEVICE_STATE_CHANGE
    * Payload type: STR
    */
   AST_EVENT_IE_DEVICE    = 0x07,
   /*!
    * \brief Generic State IE
    * Used by AST_EVENT_DEVICE_STATE_CHANGE
    * Payload type: UINT
    * The actual state values depend on the event which
    * this IE is a part of.
    */
    AST_EVENT_IE_STATE    = 0x08,
    /*!
     * \brief Context IE
     * Used by AST_EVENT_MWI
     * Payload type: str
     */
    AST_EVENT_IE_CONTEXT  = 0x09,
    /*!
     * \brief Entity ID
     * Used by All events
     * Payload type: RAW
     * This IE indicates which server the event originated from
     */
    AST_EVENT_IE_EID      = 0x0A,
};

Results for checking for subscribers.

ast_event_check_subscriber()

Enumerator:
AST_EVENT_SUB_NONE 

No subscribers exist

AST_EVENT_SUB_EXISTS 

At least one subscriber exists

Definition at line 147 of file event_defs.h.

                              {
   /*! No subscribers exist */
   AST_EVENT_SUB_NONE,
   /*! At least one subscriber exists */
   AST_EVENT_SUB_EXISTS,
};

Event types.

Note:
These values can *never* change.
Enumerator:
AST_EVENT_ALL 

Reserved to provide the ability to subscribe to all events. A specific event should never have a payload of 0.

AST_EVENT_CUSTOM 

This event type is reserved for use by third-party modules to create custom events without having to modify this file.

Note:
There are no "custom" IE types, because IEs only have to be unique to the event itself, not necessarily across all events.
AST_EVENT_MWI 

Voicemail message waiting indication

AST_EVENT_SUB 

Someone has subscribed to events

AST_EVENT_UNSUB 

Someone has unsubscribed from events

AST_EVENT_DEVICE_STATE 

The aggregate state of a device across all servers configured to be a part of a device state cluster has changed.

AST_EVENT_DEVICE_STATE_CHANGE 

The state of a device has changed on _one_ server. This should not be used directly, in general. Use AST_EVENT_DEVICE_STATE instead.

AST_EVENT_TOTAL 

Number of event types. This should be the last event type + 1

Definition at line 30 of file event_defs.h.

                    {
   /*! Reserved to provide the ability to subscribe to all events.  A specific
    *  event should never have a payload of 0. */
   AST_EVENT_ALL                 = 0x00,
   /*! This event type is reserved for use by third-party modules to create
    *  custom events without having to modify this file. 
    *  \note There are no "custom" IE types, because IEs only have to be
    *  unique to the event itself, not necessarily across all events. */
   AST_EVENT_CUSTOM              = 0x01,
   /*! Voicemail message waiting indication */
   AST_EVENT_MWI                 = 0x02,
   /*! Someone has subscribed to events */
   AST_EVENT_SUB                 = 0x03,
   /*! Someone has unsubscribed from events */
   AST_EVENT_UNSUB               = 0x04,
   /*! The aggregate state of a device across all servers configured to be
    *  a part of a device state cluster has changed. */
   AST_EVENT_DEVICE_STATE        = 0x05,
   /*! The state of a device has changed on _one_ server.  This should not be used
    *  directly, in general.  Use AST_EVENT_DEVICE_STATE instead. */
   AST_EVENT_DEVICE_STATE_CHANGE = 0x06,
   /*! Number of event types.  This should be the last event type + 1 */
   AST_EVENT_TOTAL               = 0x07,
};