[asterisk-commits] kmoore: branch kmoore/channel-state-caching r380845 - in /team/kmoore/channel...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 4 23:12:18 CST 2013


Author: kmoore
Date: Mon Feb  4 23:12:14 2013
New Revision: 380845

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380845
Log:
Move copy, cmp, and destroy pointers into the event

This change moves the manipulation function pointers for RAW_LOCAL IE
types (copy, cmp, destroy) into the associated IE itself to allow for
additional flexibility such as varying message types depending on
another field.

Modified:
    team/kmoore/channel-state-caching/include/asterisk/event.h
    team/kmoore/channel-state-caching/main/event.c
    team/kmoore/channel-state-caching/main/manager.c

Modified: team/kmoore/channel-state-caching/include/asterisk/event.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/channel-state-caching/include/asterisk/event.h?view=diff&rev=380845&r1=380844&r2=380845
==============================================================================
--- team/kmoore/channel-state-caching/include/asterisk/event.h (original)
+++ team/kmoore/channel-state-caching/include/asterisk/event.h Mon Feb  4 23:12:14 2013
@@ -559,6 +559,24 @@
 int ast_event_append_eid(struct ast_event **event);
 
 /*!
+ * \brief Copy constructor used for RAW_LOCAL PLTYPEs
+ * \since 12
+ */
+typedef void *(*ast_event_ie_payload_copy)(void *copy, const void *orig, size_t len);
+
+/*!
+ * \brief Comparator used for RAW_LOCAL PLTYPEs
+ * \since 12
+ */
+typedef int (*ast_event_ie_payload_cmp)(const void *one, size_t one_len, const void *two, size_t two_len);
+
+/*!
+ * \brief Destructor used for RAW_LOCAL PLTYPEs
+ * \since 12
+ */
+typedef void (*ast_event_ie_payload_destroy)(void *orig, size_t orig_len);
+
+/*!
  * \brief Get the value of an information element that has an integer payload
  *
  * \param event The event to get the IE from
@@ -652,6 +670,39 @@
 uint16_t ast_event_get_ie_raw_local_payload_len(const struct ast_event *event, enum ast_event_ie_type ie_type);
 
 /*!
+ * \brief Get the copy constructor function for the pointer-containing raw payload for the IE type in the event
+ * \since 12
+ *
+ * \param event The event from which to extract the copy constructor
+ * \param ie_type The IE type for which to extract the copy function pointer
+ *
+ * \return The copy function pointer associated with this payload
+ */
+ast_event_ie_payload_copy *ast_event_get_ie_raw_local_copy(const struct ast_event *event, enum ast_event_ie_type ie_type);
+
+/*!
+ * \brief Get the comparator function for the pointer-containing raw payload for the IE type in the event
+ * \since 12
+ *
+ * \param event The event from which to extract the comparator
+ * \param ie_type The IE type for which to extract the comparator function pointer
+ *
+ * \return The compare function pointer associated with this payload
+ */
+ast_event_ie_payload_cmp *ast_event_get_ie_raw_local_cmp(const struct ast_event *event, enum ast_event_ie_type ie_type);
+
+/*!
+ * \brief Get the destructor function for the pointer-containing raw payload for the IE type in the event
+ * \since 12
+ *
+ * \param event The event from which to extract the destructor
+ * \param ie_type The IE type for which to extract the destructor function pointer
+ *
+ * \return The destructor function pointer associated with this payload
+ */
+ast_event_ie_payload_destroy *ast_event_get_ie_raw_local_destroy(const struct ast_event *event, enum ast_event_ie_type ie_type);
+
+/*!
  * \brief Get the string representation of an information element type
  *
  * \param ie_type the information element type to get the string representation of
@@ -823,12 +874,43 @@
 
 /*!
  * \brief Get the length of the pointer-containing raw payload for the current IE for an iterator
+ * \since 12
  *
  * \param iterator The IE iterator
  *
  * \return The payload length of the current IE
  */
 uint16_t ast_event_iterator_get_ie_raw_local_payload_len(struct ast_event_iterator *iterator);
