[asterisk-commits] mmichelson: branch group/manager2 r121647 - in /team/group/manager2: ./ apps/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 10 14:40:10 CDT 2008


Author: mmichelson
Date: Tue Jun 10 14:40:10 2008
New Revision: 121647

URL: http://svn.digium.com/view/asterisk?view=rev&rev=121647
Log:
Resolve and reset


Added:
    team/group/manager2/configs/ais.conf.sample
      - copied unchanged from r121559, trunk/configs/ais.conf.sample
    team/group/manager2/doc/distributed_devstate.txt
      - copied unchanged from r121559, trunk/doc/distributed_devstate.txt
    team/group/manager2/res/ais/
      - copied from r121559, trunk/res/ais/
    team/group/manager2/res/ais/ais.h
      - copied unchanged from r121559, trunk/res/ais/ais.h
    team/group/manager2/res/ais/amf.c
      - copied unchanged from r121559, trunk/res/ais/amf.c
    team/group/manager2/res/ais/ckpt.c
      - copied unchanged from r121559, trunk/res/ais/ckpt.c
    team/group/manager2/res/ais/clm.c
      - copied unchanged from r121559, trunk/res/ais/clm.c
    team/group/manager2/res/ais/evt.c
      - copied unchanged from r121559, trunk/res/ais/evt.c
    team/group/manager2/res/ais/lck.c
      - copied unchanged from r121559, trunk/res/ais/lck.c
    team/group/manager2/res/res_ais.c
      - copied unchanged from r121559, trunk/res/res_ais.c
Modified:
    team/group/manager2/   (props changed)
    team/group/manager2/CHANGES
    team/group/manager2/apps/app_queue.c
    team/group/manager2/include/asterisk/event.h
    team/group/manager2/include/asterisk/event_defs.h
    team/group/manager2/main/devicestate.c
    team/group/manager2/main/event.c
    team/group/manager2/main/pbx.c
    team/group/manager2/res/Makefile
    team/group/manager2/res/res_manager2.c

Propchange: team/group/manager2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jun 10 14:40:10 2008
@@ -1,1 +1,1 @@
-/trunk:1-121513
+/trunk:1-121591

Modified: team/group/manager2/CHANGES
URL: http://svn.digium.com/view/asterisk/team/group/manager2/CHANGES?view=diff&rev=121647&r1=121646&r2=121647
==============================================================================
--- team/group/manager2/CHANGES (original)
+++ team/group/manager2/CHANGES Tue Jun 10 14:40:10 2008
@@ -1,6 +1,17 @@
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.6.0 to Asterisk 1.6.1  -------------
 ------------------------------------------------------------------------------
+
+Device State Handling
+---------------------
+ * The event infrastructure in Asterisk got another big update to help support
+    distributed events.  It currently supports distributed device state and
+    distributed Voicemail MWI (Message Waiting Indication).  A new module has
+    been merged, res_ais, which facilitates communicating events between servers.
+    It uses the SAForum AIS (Service Availability Forum Application Interface
+    Specification) CLM (Cluster Management) and EVT (Event) services to maintain
+    a cluster of Asterisk servers, and to share events between them.  For more
+    information on setting this up, see doc/distributed_devstate.txt.
 
 Dialplan Functions
 ------------------
@@ -17,9 +28,9 @@
  * TIMEOUT() has been modified to be accurate down to the millisecond.
  * ENUM*() functions now include the following new options:
      - 'u' returns the full URI and does not strip off the URI-scheme.
-	 - 's' triggers ISN specific rewriting
-	 - 'i' looks for branches into an Infrastructure ENUM tree
-	 - 'd' for a direct DNS lookup without any flipping of digits.
+     - 's' triggers ISN specific rewriting
+     - 'i' looks for branches into an Infrastructure ENUM tree
+     - 'd' for a direct DNS lookup without any flipping of digits.
  * TXCIDNAME() has a new zone-suffix parameter (which defaults to 'e164.arpa')
  * CHANNEL() now has options for the maximum, minimum, and standard or normal
    deviation of jitter, rtt, and loss for a call using chan_sip.
@@ -116,9 +127,9 @@
      which shows which configuration files are in use.
   * New CLI commands, "pri show version" and "ss7 show version" that will
      display which version of libpri and libss7 are being used, respectively.
-	 A new API call was added so trunk will now have to be compiled against
-	 a versions of libpri and libss7 that have them or it will not know that
-	 these libraries exist.
+     A new API call was added so trunk will now have to be compiled against
+     a versions of libpri and libss7 that have them or it will not know that
+     these libraries exist.
 
 DNS manager changes
 -------------------
@@ -443,10 +454,10 @@
      a web interface of some kind).
   * Added the support for marking messages as "urgent." There are two methods to accomplish
      this. One is to pass the 'U' option to VoiceMail(). Another way to mark a message as urgent
-	 is to specify "review=yes" in voicemail.conf. Doing this will cause allow the user to mark
-	 the message as urgent after he has recorded a voicemail by following the voice instructions.
-	When listening to voicemails using VoiceMailMain urgent messages will be presented before other
-	 messages
+     is to specify "review=yes" in voicemail.conf. Doing this will cause allow the user to mark
+     the message as urgent after he has recorded a voicemail by following the voice instructions.
+    When listening to voicemails using VoiceMailMain urgent messages will be presented before other
+     messages
 
 Queue changes
 -------------
@@ -480,18 +491,18 @@
     device state reported.
   * New configuration option: randomperiodicannounce. If a list of periodic announcements is
     specified by the periodic-announce option, then one will be chosen randomly when it is time
-	to play a periodic announcment
+    to play a periodic announcment
   * New configuration options: announce-position now takes two more values in addition to "yes" and
     "no." Two new options, "limit" and "more," are allowed. These are tied to another option,
-	announce-position-limit. By setting announce-position to "limit" callers will only have their
-	position announced if their position is less than what is specified by announce-position-limit.
-	If announce-position is set to "more" then callers beyond the position specified by announce-position-limit
-	will be told that their are more than announce-position-limit callers waiting.
+    announce-position-limit. By setting announce-position to "limit" callers will only have their
+    position announced if their position is less than what is specified by announce-position-limit.
+    If announce-position is set to "more" then callers beyond the position specified by announce-position-limit
+    will be told that their are more than announce-position-limit callers waiting.
   * Two new queue log events have been added. An ADDMEMBER event will be logged
     when a realtime queue member is added and a REMOVEMEMBER event will be logged
