mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 00:00:09 +00:00
Distributed Device State broken at sites using res_xmpp or res_jabber where Secuity Advisory AST-2012-015 is inplace
res_xmpp was not adding AST_EVENT_IE_CACHABLE to the event as each message came in, then devstate_change_collector_cb() was unable to find AST_EVENT_IE_CACHABLE in the event, so defaulted incorrectly to AST_DEVSTATE_NOT_CACHABLE. (issue ASTERISK-20175) (closes issue ASTERISK-21429) (closes issue ASTERISK-21069) (closes issue ASTERISK-21164) Reported by: alecdavis Tested by: alecdavis alecdavis (license 585) Review https://reviewboard.asterisk.org/r/2452/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@385938 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1328,14 +1328,15 @@ static int xmpp_pubsub_handle_event(void *data, ikspak *pak)
|
||||
return IKS_FILTER_EAT;
|
||||
}
|
||||
if (!strcasecmp(iks_name(item_content), "state")) {
|
||||
device_state = iks_find_cdata(item, "state");
|
||||
if ((cachable_str = iks_find_cdata(item, "cachable"))) {
|
||||
if ((cachable_str = iks_find_attrib(item_content, "cachable"))) {
|
||||
sscanf(cachable_str, "%30d", &cachable);
|
||||
}
|
||||
device_state = iks_find_cdata(item, "state");
|
||||
if (!(event = ast_event_new(AST_EVENT_DEVICE_STATE_CHANGE,
|
||||
AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, item_id, AST_EVENT_IE_STATE,
|
||||
AST_EVENT_IE_PLTYPE_UINT, ast_devstate_val(device_state), AST_EVENT_IE_EID,
|
||||
AST_EVENT_IE_PLTYPE_RAW, &pubsub_eid, sizeof(pubsub_eid),
|
||||
AST_EVENT_IE_CACHABLE, AST_EVENT_IE_PLTYPE_UINT, cachable,
|
||||
AST_EVENT_IE_END))) {
|
||||
return IKS_FILTER_EAT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user