Extra Parameter | Name | Description |
---|---|---|
Action | wfc.voice.REGISTRATION_INFO | |
Extras | ||
Extra 0 | action_name | The action_name extra contains one of the following strings:
|
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. |
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); } } } } } } };