From 989b2fc15614b0afb49ecd88f38396b846fb8495 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Thu, 3 Feb 2011 13:24:34 +0200 Subject: [PATCH] Fix #3156430: Messages not Delivered (4th attempt) I encountered a related situation: the remote party changes the client. - remote party is online with M$ Communicator (PC) and pidgin-sipe (N900) - start IM with remote party, e.g. appears at Communicator (a) - remote party sends IM "On PC" with Communicator - remote party starts IM on N900 and sends "On N900" (b) - we send IM "test" (c) -> Server responds with "500 internal error" -> "Message not delivered: service not available" When the session starts (a) we receive the remote epid and use it in our messages. (b) starts a new session, i.e. we receive an INVITE with a new epid. We detect that we already have an ongoing session, send BYE for the old one and parse the dialog information. But sipe_dialog_parse() doesn't update the remote epid, because it is already set in the dialog. (c) is therefore sent with the old epid and the server can't route the message to the new client. Changed process_incoming_invite() to clear dialog->theirepid after we sent BYE for the old session. --- src/core/sipe-incoming.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/sipe-incoming.c b/src/core/sipe-incoming.c index 63d5b9e2..cd431417 100644 --- a/src/core/sipe-incoming.c +++ b/src/core/sipe-incoming.c @@ -449,6 +449,8 @@ void process_incoming_invite(struct sipe_core_private *sipe_private, sipe_im_reenqueue_unconfirmed(sipe_private, session, dialog->callid, from); g_free(dialog->callid); + g_free(dialog->theirepid); + dialog->theirepid = NULL; } else { dialog = sipe_dialog_add(session); dialog->with = g_strdup(from); -- 2.11.4.GIT