diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-11-20 00:50:00 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-11-20 00:50:00 +0000 |
commit | d58d0887ce93e8d66d939e013743251bf6cb2bf6 (patch) | |
tree | ac7f93adee3f84f964434d4fb7af08b7fcbaa8ad /include | |
parent | de099b6b1042537fe84444add7bbe28f07b4be3b (diff) |
Merged revisions 295710 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
........
r295710 | russell | 2010-11-19 18:45:51 -0600 (Fri, 19 Nov 2010) | 29 lines
Fix cache of device state changes for multiple servers.
This patch addresses a regression where device states across multiple servers
were not being processing completely correctly. The code works to determine
the overall state by looking at the last known state of a device on each
server. However, there was a regression due to some invasive rewrites of how
the cache works that led to the cache only storing the last device state change
for a device, regardless of which server it was on.
The code is set up to cache device state change events by ensuring that each
event in the cache has a unique device name + entity ID (server ID). The code
that was responsible for comparing raw information elements (which EID is)
always returned a match due to a memcmp() with a length of 0.
There isn't much code to fix the actual bug. This patch also introduces a new
CLI command that was very useful for debugging this problem. The command
allows you to dump the contents of the event cache.
(closes issue #18284)
Reported by: klaus3000
Patches:
issue18284.rev1.txt uploaded by russell (license 2)
Tested by: russell, klaus3000
(closes issue #18280)
Reported by: klaus3000
Review: https://reviewboard.asterisk.org/r/1012/
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@295711 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/event.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/asterisk/event.h b/include/asterisk/event.h index 12459fc9d..9ad3a7082 100644 --- a/include/asterisk/event.h +++ b/include/asterisk/event.h @@ -584,6 +584,17 @@ uint32_t ast_event_get_ie_str_hash(const struct ast_event *event, enum ast_event const void *ast_event_get_ie_raw(const struct ast_event *event, enum ast_event_ie_type ie_type); /*! + * \brief Get the length of the raw payload for a particular IE + * + * \param event The event to get the IE payload length from + * \param ie_type the type of information element to get the length of + * + * \return If an IE of type ie_type is found, its payload length is returned. + * Otherwise, 0 is returned. + */ +uint16_t ast_event_get_ie_raw_payload_len(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 @@ -724,6 +735,15 @@ const char *ast_event_iterator_get_ie_str(struct ast_event_iterator *iterator); */ void *ast_event_iterator_get_ie_raw(struct ast_event_iterator *iterator); +/*! + * \brief Get the length of the raw payload for the current IE for an iterator + * + * \param iterator The IE iterator + * + * \return The payload length of the current IE + */ +uint16_t ast_event_iterator_get_ie_raw_payload_len(struct ast_event_iterator *iterator); + #if defined(__cplusplus) || defined(c_plusplus) } #endif |