+
+/*!
+ * \brief Get the copy constructor function for the pointer-containing raw payload for the current IE in the iterator
+ * \since 12
+ *
+ * \param iterator The IE iterator
+ *
+ * \return The copy function pointer associated with this payload
+ */
+ast_event_ie_payload_copy *ast_event_iterator_get_ie_raw_local_copy(struct ast_event_iterator *iterator);
+
+/*!
+ * \brief Get the comparator function for the pointer-containing raw payload for the current IE in the iterator
+ * \since 12
+ *
+ * \param iterator The IE iterator
+ *
+ * \return The comparison function pointer associated with this payload
+ */
+ast_event_ie_payload_cmp *ast_event_iterator_get_ie_raw_local_cmp(struct ast_event_iterator *iterator);
+
+/*!
+ * \brief Get the destructor function for the pointer-containing raw payload for the current IE in the iterator
+ * \since 12
+ *
+ * \param iterator The IE iterator
+ *
+ * \return The destructor function pointer associated with this payload
+ */
+ast_event_ie_payload_destroy *ast_event_iterator_get_ie_raw_local_destroy(struct ast_event_iterator *iterator);
 
 /*!
  * \brief Get the minimum length of an ast_event.

Modified: team/kmoore/channel-state-caching/main/event.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/channel-state-caching/main/event.c?view=diff&rev=380845&r1=380844&r2=380845
==============================================================================
--- team/kmoore/channel-state-caching/main/event.c (original)
+++ team/kmoore/channel-state-caching/main/event.c Mon Feb  4 23:12:14 2013
@@ -44,6 +44,8 @@
 #include "asterisk/astobj2.h"
 #include "asterisk/cli.h"
 #include "asterisk/channel.h"
+
+#define RAW_LOCAL_OFFSET (3*sizeof(void *))
 
 static struct ast_taskprocessor *event_dispatcher;
 
@@ -152,6 +154,12 @@
 #endif
 
 #define MAX_CACHE_ARGS 8
+
+void *raw_local_payload_from_raw(const void *payload);
+ast_event_ie_payload_copy *raw_local_copy_from_raw(const void *payload);
+ast_event_ie_payload_cmp *raw_local_cmp_from_raw(const void *payload);
+ast_event_ie_payload_destroy *raw_local_destroy_from_raw(const void *payload);
+uint16_t raw_local_len_from_raw_len(uint16_t len);
 
 /*!
  * \brief Event types that are kept in the cache.
@@ -229,9 +237,6 @@
 static const struct ie_map {
 	enum ast_event_ie_pltype ie_pltype;
 	const char *name;						/*!< Human-readable name for the IE type */
-	void *(*copy)(void *copy, const void *orig, size_t len);	/*!< Copy constructor used for RAW_LOCAL PLTYPEs */
-	int (*cmp)(const void *one, size_t one_len, const void *two, size_t two_len);	/*!< Comparator used for RAW_LOCAL PLTYPEs */
-	void (*destroy)(void *orig, size_t orig_len);			/*!< Destructor used for RAW_LOCAL PLTYPEs */
 } ie_maps[AST_EVENT_IE_TOTAL] = {
 	[AST_EVENT_IE_NEWMSGS]             = { AST_EVENT_IE_PLTYPE_UINT, "NewMessages" },
 	[AST_EVENT_IE_OLDMSGS]             = { AST_EVENT_IE_PLTYPE_UINT, "OldMessages" },
@@ -289,7 +294,7 @@
 	[AST_EVENT_IE_USING_PASSWORD]      = { AST_EVENT_IE_PLTYPE_UINT, "UsingPassword" },
 	[AST_EVENT_IE_ATTEMPTED_TRANSPORT] = { AST_EVENT_IE_PLTYPE_STR,  "AttemptedTransport" },
 	[AST_EVENT_IE_CACHABLE]            = { AST_EVENT_IE_PLTYPE_UINT, "Cachable" },
-	[AST_EVENT_IE_CHANNEL_STATE]       = { AST_EVENT_IE_PLTYPE_RAW_LOCAL,  "ChannelState", ast_channel_snapshot_copy, ast_channel_snapshot_cmp, ast_channel_snapshot_destroy },
+	[AST_EVENT_IE_CHANNEL_STATE]       = { AST_EVENT_IE_PLTYPE_RAW_LOCAL, "ChannelState" },
 };
 
 const char *ast_event_get_type_name(const struct ast_event *event)
@@ -377,9 +382,13 @@
 		ast_free(ie_val->payload.raw);
 		break;
 	case AST_EVENT_IE_PLTYPE_RAW_LOCAL:
