Phone
Phone Object
Supported Platform(s)
- BlackBerry OS 5.0+ |
- Ripple Emulator |
Configuration Document Settings
To use all of the API described for this object, you must ensure the following settings are in your configuration document: |
You must declare the feature element(s) below in your configuration document: |
Feature ID | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
---|---|---|---|---|---|---|---|
<feature id="blackberry.phone.Phone" /> | Y | Y | Y | Y |
Permission Elements (PlayBook and BlackBerry 10+) |
---|
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application. |
Functions
Constants
Functions
static
blackberry.phone.Phone.Call[]
blackberry.phone.Phone.activeCalls
()
Request all of the current active calls
Active calls are tracked when the application is running. When launched, only the current active call might be retrieved.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
Return:
Returns an array of current active calls
Code Example:
|
static
Boolean
blackberry.phone.Phone.addPhoneListener
(onPhoneEvent: function(callId : Number, [reason: Number]), [eventType : Number])
Registers PhoneListener of different type events
To subscribe to PhoneListener, a callback and an eventType (one of enumerated PhoneListener event types) should be specified.
When subscribing a different callback with the same eventType, the new callback will overwrite the previous one. To unsubscribe from a phone call event, pass null as a
callback parameter, along with proper eventType.
To unsubscribe from ALL events, pass null. All invoked callback functions will receive a 'callid' of type 'int' as a parameter, which is the ID of the Call.
A callback registered with eventType 'CB_CALL_FAILED', in addition to the 'callid' parameter, will get code as a second parameter describing the reason for the failure.
It would be equal to one of CALL_ERROR_* constants.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
Parameters | |
---|---|
onPhoneEvent |
This callback function is triggered when a phone event is triggered.
callId: ID for the resumed call. reason: CALL_ERROR_* code describing the reason for the failure when callback for CB_CALL_FAILED is triggered |
eventType | One of constants defining phone call event type. |
Return:
Returns true if the listener was successfully assigned
Code Example:
|
static
Boolean
blackberry.phone.Phone.inActiveCall
()
Determines whether or not the phone is currently in an active call
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
Return:
Returns true if the phone is currently in an active call
Code Example:
|
Constants
static
Number
CB_CALL_INITIATED
= 0
Invoked when a call has been initiated by the device (outbound).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_WAITING
= 1
Invoked when a call is waiting.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_INCOMING
= 2
Invoked when a new call is arriving.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_ANSWERED
= 3
Invoked when the user answers a call (user driven).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_CONNECTED
= 4
Invoked when the network indicates a connected event (network driven).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_CONFERENCECALL_ESTABLISHED
= 5
Invoked when a conference call has been established.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CONFERENCECALL_DISCONNECTED
= 6
Invoked when a conference call is terminated (all members disconnected).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_DISCONNECTED
= 7
Invoked when a call is disconnected.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_DIRECTCONNECT_CONNECTED
= 8
Invoked when a direct-connect call is connected.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_DIRECTCONNECT_DISCONNECTED
= 9
Invoked when a direct-connect call is disconnected.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_ENDED_BYUSER
= 10
Invoked when the user ends the call.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_FAILED
= 11
Invoked when a call fails.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_RESUMED
= 12
Invoked when a call goes from 'held' to 'resumed' state.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_HELD
= 13
Invoked when a call goes into the 'held' state.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_ADDED
= 14
Invoked when a call gets added to a conference call
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CB_CALL_REMOVED
= 15
Invoked when a call gets removed from a conference call.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_SUBSCRIBER_BUSY
= 1
Subscriber busy.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_CONGESTION
= 2
Congestion.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_RADIO_PATH_UNAVAILABLE
= 3
Radio path unavailable.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_NUMBER_UNOBTAINABLE
= 4
Number unobtainable.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_AUTHORIZATION_FAILURE
= 5
Authorization failure.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_EMERGENCY_CALLS_ONLY
= 6
Emergency calls only.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_HOLD_ERROR
= 7
Hold error.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_OUTGOING_CALLS_BARRED
= 8
Outgoing call barred.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_GENERAL
= 9
General call error.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_MAINTENANCE_REQUIRED
= 10
Maintenance required.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_SERVICE_NOT_AVAILABLE
= 11
Service not available.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_DUE_TO_FADING
= 12
Call failed because of signal fading.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_LOST_DUE_TO_FADING
= 13
Call lost because of signal fading.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_TRY_AGAIN
= 14
Call failed, please try again.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_FDN_MISMATCH
= 15
Fixed dialing number mismatch.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_CONNECTION_DENIED_BY_NETWORK
= 16
Connection denied by network.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_NUMBER_NOT_IN_SERVICE
= 17
Number not in service (IDEN specific).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_PLEASE_TRY_LATER
= 18
Please try call later (IDEN specific).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_SERVICE_CONFLICT
= 19
Service conflict TI (IDEN specific).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_SYSTEM_BUSY_TRY_LATER
= 20
System busy, try later (IDEN specific).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_USER_BUSY_IN_PRIVATE
= 21
User busy in private (IDEN specific).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_USER_BUSY_IN_DATA
= 22
User busy in data (IDEN specific).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_USER_NOT_AUTHORIZED
= 23
User not authorized (IDEN specific).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_USER_NOT_AVAILABLE
= 24
User not available (IDEN specific).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_USER_UNKNOWN
= 25
User unknown (IDEN specific).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_USER_NOT_REACHABLE
= 26
User not reachable (IDEN specific).
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |
static
Number
CALL_ERROR_INCOMING_CALL_BARRED
= 27
Incoming call barred.
Supported Platforms | |
---|---|
- BlackBerry OS 5.0+ | |
- Ripple Emulator |