com.motorola.oem.call
Class Call

java.lang.Object
  extended by OEM
      extended by com.motorola.oem.call.Call

public class Call
extends OEM

The Call class is used for organization and management of MO/MT voice and data calls.
Note: This class is implemented as a singleton and is accessible by the static method: getInstance().


Field Summary
static int CALL_DIRECTION_MO
          Current call direction - Outgoing(Mobile Originated)
static int CALL_DIRECTION_MT
          Current call direction - Incoming(Mobile Terminated)
static int CALL_SESSION_TABLE_ERROR
          Current data call profile failure.
static int CALL_STATE_ACTIVE
          Current call state - Active
static int CALL_STATE_ALERTING
          Current call state - Alerting
static int CALL_STATE_CONNECTING
          Current call state - Connecting
static int CALL_STATE_IDLE
          Current call state - Idle
static int CALL_STATE_RELEASING
          Current call state - Releasing
static int CALL_STATE_UNKNOWN
          Current call state - Unknown
static int CALL_TYPE_DATA
          Current call type - Data Call
static int CALL_TYPE_VOICE
          Current call type - Voice Call
static int DATA_CALL_FAIL_PUSH
          Current data call open/read/write failure.
static int DATA_CALL_PATH_CLOSE
          Current data call path is closed.
static int DATA_CALL_PATH_OPEN
          Current data call path is open.
static int DATA_CALL_SUCCESS_PUSH
          Current data call open/read/write successful operation.
static int ERROR_CALL_IN_PROCESS
          There is a call in process already.
static int ERROR_CALL_MEMORY_FAILURE
          Invalid call number.
static int ERROR_CALL_NO_ACTIVE_CALL
          There is no active call.
static int ERROR_CALL_NO_INCOMING_CALL
          There is no incoming call.
static int ERROR_CALL_NOT_INITIALIZED
          Current call profile initialization failure.
static int ERROR_CALL_NUMBER_INVALID
          Memory failure.
static int ERROR_CALL_TABLE_FAILURE
          Current call profile failure (not relevant for this version).
static int ERROR_CALL_TIMER_FAILURE
          Timer expiration failure (not relevant for this version).
static int ERROR_CALL_TYPE_INVALID
          Invalid call type.
 
Method Summary
 void answer()
          Answers a call.
 void configureMoDataCallconn(DataCallConfig cnfg)
          Configures the next MO data call connection.
 void dial(java.lang.String destNumber, int callType)
          Sets up a Mobile Originated (MO) call.
 int getCallDirection()
          Gets the current call direction (MO or MT)
 int getCallExitCause()
          Gets the current(released) call's exit cause.
 java.lang.String getCallNumber()
          Gets the current call's phone number.
 int getCallState()
          Gets the current call state.
 int getCallType()
          Gets the current call type (Voice or Data).
 DataCallConnection getDataCallconn()
          Gets the current data call connection object.
static Call getInstance()
          Returns a reference to the class's single instance.
 DataCallConfig getMoDataCallConfig()
          Gets the current (MO) data call configuration object.
 int getPlatformCallStatus()
          Gets the current call's state on the platform.
 void release()
          Releases a call.
 void setCallAlertListener(CallAlertListener listener)
          Sets a listener for call alerts.
 void setCallStateListener(CallStateListener listener)
          Sets a listener for call state changes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_CALL_IN_PROCESS

public static final int ERROR_CALL_IN_PROCESS
There is a call in process already.

See Also:
Constant Field Values

ERROR_CALL_MEMORY_FAILURE

public static final int ERROR_CALL_MEMORY_FAILURE
Invalid call number.

See Also:
Constant Field Values

ERROR_CALL_NUMBER_INVALID

public static final int ERROR_CALL_NUMBER_INVALID
Memory failure.

See Also:
Constant Field Values

ERROR_CALL_TYPE_INVALID

public static final int ERROR_CALL_TYPE_INVALID
Invalid call type.

See Also:
Constant Field Values

ERROR_CALL_NO_INCOMING_CALL

public static final int ERROR_CALL_NO_INCOMING_CALL
There is no incoming call.

See Also:
Constant Field Values

ERROR_CALL_NOT_INITIALIZED

public static final int ERROR_CALL_NOT_INITIALIZED
Current call profile initialization failure.

See Also:
Constant Field Values

ERROR_CALL_NO_ACTIVE_CALL

public static final int ERROR_CALL_NO_ACTIVE_CALL
There is no active call.

See Also:
Constant Field Values

ERROR_CALL_TABLE_FAILURE

public static final int ERROR_CALL_TABLE_FAILURE
Current call profile failure (not relevant for this version).

See Also:
Constant Field Values

ERROR_CALL_TIMER_FAILURE

public static final int ERROR_CALL_TIMER_FAILURE
Timer expiration failure (not relevant for this version).

See Also:
Constant Field Values

CALL_SESSION_TABLE_ERROR

public static final int CALL_SESSION_TABLE_ERROR
Current data call profile failure.

See Also:
Constant Field Values

DATA_CALL_FAIL_PUSH

public static final int DATA_CALL_FAIL_PUSH
Current data call open/read/write failure.

See Also:
Constant Field Values

DATA_CALL_SUCCESS_PUSH

public static final int DATA_CALL_SUCCESS_PUSH
Current data call open/read/write successful operation.

See Also:
Constant Field Values

DATA_CALL_PATH_OPEN

public static final int DATA_CALL_PATH_OPEN
Current data call path is open.

See Also:
Constant Field Values

DATA_CALL_PATH_CLOSE

public static final int DATA_CALL_PATH_CLOSE
Current data call path is closed.

See Also:
Constant Field Values

CALL_STATE_IDLE