-	when a realtime queue member is removed. Since there is no calling channel associated
-	with these events, the string "REALTIME" is placed where the channel's unique id
-	is typically placed.
+    when a realtime queue member is removed. Since there is no calling channel associated
+    with these events, the string "REALTIME" is placed where the channel's unique id
+    is typically placed.
 
 MeetMe Changes
 --------------
@@ -761,7 +772,7 @@
   * iLBC source code no longer included (see UPGRADE.txt for details)
   * If compiled with DETECT_DEADLOCKS enabled and if you have glibc, then if 
      deadlock is detected, a backtrace of the stack which led to the lock calls
-	 will be output to the CLI.
+     will be output to the CLI.
   * If compiled with DEBUG_THREADS enabled and if you have glibc, then issuing
      the "core show locks" CLI command will give lock information output as well
-	 as a backtrace of the stack which led to the lock calls.
+     as a backtrace of the stack which led to the lock calls.

Modified: team/group/manager2/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/group/manager2/apps/app_queue.c?view=diff&rev=121647&r1=121646&r2=121647
==============================================================================
--- team/group/manager2/apps/app_queue.c (original)
+++ team/group/manager2/apps/app_queue.c Tue Jun 10 14:40:10 2008
@@ -6350,8 +6350,10 @@
 		ast_log(LOG_WARNING, "devicestate taskprocessor reference failed - devicestate notifications will not occur\n");
 	}
 
-	if (!(device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE, device_state_cb, NULL, AST_EVENT_IE_END)))
+	if (!(device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE_CHANGE, device_state_cb, NULL, AST_EVENT_IE_END))) {
 		res = -1;
+	}
+
 	ast_realtime_require_field("queue_members", "paused", RQ_INTEGER1, 1, "uniqueid", RQ_UINTEGER2, 5, NULL);
 
 	return res ? AST_MODULE_LOAD_DECLINE : 0;

Modified: team/group/manager2/include/asterisk/event.h
URL: http://svn.digium.com/view/asterisk/team/group/manager2/include/asterisk/event.h?view=diff&rev=121647&r1=121646&r2=121647
==============================================================================
--- team/group/manager2/include/asterisk/event.h (original)
+++ team/group/manager2/include/asterisk/event.h Tue Jun 10 14:40:10 2008
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 2007, Digium, Inc.
+ * Copyright (C) 2007 - 2008, Digium, Inc.
  *
  * Russell Bryant <russell at digium.com>
  *
@@ -152,14 +152,110 @@
 	ast_event_cb_t cb, void *userdata, ...);
 
 /*!
+ * \brief Allocate a subscription, but do not activate it
+ *
+ * \arg type the event type to subscribe to
+ * \arg cb the function to call when an event matches this subscription
+ * \arg userdata data to pass to the provided callback
+ *
+ * This function should be used when you want to dynamically build a
+ * subscription.
+ *
+ * \return the allocated subscription, or NULL on failure
+ */
+struct ast_event_sub *ast_event_subscribe_new(enum ast_event_type type, 
+	ast_event_cb_t cb, void *userdata);
+
+/*!
+ * \brief Destroy an allocated subscription
+ *
+ * \arg sub the subscription to destroy
+ *
+ * This function should be used when a subscription is allocated with
+ * ast_event_subscribe_new(), but for some reason, you want to destroy it
+ * instead of activating it.  This could be because of an error when
+ * reading in the configuration for the dynamically built subscription.
+ */
+void ast_event_sub_destroy(struct ast_event_sub *sub);
+
+/*!
+ * \brief Append a uint parameter to a subscription
+ *
+ * \arg sub the dynamic subscription allocated with ast_event_subscribe_new()
+ * \arg ie_type the information element type for the parameter
+ * \arg uint the value that must be present in the event to match this subscription
+ *
+ * \retval 0 success
+ * \retval non-zero failure
+ */
+int ast_event_sub_append_ie_uint(struct ast_event_sub *sub,
+	enum ast_event_ie_type ie_type, uint32_t uint);
+
+/*!
+ * \brief Append a string parameter to a subscription
+ *
+ * \arg sub the dynamic subscription allocated with ast_event_subscribe_new()
+ * \arg ie_type the information element type for the parameter
+ * \arg str the string that must be present in the event to match this subscription
+ *
+ * \retval 0 success
+ * \retval non-zero failure
+ */
+int ast_event_sub_append_ie_str(struct ast_event_sub *sub, 	
+	enum ast_event_ie_type ie_type, const char *str);
+
+/*!
+ * \brief Append a raw parameter to a subscription
+ *
+ * \arg sub the dynamic subscription allocated with ast_event_subscribe_new()
+ * \arg ie_type the information element type for the parameter
+ * \arg raw the data that must be present in the event to match this subscription
+ *
+ * \retval 0 success
+ * \retval non-zero failure
+ */
+int ast_event_sub_append_ie_raw(struct ast_event_sub *sub, 	
+	enum ast_event_ie_type ie_type, void *data, size_t raw_datalen);
+
+/*!
+ * \brief Append an 'exists' parameter to a subscription
+ *
+ * \arg sub the dynamic subscription allocated with ast_event_subscribe_new()
+ * \arg ie_type the information element type that must be present in the event
+ *      for it to match this subscription.
+ *
+ * \retval 0 success
+ * \retval non-zero failure
+ */
+int ast_event_sub_append_ie_exists(struct ast_event_sub *sub, 	
+	enum ast_event_ie_type ie_type);
+
+/*!
+ * \brief Activate a dynamically built subscription
+ *
+ * \arg sub the subscription to activate that was allocated using
+ *      ast_event_subscribe_new()
+ *
+ * Once a dynamically built subscription has had all of the parameters added 
+ * to it, it should be activated using this function.
+ *
+ * \retval 0 success
+ * \retval non-zero failure
+ */
+int ast_event_sub_activate(struct ast_event_sub *sub);
+
+/*!
  * \brief Un-subscribe from events
  *
  * \param event_sub This is the reference to the subscription returned by
  *        ast_event_subscribe.
- * 
- * \return Nothing
- */
-void ast_event_unsubscribe(struct ast_event_sub *event_sub);
+ *
+ * This function will remove a subscription and free the associated data
+ * structures.
+ *
+ * \return NULL for convenience.
+ */
+struct ast_event_sub *ast_event_unsubscribe(struct ast_event_sub *event_sub);
 
 /*!
  * \brief Check if subscribers exist
@@ -215,6 +311,9 @@
  * all of the subscriptions to that event type that already exist.
  */
 void ast_event_report_subs(const struct ast_event_sub *sub);
