Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.call
Class CallManager

java.lang.Object
  extended by net.java.sip.communicator.impl.gui.main.call.CallManager

public class CallManager
extends Object

The CallManager is the one that handles calls. It contains also the "Call" and "Hang up" buttons panel. Here are handles incoming and outgoing calls from and to the call operation set.

Author:
Yana Stamcheva

Nested Class Summary
static class CallManager.GuiCallListener
          A call listener.
 
Constructor Summary
CallManager()
           
 
Method Summary
static void answerCall(Call call)
          Answers the given call.
static void answerVideoCall(Call call)
          Answers the given call with video.
static void createCall(ProtocolProviderService protocolProvider, Contact contact)
          Creates a call to the contact represented by the given string.
static void createCall(ProtocolProviderService protocolProvider, String contact)
          Creates a call to the contact represented by the given string.
static void createCall(String callString, JComponent c)
          Creates a call to the given call string.
static void createCall(String callString, JComponent c, CallInterfaceListener l)
          Creates a call to the given call string.
static void createConferenceCall(String[] callees, ProtocolProviderService protocolProvider)
          Creates a call to the given list of contacts.
static void createDesktopSharing(ProtocolProviderService protocolProvider, String contact)
          Creates a desktop sharing call to the contact represented by the given string.
static void createRegionDesktopSharing(ProtocolProviderService protocolProvider, String contact)
          Creates a region desktop sharing through the given protocolProvider with the given contact.
static void createRegionDesktopSharing(ProtocolProviderService protocolProvider, String contact, int x, int y, int width, int height)
          Creates a desktop sharing call to the contact represented by the given string.
static void createVideoCall(ProtocolProviderService protocolProvider, Contact contact)
          Creates a video call to the contact represented by the given string.
static void createVideoCall(ProtocolProviderService protocolProvider, String contact)
          Creates a video call to the contact represented by the given string.
static void enableDesktopRemoteControl(CallPeer callPeer, boolean isEnable)
          Enables/disables remote control when in a desktop sharing session with the given callPeer.
static void enableDesktopSharing(Call call, boolean enable)
          Enables the desktop sharing in an existing call.
static void enableLocalVideo(Call call, boolean enable)
          Enables/disables local video for the given call.
static void enableRegionDesktopSharing(Call call, boolean enable)
          Enables the region desktop sharing for the given call.
static void enableRegionDesktopSharing(Call call, int x, int y, int width, int height)
          Creates a desktop sharing call to the contact represented by the given string.
static CallPanel getActiveCallContainer(Call call)
          Returns the CallContainer corresponding to the given call.
static Collection<Call> getActiveCalls()
          Returns a collection of all currently active calls.
static byte[] getPeerImage(CallPeer peer)
          Returns the image corresponding to the given peer.
static List<ProtocolProviderService> getTelephonyProviders()
          Returns a list of all currently registered telephony providers.
static void hangupCall(Call call)
          Hang ups the given call.
static void hangupCallPeer(CallPeer callPeer)
          Hang ups the given callPeer.
static void inviteToConferenceCall(String[] callees, Call call)
          Invites the given list of callees to the given conference call.
static void inviteToCrossProtocolConferenceCall(ProtocolProviderService provider, String callee, Call call)
          Invites the given list of callees to the given conference call.
static boolean isDesktopSharingEnabled(Call call)
          Indicates if the desktop sharing is currently enabled for the given call.
static boolean isLocalVideoEnabled(Call call)
          Indicates if the desktop sharing is currently enabled for the given call.
static boolean isRegionDesktopSharingEnabled(Call call)
          Indicates if the desktop sharing is currently enabled for the given call.
static boolean isVideoQualityPresetSupported(CallPeer callPeer)
          Checks whether the callPeer supports setting video quality presets.
static void openCallTransferDialog(CallPeer peer)
          Opens a call transfer dialog to transfer the given peer.
static void putOnHold(CallPeer callPeer, boolean isOnHold)
          Puts on or off hold the given callPeer.
static void setVideoQualityPreset(CallPeer callPeer, QualityPreset qualityPreset)
          Sets the given quality preset for the video of the given call peer.
static void transferCall(CallPeer peer, CallPeer target)
          Transfers the given peer to the given target.
static void transferCall(CallPeer peer, String target)
          Transfers the given peer to the given target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallManager

