[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:55: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:54 PM:
---------------------------------------------------------------------
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
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