+
+/*! \brief Dump the event cache for the subscriber */
+void ast_event_dump_cache(const struct ast_event_sub *event_sub);
 
 /*!
  * \brief Create a new event
@@ -450,6 +549,24 @@
 const void *ast_event_get_ie_raw(const struct ast_event *event, enum ast_event_ie_type ie_type);
 
 /*!
+ * \brief Get the string representation of an information element type
+ *
+ * \arg ie_type the information element type to get the string representation of
+ *
+ * \return the string representation of the information element type
+ */
+const char *ast_event_get_ie_type_name(enum ast_event_ie_type ie_type);
+
+/*!
+ * \brief Get the payload type for a given information element type
+ *
+ * \arg ie_type the information element type to get the payload type of
+ *
+ * \return the payload type for the provided IE type
+ */
+enum ast_event_ie_pltype ast_event_get_ie_pltype(enum ast_event_ie_type ie_type);
+
+/*!
  * \brief Get the type for an event
  *
  * \param event the event to get the type for
@@ -458,6 +575,46 @@
  *         ast_event_type enum
  */
 enum ast_event_type ast_event_get_type(const struct ast_event *event);
+
+/*!
+ * \brief Get the string representation of the type of the given event
+ *
+ * \arg event the event to get the type of
+ *
+ * \return the string representation of the event type of the provided event
+ */
+const char *ast_event_get_type_name(const struct ast_event *event);
+
+/*!
+ * \brief Convert a string into an event type
+ *
+ * \arg str the string to convert
+ * \arg event_type an output parameter for the event type
+ *
+ * \retval 0 success
+ * \retval non-zero failure
+ */
+int ast_event_str_to_event_type(const char *str, enum ast_event_type *event_type);
+
+/*!
+ * \brief Convert a string to an IE type
+ *
+ * \arg str the string to convert
+ * \arg ie_type an output parameter for the IE type
+ *
+ * \retval 0 success
+ * \retval non-zero failure
+ */
+int ast_event_str_to_ie_type(const char *str, enum ast_event_ie_type *ie_type);
+
+/*!
+ * \brief Get the size of an event
+ *
+ * \param event the event to get the size of
+ *
+ * \return the number of bytes contained in the event
+ */
+size_t ast_event_get_size(const struct ast_event *event);
 
 /*!
  * \brief Initialize an event iterator instance

Modified: team/group/manager2/include/asterisk/event_defs.h
URL: http://svn.digium.com/view/asterisk/team/group/manager2/include/asterisk/event_defs.h?view=diff&rev=121647&r1=121646&r2=121647
==============================================================================
--- team/group/manager2/include/asterisk/event_defs.h (original)
+++ team/group/manager2/include/asterisk/event_defs.h Tue Jun 10 14:40:10 2008
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 2007, Digium, Inc.
+ * Copyright (C) 2007 - 2008, Digium, Inc.
  *
  * Russell Bryant <russell at digium.com>
  *
@@ -44,21 +44,22 @@
 	AST_EVENT_UNSUB = 4,
 	/*! The state of a device has changed */
 	AST_EVENT_DEVICE_STATE = 5,
+	AST_EVENT_DEVICE_STATE_CHANGE = 6,
 	/*! This block of events is for queue shit */
-	AST_EVENT_QUEUE_MEMBER_STATUS = 6,
-	AST_EVENT_QUEUE_JOIN = 7,
-	AST_EVENT_QUEUE_LEAVE = 8,
-	AST_EVENT_QUEUE_MEMBER_CALLED = 9,
-	AST_EVENT_QUEUE_CALLER_ABANDON = 10,
-	AST_EVENT_QUEUE_MEMBER_COMPLETE = 11,
-	AST_EVENT_QUEUE_MEMBER_DUMP = 12,
-	AST_EVENT_QUEUE_MEMBER_CONNECT = 13,
-	AST_EVENT_QUEUE_MEMBER_REMOVED = 14,
-	AST_EVENT_QUEUE_MEMBER_ADDED = 15,
-	AST_EVENT_QUEUE_MEMBER_PAUSED = 16,
-	AST_EVENT_QUEUE_MEMBER_PENALTY = 17,
+	AST_EVENT_QUEUE_MEMBER_STATUS = 7,
+	AST_EVENT_QUEUE_JOIN = 8,
+	AST_EVENT_QUEUE_LEAVE = 9,
+	AST_EVENT_QUEUE_MEMBER_CALLED = 10,
+	AST_EVENT_QUEUE_CALLER_ABANDON = 11,
+	AST_EVENT_QUEUE_MEMBER_COMPLETE = 12,
+	AST_EVENT_QUEUE_MEMBER_DUMP = 13,
+	AST_EVENT_QUEUE_MEMBER_CONNECT = 14,
+	AST_EVENT_QUEUE_MEMBER_REMOVED = 15,
+	AST_EVENT_QUEUE_MEMBER_ADDED = 16,
+	AST_EVENT_QUEUE_MEMBER_PAUSED = 17,
+	AST_EVENT_QUEUE_MEMBER_PENALTY = 18,
 	/*! Number of event types.  This should be the last event type + 1 */
-	AST_EVENT_TOTAL = 18,
+	AST_EVENT_TOTAL = 19,
 };
 
 
@@ -105,13 +106,13 @@
 	AST_EVENT_IE_EXISTS    = 0x06,
 	/*!
 	 * \brief Device Name
-	 * Used by AST_EVENT_DEVICE_STATE
+	 * 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
+	 * 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.
@@ -123,68 +124,80 @@
 	  * 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,
 	 /*! Queue's name, string */
-	 AST_EVENT_IE_QUEUE_NAME = 0x0A,
+	 AST_EVENT_IE_QUEUE_NAME = 0x0B,
 	 /*! Member name, string */
