Phone State Monitoring

Phone State Monitoring

The Zebra Voice Client broadcasts its status using the following intent. This is an intent that the Zebra Voice Client sends. A third-party application can register to receive the intents.

Prerequisites

  • Zebra Voice Client is loaded to the device.
  • The third-party application must register to receive the intents as described in the Phone State Example.
  • All versions of Zebra Voice Client 9.0 support these intents.

Intent Definition

Name
Description
Action
wfc.voice.PHONE_STATE
extras
registration_state
PBX registration state
ACTIVE|ACTIVE_DND|CONNECTING|INACTIVE|EXTENSION_UNAVAILABLE
state
Voice call state
IDLE|CALLING|RINGING|ACTIVE
number
The phone number for the current session that is reported when the voice call state changes (optional).
line_id
The line number is reported when one of the line registers (optional).
line_extension
Line extension that is reported when one of the lines registers (optional).
line_registered
A boolean expression that is reported when one of the lines registers (optional).
suspended
A boolean expression that is reported when the state is
IDLE
because one of the sessions is suspended or on hold (optional).
The suspended extra is only available in Zebra Voice version 9.0.21104 or later. The EXTENSION_UNAVAILABLE registration state is broadcasted solely when no extension is available for the specific department or PFM role chosen by the user.

Phone State Example

The following code example registers the phone state intent from a third-party app.
// Create a broadcast receiver BroadcastReceiver mMessageReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Log.i(TAG, "Received PHONE_STATE from WFCVoice “ + " registration_state=" + intent.getStringExtra("registration_state") + “ call state=" + intent.getStringExtra("state") + " number=" + intent.getStringExtra("number") + " line_id=" + intent.getStringExtra("line_id") + " line_extension=" + intent.getStringExtra("line_extension") + " line_registered=" + intent.getBooleanExtra("line_registered" false) ); } }; //Register broadcast receiver in the Activity IntentFilter mMessageReceiver = new IntentFilter(); requestFilter.addAction(“wfc.voice.PHONE_STATE”); registerReceiver(mMessageReceiver, requestFilter);