public CallManager()
Method Detail

answerCall

public static void answerCall(Call call)
Answers the given call.

Parameters:
call - the call to answer

answerVideoCall

public static void answerVideoCall(Call call)
Answers the given call with video.

Parameters:
call - the call to answer

hangupCall

public static void hangupCall(Call call)
Hang ups the given call.

Parameters:
call - the call to hang up

hangupCallPeer

public static void hangupCallPeer(CallPeer callPeer)
Hang ups the given callPeer.

Parameters:
callPeer - the CallPeer to hang up

createCall

public static void createCall(ProtocolProviderService protocolProvider,
                              String contact)
Creates a call to the contact represented by the given string.

Parameters:
protocolProvider - the protocol provider to which this call belongs.
contact - the contact to call to

createCall

public static void createCall(ProtocolProviderService protocolProvider,
                              Contact contact)
Creates a call to the contact represented by the given string.

Parameters:
protocolProvider - the protocol provider to which this call belongs.
contact - the contact to call to

createVideoCall

public static void createVideoCall(ProtocolProviderService protocolProvider,
                                   String contact)
Creates a video call to the contact represented by the given string.

Parameters:
protocolProvider - the protocol provider to which this call belongs.
contact - the contact to call to

createVideoCall

public static void createVideoCall(ProtocolProviderService protocolProvider,
                                   Contact contact)
Creates a video call to the contact represented by the given string.

Parameters:
protocolProvider - the protocol provider to which this call belongs.
contact - the contact to call to

enableLocalVideo

public static void enableLocalVideo(Call call,
                                    boolean enable)
Enables/disables local video for the given call.

Parameters:
enable - indicates whether to enable or disable the local video
call - the call for which the local video should be enabled/disabled

isLocalVideoEnabled

public static boolean isLocalVideoEnabled(Call call)
Indicates if the desktop sharing is currently enabled for the given call.

Parameters:
call - the Call, for which we would to check if the desktop sharing is currently enabled
Returns:
true if the desktop sharing is currently enabled for the given call, false otherwise

createDesktopSharing

public static void createDesktopSharing(ProtocolProviderService protocolProvider,
                                        String contact)
Creates a desktop sharing call to the contact represented by the given string.

Parameters:
protocolProvider - the protocol provider to which this call belongs.
contact - the contact to call to

createRegionDesktopSharing

public static void createRegionDesktopSharing(ProtocolProviderService protocolProvider,
                                              String contact)
Creates a region desktop sharing through the given protocolProvider with the given contact.

Parameters:
protocolProvider - the ProtocolProviderService, through which the sharing session will be established
contact - the address of the contact recipient

createRegionDesktopSharing

public static void createRegionDesktopSharing(ProtocolProviderService protocolProvider,
                                              String contact,
                                              int x,
                                              int y,
                                              int width,
                                              int height)
Creates a desktop sharing call to the contact represented by the given string.

Parameters:
protocolProvider - the protocol provider to which this call belongs.
contact - the contact to call to
x - the x coordinate of the shared region
y - the y coordinated of the shared region
width - the width of the shared region
height - the height of the shared region

enableDesktopSharing

public static void enableDesktopSharing(Call call,
                                        boolean enable)
Enables the desktop sharing in an existing call.

Parameters:
call - the call for which desktop sharing should be enabled
enable - indicates if the desktop sharing should be enabled or disabled

enableRegionDesktopSharing

public static void enableRegionDesktopSharing(Call call,
                                              boolean enable)
Enables the region desktop sharing for the given call.

Parameters:
call - the call, for which the region desktop sharing should be enabled
enable - indicates if the desktop sharing should be enabled or disabled

enableRegionDesktopSharing

public static void enableRegionDesktopSharing(Call call,
                                              int x,
                                              int y,
                                              int width,
                                              int height)
Creates a desktop sharing call to the contact represented by the given string.

Parameters:
call - the call for which desktop sharing should be enabled
x - the x coordinate of the shared region
y - the y coordinated of the shared region
width - the width of the shared region
height - the height of the shared region

isDesktopSharingEnabled

public static boolean isDesktopSharingEnabled(Call call)
Indicates if the desktop sharing is currently enabled for the given call.

Parameters:
call - the Call, for which we would to check if the desktop sharing is currently enabled
Returns:
true if the desktop sharing is currently enabled for the given call, false otherwise