-	 AST_EVENT_IE_QUEUE_MEMBERNAME = 0x0B,
+	 AST_EVENT_IE_QUEUE_MEMBERNAME = 0x0C,
 	 /*! Member penalty, int */
-	 AST_EVENT_IE_QUEUE_PENALTY = 0x0C,
+	 AST_EVENT_IE_QUEUE_PENALTY = 0x0D,
 	 /*! Number of calls taken, int */
-	 AST_EVENT_IE_QUEUE_CALLS = 0x0D,
+	 AST_EVENT_IE_QUEUE_CALLS = 0x0E,
 	 /*! Time of last call, int */
-	 AST_EVENT_IE_QUEUE_LASTCALL = 0x0E,
+	 AST_EVENT_IE_QUEUE_LASTCALL = 0x0F,
 	 /*! Paused status, int */
-	 AST_EVENT_IE_QUEUE_PAUSED = 0x0F,
+	 AST_EVENT_IE_QUEUE_PAUSED = 0x10,
 	 /*! Queue caller's channel name, string */
-	 AST_EVENT_IE_SOURCE_CHANNEL = 0x10,
+	 AST_EVENT_IE_SOURCE_CHANNEL = 0x11,
 	 /*! Queue caller's callerid number, string */
-	 AST_EVENT_IE_CALLERIDNUM = 0x11,
+	 AST_EVENT_IE_CALLERIDNUM = 0x12,
 	 /*! Queue caller's callerid name, string */
-	 AST_EVENT_IE_CALLERIDNAME = 0x12,
+	 AST_EVENT_IE_CALLERIDNAME = 0x13,
 	 /*! Queue caller's position, int */
-	 AST_EVENT_IE_QUEUE_POSITION = 0x13,
+	 AST_EVENT_IE_QUEUE_POSITION = 0x14,
 	 /*! Number of callers in queue, int */
-	 AST_EVENT_IE_QUEUE_COUNT = 0x14,
+	 AST_EVENT_IE_QUEUE_COUNT = 0x15,
 	 /*! Uniqueid of queue caller's channel, string */
-	 AST_EVENT_IE_SOURCE_UNIQUEID = 0x15,
+	 AST_EVENT_IE_SOURCE_UNIQUEID = 0x16,
 	 /*! Membership of queue member, string */
-	 AST_EVENT_IE_QUEUE_MEMBERSHIP = 0x16, /* static, dynamic, or realtime */
+	 AST_EVENT_IE_QUEUE_MEMBERSHIP = 0x17, /* static, dynamic, or realtime */
 	 /*! Member channel name, string */
-	 AST_EVENT_IE_DESTINATION_CHANNEL = 0x17,
+	 AST_EVENT_IE_DESTINATION_CHANNEL = 0x18,
 	 /*! Queue extension, string */
-	 AST_EVENT_IE_EXTENSION = 0x18,
+	 AST_EVENT_IE_EXTENSION = 0x19,
 	 /*! Queue dialplan priority, int */
-	 AST_EVENT_IE_PRIORITY = 0x19,
+	 AST_EVENT_IE_PRIORITY = 0x1A,
 	 /*! Original position of queue caller, int */
-	 AST_EVENT_IE_QUEUE_ORIGINAL_POSITION = 0x1A,
+	 AST_EVENT_IE_QUEUE_ORIGINAL_POSITION = 0x1B,
 	 /*! Queue's holdtime, int */
-	 AST_EVENT_IE_QUEUE_HOLDTIME = 0x1B,
+	 AST_EVENT_IE_QUEUE_HOLDTIME = 0x1C,
 	 /*! Amount of time spent talking to queue member, int */
-	 AST_EVENT_IE_QUEUE_TALKTIME = 0x1C,
+	 AST_EVENT_IE_QUEUE_TALKTIME = 0x1D,
 	 /*! Reason the call ended, int */
-	 AST_EVENT_IE_QUEUE_REASON = 0x1D,
+	 AST_EVENT_IE_QUEUE_REASON = 0x1E,
 	 /*! Amount of time queue call rang, int */
-	 AST_EVENT_IE_QUEUE_RINGTIME = 0x1E,
+	 AST_EVENT_IE_QUEUE_RINGTIME = 0x1F,
 	 /*! Member channel's uniqueid, string */
-	 AST_EVENT_IE_DESTINATION_UNIQUEID = 0x1F,
+	 AST_EVENT_IE_DESTINATION_UNIQUEID = 0x20,
 	 /*! Channel variable */
-	 AST_EVENT_IE_CHANVAR = 0x20,
+	 AST_EVENT_IE_CHANVAR = 0x21,
 	 /*! A file descriptor */
-	 AST_EVENT_IE_FD = 0x21,
+	 AST_EVENT_IE_FD = 0x22,
 	 /*! A username */
-	 AST_EVENT_IE_USERNAME = 0x22,
-	 AST_EVENT_IE_LAST = 0x23,
-};
+	 AST_EVENT_IE_USERNAME = 0x23,
+	 AST_EVENT_IE_LAST = 0x24,
+};
+#define AST_EVENT_IE_MAX AST_EVENT_IE_EID
+
 /*!
  * \brief Payload types for event information elements
  */
 enum ast_event_ie_pltype {
+	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,
 };
 
 
@@ -204,9 +217,10 @@
 struct ast_event_ie;
 struct ast_event_sub;
 
