diff options
Diffstat (limited to 'main/event.c')
-rw-r--r-- | main/event.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/main/event.c b/main/event.c index 9ecf71028..d79b07a89 100644 --- a/main/event.c +++ b/main/event.c @@ -137,6 +137,7 @@ static int ast_event_cmp(void *obj, void *arg, int flags); static int ast_event_hash_mwi(const void *obj, const int flags); static int ast_event_hash_devstate(const void *obj, const int flags); static int ast_event_hash_devstate_change(const void *obj, const int flags); +static int ast_event_hash_presence_state_change(const void *obj, const int flags); #ifdef LOW_MEMORY #define NUM_CACHE_BUCKETS 17 @@ -181,6 +182,11 @@ static struct { .hash_fn = ast_event_hash_devstate_change, .cache_args = { AST_EVENT_IE_DEVICE, AST_EVENT_IE_EID, }, }, + [AST_EVENT_PRESENCE_STATE] = { + .hash_fn = ast_event_hash_presence_state_change, + .cache_args = { AST_EVENT_IE_PRESENCE_STATE, }, + }, + }; /*! @@ -1587,6 +1593,22 @@ static int ast_event_hash_devstate_change(const void *obj, const int flags) return ast_str_hash(ast_event_get_ie_str(event, AST_EVENT_IE_DEVICE)); } +/*! + * \internal + * \brief Hash function for AST_EVENT_PRESENCE_STATE + * + * \param[in] obj an ast_event + * \param[in] flags unused + * + * \return hash value + */ +static int ast_event_hash_presence_state_change(const void *obj, const int flags) +{ + const struct ast_event *event = obj; + + return ast_str_hash(ast_event_get_ie_str(event, AST_EVENT_IE_PRESENCE_PROVIDER)); +} + static int ast_event_hash(const void *obj, const int flags) { const struct ast_event_ref *event_ref; |