isRegionDesktopSharingEnabled

public static boolean isRegionDesktopSharingEnabled(Call call)
Indicates if the desktop sharing is currently enabled for the given call.

Parameters:
call - the Call, for which we would to check if the desktop sharing is currently enabled
Returns:
true if the desktop sharing is currently enabled for the given call, false otherwise

enableDesktopRemoteControl

public static void enableDesktopRemoteControl(CallPeer callPeer,
                                              boolean isEnable)
Enables/disables remote control when in a desktop sharing session with the given callPeer.

Parameters:
callPeer - the call peer for which we enable/disable remote control
isEnable - indicates if the remote control should be enabled

createCall

public static void createCall(String callString,
                              JComponent c)
Creates a call to the given call string. The given component indicates where should be shown the "call via" menu if needed.

Parameters:
callString - the string to call
c - the component, which indicates where should be shown the "call via" menu if needed

createCall

public static void createCall(String callString,
                              JComponent c,
                              CallInterfaceListener l)
Creates a call to the given call string. The given component indicates where should be shown the "call via" menu if needed.

Parameters:
callString - the string to call
c - the component, which indicates where should be shown the "call via" menu if needed
l - listener that is notified when the call interface has been started after call was created

createConferenceCall

public static void createConferenceCall(String[] callees,
                                        ProtocolProviderService protocolProvider)
Creates a call to the given list of contacts.

Parameters:
protocolProvider - the protocol provider to which this call belongs.
callees - the list of contacts to call to

inviteToConferenceCall

public static void inviteToConferenceCall(String[] callees,
                                          Call call)
Invites the given list of callees to the given conference call.

Parameters:
callees - the list of contacts to invite
call - the protocol provider to which this call belongs

inviteToCrossProtocolConferenceCall

public static void inviteToCrossProtocolConferenceCall(ProtocolProviderService provider,
                                                       String callee,
                                                       Call call)
Invites the given list of callees to the given conference call.

Parameters:
provider - provider to which the callee belongs
callee - the list of contacts to invite
call - existing call

putOnHold

public static void putOnHold(CallPeer callPeer,
                             boolean isOnHold)
Puts on or off hold the given callPeer.

Parameters:
callPeer - the peer to put on/off hold
isOnHold - indicates the action (on hold or off hold)

transferCall

public static void transferCall(CallPeer peer,
                                CallPeer target)
Transfers the given peer to the given target.

Parameters:
peer - the CallPeer to transfer
target - the CallPeer target to transfer to

transferCall

public static void transferCall(CallPeer peer,
                                String target)
Transfers the given peer to the given target.

Parameters:
peer - the CallPeer to transfer
target - the target of the transfer

getTelephonyProviders

public static List<ProtocolProviderService> getTelephonyProviders()
Returns a list of all currently registered telephony providers.

Returns:
a list of all currently registered telephony providers

getActiveCalls

public static Collection<Call> getActiveCalls()
Returns a collection of all currently active calls.

Returns:
a collection of all currently active calls

getActiveCallContainer

public static CallPanel getActiveCallContainer(Call call)
Returns the CallContainer corresponding to the given call. If the call has been finished and no active CallContainer could be found it returns null.

Parameters:
call - the Call, which dialog we're looking for
Returns:
the CallContainer corresponding to the given call

getPeerImage

public static byte[] getPeerImage(CallPeer peer)
Returns the image corresponding to the given peer.

Parameters:
peer - the call peer, for which we're returning an image
Returns:
the peer image

openCallTransferDialog

public static void openCallTransferDialog(CallPeer peer)
Opens a call transfer dialog to transfer the given peer.

Parameters:
peer - the CallPeer to transfer

isVideoQualityPresetSupported

public static boolean isVideoQualityPresetSupported(CallPeer callPeer)
Checks whether the callPeer supports setting video quality presets. If quality controls is null, its not supported.

Parameters:
callPeer - the peer, which video quality we're checking
Returns:
whether call peer supports setting quality preset.

setVideoQualityPreset

public static void setVideoQualityPreset(CallPeer callPeer,
                                         QualityPreset qualityPreset)
Sets the given quality preset for the video of the given call peer.

Parameters:
callPeer - the peer, which video quality we're setting
qualityPreset - the new quality settings

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.