From bf66ebc291a9342a42942842043cc80e63e00fcd Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Sun, 24 Sep 2006 21:11:13 +0000 Subject: [PATCH] Support for SIP (Work in Progress) Events distributed by telephony operation sets. --- .../service/protocol/event/CallEvent.java | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 src/net/java/sip/communicator/service/protocol/event/CallEvent.java diff --git a/src/net/java/sip/communicator/service/protocol/event/CallEvent.java b/src/net/java/sip/communicator/service/protocol/event/CallEvent.java new file mode 100644 index 000000000..341e4651c --- /dev/null +++ b/src/net/java/sip/communicator/service/protocol/event/CallEvent.java @@ -0,0 +1,82 @@ +/* + * 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.service.protocol.event; + +import java.util.*; + +import net.java.sip.communicator.service.protocol.*; + +/** + * An event class representing that an incoming or an outgoing call has been + * created. The event id indicates the exact reason for this event. + * + * @author Emil Ivov + */ +public class CallEvent + extends EventObject +{ + /** + * An event id value indicating that this event has been triggerred as a + * result of an outgoing call. + */ + public static final int CALL_INITIATED = 1; + + /** + * An event id value indicating that this event has been triggerred as a + * result of an incoming call. + */ + public static final int CALL_RECEIVED = 2; + + /** + * An event id value indicating that this event has been triggerred as a + * result of a call being ended (all its participants have left). + */ + public static final int CALL_ENDED = 3; + + + /** + * Determines whether this event has been fired to indicate an incoming or + * an outgoing call. + */ + private int eventID; + + /** + * Creates an event instance indicating that an incoming/outgoing call + * has been created + * + * @param call the call that triggerred this event. + * @param eventID determines whether this is an incoming or an outgoing + * call. + */ + public CallEvent(Call call, int eventID) + { + super(call); + this.eventID = eventID; + } + + /** + * Returns the Call that trigerred this event. + * + * @return the Call that trigerred this event. + */ + public Call getSourceCall() + { + return (Call)getSource(); + } + + /** + * Returns an event ID int indicating whether this event was triggerred by + * an outgoing or an incoming call. + * + * @return on of the CALL_XXX static member ints. + */ + public int getEventID() + { + return this.eventID; + } +}