-/*I had to define the ast_event_iterator structure
- * fully here in this file so that its size could be
- * known. It is designed not to be directly accessed though
+/*!
+ * \brief supposed to be an opaque type
+ *
+ * This is only here so that it can be declared on the stack.
  */
 struct ast_event_iterator {
 	uint16_t event_len;

Modified: team/group/manager2/main/devicestate.c
URL: http://svn.digium.com/view/asterisk/team/group/manager2/main/devicestate.c?view=diff&rev=121647&r1=121646&r2=121647
==============================================================================
--- team/group/manager2/main/devicestate.c (original)
+++ team/group/manager2/main/devicestate.c Tue Jun 10 14:40:10 2008
@@ -1,9 +1,10 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 1999 - 2007, Digium, Inc.
+ * Copyright (C) 1999 - 2008, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
+ * Russell Bryant <russell at digium.com>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -20,13 +21,17 @@
  *
  * \brief Device state management
  *
- *
  * \author Mark Spencer <markster at digium.com> 
+ * \author Russell Bryant <russell at digium.com>
  *
  *	\arg \ref AstExtState
  */
 
 /*! \page AstExtState Extension and device states in Asterisk
+ *
+ * (Note that these descriptions of device states and extension
+ * states have not been updated to the way things work
+ * in Asterisk 1.6.)
  *
  *	Asterisk has an internal system that reports states
  *	for an extension. By using the dialplan priority -1,
@@ -169,6 +174,23 @@
 	 *  We only want to cache results from device state providers that are being nice
 	 *  and pushing state change events up to us as they happen. */
 	CACHE_OFF,
+};
+
+struct devstate_change {
+	AST_LIST_ENTRY(devstate_change) entry;
+	uint32_t state;
+	struct ast_eid eid;
+	char device[1];
+};
+
+struct {
+	pthread_t thread;
+	struct ast_event_sub *event_sub;
+	ast_cond_t cond;
+	ast_mutex_t lock;
+	AST_LIST_HEAD_NOLOCK(, devstate_change) devstate_change_q;
+} devstate_collector = {
+	.thread = AST_PTHREADT_NULL,
 };
 
 /* Forward declarations */
@@ -271,7 +293,7 @@
 	enum ast_device_state res = AST_DEVICE_UNKNOWN;
 	struct ast_event *event;
 
-	event = ast_event_get_cached(AST_EVENT_DEVICE_STATE,
+	event = ast_event_get_cached(AST_EVENT_DEVICE_STATE_CHANGE,
 		AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, device,
 		AST_EVENT_IE_END);
 
@@ -383,7 +405,6 @@
 	struct devstate_prov *devprov;
 	int res = AST_DEVICE_INVALID;
 
-
 	AST_RWLIST_RDLOCK(&devstate_provs);
 	AST_RWLIST_TRAVERSE(&devstate_provs, devprov, list) {
 		ast_debug(5, "Checking provider %s with %s\n", devprov->label, provider);
@@ -394,6 +415,7 @@
 		}
 	}
 	AST_RWLIST_UNLOCK(&devstate_provs);
+
 	return res;
 }
 
