aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip
diff options
context:
space:
mode:
authorEmil Ivov <emcho@jitsi.org>2009-05-06 15:42:37 +0000
committerEmil Ivov <emcho@jitsi.org>2009-05-06 15:42:37 +0000
commit073ca80d9e9fe24aad8570e8c862cd10f6cf966b (patch)
tree0e7f42ccc865916fbe940b094e7d64427b7ef2dc /src/net/java/sip
parentdaa208a792e52ca3c267649bab3d13449bf0b978 (diff)
downloadjitsi-073ca80d9e9fe24aad8570e8c862cd10f6cf966b.zip
jitsi-073ca80d9e9fe24aad8570e8c862cd10f6cf966b.tar.gz
jitsi-073ca80d9e9fe24aad8570e8c862cd10f6cf966b.tar.bz2
Cosmetics and an extra method in the TransformLayer that allows capturing messages before they are sent.
Diffstat (limited to 'src/net/java/sip')
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java12
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java2
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java14
-rw-r--r--src/net/java/sip/communicator/service/protocol/TransformLayer.java20
4 files changed, 29 insertions, 19 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java
index 7e740f3..5e11ba9 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java
@@ -302,7 +302,7 @@ public class OperationSetBasicTelephonySipImpl
{
inviteTransaction.sendRequest();
if (logger.isDebugEnabled())
- logger.debug("sent request: " + invite);
+ logger.debug("sent request:\n" + invite);
}
catch (SipException ex)
{
@@ -3162,10 +3162,10 @@ public class OperationSetBasicTelephonySipImpl
}
/**
- * Returns <code>true</code> to indicate that the call associated with the
+ * Returns <code>true</code> to indicate that the call associated with the
* given participant is secured, otherwise returns <code>false</code>.
- *
- * @return <code>true</code> to indicate that the call associated with the
+ *
+ * @return <code>true</code> to indicate that the call associated with the
* given participant is secured, otherwise returns <code>false</code>.
*/
public boolean isSecure(CallParticipant participant)
@@ -3178,8 +3178,8 @@ public class OperationSetBasicTelephonySipImpl
/**
* Sets the SAS verification property value for the given call participant.
- *
- * @param participant the call participant, for which we set the
+ *
+ * @param participant the call participant, for which we set the
* @param isVerified indicates whether the SAS string is verified or not
* for the given participant.
*/
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
index 10d593d..2df3016 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/ProtocolProviderServiceSipImpl.java
@@ -633,7 +633,7 @@ public class ProtocolProviderServiceSipImpl
}
Request request = transaction.getRequest();
- logger.debug("Transaction terminated for req=" + request);
+ logger.debug("Transaction terminated for req=\n" + request);
//find the object that is supposed to take care of responses with the
//corresponding method
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 2bce2ca..cebdc28 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java
@@ -411,7 +411,7 @@ public class SipRegistrarConnection
try
{
regTrans.sendRequest();
- logger.debug("sent request= " + request);
+ logger.debug("sent request=\n" + request);
}
//we sometimes get a null pointer exception here so catch them all
catch (Exception ex)
@@ -442,11 +442,6 @@ public class SipRegistrarConnection
public void processOK(ClientTransaction clientTransatcion,
Response response)
{
- FromHeader fromHeader =
- ( (FromHeader) response.getHeader(FromHeader.NAME));
-
-
-
//first extract the expires value that we requested
int requestedExpiration = 0;
Request register = clientTransatcion.getRequest();
@@ -673,7 +668,7 @@ public class SipRegistrarConnection
unregisterTransaction.sendRequest();
- logger.info("sent request: " + unregisterRequest);
+ logger.info("sent request:\n" + unregisterRequest);
//if we're currently registered or in a process of unregistering
//we'll wait for an ok response before changing the status.
@@ -910,11 +905,6 @@ public class SipRegistrarConnection
.getClientTransaction();
Response response = responseEvent.getResponse();
- Dialog dialog = clientTransaction.getDialog();
- String method = ( (CSeqHeader) response.getHeader(CSeqHeader.NAME)).
- getMethod();
-
- Response responseClone = (Response) response.clone();
SipProvider sourceProvider = (SipProvider)responseEvent.getSource();
boolean processed = false;
diff --git a/src/net/java/sip/communicator/service/protocol/TransformLayer.java b/src/net/java/sip/communicator/service/protocol/TransformLayer.java
index 683bc41..5e8d3f7 100644
--- a/src/net/java/sip/communicator/service/protocol/TransformLayer.java
+++ b/src/net/java/sip/communicator/service/protocol/TransformLayer.java
@@ -49,6 +49,26 @@ public interface TransformLayer
public MessageReceivedEvent messageReceived(MessageReceivedEvent evt);
/**
+ * Called when the underlying implementation has just been asked by other
+ * bundles to send an outgoing message. The method returns an instance of
+ * <tt>MessageDeliveredEvent</tt> which in many cases would be different
+ * from the <tt>evt</tt> instance that was passed as a parameter. The param
+ * and the return instances could very well (and will often) be instances of
+ * different implementations so users of this interface (i.e. protocol
+ * implementors) should make no assumptions for the class of the return type
+ * and copy the returned instance into a new one if necessary.
+ *
+ * @param evt the MessageDeliveredEvent containing the id of the message
+ * that has caused the event.
+ *
+ * @return an instance of a (possibly new) <tt>MessageDeliveredEvent</tt>
+ * instance containing the transformed message or <tt>null</tt> if the
+ * <tt>TransportLayer</tt> has determined that this message event should not
+ * be delivered to the upper layers.
+ */
+ public MessageDeliveredEvent messageDeliveryPending(MessageDeliveredEvent evt);
+
+ /**
* Called when the underlying implementation has received an indication
* that a message, sent earlier has been successfully received by the
* destination. The method returns an instance of