[asterisk-bugs] [JIRA] (ASTERISK-18078) [patch] Segfault when publishing device states via XMPP and not connected
SImone Freddio (JIRA)
noreply at issues.asterisk.org
Wed Oct 24 17:59:18 CDT 2012
[ https://issues.asterisk.org/jira/browse/ASTERISK-18078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=198897#comment-198897 ]
SImone Freddio edited comment on ASTERISK-18078 at 10/24/12 5:58 PM:
---------------------------------------------------------------------
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
was (Author: siouxes):
Hi Michael,
this is my two cents:
--------------------------------------------------------------------------- cut here
--- res/res_jabber.c 2012-10-24 18:31:33.983082648 +0200
+++ res/res_jabber.c 2012-10-24 21:13:17.477083737 +0200
@@ -3210,7 +3210,11 @@
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));
- aji_publish_device_state(client, device, device_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);
}
---------------------------------------------------------------------- cut here
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