com.alarexgroup.m2mplf.adapters.incomingCallAdapter
Class IncomingCallAdapter

java.lang.Object
  extended by com.alarexgroup.m2mplf.adapters.incomingCallAdapter.IncomingCallAdapter
All Implemented Interfaces:
ATCommanderListener
public final class IncomingCallAdapter
extends java.lang.Object
implements ATCommanderListener

This adapter allows you to handle incomming calls.
Indicates the number of caller and how many times it has rung already.

Example:

import com.alarexgroup.m2mplf.M2Mlet;
import com.alarexgroup.m2mplf.adapters.incomingCallAdapter.IncomingCallAdapter;
import com.alarexgroup.m2mplf.adapters.incomingCallAdapter.IncomingCallAdapterListener;
import com.alarexgroup.m2mplf.logging.Logger;

public class IncomingCallExample extends M2Mlet implements IncomingCallAdapterListener {
    IncomingCallAdapter inc;

    public void appStart() {
        inc = IncomingCallAdapter.getIncomingCallAdapter(this);
    }
    
     public void onIncomingCall(String number, int status, int type, int count) {
        if (count>4inc.hangUpCall(IncomingCallAdapter.HANGUP_BUSY);
        Logger.logInfo("Incoming call: "+number+" count: "+count);
    }

    
    public void appStop(boolean unconditional) {
    }
    
    public void appPause() {
    }    
}

Field Summary
static int CALL_STATUS_ACTIVE
          Call active
static int CALL_STATUS_ALERTING
          Call alerting
static int CALL_STATUS_DIALING
          Call dialing
static int CALL_STATUS_HELD
          Call held
static int CALL_STATUS_INCOMING
          Call incomming
static int CALL_STATUS_WAITING
          Call waiting
static int CALL_TYPE_DATA
          Data call
static int CALL_TYPE_FAX
          Fax call
static int CALL_TYPE_UNKNOWN
          Unknown call
static int CALL_TYPE_VOICE
          Voice call
static int HANGUP_BUSY
          Busy
static int HANGUP_NORMAL_CLEARING
          Normal hangup
static int HANGUP_NORMAL_UNSPECIFIED
          Normal hangup
static int HANGUP_NOT_RESPONDING
          Not responding
static int HANGUP_OUT_OF_ORDER
          Out of order
static int HANGUP_UNASSIGNED_NUMBER
          Unassigned number
 
Method Summary
static IncomingCallAdapter getIncomingCallAdapter(IncomingCallAdapterListener listener)
          Initializes the adapter
 void hangUpCall(int type)
          Hang up incomming call
 void onURCEvent(java.lang.String urc)
          Internal method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HANGUP_UNASSIGNED_NUMBER

public static final int HANGUP_UNASSIGNED_NUMBER
Unassigned number

See Also:
Constant Field Values

HANGUP_NORMAL_CLEARING

public static final int HANGUP_NORMAL_CLEARING
Normal hangup

See Also:
Constant Field Values

HANGUP_BUSY

public static final int HANGUP_BUSY
Busy

See Also:
Constant Field Values

HANGUP_NOT_RESPONDING

public static final int HANGUP_NOT_RESPONDING
Not responding

See Also:
Constant Field Values

HANGUP_OUT_OF_ORDER

public static final int HANGUP_OUT_OF_ORDER
Out of order

See Also:
Constant Field Values

HANGUP_NORMAL_UNSPECIFIED

public static final int HANGUP_NORMAL_UNSPECIFIED
Normal hangup

See Also:
Constant Field Values

CALL_STATUS_ACTIVE

public static final int CALL_STATUS_ACTIVE
Call active

See Also:
Constant Field Values

CALL_STATUS_HELD

public static final int CALL_STATUS_HELD
Call held

See Also:
Constant Field Values

CALL_STATUS_DIALING

public static final int CALL_STATUS_DIALING
Call dialing

See Also:
Constant Field Values

CALL_STATUS_ALERTING

public static final int CALL_STATUS_ALERTING
Call alerting

See Also:
Constant Field Values

CALL_STATUS_INCOMING

public static final int CALL_STATUS_INCOMING
Call incomming

See Also:
Constant Field Values

CALL_STATUS_WAITING

public static final int CALL_STATUS_WAITING
Call waiting

See Also:
Constant Field Values

CALL_TYPE_VOICE

public static final int CALL_TYPE_VOICE
Voice call

See Also:
Constant Field Values

CALL_TYPE_DATA

public static final int CALL_TYPE_DATA
Data call

See Also:
Constant Field Values

CALL_TYPE_FAX

public static final int CALL_TYPE_FAX
Fax call

See Also:
Constant Field Values

CALL_TYPE_UNKNOWN

public static final int CALL_TYPE_UNKNOWN
Unknown call

See Also:
Constant Field Values
Method Detail

getIncomingCallAdapter

public static IncomingCallAdapter getIncomingCallAdapter(IncomingCallAdapterListener listener)
Initializes the adapter

Parameters:
listener - Listener
Returns:
an instance of the adapter

onURCEvent

public void onURCEvent(java.lang.String urc)
Internal method

Specified by:
onURCEvent in interface ATCommanderListener
Parameters:
urc - AT event

hangUpCall

public void hangUpCall(int type)
Hang up incomming call

Parameters:
type - type of hanging up
See Also:
HANGUP_UNASSIGNED_NUMBER, HANGUP_NORMAL_CLEARING, HANGUP_BUSY, HANGUP_NOT_RESPONDING, HANGUP_OUT_OF_ORDER, HANGUP_NORMAL_UNSPECIFIED