[asterisk-commits] [svn-commits] russell: branch russell/events r110871 - in /team/russell/events: ./ include/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Mar 26 10:57:25 CDT 2008
Author: russell
Date: Wed Mar 26 10:57:25 2008
New Revision: 110871
URL: http://svn.digium.com/view/asterisk?view=rev&rev=110871
Log:
revert previous commit that had way more than it was supposed to ...
Removed:
team/russell/events/res/res_xmlevents.c
Modified:
team/russell/events/configure.ac
team/russell/events/include/asterisk/event.h
team/russell/events/include/asterisk/event_defs.h
team/russell/events/include/asterisk/tcptls.h
team/russell/events/main/devicestate.c
team/russell/events/main/event.c
team/russell/events/main/tcptls.c
team/russell/events/res/res_ais.c
Modified: team/russell/events/configure.ac
URL: http://svn.digium.com/view/asterisk/team/russell/events/configure.ac?view=diff&rev=110871&r1=110870&r2=110871
==============================================================================
--- team/russell/events/configure.ac (original)
+++ team/russell/events/configure.ac Wed Mar 26 10:57:25 2008
@@ -1499,8 +1499,7 @@
AST_EXT_LIB_CHECK([X11], [X11], [XOpenDisplay], [X11/Xlib.h],,, [standard_path])
AST_EXT_LIB_CHECK([X11], [X11], [XOpenDisplay], [X11/Xlib.h],, [-I/usr/X11R6/include], [X11R6])
-AST_EXT_TOOL_CHECK([XML2], [xml2])
-AST_EXT_LIB_CHECK([XML2], [xml2], [xmlCreatePushParserCtxt], [], [${XML2_LIB}], [${XML2_INCLUDE}])
+AST_EXT_LIB_CHECK([XML2], [xml2], [xmlCreatePushParserCtxt], [])
if test "${cross_compiling}" = "no";
then
Modified: team/russell/events/include/asterisk/event.h
URL: http://svn.digium.com/view/asterisk/team/russell/events/include/asterisk/event.h?view=diff&rev=110871&r1=110870&r2=110871
==============================================================================
--- team/russell/events/include/asterisk/event.h (original)
+++ team/russell/events/include/asterisk/event.h Wed Mar 26 10:57:25 2008
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 2007 - 2008, Digium, Inc.
+ * Copyright (C) 2007, Digium, Inc.
*
* Russell Bryant <russell at digium.com>
*
@@ -436,10 +436,6 @@
*/
const void *ast_event_get_ie_raw(const struct ast_event *event, enum ast_event_ie_type ie_type);
-const char *ast_event_get_ie_type_name(enum ast_event_ie_type 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
*
@@ -449,8 +445,6 @@
* ast_event_type enum
*/
enum ast_event_type ast_event_get_type(const struct ast_event *event);
-
-const char *ast_event_get_type_name(const struct ast_event *event);
/*!
* \brief Get the size of an event
Modified: team/russell/events/include/asterisk/event_defs.h
URL: http://svn.digium.com/view/asterisk/team/russell/events/include/asterisk/event_defs.h?view=diff&rev=110871&r1=110870&r2=110871
==============================================================================
--- team/russell/events/include/asterisk/event_defs.h (original)
+++ team/russell/events/include/asterisk/event_defs.h Wed Mar 26 10:57:25 2008
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 2007 - 2008, Digium, Inc.
+ * Copyright (C) 2007, Digium, Inc.
*
* Russell Bryant <russell at digium.com>
*
@@ -30,26 +30,26 @@
enum ast_event_type {
/*! Reserved to provide the ability to subscribe to all events. A specific
* event should never have a payload of 0. */
- AST_EVENT_ALL = 0x00,
+ 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,
+ AST_EVENT_CUSTOM = 0x01,
/*! Voicemail message waiting indication */
- AST_EVENT_MWI = 0x02,
+ AST_EVENT_MWI = 0x02,
/*! Someone has subscribed to events */
- AST_EVENT_SUB = 0x03,
+ AST_EVENT_SUB = 0x03,
/*! Someone has unsubscribed from events */
- AST_EVENT_UNSUB = 0x04,
+ 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,
+ 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,
+ AST_EVENT_TOTAL = 0x07,
};
/*! \brief Event Information Element types */
@@ -122,8 +122,6 @@
AST_EVENT_IE_EID = 0x0A,
};
-#define AST_EVENT_IE_MAX AST_EVENT_IE_EID
-
/*!
* \brief Payload types for event information elements
*/
@@ -156,15 +154,4 @@
struct ast_event_sub;
struct ast_event_iterator;
-/*!
- * \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;
- const struct ast_event *event;
- struct ast_event_ie *ie;
-};
-
#endif /* AST_EVENT_DEFS_H */
Modified: team/russell/events/include/asterisk/tcptls.h
URL: http://svn.digium.com/view/asterisk/team/russell/events/include/asterisk/tcptls.h?view=diff&rev=110871&r1=110870&r2=110871
==============================================================================
--- team/russell/events/include/asterisk/tcptls.h (original)
+++ team/russell/events/include/asterisk/tcptls.h Wed Mar 26 10:57:25 2008
@@ -48,8 +48,6 @@
#ifndef _ASTERISK_SERVER_H
#define _ASTERISK_SERVER_H
-
-#include <fcntl.h>
#include "asterisk/utils.h"
@@ -129,7 +127,6 @@
int client;
struct sockaddr_in requestor;
struct server_args *parent;
- pthread_t worker_thread;
};
/*! \brief
Modified: team/russell/events/main/devicestate.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/main/devicestate.c?view=diff&rev=110871&r1=110870&r2=110871
==============================================================================
--- team/russell/events/main/devicestate.c (original)
+++ team/russell/events/main/devicestate.c Wed Mar 26 10:57:25 2008
@@ -1,10 +1,9 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2008, Digium, Inc.
+ * Copyright (C) 1999 - 2007, 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
@@ -22,16 +21,11 @@
* \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,
@@ -423,8 +417,6 @@
{
struct ast_event *event;
- ast_debug(1, "device '%s' state '%d'\n", device, state);
-
if (!(event = ast_event_new(AST_EVENT_DEVICE_STATE_CHANGE,
AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, device,
AST_EVENT_IE_STATE, AST_EVENT_IE_PLTYPE_UINT, state,
@@ -705,8 +697,6 @@
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);
Modified: team/russell/events/main/event.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/main/event.c?view=diff&rev=110871&r1=110870&r2=110871
==============================================================================
--- team/russell/events/main/event.c (original)
+++ team/russell/events/main/event.c Wed Mar 26 10:57:25 2008
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 2007 - 2008, Digium, Inc.
+ * Copyright (C) 2007, Digium, Inc.
*
* Russell Bryant <russell at digium.com>
*
@@ -78,6 +78,12 @@
AST_LIST_ENTRY(ast_event_ref) entry;
};
+struct ast_event_iterator {
+ uint16_t event_len;
+ const struct ast_event *event;
+ struct ast_event_ie *ie;
+};
+
/*! \brief data shared between event dispatching threads */
static struct {
ast_cond_t cond;
@@ -120,77 +126,6 @@
* for events that express some sort of state. So, when someone first
* 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];
-
-/*!
- * The index of each entry _must_ match the event type number!
- */
-static struct event_name {
- enum ast_event_type type;
- const char *name;
-} 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" },
-};
-
-/*!
- * 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, },
- { 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" },
-};
-
-const char *ast_event_get_type_name(const struct ast_event *event)
-{
- enum ast_event_type type;
-
- type = ast_event_get_type(event);
-
- if (type >= AST_EVENT_TOTAL || type < 0) {
- ast_log(LOG_ERROR, "Invalid event type - '%d'\n", type);
- return "";
- }
-
- return event_names[type].name;
-}
-
-const char *ast_event_get_ie_type_name(enum ast_event_ie_type ie_type)
-{
- if (ie_type <= 0 || ie_type > AST_EVENT_IE_MAX) {
- ast_log(LOG_ERROR, "Invalid IE type - '%d'\n", ie_type);
- return "";
- }
-
- return ie_maps[ie_type].name;
-}
-
-enum ast_event_ie_pltype ast_event_get_ie_pltype(enum ast_event_ie_type ie_type)
-{
- if (ie_type <= 0 || ie_type > AST_EVENT_IE_MAX) {
- ast_log(LOG_ERROR, "Invalid IE type - '%d'\n", ie_type);
- return AST_EVENT_IE_PLTYPE_UNKNOWN;
- }
-
- return ie_maps[ie_type].ie_pltype;
-}
size_t ast_event_get_size(const struct ast_event *event)
{
@@ -612,7 +547,7 @@
struct ast_event *event;
AST_RWLIST_WRLOCK(&ast_event_subs[sub->type]);
- AST_RWLIST_REMOVE(&ast_event_subs[sub->type], sub, entry);
+ AST_LIST_REMOVE(&ast_event_subs[sub->type], sub, entry);
AST_RWLIST_UNLOCK(&ast_event_subs[sub->type]);
if (ast_event_check_subscriber(AST_EVENT_UNSUB,
@@ -817,7 +752,7 @@
struct ast_event *dup_event;
uint16_t event_len;
- event_len = ast_event_get_size(event);
+ event_len = ntohs(event->event_len);
if (!(dup_event = ast_calloc(1, event_len)))
return NULL;
Modified: team/russell/events/main/tcptls.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/main/tcptls.c?view=diff&rev=110871&r1=110870&r2=110871
==============================================================================
--- team/russell/events/main/tcptls.c (original)
+++ team/russell/events/main/tcptls.c Wed Mar 26 10:57:25 2008
@@ -106,6 +106,7 @@
struct sockaddr_in sin;
socklen_t sinlen;
struct ast_tcptls_session_instance *ser;
+ pthread_t launched;
for (;;) {
int i, flags;
@@ -136,7 +137,7 @@
ser->client = 0;
- if (ast_pthread_create_detached_background(&ser->worker_thread, NULL, ast_make_file_from_fd, ser)) {
+ if (ast_pthread_create_detached_background(&launched, NULL, ast_make_file_from_fd, ser)) {
ast_log(LOG_WARNING, "Unable to launch helper thread: %s\n", strerror(errno));
close(ser->fd);
ast_free(ser);
Modified: team/russell/events/res/res_ais.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/res/res_ais.c?view=diff&rev=110871&r1=110870&r2=110871
==============================================================================
--- team/russell/events/res/res_ais.c (original)
+++ team/russell/events/res/res_ais.c Wed Mar 26 10:57:25 2008
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 2007 - 2008, Digium, Inc.
+ * Copyright (C) 2007, Digium, Inc.
*
* Russell Bryant <russell at digium.com>
*
_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--
svn-commits mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/svn-commits
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the asterisk-commits
mailing list