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.