fix-message-formatting
George Politis 12 years ago
commit 1c9691a3b4

File diff suppressed because it is too large Load Diff

@ -304,7 +304,8 @@ public Chat obtainChatInstance(String toAddress,
if (ta != null
&& ta.chat != null
&& ta.jid.equals(jid))
&& ta.jid.equals(jid)
&& ta.chat.getParticipant().equals(jid))
{
return ta.chat;
}
@ -324,7 +325,6 @@ public void processMessage(
}
};
//we don't have a thread for this chat, so let's create one.
Chat chat = jabberConnection.getChatManager()
.createChat(jid, msgListener);

@ -313,8 +313,18 @@ public boolean processRequest(RequestEvent requestEvent)
}
else
{
logger.error("reINVITEs while the dialog is not "
+ "confirmed are not currently supported.");
if (dialogState.equals(DialogState.TERMINATED))
{
processStrayInvite(serverTransaction);
}
else
{
logger.error("reINVITEs while the dialog is not "
+ "confirmed are not currently supported. "
+ "DialogState is: " + dialogState);
}
processed = true;
}
}
// ACK
@ -1166,6 +1176,55 @@ private void processBye(ServerTransaction serverTransaction,
callPeer.processBye(serverTransaction);
}
/**
* Processes stray INVITE requests that arrive for a dialog which has been
* already terminated. This method simply responds with a
* 481 Call/Transaction Does Not exist.
*
* @param serverTransaction the ServerTransaction the INVITE request
* arrived in.
*/
private void processStrayInvite(ServerTransaction serverTransaction)
{
logger.info("got an INVITE for a dead dialog. Rejecting");
Request inviteRequest = serverTransaction.getRequest();
// Send 481 Call/Transaction Does Not exist
Response noSuchCall = null;
try
{
noSuchCall = messageFactory.createResponse(
Response.CALL_OR_TRANSACTION_DOES_NOT_EXIST, inviteRequest);
}
catch (ParseException ex)
{
logger
.error("Error while trying to send a response to an INVITE", ex);
/*
* No need to let the user know about the error since it doesn't
* affect them.
*/
}
if (noSuchCall != null)
{
try
{
serverTransaction.sendResponse(noSuchCall);
if (logger.isDebugEnabled())
logger.debug("sent response " + noSuchCall);
}
catch (Exception ex)
{
logger.error("Failed to reject a stray INVITE with a 481, "
+ "exception was:\n", ex);
}
}
//there's really nothing else for us to do here.
}
/**
* Sets the state of the specifies call peer as DISCONNECTED.
*

Loading…
Cancel
Save