Implementing Shared URI Reporting Via Intent

Implementing Shared URI Reporting Via Intent

A new intent has been introduced that provides additional information on registration use cases. Third-party applications can subscribe to this intent to access detailed insights about these cases.

The new intent is activated when:
  • A profile is applied to the Voice Client.
  • A reload is executed on the Voice Client.
  • The Voice Client is signed out/logged out.
  • The Profile Client executes a role switch, applying a new profile to the Voice Client.
In all the aforementioned use cases, the intent records which extension is deregistered and which extension the Voice Client is registered with. Additionally, it records if there is a failure during the registration of an extension.

Intent Definition

Extra Parameter
Name
Description
Action
wfc.voice.REGISTRATION_INFO
Extras
Extra 0
action_name
The
action_name
extra contains one of the following strings:
  • switch_role
    - This is returned if the
    switch_role
    operation is executed.
  • reload
    - This is returned if the
    reload
    operation is executed inside Voice Client.
  • sign_out
    - This is returned if the
    sign_out
    operation is executed inside Voice Client.
  • initialized
    - This is returned if the extension is initialized inside Voice Client.
  • if
    action_name
    is
    switch_role
    or
    reload
    in the particular scenario only
    current_extension_info
    and
    previous_extension_info
    extra are broadcasted.
  • if
    action_name
    is
    sign_out
    or
    initialized
    the particular scenario only
    extension_info
    extra is broadcasted.
Extra 1
var_location
This
var_location
extra contains the shared profile URL, used to load the profile.
Extra 2
previous_extension_info
The
previous_extension_info
contains details about the previously registered extension, presented in a key-value format. The keys include
site_id
,
department
,
extension
,
sip_sipid
,
pbxType
,
extension_applied
, and
failure_reason
, with their corresponding values returned.
The expected corresponding value for the following-mentioned keys:
The keys
site_id
,
department
,
extension
,
sip_sipid
,
pbxType
, and
failure_reason
, values are any string.
The
extension_applied
value either 0 or 1(integer) if 0 in
failure_reason
is broadcasted.
Extra 3
current_extension_info
The current_extension_info offers details about the currently registered extension in a key-value format. The keys include
site_id
,
department
,
extension
,
sip_sipid
,
pbxType
, and
failure_reason
, values are any string.
The expected corresponding value for the following-mentioned keys:
The keys
site_id
,
department
,
extension
,
sip_sipid
,
pbxType
, and
failure_reason
, values are any string.
The
extension_applied
value is either 0 or 1 (integer) if 0 in
failure_reason
is broadcasted.
Extra 4
extension_info
The
extension_info
contains details about the registered extension in a key-value format. The keys include
site_id
,
department
,
extension
,
sip_sipid
,
pbxType
,
extension_applied
, and
failure_reason
, with their corresponding values are returned.
The expected corresponding value for the following-mentioned keys:
The keys
site_id
,
department
,
extension
,
sip_sipid
,
pbxType
, and
failure_reason
, values can be any string.
The
extension_applied
value either 0 or 1(integer) if 0 in
failure_reason
is broadcasted.

Code Snippet Example

IntentFilter intent = new IntentFilter(); intent.addAction("wfc.voice.REGISTRATION_INFO"); registerReceiver(mReceiver,intent); private final BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction() != null && intent.getAction(). equals ("wfc.voice.REGISTRATION_INFO")) { String intentAction = intent.getAction(); Bundle intentExtras = intent.getExtras(); if (intentExtras != null) { String varLocation = intentExtras.getString("var_location"); String actionName = intentExtras.getString("action_name"); if (actionName != null) { if (actionName.equals("reload")) { String previousExtensionInfo = intentExtras.getString ("previous_extension_info"); String currentExtensionInfo = intentExtras.getString ("current_extension_info"); Log.d("RegistrationInfo: ", "IntentAction: " + intentAction + "\nactionName: " + actionName + "\nvarLocation: " + varLocation + "\nPrevious Extension Info: " + previousExtensionInfo + "\nCurrent Extension Info: " + currentExtensionInfo); } else { String extensionInfo = intentExtras.getString("extension_info"); Log.d("RegistrationInfo: ", "IntentAction: " + intentAction + "\nactionName: " + actionName + "\nvarLocation: " + varLocation + "\nExtension Info: " + extensionInfo); try { JSONArray extensionInfoJSONArray = new JSONArray(extensionInfo); for (int i = 0; i < extensionInfoJSONArray.length(); i++) { JSONObject line = (JSONObject) extensionInfoJSONArray.get(i); if (line != null) { String siteId = line.getString("site_id"); String department = line.getString("department"); String sipSipId = line.getString("sip_sipid"); String pbxType = line.getString("pbxType"); int extensionApplied = line.getInt("extension_applied"); Log.d("LineInfo", "siteId: " + siteId + ", department: " + department + ", sipSipId: " + sipSipId + ", pbxType: " + pbxType + ", extensionApplied: " + extensionApplied); if (extensionApplied == 0) { String failureReason = line.getString("failure_reason") Log.d("LineInfo", "failureReason: " + failureReason); } } } } catch (JSONException e) { throw new RuntimeException(e); } } } } } } };