[asterisk-commits] file: trunk r81344 - in /trunk: include/asterisk/event.h main/event.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 29 11:03:52 CDT 2007


Author: file
Date: Wed Aug 29 11:03:51 2007
New Revision: 81344

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81344
Log:
To keep others happy... revert part of my additions so trunk works.

Modified:
    trunk/include/asterisk/event.h
    trunk/main/event.c

Modified: trunk/include/asterisk/event.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/event.h?view=diff&rev=81344&r1=81343&r2=81344
==============================================================================
--- trunk/include/asterisk/event.h (original)
+++ trunk/include/asterisk/event.h Wed Aug 29 11:03:51 2007
@@ -450,7 +450,7 @@
  *
  * \return This returns the payload of the information element as a uint.
  */
-uint32_t ast_event_iteragor_get_ie_uint(struct ast_event_iterator *iterator);
+uint32_t ast_event_iterator_get_ie_uint(struct ast_event_iterator *iterator);
 
 /*!
  * \brief Get the value of the current IE in the iterator as a string payload

Modified: trunk/main/event.c
URL: http://svn.digium.com/view/asterisk/trunk/main/event.c?view=diff&rev=81344&r1=81343&r2=81344
==============================================================================
--- trunk/main/event.c (original)
+++ trunk/main/event.c Wed Aug 29 11:03:51 2007
@@ -380,7 +380,7 @@
 	return iterator->ie->ie_type;
 }
 
-uint32_t ast_event_iteragor_get_ie_uint(struct ast_event_iterator *iterator)
+uint32_t ast_event_iterator_get_ie_uint(struct ast_event_iterator *iterator)
 {
 	return ntohl(*iterator->ie->ie_payload);
 }
@@ -416,13 +416,19 @@
 
 const void *ast_event_get_ie_raw(const struct ast_event *event, enum ast_event_ie_type ie_type)
 {
-	struct ast_event_iterator iterator;
-
-	for (ast_event_iterator_init(&iterator, event); !ast_event_iterator_next(&iterator); ) {
-		if (ast_event_iterator_get_ie_type(&iterator) == ie_type)
-			return ast_event_iterator_get_ie_raw(&iterator);
-	}
-
+	struct ast_event_ie *ie;
+	uint16_t event_len;
+	
+	ie_type = ntohs(ie_type);
+	event_len = ntohs(event->event_len);
+	
+	ie = ((void *) event) + sizeof(*event);
+	
+	while ((((void *) ie) - ((void *) event)) < event_len) {
+		if (ie->ie_type == ie_type)
+			return ie->ie_payload;
+	}
+	
 	return NULL;
 }
 




More information about the asterisk-commits mailing list