-		ie_maps[ie_val->ie_type].destroy(ie_val->payload.raw, ie_val->raw_datalen);
+	{
+		void *raw_payload = ie_val->payload.raw;
+		uint16_t len = raw_local_len_from_raw_len(ie_val->raw_datalen);
+		(*raw_local_destroy_from_raw(raw_payload))(raw_local_payload_from_raw(raw_payload), len);
 		ast_free(ie_val->payload.raw);
 		break;
+	}
 	case AST_EVENT_IE_PLTYPE_UINT:
 	case AST_EVENT_IE_PLTYPE_BITFLAGS:
 	case AST_EVENT_IE_PLTYPE_EXISTS:
@@ -458,10 +467,11 @@
 		break;
 	case AST_EVENT_IE_PLTYPE_RAW_LOCAL:
 		res = (sub_ie_val->raw_datalen == event_ie_val->raw_datalen
-			&& !ie_maps[sub_ie_val->ie_type].cmp(sub_ie_val->payload.raw,
-							sub_ie_val->raw_datalen,
-							event_ie_val->payload.raw,
-							event_ie_val->raw_datalen));
+			&& !(*raw_local_cmp_from_raw(sub_ie_val->payload.raw))(
+					raw_local_payload_from_raw(sub_ie_val->payload.raw),
+					raw_local_len_from_raw_len(sub_ie_val->raw_datalen),
+					raw_local_payload_from_raw(event_ie_val->payload.raw),
+					raw_local_len_from_raw_len(event_ie_val->raw_datalen)));
 		break;
 	case AST_EVENT_IE_PLTYPE_EXISTS:
 		/* Should never get here since check_ie_vals cannot have this type. */
@@ -537,12 +547,13 @@
 			void *data = va_arg(ap, void *);
 			size_t datalen = va_arg(ap, size_t);
 
-			ie_value->payload.raw = ast_alloca(datalen);
-			ie_maps[ie_type].copy(
-				ie_value->payload.raw,
-				data,
-				datalen);
-			ie_value->raw_datalen = datalen;
+			ie_value->payload.raw = ast_alloca(RAW_LOCAL_OFFSET + datalen);
+			*raw_local_copy_from_raw(ie_value->payload.raw) = va_arg(ap, void *);
+			*raw_local_cmp_from_raw(ie_value->payload.raw) = va_arg(ap, void *);
+			*raw_local_destroy_from_raw(ie_value->payload.raw) = va_arg(ap, void *);
+
+			(*raw_local_copy_from_raw(ie_value->payload.raw))(raw_local_payload_from_raw(ie_value->payload.raw), data, datalen);
+			ie_value->raw_datalen = RAW_LOCAL_OFFSET + datalen;
 			insert = 1;
 			break;
 		}
