Fix a crash as a result of propagating MWI or device state over XMPP when the client is disconnected.

The MWI and device state propagation code wrongly assumes that an XMPP client connection will remain established at all times. This fix corrects that by making the lifetime of the subscription the same as the lifetime of the connection itself. As the connection is established and disconnected the subscription itself is created and destroyed.

(closes issue ASTERISK-18078)
Reported by: elguero


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2012-07-17 16:32:10 +00:00
parent 6027b26fa7
commit 44345b0973
2 changed files with 33 additions and 24 deletions

View File

@@ -134,6 +134,8 @@ struct ast_xmpp_client {
pthread_t thread;
int timeout;
unsigned int reconnect:1; /*!< Reconnect this client */
struct ast_event_sub *mwi_sub; /*!< If distributing event information the MWI subscription */
struct ast_event_sub *device_state_sub; /*!< If distributing event information the device state subscription */
};
/*!