Fix #3156430: Messages not Delivered (4th attempt)
commit989b2fc15614b0afb49ecd88f38396b846fb8495
authorStefan Becker <stefan.becker@nokia.com>
Thu, 3 Feb 2011 11:24:34 +0000 (3 13:24 +0200)
committerStefan Becker <stefan.becker@nokia.com>
Thu, 3 Feb 2011 11:24:34 +0000 (3 13:24 +0200)
tree8359f096c603f00aa132b3da0044036e416a5522
parentd12251cbec5ab0aa4b737ad22ae2a73234002a01
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