@@ -665,8 +676,12 @@
 
 	case AST_EVENT_IE_PLTYPE_RAW_LOCAL:
 	{
-		const void *buf = event2 ? ast_event_get_ie_raw_local(event2, ie_val->ie_type) : ie_val->payload.raw;
-		uint16_t ie_payload_len = event2 ? ast_event_get_ie_raw_local_payload_len(event2, ie_val->ie_type) : ie_val->raw_datalen;
+		const void *buf = event2 ? ast_event_get_ie_raw_local(event2, ie_val->ie_type) :
+					raw_local_payload_from_raw(ie_val->payload.raw);
+		uint16_t ie_payload_len = event2 ? ast_event_get_ie_raw_local_payload_len(event2, ie_val->ie_type) :
+					raw_local_len_from_raw_len(ie_val->raw_datalen);
+		ast_event_ie_payload_cmp *cmp = event2 ? ast_event_get_ie_raw_local_cmp(event2, ie_val->ie_type) :
+					raw_local_cmp_from_raw(ie_val->payload.raw);
 		uint16_t event1_payload_len = ast_event_get_ie_raw_local_payload_len(event, ie_val->ie_type);
 		int event_cmp;
 
@@ -676,10 +691,10 @@
 		if (ie_payload_len != event1_payload_len) {
 			return 0;
 		}
-		event_cmp = ie_maps[ie_val->ie_type].cmp(buf,
-							ie_payload_len,
-							ast_event_get_ie_raw_local(event, ie_val->ie_type),
-							event1_payload_len);
+		event_cmp = (*cmp)(buf,
+				ie_payload_len,
+				ast_event_get_ie_raw_local(event, ie_val->ie_type),
+				event1_payload_len);
 		if (event_cmp) {
 			return 0;
 		}
@@ -966,6 +981,7 @@
 	enum ast_event_ie_type ie_type, void *data, size_t raw_local_datalen)
 {
 	struct ast_event_ie_val *ie_val;
+	ast_event_ie_payload_copy copy;
 
 	if (ie_type <= 0 || ie_type >= AST_EVENT_IE_TOTAL) {
 		return -1;
@@ -984,10 +1000,15 @@
 		return -1;
 	}
 
-	ie_maps[ie_type].copy(
-		ie_val->payload.raw,
+	// copy function pointers
+	copy = *raw_local_copy_from_raw(data);
+	*raw_local_copy_from_raw(ie_val->payload.raw) = copy;
+	*raw_local_cmp_from_raw(ie_val->payload.raw) = *raw_local_cmp_from_raw(data);
+	*raw_local_destroy_from_raw(ie_val->payload.raw) = *raw_local_destroy_from_raw(data);
+
+	copy(raw_local_payload_from_raw(ie_val->payload.raw),
 		data,
-		raw_local_datalen);
+		raw_local_len_from_raw_len(raw_local_datalen));
 
 	AST_LIST_INSERT_TAIL(&sub->ie_vals, ie_val, entry);
 
@@ -1068,7 +1089,19 @@
 		{
 			void *data = va_arg(ap, void *);
 			size_t data_len = va_arg(ap, size_t);
-			ast_event_sub_append_ie_raw_local(sub, ie_type, data, data_len);
+			size_t tmp_len = data_len + RAW_LOCAL_OFFSET;
+			void *tmp_data = ast_alloca(tmp_len);
+
+			/* copy function pointers into the temporary raw local payload */
+			*raw_local_copy_from_raw(tmp_data) = va_arg(ap, void *);
+			*raw_local_cmp_from_raw(tmp_data) = va_arg(ap, void *);
+			*raw_local_destroy_from_raw(tmp_data) = va_arg(ap, void *);
+
+			/* don't use the constructor because this will not be destroyed */
+			memcpy(raw_local_payload_from_raw(tmp_data), data, data_len);
+
+			/* append the constructed raw local payload */
+			ast_event_sub_append_ie_raw_local(sub, ie_type, tmp_data, tmp_len);
 			break;
 		}
 		case AST_EVENT_IE_PLTYPE_EXISTS:
@@ -1193,12 +1226,27 @@
 
 void *ast_event_iterator_get_ie_raw_local(struct ast_event_iterator *iterator)
 {
-	return ast_event_iterator_get_ie_raw(iterator);
+	return raw_local_payload_from_raw(ast_event_iterator_get_ie_raw(iterator));
+}
+
+ast_event_ie_payload_copy *ast_event_iterator_get_ie_raw_local_copy(struct ast_event_iterator *iterator)
+{
+	return raw_local_copy_from_raw(ast_event_iterator_get_ie_raw(iterator));
+}
+
+ast_event_ie_payload_cmp *ast_event_iterator_get_ie_raw_local_cmp(struct ast_event_iterator *iterator)
+{
+	return raw_local_cmp_from_raw(ast_event_iterator_get_ie_raw(iterator));
+}
+
+ast_event_ie_payload_destroy *ast_event_iterator_get_ie_raw_local_destroy(struct ast_event_iterator *iterator)
+{
+	return raw_local_destroy_from_raw(ast_event_iterator_get_ie_raw(iterator));
 }
 
 uint16_t ast_event_iterator_get_ie_raw_local_payload_len(struct ast_event_iterator *iterator)
 {
-	return ast_event_iterator_get_ie_raw_payload_len(iterator);
+	return raw_local_len_from_raw_len(ast_event_iterator_get_ie_raw_payload_len(iterator));
 }
 
 enum ast_event_type ast_event_get_type(const struct ast_event *event)
@@ -1270,14 +1318,54 @@
 	return 0;
 }
 