public static final int CALL_STATE_IDLE
Current call state - Idle

See Also:
Constant Field Values

CALL_STATE_CONNECTING

public static final int CALL_STATE_CONNECTING
Current call state - Connecting

See Also:
Constant Field Values

CALL_STATE_ALERTING

public static final int CALL_STATE_ALERTING
Current call state - Alerting

See Also:
Constant Field Values

CALL_STATE_ACTIVE

public static final int CALL_STATE_ACTIVE
Current call state - Active

See Also:
Constant Field Values

CALL_STATE_RELEASING

public static final int CALL_STATE_RELEASING
Current call state - Releasing

See Also:
Constant Field Values

CALL_STATE_UNKNOWN

public static final int CALL_STATE_UNKNOWN
Current call state - Unknown

See Also:
Constant Field Values

CALL_DIRECTION_MT

public static final int CALL_DIRECTION_MT
Current call direction - Incoming(Mobile Terminated)

See Also:
Constant Field Values

CALL_DIRECTION_MO

public static final int CALL_DIRECTION_MO
Current call direction - Outgoing(Mobile Originated)

See Also:
Constant Field Values

CALL_TYPE_VOICE

public static final int CALL_TYPE_VOICE
Current call type - Voice Call

See Also:
Constant Field Values

CALL_TYPE_DATA

public static final int CALL_TYPE_DATA
Current call type - Data Call

See Also:
Constant Field Values
Method Detail

getInstance

public static Call getInstance()
                        throws CallException
Returns a reference to the class's single instance. If the instance does not exist, then one is created and its reference is returned.

Throws:
CallException - Failed to construct the Call object.

setCallAlertListener

public void setCallAlertListener(CallAlertListener listener)
Sets a listener for call alerts.
CallAlertListener.onCallAlert(int) will be called upon a call alert.


setCallStateListener

public void setCallStateListener(CallStateListener listener)
Sets a listener for call state changes.
CallStateListener.onCallStateChanged(int) will be called upon a call state change.


dial

public void dial(java.lang.String destNumber,
                 int callType)
          throws CallException
Sets up a Mobile Originated (MO) call.

Parameters:
destNumber - Destination phone number
callType - MO call type (voice or data call)
Throws:
CallException - Invalid parameters, Sim error or platform error
java.lang.SecurityException
See Also:
CALL_TYPE_VOICE, CALL_TYPE_DATA

answer

public void answer()
            throws CallException
Answers a call.

Throws:
CallException - There is no alerting call to answer or a platform error while trying to answer.
java.lang.SecurityException

release

public void release()
             throws CallException
Releases a call.

Throws:
CallException - There is no call to release or a platform error while trying to release the call.

configureMoDataCallconn

public void configureMoDataCallconn(DataCallConfig cnfg)
                             throws CallException
Configures the next MO data call connection. If this method is not called - default configuration values are used. The default values are detailed in DataCallConfig.

Notes:
1. Mobile Terminated data call parameters are set automatically according to the remote side's configuration.
2. The new configuration will take affect only for the next call and not for the current one.

Parameters:
cnfg - Object holding the configuration values to be set
Throws:
CallException - MO data call configuration has failed

getMoDataCallConfig

public DataCallConfig getMoDataCallConfig()
Gets the current (MO) data call configuration object.

Returns:
DataCallConfig current data call configuration object.

getDataCallconn

public DataCallConnection getDataCallconn()
                                   throws CallException
Gets the current data call connection object.

Returns:
DataCallConnection current data call connection object.
Throws:
CallException - There is no active call or active data connection for the call

getCallDirection

public int getCallDirection()
                     throws CallException
Gets the current call direction (MO or MT)

Returns:
int current call direction.
Throws:
CallException - There is no active call
See Also:
CALL_DIRECTION_MT, CALL_DIRECTION_MO

getCallState

public int getCallState()
Gets the current call state.

Returns:
int current call state.
See Also:
CALL_STATE_IDLE, CALL_STATE_CONNECTING, CALL_STATE_ALERTING, CALL_STATE_ACTIVE, CALL_STATE_RELEASING

getCallType

public int getCallType()
                throws CallException
Gets the current call type (Voice or Data).

Returns:
int current call type.
Throws:
CallException - There is no active call
See Also:
CALL_TYPE_VOICE, CALL_TYPE_DATA

getCallNumber

public java.lang.String getCallNumber()
                               throws CallException
Gets the current call's phone number.

Returns:
current call number. If method can't get caller ID information return null.
Throws:
CallException - No active call or caller ID is restricted/not available/not specified/not recognized

getPlatformCallStatus

public int getPlatformCallStatus()
Gets the current call's state on the platform.

Returns:
int current call state.
 
 Note: The platform's call states are:
 call state is idle - 0   
 call state MT establishing - 1   
 call state MO connecting - 2 
 call state MT offering for data calls - 3    
 call state MT accepted for data calls - 4    
 call state MT alerting - 5   
 call state MT connecting - 6 
 call state MT call control by SIM - 7
 call state connected - 8 
 call state multiparty active - 9 
 call state hold request - 10 
 call state multiparty hold request - 11    
 call state held - 12 
 call state multiparty held - 13    
 call state unhold request - 14   
 call state multiparty retrieve request - 15    
 call state join request - 16 
 call state split request - 17    
 call state transfer request - 18 
 call state MO mode change request - 19   
 call state MT mode change request - 20   
 call state reestablishing - 21   
 call state releasing - 22    
 call state redial - 23   
 call state resource pending - 24

getCallExitCause

public int getCallExitCause()
Gets the current(released) call's exit cause.

Returns:
call's exit cause. Note: This value indicates what caused current call to fail.