aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2015-02-05 14:58:57 +0200
committerDamian Minkov <damencho@jitsi.org>2015-02-10 13:01:54 +0200
commite25de5721762b8d08c4ff75584e8f46a138aaa49 (patch)
tree52c64d5453edfd3fd7ee0e3b2f7c4ceeb949877e /src
parent8fb59e2b9506a528379937c3b178669fd90012a5 (diff)
downloadjitsi-e25de5721762b8d08c4ff75584e8f46a138aaa49.zip
jitsi-e25de5721762b8d08c4ff75584e8f46a138aaa49.tar.gz
jitsi-e25de5721762b8d08c4ff75584e8f46a138aaa49.tar.bz2
Adds fireCallEvent by CallEvent, so it can be overridden and a custom CallEvent to be used.
Diffstat (limited to 'src')
-rw-r--r--src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java30
-rw-r--r--src/net/java/sip/communicator/service/protocol/media/AbstractOperationSetBasicTelephony.java15
2 files changed, 37 insertions, 8 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java
index 543f217..e954e75 100644
--- a/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java
@@ -291,12 +291,12 @@ public class CallSipImpl
logger.warn("Error getting media types", t);
}
- getParentOperationSet().fireCallEvent(
- incomingCall
- ? CallEvent.CALL_RECEIVED
- : CallEvent.CALL_INITIATED,
- this,
- mediaDirections);
+ fireCallEvent(
+ incomingCall
+ ? CallEvent.CALL_RECEIVED
+ : CallEvent.CALL_INITIATED,
+ this,
+ mediaDirections);
if(hasZrtp)
{
@@ -314,6 +314,24 @@ public class CallSipImpl
}
/**
+ * Creates and dispatches a <tt>CallEvent</tt> notifying registered
+ * listeners that an event with id <tt>eventID</tt> has occurred on
+ * <tt>sourceCall</tt>.
+ *
+ * @param eventID the ID of the event to dispatch
+ * @param sourceCall the call on which the event has occurred.
+ * @param mediaDirections direction map for media types
+ */
+ protected void fireCallEvent(
+ int eventID,
+ Call sourceCall,
+ Map<MediaType, MediaDirection> mediaDirections)
+ {
+ getParentOperationSet().fireCallEvent(
+ eventID, sourceCall, mediaDirections);
+ }
+
+ /**
* Returns the call peer whose associated jain sip dialog matches
* <tt>dialog</tt>.
*
diff --git a/src/net/java/sip/communicator/service/protocol/media/AbstractOperationSetBasicTelephony.java b/src/net/java/sip/communicator/service/protocol/media/AbstractOperationSetBasicTelephony.java
index f41ddaf..ceab757 100644
--- a/src/net/java/sip/communicator/service/protocol/media/AbstractOperationSetBasicTelephony.java
+++ b/src/net/java/sip/communicator/service/protocol/media/AbstractOperationSetBasicTelephony.java
@@ -152,7 +152,18 @@ public abstract class AbstractOperationSetBasicTelephony
Call sourceCall,
Map<MediaType, MediaDirection> mediaDirections)
{
- CallEvent event = new CallEvent(sourceCall, eventID, mediaDirections);
+ fireCallEvent(new CallEvent(sourceCall, eventID, mediaDirections));
+ }
+
+ /**
+ * Creates and dispatches a <tt>CallEvent</tt> notifying registered
+ * listeners that an event with id <tt>eventID</tt> has occurred on
+ * <tt>sourceCall</tt>.
+ *
+ * @param event the event to dispatch
+ */
+ public void fireCallEvent(CallEvent event)
+ {
List<CallListener> listeners;
synchronized (callListeners)
@@ -176,7 +187,7 @@ public abstract class AbstractOperationSetBasicTelephony
"Dispatching a CallEvent to "
+ listener.getClass() + " . The event is: "+ event);
- switch (eventID)
+ switch (event.getEventID())
{
case CallEvent.CALL_INITIATED:
listener.outgoingCallCreated(event);