+void *raw_local_payload_from_raw(const void *payload)
+{
+	return (void *)(payload + RAW_LOCAL_OFFSET);
+}
+
 const void *ast_event_get_ie_raw_local(const struct ast_event *event, enum ast_event_ie_type ie_type)
 {
-	return ast_event_get_ie_raw(event, ie_type);
+	return raw_local_payload_from_raw(ast_event_get_ie_raw(event, ie_type));
+}
+
+ast_event_ie_payload_copy *raw_local_copy_from_raw(const void *payload)
+{
+	return (ast_event_ie_payload_copy*)payload;
+}
+
+ast_event_ie_payload_copy *ast_event_get_ie_raw_local_copy(const struct ast_event *event, enum ast_event_ie_type ie_type)
+{
+	return raw_local_copy_from_raw(ast_event_get_ie_raw(event, ie_type));
+}
+
+ast_event_ie_payload_cmp *raw_local_cmp_from_raw(const void *payload)
+{
+	return (ast_event_ie_payload_cmp*)(payload + sizeof(void *));
+}
+
+ast_event_ie_payload_cmp *ast_event_get_ie_raw_local_cmp(const struct ast_event *event, enum ast_event_ie_type ie_type)
+{
+	return raw_local_cmp_from_raw(ast_event_get_ie_raw(event, ie_type));
+}
+
+ast_event_ie_payload_destroy *raw_local_destroy_from_raw(const void *payload)
+{
+	return (ast_event_ie_payload_destroy*)(payload + 2*sizeof(void *));
+}
+
+ast_event_ie_payload_destroy *ast_event_get_ie_raw_local_destroy(const struct ast_event *event, enum ast_event_ie_type ie_type)
+{
+	return raw_local_destroy_from_raw(ast_event_get_ie_raw(event, ie_type));
+}
+
+uint16_t raw_local_len_from_raw_len(uint16_t len)
+{
+	return len - RAW_LOCAL_OFFSET;
 }
 
 uint16_t ast_event_get_ie_raw_local_payload_len(const struct ast_event *event, enum ast_event_ie_type ie_type)
 {
-	return ast_event_get_ie_raw_payload_len(event, ie_type);
+	return raw_local_len_from_raw_len(ast_event_get_ie_raw_payload_len(event, ie_type));
 }
 
 int ast_event_append_ie_str(struct ast_event **event, enum ast_event_ie_type ie_type,
@@ -1345,6 +1433,7 @@
 	struct ast_event_ie *ie;
 	unsigned int extra_len;
 	uint16_t event_len;
+	ast_event_ie_payload_copy copy;
 
 	event_len = ntohs((*event)->event_len);
 	extra_len = sizeof(*ie) + data_len;
@@ -1356,10 +1445,14 @@
 	ie = (struct ast_event_ie *) ( ((char *) *event) + event_len );
 	ie->ie_type = htons(ie_type);
 	ie->ie_payload_len = htons(data_len);
-	ie_maps[ie_type].copy(
-		ie->ie_payload,
-		data,
-		data_len);
+	copy = *raw_local_copy_from_raw(data);
+	*raw_local_copy_from_raw(ie->ie_payload) = copy;
+	*raw_local_cmp_from_raw(ie->ie_payload) = *raw_local_cmp_from_raw(data);
+	*raw_local_destroy_from_raw(ie->ie_payload) = *raw_local_destroy_from_raw(data);
+
+	copy(raw_local_payload_from_raw(ie->ie_payload),
+		raw_local_payload_from_raw(data),
+		raw_local_len_from_raw_len(data_len));
 
 	(*event)->event_len = htons(event_len + extra_len);
 
@@ -1419,12 +1512,16 @@
 		{
 			void *data = va_arg(ap, void *);
 			size_t datalen = va_arg(ap, size_t);
-			ie_value->payload.raw = ast_alloca(datalen);
-			ie_maps[ie_type].copy(
-				ie_value->payload.raw,
+			ie_value->raw_datalen = RAW_LOCAL_OFFSET + datalen;
+			ie_value->payload.raw = ast_alloca(ie_value->raw_datalen);
+			/* store copy, cmp, and destroy */
+			*raw_local_copy_from_raw(ie_value->payload.raw) = va_arg(ap, void *);
+			*raw_local_cmp_from_raw(ie_value->payload.raw) = va_arg(ap, void *);
+			*raw_local_destroy_from_raw(ie_value->payload.raw) = va_arg(ap, void *);
+			(*raw_local_copy_from_raw(ie_value->payload.raw))(
+				raw_local_payload_from_raw(ie_value->payload.raw),
 				data,
 				datalen);
-			ie_value->raw_datalen = datalen;
 			insert = 1;
 			break;
 		}
@@ -1501,12 +1598,11 @@
 	/* take care of IE types that need the use of destructors */
 	for (res = ast_event_iterator_init(&iterator, event); !res; res = ast_event_iterator_next(&iterator)) {
 		if (ast_event_iterator_get_ie_pltype(&iterator) == AST_EVENT_IE_PLTYPE_RAW_LOCAL) {
-			enum ast_event_ie_type ie_type = ast_event_iterator_get_ie_type(&iterator);
 			void *orig = ast_event_iterator_get_ie_raw_local(&iterator);
-			size_t len = ast_event_iterator_get_ie_raw_local_payload_len(&iterator);
+			uint16_t len = ast_event_iterator_get_ie_raw_local_payload_len(&iterator);
 
 			/* run the destructor */
-			ie_maps[ie_type].destroy(orig, len);
+			(*ast_event_iterator_get_ie_raw_local_destroy(&iterator))(orig, len);
 		}
 	}
 
@@ -1542,11 +1638,13 @@
 			void *orig = ast_event_iterator_get_ie_raw_local(&iterator);
 			size_t len = ast_event_iterator_get_ie_raw_local_payload_len(&iterator);
 			void *copy = (void *)ast_event_get_ie_raw_local(dup_event, ie_type);
-
+			ast_event_ie_payload_copy do_copy = *ast_event_iterator_get_ie_raw_local_copy(&iterator);
+
+			/* function pointers were copied over by the memcpy */
 			/* clear this out as if it was never touched */
 			memset(copy, 0, len);
 			/* run the copy constructor */
-			ie_maps[ie_type].copy(copy, orig, len);
+			do_copy(copy, orig, len);
 		}
 	}
 