@@ -401,7 +423,9 @@
 {
 	struct ast_event *event;
 
-	if (!(event = ast_event_new(AST_EVENT_DEVICE_STATE,
+	ast_debug(1, "device '%s' state '%d'\n", device, state);
+
+	if (!(event = ast_event_new(AST_EVENT_DEVICE_STATE_CHANGE,
 			AST_EVENT_IE_DEVICE, device,
 			AST_EVENT_IE_STATE, state,
 			AST_EVENT_IE_END))) {
@@ -413,6 +437,7 @@
 		 * device name if it exists. */
 		ast_event_queue_and_cache(event,
 			AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR,
+			AST_EVENT_IE_EID, AST_EVENT_IE_PLTYPE_RAW, sizeof(struct ast_eid),
 			AST_EVENT_IE_END);
 	} else {
 		ast_event_queue(event);
@@ -540,9 +565,189 @@
 	return NULL;
 }
 
+static void destroy_devstate_change(struct devstate_change *sc)
+{
+	ast_free(sc);
+}
+
+#define MAX_SERVERS 64
+struct change_collection {
+	struct devstate_change states[MAX_SERVERS];
+	size_t num_states;
+};
+
+static void devstate_cache_cb(const struct ast_event *event, void *data)
+{
+	struct change_collection *collection = data;
+	int i;
+	const struct ast_eid *eid;
+
+	if (collection->num_states == ARRAY_LEN(collection->states)) {
+		ast_log(LOG_ERROR, "More per-server state values than we have room for (MAX_SERVERS is %d)\n",
+			MAX_SERVERS);
+		return;
+	}
+
+	if (!(eid = ast_event_get_ie_raw(event, AST_EVENT_IE_EID))) {
+		ast_log(LOG_ERROR, "Device state change event with no EID\n");
+		return;
+	}
+
+	i = collection->num_states;
+
+	collection->states[i].state = ast_event_get_ie_uint(event, AST_EVENT_IE_STATE);
+	collection->states[i].eid = *eid;
+
+	collection->num_states++;
+}
+
+static void process_collection(const char *device, struct change_collection *collection)
+{
+	int i;
+	struct ast_devstate_aggregate agg;
+	enum ast_device_state state;
+	struct ast_event *event;
+
+	ast_devstate_aggregate_init(&agg);
+
+	for (i = 0; i < collection->num_states; i++) {
+		ast_debug(1, "Adding per-server state of '%s' for '%s'\n", 
+			devstate2str(collection->states[i].state), device);
+		ast_devstate_aggregate_add(&agg, collection->states[i].state);
+	}
+
+	state = ast_devstate_aggregate_result(&agg);
+
+	ast_debug(1, "Aggregate devstate result is %d\n", state);
+
+	event = ast_event_get_cached(AST_EVENT_DEVICE_STATE,
+		AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, device,
+		AST_EVENT_IE_END);
+	
+	if (event) {
+		enum ast_device_state old_state;
+
+		old_state = ast_event_get_ie_uint(event, AST_EVENT_IE_STATE);
+		
+		ast_event_destroy(event);
+
+		if (state == old_state) {
+			/* No change since last reported device state */
+			ast_debug(1, "Aggregate state for device '%s' has not changed from '%s'\n",
+				device, devstate2str(state));
+			return;
+		}
+	}
+
+	ast_debug(1, "Aggregate state for device '%s' has changed to '%s'\n",
+		device, devstate2str(state));
+
+	event = ast_event_new(AST_EVENT_DEVICE_STATE,
+		AST_EVENT_IE_DEVICE, device,
+		AST_EVENT_IE_STATE, state,
+		AST_EVENT_IE_END);
+	
+	if (!event)
+		return;
+
+	ast_event_queue_and_cache(event,
+		AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR,
+		AST_EVENT_IE_END);
+}
+
+static void handle_devstate_change(struct devstate_change *sc)
+{
+	struct ast_event_sub *tmp_sub;
+	struct change_collection collection = {
+		.num_states = 0,
+	};
+
+	ast_debug(1, "Processing device state change for '%s'\n", sc->device);
+
+	if (!(tmp_sub = ast_event_subscribe_new(AST_EVENT_DEVICE_STATE_CHANGE, devstate_cache_cb, &collection))) {
+		ast_log(LOG_ERROR, "Failed to create subscription\n");
+		return;
+	}
+
+	if (ast_event_sub_append_ie_str(tmp_sub, AST_EVENT_IE_DEVICE, sc->device)) {
+		ast_log(LOG_ERROR, "Failed to append device IE\n");
+		ast_event_sub_destroy(tmp_sub);
+		return;
+	}
+
+	/* Populate the collection of device states from the cache */
+	ast_event_dump_cache(tmp_sub);
+
+	process_collection(sc->device, &collection);
+
+	ast_event_sub_destroy(tmp_sub);
+}
+
+static void *run_devstate_collector(void *data)
+{
+	for (;;) {
+		struct devstate_change *sc;
+
+		ast_mutex_lock(&devstate_collector.lock);
+		while (!(sc = AST_LIST_REMOVE_HEAD(&devstate_collector.devstate_change_q, entry)))
+			ast_cond_wait(&devstate_collector.cond, &devstate_collector.lock);
+		ast_mutex_unlock(&devstate_collector.lock);
+
+		handle_devstate_change(sc);
+
+		destroy_devstate_change(sc);
+	}
+
+	return NULL;
+}
+
+static void devstate_change_collector_cb(const struct ast_event *event, void *data)
+{
+	struct devstate_change *sc;
+	const char *device;
+	const struct ast_eid *eid;
+	uint32_t state;
+
+	device = ast_event_get_ie_str(event, AST_EVENT_IE_DEVICE);
+	eid = ast_event_get_ie_raw(event, AST_EVENT_IE_EID);
+	state = ast_event_get_ie_uint(event, AST_EVENT_IE_STATE);
+
+	if (ast_strlen_zero(device) || !eid) {
+		ast_log(LOG_ERROR, "Invalid device state change event received\n");
+		return;
+	}
+
+	if (!(sc = ast_calloc(1, sizeof(*sc) + strlen(device))))
+		return;
+
+	strcpy(sc->device, device);
+	sc->eid = *eid;
+	sc->state = state;
+
+	ast_mutex_lock(&devstate_collector.lock);
+	AST_LIST_INSERT_TAIL(&devstate_collector.devstate_change_q, sc, entry);
+	ast_cond_signal(&devstate_collector.cond);
+	ast_mutex_unlock(&devstate_collector.lock);
+}
+
 /*! \brief Initialize the device state engine in separate thread */
 int ast_device_state_engine_init(void)
 {
+	devstate_collector.event_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE_CHANGE,
+		devstate_change_collector_cb, NULL, AST_EVENT_IE_END);
+
+	if (!devstate_collector.event_sub) {
+		ast_log(LOG_ERROR, "Failed to create subscription for the device state change collector\n");
+		return -1;
+	}
+
+	ast_mutex_init(&devstate_collector.lock);
+	ast_cond_init(&devstate_collector.cond, NULL);
+	if (ast_pthread_create_background(&devstate_collector.thread, NULL, run_devstate_collector, NULL) < 0) {
+		ast_log(LOG_ERROR, "Unable to start device state collector thread.\n");
+		return -1;
+	}
+
 	ast_cond_init(&change_pending, NULL);
 	if (ast_pthread_create_background(&change_thread, NULL, do_devstate_changes, NULL) < 0) {
 		ast_log(LOG_ERROR, "Unable to start device state change thread.\n");

Modified: team/group/manager2/main/event.c
URL: http://svn.digium.com/view/asterisk/team/group/manager2/main/event.c?view=diff&rev=121647&r1=121646&r2=121647
==============================================================================
--- team/group/manager2/main/event.c (original)
+++ team/group/manager2/main/event.c Tue Jun 10 14:40:10 2008
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 2007, Digium, Inc.
+ * Copyright (C) 2007 - 2008, Digium, Inc.
  *
  * Russell Bryant <russell at digium.com>
  *
@@ -34,6 +34,7 @@
 #include "asterisk/lock.h"
 #include "asterisk/utils.h"
 #include "asterisk/unaligned.h"
+#include "asterisk/utils.h"
 #include "asterisk/taskprocessor.h"
 
 struct ast_taskprocessor *event_dispatcher;
@@ -85,7 +86,9 @@
 	union {
 		uint32_t uint;
 		const char *str;
+		void *raw;
 	} payload;
+	size_t raw_datalen;
 };
 
 /*! \brief Event subscription */
@@ -110,126 +113,167 @@
  * needs to know this state, it can get the last known state from the cache. */
 static AST_RWLIST_HEAD(ast_event_ref_list, ast_event_ref) ast_event_cache[AST_EVENT_TOTAL];
 
-struct ast_event_map {
-	enum ast_event_type event;
+/*!
+ * The index of each entry _must_ match the event type number!
+ */
+static struct event_name {
+	enum ast_event_type type;
 	const char *name;
-} event_name_map [] = {
-	{AST_EVENT_ALL, "All"},
-	{AST_EVENT_CUSTOM, "Custom"},
-	{AST_EVENT_MWI, "MWI"},
-	{AST_EVENT_SUB, "Subscribe"},
-	{AST_EVENT_UNSUB, "Unsubscribe"},
-	{AST_EVENT_DEVICE_STATE, "DeviceState"},
-	{AST_EVENT_QUEUE_MEMBER_STATUS, "QueueMemberStatus"},
-	{AST_EVENT_QUEUE_JOIN, "QueueJoin"},
-	{AST_EVENT_QUEUE_LEAVE, "QueueLeave"},
-	{AST_EVENT_QUEUE_MEMBER_CALLED, "QueueMemberCalled"},
-	{AST_EVENT_QUEUE_CALLER_ABANDON, "QueueCallerAbandon"},
-	{AST_EVENT_QUEUE_MEMBER_COMPLETE, "QueueMemberComplete"},
-	{AST_EVENT_QUEUE_MEMBER_DUMP, "QueueMemberDump"},
-	{AST_EVENT_QUEUE_MEMBER_CONNECT, "QueueMemberConnect"},
-	{AST_EVENT_QUEUE_MEMBER_REMOVED, "QueueMemberRemoved"},
-	{AST_EVENT_QUEUE_MEMBER_ADDED, "QueueMemberAdded"},
-	{AST_EVENT_QUEUE_MEMBER_PAUSED, "QueueMemberPaused"},
-	{AST_EVENT_QUEUE_MEMBER_PENALTY, "QueueMemberPenalty"},
-	{AST_EVENT_TOTAL, "Total"},
+} event_names[] = {
+	{ 0, "" },
+	{ AST_EVENT_CUSTOM,              "Custom" },
+	{ AST_EVENT_MWI,                 "MWI" },
+	{ AST_EVENT_SUB,                 "Subscription" },
+	{ AST_EVENT_UNSUB,               "Unsubscription" },
+	{ AST_EVENT_DEVICE_STATE,        "DeviceState" },
+	{ AST_EVENT_DEVICE_STATE_CHANGE, "DeviceStateChange" },
+	{ AST_EVENT_QUEUE_MEMBER_STATUS, "QueueMemberStatus"},
+	{ AST_EVENT_QUEUE_JOIN, "QueueJoin"},
+	{ AST_EVENT_QUEUE_LEAVE, "QueueLeave"},
+	{ AST_EVENT_QUEUE_MEMBER_CALLED, "QueueMemberCalled"},
+	{ AST_EVENT_QUEUE_CALLER_ABANDON, "QueueCallerAbandon"},
+	{ AST_EVENT_QUEUE_MEMBER_COMPLETE, "QueueMemberComplete"},
+	{ AST_EVENT_QUEUE_MEMBER_DUMP, "QueueMemberDump"},
+	{ AST_EVENT_QUEUE_MEMBER_CONNECT, "QueueMemberConnect"},
+	{ AST_EVENT_QUEUE_MEMBER_REMOVED, "QueueMemberRemoved"},
+	{ AST_EVENT_QUEUE_MEMBER_ADDED, "QueueMemberAdded"},
+	{ AST_EVENT_QUEUE_MEMBER_PAUSED, "QueueMemberPaused"},
+	{ AST_EVENT_QUEUE_MEMBER_PENALTY, "QueueMemberPenalty"},
+	{ AST_EVENT_TOTAL, "Total"},
+
 };
 
-struct ast_event_ie_map {
-	enum ast_event_ie_type ie;
-	enum ast_event_ie_pltype pltype;
-	const char * name;               /*!< The name is used for debugging and manager purposes currently */
-} info_map[] = { /*NOTE: it is INSANELY IMPORTANT that these are in the same order as the above enum. My GOD I CANNOT STRESS THIS ENOUGH!!! */
-	{0, AST_EVENT_IE_PLTYPE_STR,	"RUBBERDUCK"},                  /*!< Placeholder for nonexistent IE 0 */
-	{AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT,	"NewMessages"},                 /*!< AST_EVENT_IE_NEWMSGS 1 */
-	{AST_EVENT_IE_OLDMSGS, AST_EVENT_IE_PLTYPE_UINT,	"OldMessages"},	                /*!< AST_EVENT_IE_OLDMSGS 2 */
-	{AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR,	"Mailbox"},	                    /*!< AST_EVENT_IE_MAILBOX 3 */
-	{AST_EVENT_IE_UNIQUEID, AST_EVENT_IE_PLTYPE_UINT,	"EventUniqueID"},               /*!< AST_EVENT_IE_UNIQUEIED 4 */
-	{AST_EVENT_IE_EVENTTYPE, AST_EVENT_IE_PLTYPE_UINT,	"EventType"},	                /*!< AST_EVENT_IE_EVENTTYPE 5 */
-	{AST_EVENT_IE_EXISTS, AST_EVENT_IE_PLTYPE_UINT,	"Exists"},                      /*!< AST_EVENT_IE_EXISTS 6 */
-	{AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR,	"Device"},                      /*!< AST_EVENT_IE_DEVICE 7 */
-	{AST_EVENT_IE_STATE, AST_EVENT_IE_PLTYPE_UINT,	"State"},                       /*!< AST_EVENT_IE_STATE 8 */
-	{AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR,	"Context"},	                    /*!< AST_EVENT_IE_CONTEXT 9 */
-	{AST_EVENT_IE_QUEUE_NAME, AST_EVENT_IE_PLTYPE_STR,	"QueueName"},                   /*!< AST_EVENT_IE_QUEUE_NAME 10 */
-	{AST_EVENT_IE_QUEUE_MEMBERNAME, AST_EVENT_IE_PLTYPE_STR,	"MemberName"},                  /*!< AST_EVENT_IE_QUEUE_MEMBERNAME 11 */
-	{AST_EVENT_IE_QUEUE_PENALTY, AST_EVENT_IE_PLTYPE_UINT,	"Penalty"},                     /*!< AST_EVENT_IE_QUEUE_PENALTY 12 */
-	{AST_EVENT_IE_QUEUE_CALLS, AST_EVENT_IE_PLTYPE_UINT,	"Calls"},                       /*!< AST_EVENT_IE_QUEUE_CALLS 13 */
-	{AST_EVENT_IE_QUEUE_LASTCALL, AST_EVENT_IE_PLTYPE_UINT,	"LastCall"},                    /*!< AST_EVENT_IE_QUEUE_LASTCALL 14 */
-	{AST_EVENT_IE_QUEUE_PAUSED, AST_EVENT_IE_PLTYPE_UINT,	"Paused"},                      /*!< AST_EVENT_IE_QUEUE_PAUSED 15 */
-	{AST_EVENT_IE_SOURCE_CHANNEL, AST_EVENT_IE_PLTYPE_STR,	"SourceChannel"},               /*!< AST_EVENT_IE SOURCE_CHANNEL 16 */
-	{AST_EVENT_IE_CALLERIDNUM, AST_EVENT_IE_PLTYPE_STR,	"CallerIDNumber"},              /*!< AST_EVENT_IE_CALLERIDNUMBER 17 */
-	{AST_EVENT_IE_CALLERIDNAME, AST_EVENT_IE_PLTYPE_STR,	"CallerIDName"},                /*!< AST_EVENT_IE_CALLERIDNAME 18 */
-	{AST_EVENT_IE_QUEUE_POSITION, AST_EVENT_IE_PLTYPE_UINT,	"Position"},                    /*!< AST_EVENT_IE_QUEUE_POSITION 19 */
-	{AST_EVENT_IE_QUEUE_COUNT, AST_EVENT_IE_PLTYPE_UINT,	"Count"},                       /*!< AST_EVENT_IE_QUEUE_COUNT 20 */
-	{AST_EVENT_IE_SOURCE_UNIQUEID, AST_EVENT_IE_PLTYPE_STR,	"SourceUniqueID"},              /*!< AST_EVENT_IE_SOURCE_UNIQUEID 21 */
-	{AST_EVENT_IE_QUEUE_MEMBERSHIP, AST_EVENT_IE_PLTYPE_STR,	"Membership"},                  /*!< AST_EVENT_IE_QUEUE_MEMBERSHIP 22 */
-	{AST_EVENT_IE_DESTINATION_CHANNEL, AST_EVENT_IE_PLTYPE_STR,	"DestinationChannel"},          /*!< AST_EVENT_IE_DESTINATION_CHANNEL 23 */
-	{AST_EVENT_IE_EXTENSION, AST_EVENT_IE_PLTYPE_STR,	"Extension"},                   /*!< AST_EVENT_IE_EXTENSION 24 */
-	{AST_EVENT_IE_PRIORITY, AST_EVENT_IE_PLTYPE_UINT,	"Priority"},                    /*!< AST_EVENT_IE_PRIORITY 25 */
-	{AST_EVENT_IE_QUEUE_ORIGINAL_POSITION, AST_EVENT_IE_PLTYPE_UINT,	"OriginalPosition"},            /*!< AST_EVENT_IE_QUEUE_ORIGINAL_POSITION 26 */
-	{AST_EVENT_IE_QUEUE_HOLDTIME, AST_EVENT_IE_PLTYPE_UINT,	"HoldTime"},                    /*!< AST_EVENT_IE_QUEUE_HOLDTIME 27 */
-	{AST_EVENT_IE_QUEUE_TALKTIME, AST_EVENT_IE_PLTYPE_UINT,	"TalkTime"},                    /*!< AST_EVENT_IE_QUEUE_TALKTIME 28 */
-	{AST_EVENT_IE_QUEUE_REASON, AST_EVENT_IE_PLTYPE_STR,	"Reason"},                      /*!< AST_EVENT_IE_QUEUE_REASON 29 */
-	{AST_EVENT_IE_QUEUE_RINGTIME, AST_EVENT_IE_PLTYPE_UINT,	"RingTime"},                    /*!< AST_EVENT_IE_QUEUE_RINGTIME 30 */
-	{AST_EVENT_IE_DESTINATION_UNIQUEID, AST_EVENT_IE_PLTYPE_STR,	"DestinationUniqueID"},         /*!< AST_EVENT_IE_DESTINATION_UNIQUEID 31 */
-	{AST_EVENT_IE_CHANVAR, AST_EVENT_IE_PLTYPE_STR,	"Variable"},                    /*!< AST_EVENT_IE_CHANVAR 32 */
-	{AST_EVENT_IE_FD, AST_EVENT_IE_PLTYPE_UINT,	"FileDescriptor"},              /*!< AST_EVENT_IE_FD 33 */
-	{AST_EVENT_IE_USERNAME, AST_EVENT_IE_PLTYPE_STR,	"Username"},                    /*!< AST_EVENT_IE_USERNAME 34 */
+/*!
+ * The index of each entry _must_ match the event ie number!
+ */
+static struct ie_map {
+	enum ast_event_ie_type ie_type;
+	enum ast_event_ie_pltype ie_pltype;
+	const char *name;
+} ie_maps[] = {
+	{ 0, 0, "" },
+	{ AST_EVENT_IE_NEWMSGS,   AST_EVENT_IE_PLTYPE_UINT, "NewMessages" },
+	{ AST_EVENT_IE_OLDMSGS,   AST_EVENT_IE_PLTYPE_UINT, "OldMessages" },
+	{ AST_EVENT_IE_MAILBOX,   AST_EVENT_IE_PLTYPE_STR,  "Mailbox" },
+	{ AST_EVENT_IE_UNIQUEID,  AST_EVENT_IE_PLTYPE_UINT, "UniqueID" },
+	{ AST_EVENT_IE_EVENTTYPE, AST_EVENT_IE_PLTYPE_UINT, "EventType" },
+	{ AST_EVENT_IE_EXISTS,    AST_EVENT_IE_PLTYPE_UINT, "Exists" },
+	{ AST_EVENT_IE_DEVICE,    AST_EVENT_IE_PLTYPE_STR,  "Device" },
+	{ AST_EVENT_IE_STATE,     AST_EVENT_IE_PLTYPE_UINT, "State" },
+	{ AST_EVENT_IE_CONTEXT,   AST_EVENT_IE_PLTYPE_STR,  "Context" },
+	{ AST_EVENT_IE_EID,       AST_EVENT_IE_PLTYPE_RAW,  "EntityID" },
+	{ AST_EVENT_IE_QUEUE_NAME, AST_EVENT_IE_PLTYPE_STR,	"QueueName"},                   /*!< AST_EVENT_IE_QUEUE_NAME 10 */
+	{ AST_EVENT_IE_QUEUE_MEMBERNAME, AST_EVENT_IE_PLTYPE_STR,	"MemberName"},                  /*!< AST_EVENT_IE_QUEUE_MEMBERNAME 11 */
+	{ AST_EVENT_IE_QUEUE_PENALTY, AST_EVENT_IE_PLTYPE_UINT,	"Penalty"},                     /*!< AST_EVENT_IE_QUEUE_PENALTY 12 */
+	{ AST_EVENT_IE_QUEUE_CALLS, AST_EVENT_IE_PLTYPE_UINT,	"Calls"},                       /*!< AST_EVENT_IE_QUEUE_CALLS 13 */
+	{ AST_EVENT_IE_QUEUE_LASTCALL, AST_EVENT_IE_PLTYPE_UINT,	"LastCall"},                    /*!< AST_EVENT_IE_QUEUE_LASTCALL 14 */

[... 824 lines stripped ...]



More information about the asterisk-commits mailing list