From: Stefan Becker Date: Thu, 5 Dec 2013 07:19:02 +0000 (+0200) Subject: Fix #222: SIPE crashes when groupchat session expires (VII) X-Git-Tag: 1.17.3~2 X-Git-Url: https://repo.or.cz/w/siplcs.git/commitdiff_plain/e16c93e2ae0e6d89e0ae01d19ef753da3ebc4367 Fix #222: SIPE crashes when groupchat session expires (VII) We need to drop the dialog from our side before we can call sipe_groupchat_init(), otherwise no INVITE will be sent out. (cherry picked from commit 57f6744f9c2c5dc350c88c74d88a49ea29908704) --- diff --git a/src/core/sipe-groupchat.c b/src/core/sipe-groupchat.c index 74d22e74..294cbff5 100644 --- a/src/core/sipe-groupchat.c +++ b/src/core/sipe-groupchat.c @@ -373,6 +373,16 @@ static gboolean groupchat_expired_session_response(struct sipe_core_private *sip /* 481 Call Leg Does Not Exist -> server dropped session */ if (msg->response == 481) { + struct sip_session *session = groupchat->session; + struct sip_dialog *dialog = sipe_dialog_find(session, + session->with); + + /* close dialog from our side */ + sip_transport_bye(sipe_private, dialog); + sipe_dialog_remove(session, session->with); + /* dialog is no longer valid */ + + /* re-initialize groupchat session */ groupchat->session = NULL; groupchat->connected = FALSE; sipe_groupchat_init(sipe_private);