@@ -3670,10 +3672,10 @@ public void setPidfPresenceStatus(String presenceDoc)
NodeList personList = presence.getElementsByTagNameNS(ANY_NS,
PERSON_ELEMENT);
- if (personList.getLength() > 1) {
- logger.error("more than one person in this document");
- return;
- }
+ //if (personList.getLength() > 1) {
+ // logger.error("more than one person in this document");
+ // return;
+ //}
if (personList.getLength() > 0) {
Node personNode = personList.item(0);
@@ -4314,7 +4316,7 @@ protected class watcherTimeoutTask extends TimerTask
/**
* Default constructor
*
- * @param contact The watcher conecerned by this timeout
+ * @param contact The watcher concerned by this timeout
*/
public watcherTimeoutTask(ContactSipImpl contact) {
this.contact = contact;
@@ -4424,7 +4426,7 @@ protected class RegistrationListener
implements RegistrationStateChangeListener
{
/**
- * The method is called by a ProtocolProvider implementation whenver
+ * The method is called by a ProtocolProvider implementation whenever
* a change in the registration state of the corresponding provider had
* occurred. The method is particularly interested in events stating
* that the SIP provider has unregistered so that it would fire
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/SipMessageProcessor.java b/src/net/java/sip/communicator/impl/protocol/sip/SipMessageProcessor.java
new file mode 100644
index 000000000..79e481576
--- /dev/null
+++ b/src/net/java/sip/communicator/impl/protocol/sip/SipMessageProcessor.java
@@ -0,0 +1,25 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.impl.protocol.sip;
+
+import javax.sip.*;
+
+/**
+ * Listener receiving events for incoming messages
+ * that need processing
+ *
+ * @author Damian Minkov
+ */
+public interface SipMessageProcessor
+{
+ /**
+ * Process the incoming message
+ * @param requestEvent the incoming event holding the message
+ * @return whether this message needs further processing(true) or no(false)
+ */
+ public boolean processMessage(RequestEvent requestEvent);
+}
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java b/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java
index acb9cc147..a3ca95fce 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java
@@ -79,7 +79,7 @@ public class SipRegistrarConnection
private Request registerRequest = null;
/**
- * The next long to use as a cseq header velue.
+ * The next long to use as a cseq header value.
*/
private long nextCSeqValue = 1;
@@ -131,7 +131,7 @@ public SipRegistrarConnection(InetAddress registrarAddress,
}
/**
- * Sends the REGISTER request to the server speciied in the constructor.
+ * Sends the REGISTER request to the server specified in the constructor.
*
* @throws OperationFailedException with the corresponding error code
* if registration or construction of the Register request fail.
@@ -384,7 +384,7 @@ void register()
* notify listeners and (in the case of a new registration) schedule
* reregistration.
*
- * @param clientTransatcion the ClientTransaction that we crated when
+ * @param clientTransatcion the ClientTransaction that we created when
* sending the register request.
* @param response the OK Response that we've just received.
*/
@@ -564,33 +564,33 @@ public void unregister() throws OperationFailedException
}
try
{
+ //check whether there's a cached authorization header for this
+ //call id and if so - attach it to the request.
+ // add authorization header
+ CallIdHeader call = (CallIdHeader)unregisterRequest
+ .getHeader(CallIdHeader.NAME);
+ String callid = call.getCallId();
+
+ AuthorizationHeader authorization = sipProvider
+ .getSipSecurityManager()
+ .getCachedAuthorizationHeader(callid);
+
+ if(authorization != null)
+ unregisterRequest.addHeader(authorization);
+
+
unregisterTransaction.sendRequest();
- logger.debug("sent request: " + unregisterRequest);
+ logger.info("sent request: " + unregisterRequest);
//if we're currently registered we'll wait for an ok response
//before changing the status. otherwise we set it immediately.
if(!getRegistrationState().equals(RegistrationState.REGISTERED))
{
- logger.trace("Setting state to UNREGISTERED.");
+ logger.info("Setting state to UNREGISTERED.");
setRegistrationState(
RegistrationState.UNREGISTERED
, RegistrationStateChangeEvent.REASON_USER_REQUEST, null);
- //check whether there's a cached authorization header for this
- //call id and if so - attach it to the request.
- // add authorization header
- CallIdHeader call = (CallIdHeader)unregisterRequest
- .getHeader(CallIdHeader.NAME);
- String callid = call.getCallId();
-
- AuthorizationHeader authorization = sipProvider
- .getSipSecurityManager()
- .getCachedAuthorizationHeader(callid);
-
- if(authorization != null)
- unregisterRequest.addHeader(authorization);
-
-
//kill the registration tran in case it is still active
if (regTrans != null
&& regTrans.getState().getValue()
@@ -627,7 +627,7 @@ public RegistrationState getRegistrationState()
}
/**
- * Sets our registraton state to newState and dispatches an event
+ * Sets our registration state to newState and dispatches an event
* through the protocol provider service impl.
*
* @param newState a reference to the RegistrationState that we're currently
@@ -728,8 +728,8 @@ private void scheduleReRegistration(int expires)
}
/**
- * Returns the next long to use as a cseq header velue.
- * @return the next long to use as a cseq header velue.
+ * Returns the next long to use as a cseq header value.
+ * @return the next long to use as a cseq header value.
*/
private long getNextCSeqValue()
{
@@ -739,7 +739,7 @@ private long getNextCSeqValue()
/**
* Handles a NOT_IMPLEMENTED response sent in reply of our register request.
*
- * @param transatcion the transaction that our initial register reqeust
+ * @param transatcion the transaction that our initial register request
* belongs to.
* @param response our initial register request.
*/
@@ -765,10 +765,10 @@ public InetAddress getRegistrarAddress()
}
/**
- * Returns the listening point that should be used for communiction with our
+ * Returns the listening point that should be used for communication with our
* current registrar.
*
- * @return the listening point that should be used for communiction with our
+ * @return the listening point that should be used for communication with our
* current registrar.
*/
ListeningPoint getRegistrarListeningPoint()
@@ -854,12 +854,12 @@ else if ( response.getStatusCode() / 100 == 4 )
}
/**
- * Attempts to re-ogenerate the corresponding request with the proper
+ * Attempts to re-generate the corresponding request with the proper
* credentials and terminates the call if it fails.
*
* @param clientTransaction the corresponding transaction
* @param response the challenge
- * @param jainSipProvider the provider that received the challende
+ * @param jainSipProvider the provider that received the challenge
*/
private void processAuthenticationChallenge(
ClientTransaction clientTransaction,
@@ -898,7 +898,7 @@ private void processAuthenticationChallenge(
*
* @param clientTransaction the corresponding transaction
* @param response the challenge
- * @param jainSipProvider the provider that received the challende
+ * @param jainSipProvider the provider that received the challenge
*/
private void processForbidden(
ClientTransaction clientTransaction,