[asterisk-bugs] [JIRA] (ASTERISK-18078) [patch] Segfault when publishing device states via XMPP and not connected

Michael L. Young (JIRA) noreply at issues.asterisk.org
Wed Oct 24 20:12:18 CDT 2012


    [ https://issues.asterisk.org/jira/browse/ASTERISK-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=198897#comment-198897 ] 

Michael L. Young edited comment on ASTERISK-18078 at 10/24/12 8:11 PM:
-----------------------------------------------------------------------

Hi Michael,

i have modified the funtion aji_devstate_cb in this way (cut&paste causes some garbled tabs)

{noformat}
        if (client->state == AJI_CONNECTED) {
                aji_publish_device_state(client, device, device_state);
        } else {
                ast_log(LOG_DEBUG, "Can't publish device state, client is not connected\n");
        }
{noformat}

BR Simone
                
      was (Author: siouxes):
    Hi Michael,

i have modified the funtion aji_devstate_cb in this way (cut&paste causes some garbled tabs)

static void aji_devstate_cb(const struct ast_event *ast_event, void *data)
{
        const char *device;
        const char *device_state;
        struct aji_client *client;
        if (ast_eid_cmp(&ast_eid_default, ast_event_get_ie_raw(ast_event, AST_EVENT_IE_EID)))
        {
                /* If the event didn't originate from this server, don't send it back out. */
                ast_log(LOG_DEBUG, "Returning here\n");
                return;
        }

        client = ASTOBJ_REF((struct aji_client *) data);
        device = ast_event_get_ie_str(ast_event, AST_EVENT_IE_DEVICE);
        device_state = ast_devstate_str(ast_event_get_ie_uint(ast_event, AST_EVENT_IE_STATE));
        if (client->state == AJI_CONNECTED) {
                aji_publish_device_state(client, device, device_state);
        } else {
                ast_log(LOG_DEBUG, "Can't publish device state, client is not connected\n");
        }
        ASTOBJ_UNREF(client, ast_aji_client_destroy);
}


BR Simone
                  
> [patch] Segfault when publishing device states via XMPP and not connected
> -------------------------------------------------------------------------
>
>                 Key: ASTERISK-18078
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-18078
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_jabber
>    Affects Versions: SVN, 1.8.4, 1.8.5.0
>            Reporter: Michael L. Young
>            Severity: Critical
>         Attachments: gdb290812.txt, res_jabber-segfault-pubsub-not-connected2.patch, res_jabber-segfault-pubsub-not-connected.patch
>
>
> When using XMPP PubSub to distribute device states, if the XMPP server disappears and Asterisk tries to publish device states, we will segfault.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list