From: Alec L Davis Date: Tue, 16 Apr 2013 23:44:18 +0000 (+0000) Subject: res_xmpp and res_jabber need to search 'cachable' in the attrib section of the receiv... X-Git-Tag: 13.0.0-beta1~1913 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fed7249ad1a20f5c6ecf8e657a2e83f4af8b379b;p=thirdparty%2Fasterisk.git res_xmpp and res_jabber need to search 'cachable' in the attrib section of the received IE, not data. (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/trunk@385939 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_jabber.c b/res/res_jabber.c index 04bc614e9c..69f3665228 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -3355,10 +3355,10 @@ static int aji_handle_pubsub_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"); ast_publish_device_state_full(item_id, ast_devstate_val(device_state), cachable == AST_DEVSTATE_CACHABLE ? AST_DEVSTATE_CACHABLE : AST_DEVSTATE_NOT_CACHABLE, diff --git a/res/res_xmpp.c b/res/res_xmpp.c index f9cfdac113..dea8372049 100644 --- a/res/res_xmpp.c +++ b/res/res_xmpp.c @@ -1470,10 +1470,10 @@ 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"); ast_publish_device_state_full(item_id, ast_devstate_val(device_state), cachable == AST_DEVSTATE_CACHABLE ? AST_DEVSTATE_CACHABLE : AST_DEVSTATE_NOT_CACHABLE,