@@ -1609,7 +1707,18 @@
 		{
 			void *data = va_arg(ap, void *);
 			size_t datalen = va_arg(ap, size_t);
-			ast_event_append_ie_raw_local(&cache_arg_event, ie_type, data, datalen);
+			size_t tmp_len = datalen + RAW_LOCAL_OFFSET;
+			void *tmp_data = ast_alloca(tmp_len);
+
+			/* copy function pointers into the temporary raw local payload */
+			*raw_local_copy_from_raw(tmp_data) = va_arg(ap, void *);
+			*raw_local_cmp_from_raw(tmp_data) = va_arg(ap, void *);
+			*raw_local_destroy_from_raw(tmp_data) = va_arg(ap, void *);
+
+			/* don't use the constructor because this will not be destroyed */
+			memcpy(raw_local_payload_from_raw(tmp_data), data, datalen);
+
+			ast_event_append_ie_raw_local(&cache_arg_event, ie_type, tmp_data, tmp_len);
 			break;
 		}
 		case AST_EVENT_IE_PLTYPE_EXISTS:
@@ -2137,8 +2246,10 @@
 	newchannel_event = ast_event_new(AST_EVENT_CHANNEL_STATE,
 		AST_EVENT_IE_CEL_CHANNAME,          AST_EVENT_IE_PLTYPE_STR, ast_channel_name(chan),
 		AST_EVENT_IE_CHANNEL_STATE,         AST_EVENT_IE_PLTYPE_RAW_LOCAL, snapshot, sizeof(*snapshot),
+			ast_channel_snapshot_copy, ast_channel_snapshot_cmp, ast_channel_snapshot_destroy, 
 		AST_EVENT_IE_END);
 
+	ast_channel_snapshot_destroy(snapshot, sizeof(*snapshot));
 	ast_free(snapshot);
 	if (!newchannel_event) {
 		return -1;

Modified: team/kmoore/channel-state-caching/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/channel-state-caching/main/manager.c?view=diff&rev=380845&r1=380844&r2=380845
==============================================================================
--- team/kmoore/channel-state-caching/main/manager.c (original)
+++ team/kmoore/channel-state-caching/main/manager.c Mon Feb  4 23:12:14 2013
@@ -7480,7 +7480,7 @@
 
 static void channel_state_cb(const struct ast_event *event, void *userdata)
 {
-	const struct ast_channel_snapshot *new_snapshot = ast_event_get_ie_raw(event, AST_EVENT_IE_CHANNEL_STATE);
+	const struct ast_channel_snapshot *new_snapshot = ast_event_get_ie_raw_local(event, AST_EVENT_IE_CHANNEL_STATE);
 	struct ast_channel_snapshot *old_snapshot = NULL, *ao2_snapshot = NULL;
 	int is_hungup = ast_test_flag(&new_snapshot->flags, AST_FLAG_ZOMBIE) ? 1 : 0;
 	int find_flags = OBJ_KEY;




More information about the asterisk-commits mailing list