<p>Josh Soref has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16783">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">spelling: cacheable<br><br>Change-Id: I12dec6a88b25431a6bb07538112dec1577b4b7de<br>---<br>M channels/chan_iax2.c<br>M include/asterisk/devicestate.h<br>M main/channel.c<br>M main/devicestate.c<br>M res/res_corosync.c<br>M res/res_pjsip_publish_asterisk.c<br>M res/res_xmpp.c<br>M tests/test_stasis.c<br>8 files changed, 57 insertions(+), 57 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/83/16783/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c</span><br><span>index 4decf88..80c0c8b 100644</span><br><span>--- a/channels/chan_iax2.c</span><br><span>+++ b/channels/chan_iax2.c</span><br><span>@@ -5830,7 +5830,7 @@</span><br><span> /*! \brief  Create new call, interface with the PBX core */</span><br><span> static struct ast_channel *ast_iax2_new(int callno, int state, iax2_format capability,</span><br><span>      struct iax2_codec_pref *prefs, const struct ast_assigned_ids *assignedids,</span><br><span style="color: hsl(0, 100%, 40%);">-      const struct ast_channel *requestor, unsigned int cachable)</span><br><span style="color: hsl(120, 100%, 40%);">+   const struct ast_channel *requestor, unsigned int cacheable)</span><br><span> {</span><br><span>    struct ast_channel *tmp = NULL;</span><br><span>      struct chan_iax2_pvt *i;</span><br><span>@@ -5963,7 +5963,7 @@</span><br><span>     i->owner = tmp;</span><br><span>   i->capability = capability;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      if (!cachable) {</span><br><span style="color: hsl(120, 100%, 40%);">+      if (!cacheable) {</span><br><span>            ast_set_flag(ast_channel_flags(tmp), AST_FLAG_DISABLE_DEVSTATE_CACHE);</span><br><span>       }</span><br><span> </span><br><span>diff --git a/include/asterisk/devicestate.h b/include/asterisk/devicestate.h</span><br><span>index 5d7e3a4..e885c21 100644</span><br><span>--- a/include/asterisk/devicestate.h</span><br><span>+++ b/include/asterisk/devicestate.h</span><br><span>@@ -66,8 +66,8 @@</span><br><span>  *  \note This is used to define the cacheability of a device state when set.</span><br><span>  */</span><br><span> enum ast_devstate_cache {</span><br><span style="color: hsl(0, 100%, 40%);">-     AST_DEVSTATE_NOT_CACHABLE,  /*!< This device state is not cachable */</span><br><span style="color: hsl(0, 100%, 40%);">-        AST_DEVSTATE_CACHABLE,      /*!< This device state is cachable */</span><br><span style="color: hsl(120, 100%, 40%);">+  AST_DEVSTATE_NOT_CACHABLE,  /*!< This device state is not cacheable */</span><br><span style="color: hsl(120, 100%, 40%);">+     AST_DEVSTATE_CACHABLE,      /*!< This device state is cacheable */</span><br><span> };</span><br><span> </span><br><span> /*! \brief Devicestate provider call back */</span><br><span>@@ -136,7 +136,7 @@</span><br><span>  * \brief Tells Asterisk the State for Device is changed</span><br><span>  *</span><br><span>  * \param state the new state of the device</span><br><span style="color: hsl(0, 100%, 40%);">- * \param cachable whether this device state is cachable</span><br><span style="color: hsl(120, 100%, 40%);">+ * \param cacheable whether this device state is cacheable</span><br><span>  * \param fmt device name like a dial string with format parameters</span><br><span>  *</span><br><span>  * The new state of the device will be sent off to any subscribers</span><br><span>@@ -146,14 +146,14 @@</span><br><span>  * \retval 0 on success</span><br><span>  * \retval -1 on failure</span><br><span>  */</span><br><span style="color: hsl(0, 100%, 40%);">-int ast_devstate_changed(enum ast_device_state state, enum ast_devstate_cache cachable, const char *fmt, ...)</span><br><span style="color: hsl(120, 100%, 40%);">+int ast_devstate_changed(enum ast_device_state state, enum ast_devstate_cache cacheable, const char *fmt, ...)</span><br><span>     __attribute__((format(printf, 3, 4)));</span><br><span> </span><br><span> /*!</span><br><span>  * \brief Tells Asterisk the State for Device is changed</span><br><span>  *</span><br><span>  * \param state the new state of the device</span><br><span style="color: hsl(0, 100%, 40%);">- * \param cachable whether this device state is cachable</span><br><span style="color: hsl(120, 100%, 40%);">+ * \param cacheable whether this device state is cacheable</span><br><span>  * \param device device name like a dial string with format parameters</span><br><span>  *</span><br><span>  * The new state of the device will be sent off to any subscribers</span><br><span>@@ -163,7 +163,7 @@</span><br><span>  * \retval 0 on success</span><br><span>  * \retval -1 on failure</span><br><span>  */</span><br><span style="color: hsl(0, 100%, 40%);">-int ast_devstate_changed_literal(enum ast_device_state state, enum ast_devstate_cache cachable, const char *device);</span><br><span style="color: hsl(120, 100%, 40%);">+int ast_devstate_changed_literal(enum ast_device_state state, enum ast_devstate_cache cacheable, const char *device);</span><br><span> </span><br><span> /*!</span><br><span>  * \brief Add device state provider</span><br><span>@@ -249,7 +249,7 @@</span><br><span>  /*! The state of the device */</span><br><span>       enum ast_device_state state;</span><br><span>         /*! Flag designating the cacheability of this device state */</span><br><span style="color: hsl(0, 100%, 40%);">-   enum ast_devstate_cache cachable;</span><br><span style="color: hsl(120, 100%, 40%);">+     enum ast_devstate_cache cacheable;</span><br><span>   /*! The device and eid data is stuffed here when the struct is allocated. */</span><br><span>         struct ast_eid stuff[0];</span><br><span> };</span><br><span>@@ -315,19 +315,19 @@</span><br><span>  * \brief Publish a device state update</span><br><span>  * \param[in] device The device name</span><br><span>  * \param[in] state The state of the device</span><br><span style="color: hsl(0, 100%, 40%);">- * \param[in] cachable Whether the device state can be cached</span><br><span style="color: hsl(120, 100%, 40%);">+ * \param[in] cacheable Whether the device state can be cached</span><br><span>  * \retval 0 Success</span><br><span>  * \retval -1 Failure</span><br><span>  * \since 12</span><br><span>  */</span><br><span style="color: hsl(0, 100%, 40%);">-#define ast_publish_device_state(device, state, cachable) \</span><br><span style="color: hsl(0, 100%, 40%);">-        ast_publish_device_state_full(device, state, cachable, &ast_eid_default)</span><br><span style="color: hsl(120, 100%, 40%);">+#define ast_publish_device_state(device, state, cacheable) \</span><br><span style="color: hsl(120, 100%, 40%);">+    ast_publish_device_state_full(device, state, cacheable, &ast_eid_default)</span><br><span> </span><br><span> /*!</span><br><span>  * \brief Publish a device state update with EID</span><br><span>  * \param[in] device The device name</span><br><span>  * \param[in] state The state of the device</span><br><span style="color: hsl(0, 100%, 40%);">- * \param[in] cachable Whether the device state can be cached</span><br><span style="color: hsl(120, 100%, 40%);">+ * \param[in] cacheable Whether the device state can be cached</span><br><span>  * \param[in] eid The EID of the server that originally published the message</span><br><span>  * \retval 0 Success</span><br><span>  * \retval -1 Failure</span><br><span>@@ -336,7 +336,7 @@</span><br><span> int ast_publish_device_state_full(</span><br><span>                       const char *device,</span><br><span>                  enum ast_device_state state,</span><br><span style="color: hsl(0, 100%, 40%);">-                    enum ast_devstate_cache cachable,</span><br><span style="color: hsl(120, 100%, 40%);">+                     enum ast_devstate_cache cacheable,</span><br><span>                   struct ast_eid *eid);</span><br><span> </span><br><span> #if defined(__cplusplus) || defined(c_plusplus)</span><br><span>diff --git a/main/channel.c b/main/channel.c</span><br><span>index d601595..8868260 100644</span><br><span>--- a/main/channel.c</span><br><span>+++ b/main/channel.c</span><br><span>@@ -7052,7 +7052,7 @@</span><br><span>    ast_channel_state_set(original, ast_channel_state(clonechan));</span><br><span>       ast_channel_state_set(clonechan, origstate);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        /* And the swap the cachable state too. Otherwise we'd start caching</span><br><span style="color: hsl(120, 100%, 40%);">+      /* And the swap the cacheable state too. Otherwise we'd start caching</span><br><span>     * Local channels and ignoring real ones. */</span><br><span>         orig_disablestatecache = ast_test_flag(ast_channel_flags(original), AST_FLAG_DISABLE_DEVSTATE_CACHE);</span><br><span>        clone_disablestatecache = ast_test_flag(ast_channel_flags(clonechan), AST_FLAG_DISABLE_DEVSTATE_CACHE);</span><br><span>diff --git a/main/devicestate.c b/main/devicestate.c</span><br><span>index ecf255f..9033047 100644</span><br><span>--- a/main/devicestate.c</span><br><span>+++ b/main/devicestate.c</span><br><span>@@ -199,7 +199,7 @@</span><br><span> </span><br><span> struct state_change {</span><br><span>      AST_LIST_ENTRY(state_change) list;</span><br><span style="color: hsl(0, 100%, 40%);">-      enum ast_devstate_cache cachable;</span><br><span style="color: hsl(120, 100%, 40%);">+     enum ast_devstate_cache cacheable;</span><br><span>   char device[1];</span><br><span> };</span><br><span> </span><br><span>@@ -457,7 +457,7 @@</span><br><span> </span><br><span> /*! Called by the state change thread to find out what the state is, and then</span><br><span>  *  to queue up the state change event */</span><br><span style="color: hsl(0, 100%, 40%);">-static void do_state_change(const char *device, enum ast_devstate_cache cachable)</span><br><span style="color: hsl(120, 100%, 40%);">+static void do_state_change(const char *device, enum ast_devstate_cache cacheable)</span><br><span> {</span><br><span>  enum ast_device_state state;</span><br><span> </span><br><span>@@ -465,10 +465,10 @@</span><br><span> </span><br><span>         ast_debug(3, "Changing state for %s - state %u (%s)\n", device, state, ast_devstate2str(state));</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  ast_publish_device_state(device, state, cachable);</span><br><span style="color: hsl(120, 100%, 40%);">+    ast_publish_device_state(device, state, cacheable);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-int ast_devstate_changed_literal(enum ast_device_state state, enum ast_devstate_cache cachable, const char *device)</span><br><span style="color: hsl(120, 100%, 40%);">+int ast_devstate_changed_literal(enum ast_device_state state, enum ast_devstate_cache cacheable, const char *device)</span><br><span> {</span><br><span>   struct state_change *change;</span><br><span> </span><br><span>@@ -489,15 +489,15 @@</span><br><span>      */</span><br><span> </span><br><span>      if (state != AST_DEVICE_UNKNOWN) {</span><br><span style="color: hsl(0, 100%, 40%);">-              ast_publish_device_state(device, state, cachable);</span><br><span style="color: hsl(120, 100%, 40%);">+            ast_publish_device_state(device, state, cacheable);</span><br><span>  } else if (change_thread == AST_PTHREADT_NULL || !(change = ast_calloc(1, sizeof(*change) + strlen(device)))) {</span><br><span>              /* we could not allocate a change struct, or */</span><br><span>              /* there is no background thread, so process the change now */</span><br><span style="color: hsl(0, 100%, 40%);">-          do_state_change(device, cachable);</span><br><span style="color: hsl(120, 100%, 40%);">+            do_state_change(device, cacheable);</span><br><span>  } else {</span><br><span>             /* queue the change */</span><br><span>               strcpy(change->device, device);</span><br><span style="color: hsl(0, 100%, 40%);">-              change->cachable = cachable;</span><br><span style="color: hsl(120, 100%, 40%);">+               change->cacheable = cacheable;</span><br><span>            AST_LIST_LOCK(&state_changes);</span><br><span>           AST_LIST_INSERT_TAIL(&state_changes, change, list);</span><br><span>              ast_cond_signal(&change_pending);</span><br><span>@@ -507,7 +507,7 @@</span><br><span>  return 0;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-int ast_devstate_changed(enum ast_device_state state, enum ast_devstate_cache cachable, const char *fmt, ...)</span><br><span style="color: hsl(120, 100%, 40%);">+int ast_devstate_changed(enum ast_device_state state, enum ast_devstate_cache cacheable, const char *fmt, ...)</span><br><span> {</span><br><span>         char buf[AST_MAX_EXTENSION];</span><br><span>         va_list ap;</span><br><span>@@ -516,7 +516,7 @@</span><br><span>    vsnprintf(buf, sizeof(buf), fmt, ap);</span><br><span>        va_end(ap);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- return ast_devstate_changed_literal(state, cachable, buf);</span><br><span style="color: hsl(120, 100%, 40%);">+    return ast_devstate_changed_literal(state, cacheable, buf);</span><br><span> }</span><br><span> </span><br><span> /*! \brief Go through the dev state change queue and update changes in the dev state thread */</span><br><span>@@ -536,7 +536,7 @@</span><br><span>                 /* Process each state change */</span><br><span>              while ((current = next)) {</span><br><span>                   next = AST_LIST_NEXT(current, list);</span><br><span style="color: hsl(0, 100%, 40%);">-                    do_state_change(current->device, current->cachable);</span><br><span style="color: hsl(120, 100%, 40%);">+                    do_state_change(current->device, current->cacheable);</span><br><span>                  ast_free(current);</span><br><span>           }</span><br><span>    }</span><br><span>@@ -544,7 +544,7 @@</span><br><span>      return NULL;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static struct ast_device_state_message *device_state_alloc(const char *device, enum ast_device_state state, enum ast_devstate_cache cachable, const struct ast_eid *eid)</span><br><span style="color: hsl(120, 100%, 40%);">+static struct ast_device_state_message *device_state_alloc(const char *device, enum ast_device_state state, enum ast_devstate_cache cacheable, const struct ast_eid *eid)</span><br><span> {</span><br><span>        struct ast_device_state_message *new_device_state;</span><br><span>   char *pos;</span><br><span>@@ -575,7 +575,7 @@</span><br><span>     new_device_state->device = pos;</span><br><span> </span><br><span>       new_device_state->state = state;</span><br><span style="color: hsl(0, 100%, 40%);">-     new_device_state->cachable = cachable;</span><br><span style="color: hsl(120, 100%, 40%);">+     new_device_state->cacheable = cacheable;</span><br><span> </span><br><span>      return new_device_state;</span><br><span> }</span><br><span>@@ -589,7 +589,7 @@</span><br><span>  }</span><br><span> </span><br><span>        device_state = stasis_message_data(msg);</span><br><span style="color: hsl(0, 100%, 40%);">-        if (device_state->cachable == AST_DEVSTATE_CACHABLE || !device_state->eid) {</span><br><span style="color: hsl(120, 100%, 40%);">+    if (device_state->cacheable == AST_DEVSTATE_CACHABLE || !device_state->eid) {</span><br><span>          /* Ignore cacheable and aggregate messages. */</span><br><span>               return;</span><br><span>      }</span><br><span>@@ -599,7 +599,7 @@</span><br><span>       * device state republished as the aggregate.</span><br><span>         */</span><br><span>  ast_publish_device_state_full(device_state->device, device_state->state,</span><br><span style="color: hsl(0, 100%, 40%);">-          device_state->cachable, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+             device_state->cacheable, NULL);</span><br><span> }</span><br><span> </span><br><span> static void device_state_engine_cleanup(void)</span><br><span>@@ -709,7 +709,7 @@</span><br><span> int ast_publish_device_state_full(</span><br><span>     const char *device,</span><br><span>  enum ast_device_state state,</span><br><span style="color: hsl(0, 100%, 40%);">-    enum ast_devstate_cache cachable,</span><br><span style="color: hsl(120, 100%, 40%);">+     enum ast_devstate_cache cacheable,</span><br><span>   struct ast_eid *eid)</span><br><span> {</span><br><span>    RAII_VAR(struct ast_device_state_message *, device_state, NULL, ao2_cleanup);</span><br><span>@@ -722,7 +722,7 @@</span><br><span>          return -1;</span><br><span>   }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   device_state = device_state_alloc(device, state, cachable, eid);</span><br><span style="color: hsl(120, 100%, 40%);">+      device_state = device_state_alloc(device, state, cacheable, eid);</span><br><span>    if (!device_state) {</span><br><span>                 return -1;</span><br><span>   }</span><br><span>@@ -741,10 +741,10 @@</span><br><span>     * When a device state is not to be cached we only publish to its</span><br><span>     * specific topic if something has already created the topic. Publishing</span><br><span>      * to its topic otherwise would create the topic, which may not be</span><br><span style="color: hsl(0, 100%, 40%);">-       * necessary as it could be an ephemeral device. Uncachable updates</span><br><span style="color: hsl(120, 100%, 40%);">+    * necessary as it could be an ephemeral device. Uncacheable updates</span><br><span>          * traditionally come from such things as Local channels.</span><br><span>     */</span><br><span style="color: hsl(0, 100%, 40%);">-     if (cachable || stasis_topic_pool_topic_exists(device_state_topic_pool, device)) {</span><br><span style="color: hsl(120, 100%, 40%);">+    if (cacheable || stasis_topic_pool_topic_exists(device_state_topic_pool, device)) {</span><br><span>          topic = ast_device_state_topic(device);</span><br><span>      } else {</span><br><span>             topic = ast_device_state_topic_all();</span><br><span>@@ -767,7 +767,7 @@</span><br><span>  }</span><br><span> </span><br><span>        device_state = stasis_message_data(message);</span><br><span style="color: hsl(0, 100%, 40%);">-    if (device_state->cachable == AST_DEVSTATE_NOT_CACHABLE) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (device_state->cacheable == AST_DEVSTATE_NOT_CACHABLE) {</span><br><span>               return NULL;</span><br><span>         }</span><br><span> </span><br><span>@@ -968,14 +968,14 @@</span><br><span>                event = ast_event_new(AST_EVENT_DEVICE_STATE_CHANGE,</span><br><span>                                             AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, device_state->device,</span><br><span>                                       AST_EVENT_IE_STATE, AST_EVENT_IE_PLTYPE_UINT, device_state->state,</span><br><span style="color: hsl(0, 100%, 40%);">-                                           AST_EVENT_IE_CACHABLE, AST_EVENT_IE_PLTYPE_UINT, device_state->cachable,</span><br><span style="color: hsl(120, 100%, 40%);">+                                           AST_EVENT_IE_CACHABLE, AST_EVENT_IE_PLTYPE_UINT, device_state->cacheable,</span><br><span>                                         AST_EVENT_IE_EID, AST_EVENT_IE_PLTYPE_RAW, device_state->eid, sizeof(*device_state->eid),</span><br><span>                                      AST_EVENT_IE_END);</span><br><span>       } else {</span><br><span>             event = ast_event_new(AST_EVENT_DEVICE_STATE,</span><br><span>                                            AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, device_state->device,</span><br><span>                                       AST_EVENT_IE_STATE, AST_EVENT_IE_PLTYPE_UINT, device_state->state,</span><br><span style="color: hsl(0, 100%, 40%);">-                                           AST_EVENT_IE_CACHABLE, AST_EVENT_IE_PLTYPE_UINT, device_state->cachable,</span><br><span style="color: hsl(120, 100%, 40%);">+                                           AST_EVENT_IE_CACHABLE, AST_EVENT_IE_PLTYPE_UINT, device_state->cacheable,</span><br><span>                                         AST_EVENT_IE_END);</span><br><span>       }</span><br><span> </span><br><span>diff --git a/res/res_corosync.c b/res/res_corosync.c</span><br><span>index e5448b9..f89ac69 100644</span><br><span>--- a/res/res_corosync.c</span><br><span>+++ b/res/res_corosync.c</span><br><span>@@ -433,21 +433,21 @@</span><br><span> {</span><br><span>      const char *device;</span><br><span>  enum ast_device_state state;</span><br><span style="color: hsl(0, 100%, 40%);">-    unsigned int cachable;</span><br><span style="color: hsl(120, 100%, 40%);">+        unsigned int cacheable;</span><br><span>      struct ast_eid *event_eid;</span><br><span> </span><br><span>       ast_assert(ast_event_get_type(event) == AST_EVENT_DEVICE_STATE_CHANGE);</span><br><span> </span><br><span>  device = ast_event_get_ie_str(event, AST_EVENT_IE_DEVICE);</span><br><span>   state = ast_event_get_ie_uint(event, AST_EVENT_IE_STATE);</span><br><span style="color: hsl(0, 100%, 40%);">-       cachable = ast_event_get_ie_uint(event, AST_EVENT_IE_CACHABLE);</span><br><span style="color: hsl(120, 100%, 40%);">+       cacheable = ast_event_get_ie_uint(event, AST_EVENT_IE_CACHABLE);</span><br><span>     event_eid = (struct ast_eid *)ast_event_get_ie_raw(event, AST_EVENT_IE_EID);</span><br><span> </span><br><span>     if (ast_strlen_zero(device)) {</span><br><span>               return;</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   if (ast_publish_device_state_full(device, state, cachable, event_eid)) {</span><br><span style="color: hsl(120, 100%, 40%);">+      if (ast_publish_device_state_full(device, state, cacheable, event_eid)) {</span><br><span>            char eid[18];</span><br><span>                ast_eid_to_str(eid, sizeof(eid), event_eid);</span><br><span>                 ast_log(LOG_WARNING, "Failed to publish device state message for %s from %s\n",</span><br><span>diff --git a/res/res_pjsip_publish_asterisk.c b/res/res_pjsip_publish_asterisk.c</span><br><span>index 5fea3bf..e27959a 100644</span><br><span>--- a/res/res_pjsip_publish_asterisk.c</span><br><span>+++ b/res/res_pjsip_publish_asterisk.c</span><br><span>@@ -204,7 +204,7 @@</span><br><span>                 "type", "devicestate",</span><br><span>           "device", dev_state->device,</span><br><span>            "state", ast_devstate_str(dev_state->state),</span><br><span style="color: hsl(0, 100%, 40%);">-               "cachable", dev_state->cachable,</span><br><span style="color: hsl(120, 100%, 40%);">+         "cacheable", dev_state->cacheable,</span><br><span>              "eid", eid_str);</span><br><span>   if (!json) {</span><br><span>                 return;</span><br><span>@@ -494,7 +494,7 @@</span><br><span> {</span><br><span>   const char *device = ast_json_string_get(ast_json_object_get(json, "device"));</span><br><span>     const char *state = ast_json_string_get(ast_json_object_get(json, "state"));</span><br><span style="color: hsl(0, 100%, 40%);">-  int cachable = ast_json_integer_get(ast_json_object_get(json, "cachable"));</span><br><span style="color: hsl(120, 100%, 40%);">+ int cacheable = ast_json_integer_get(ast_json_object_get(json, "cacheable"));</span><br><span> </span><br><span>  if (!config->device_state) {</span><br><span>              ast_debug(2, "Received device state event for resource '%s' but it is not configured to accept them\n",</span><br><span>@@ -515,7 +515,7 @@</span><br><span>      }</span><br><span> </span><br><span>        ast_publish_device_state_full(device, ast_devstate_val(state),</span><br><span style="color: hsl(0, 100%, 40%);">-          cachable == AST_DEVSTATE_CACHABLE ? AST_DEVSTATE_CACHABLE : AST_DEVSTATE_NOT_CACHABLE,</span><br><span style="color: hsl(120, 100%, 40%);">+                cacheable == AST_DEVSTATE_CACHABLE ? AST_DEVSTATE_CACHABLE : AST_DEVSTATE_NOT_CACHABLE,</span><br><span>              pubsub_eid);</span><br><span> </span><br><span>     return 0;</span><br><span>diff --git a/res/res_xmpp.c b/res/res_xmpp.c</span><br><span>index ebf128d..1815564 100644</span><br><span>--- a/res/res_xmpp.c</span><br><span>+++ b/res/res_xmpp.c</span><br><span>@@ -1069,7 +1069,7 @@</span><br><span>  * \return iks *</span><br><span>  */</span><br><span> static iks* xmpp_pubsub_build_publish_skeleton(struct ast_xmpp_client *client, const char *node,</span><br><span style="color: hsl(0, 100%, 40%);">-                                          const char *event_type, unsigned int cachable)</span><br><span style="color: hsl(120, 100%, 40%);">+                                        const char *event_type, unsigned int cacheable)</span><br><span> {</span><br><span>  RAII_VAR(struct xmpp_config *, cfg, ao2_global_obj_ref(globals), ao2_cleanup);</span><br><span>       iks *request, *pubsub, *publish, *item;</span><br><span>@@ -1085,7 +1085,7 @@</span><br><span>      item = iks_insert(publish, "item");</span><br><span>        iks_insert_attrib(item, "id", node);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      if (cachable == AST_DEVSTATE_NOT_CACHABLE) {</span><br><span style="color: hsl(120, 100%, 40%);">+  if (cacheable == AST_DEVSTATE_NOT_CACHABLE) {</span><br><span>                iks *options, *x, *field_form_type, *field_persist;</span><br><span> </span><br><span>              options = iks_insert(pubsub, "publish-options");</span><br><span>@@ -1298,13 +1298,13 @@</span><br><span>  * \return void</span><br><span>  */</span><br><span> static void xmpp_pubsub_publish_device_state(struct ast_xmpp_client *client, const char *device,</span><br><span style="color: hsl(0, 100%, 40%);">-                                           const char *device_state, unsigned int cachable)</span><br><span style="color: hsl(120, 100%, 40%);">+                                      const char *device_state, unsigned int cacheable)</span><br><span> {</span><br><span>  RAII_VAR(struct xmpp_config *, cfg, ao2_global_obj_ref(globals), ao2_cleanup);</span><br><span>       iks *request, *state;</span><br><span style="color: hsl(0, 100%, 40%);">-   char eid_str[20], cachable_str[2];</span><br><span style="color: hsl(120, 100%, 40%);">+    char eid_str[20], cacheable_str[2];</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (!cfg || !cfg->global || !(request = xmpp_pubsub_build_publish_skeleton(client, device, "device_state", cachable))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!cfg || !cfg->global || !(request = xmpp_pubsub_build_publish_skeleton(client, device, "device_state", cacheable))) {</span><br><span>               return;</span><br><span>      }</span><br><span> </span><br><span>@@ -1320,8 +1320,8 @@</span><br><span>        state = iks_insert(request, "state");</span><br><span>      iks_insert_attrib(state, "xmlns", "http://asterisk.org");</span><br><span>        iks_insert_attrib(state, "eid", eid_str);</span><br><span style="color: hsl(0, 100%, 40%);">-     snprintf(cachable_str, sizeof(cachable_str), "%u", cachable);</span><br><span style="color: hsl(0, 100%, 40%);">- iks_insert_attrib(state, "cachable", cachable_str);</span><br><span style="color: hsl(120, 100%, 40%);">+ snprintf(cacheable_str, sizeof(cacheable_str), "%u", cacheable);</span><br><span style="color: hsl(120, 100%, 40%);">+    iks_insert_attrib(state, "cacheable", cacheable_str);</span><br><span>      iks_insert_cdata(state, device_state, strlen(device_state));</span><br><span>         ast_xmpp_client_send(client, iks_root(request));</span><br><span>     iks_delete(request);</span><br><span>@@ -1376,7 +1376,7 @@</span><br><span>                 return;</span><br><span>      }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   xmpp_pubsub_publish_device_state(client, dev_state->device, ast_devstate_str(dev_state->state), dev_state->cachable);</span><br><span style="color: hsl(120, 100%, 40%);">+        xmpp_pubsub_publish_device_state(client, dev_state->device, ast_devstate_str(dev_state->state), dev_state->cacheable);</span><br><span> }</span><br><span> </span><br><span> /*!</span><br><span>@@ -1460,11 +1460,11 @@</span><br><span>  */</span><br><span> static int xmpp_pubsub_handle_event(void *data, ikspak *pak)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-   char *item_id, *device_state, *mailbox, *cachable_str;</span><br><span style="color: hsl(120, 100%, 40%);">+        char *item_id, *device_state, *mailbox, *cacheable_str;</span><br><span>      int oldmsgs, newmsgs;</span><br><span>        iks *item, *item_content;</span><br><span>    struct ast_eid pubsub_eid;</span><br><span style="color: hsl(0, 100%, 40%);">-      unsigned int cachable = AST_DEVSTATE_CACHABLE;</span><br><span style="color: hsl(120, 100%, 40%);">+        unsigned int cacheable = AST_DEVSTATE_CACHABLE;</span><br><span>      item = iks_find(iks_find(iks_find(pak->x, "event"), "items"), "item");</span><br><span>      if (!item) {</span><br><span>                 ast_log(LOG_ERROR, "Could not parse incoming PubSub event\n");</span><br><span>@@ -1478,13 +1478,13 @@</span><br><span>           return IKS_FILTER_EAT;</span><br><span>       }</span><br><span>    if (!strcasecmp(iks_name(item_content), "state")) {</span><br><span style="color: hsl(0, 100%, 40%);">-           if ((cachable_str = iks_find_attrib(item_content, "cachable"))) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     sscanf(cachable_str, "%30u", &cachable);</span><br><span style="color: hsl(120, 100%, 40%);">+                if ((cacheable_str = iks_find_attrib(item_content, "cacheable"))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 sscanf(cacheable_str, "%30u", &cacheable);</span><br><span>             }</span><br><span>            device_state = iks_find_cdata(item, "state");</span><br><span>              ast_publish_device_state_full(item_id,</span><br><span>                                               ast_devstate_val(device_state),</span><br><span style="color: hsl(0, 100%, 40%);">-                                         cachable == AST_DEVSTATE_CACHABLE ? AST_DEVSTATE_CACHABLE : AST_DEVSTATE_NOT_CACHABLE,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                cacheable == AST_DEVSTATE_CACHABLE ? AST_DEVSTATE_CACHABLE : AST_DEVSTATE_NOT_CACHABLE,</span><br><span>                                              &pubsub_eid);</span><br><span>            return IKS_FILTER_EAT;</span><br><span>       } else if (!strcasecmp(iks_name(item_content), "mailbox")) {</span><br><span>diff --git a/tests/test_stasis.c b/tests/test_stasis.c</span><br><span>index 08c3d1e..16a93ff 100644</span><br><span>--- a/tests/test_stasis.c</span><br><span>+++ b/tests/test_stasis.c</span><br><span>@@ -900,12 +900,12 @@</span><br><span> </span><br><span> static const char *cache_test_data_id(struct stasis_message *message)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-       struct cache_test_data *cachable = stasis_message_data(message);</span><br><span style="color: hsl(120, 100%, 40%);">+      struct cache_test_data *cacheable = stasis_message_data(message);</span><br><span> </span><br><span>        if (0 != strcmp("Cacheable", stasis_message_type_name(stasis_message_type(message)))) {</span><br><span>            return NULL;</span><br><span>         }</span><br><span style="color: hsl(0, 100%, 40%);">-       return cachable->id;</span><br><span style="color: hsl(120, 100%, 40%);">+       return cacheable->id;</span><br><span> }</span><br><span> </span><br><span> static struct stasis_message *cache_test_aggregate_calc_fn(struct stasis_cache_entry *entry, struct stasis_message *new_snapshot)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16783">change 16783</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/16783"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I12dec6a88b25431a6bb07538112dec1577b4b7de </div>
<div style="display:none"> Gerrit-Change-Number: 16783 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Josh Soref <jsoref@gmail.com> </div>
<div style="display:none"> Gerrit-CC: Friendly Automation </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>