android 6.0 (marshmallow) brought an implementation of visual voicemail (vvm) support built into the dialer, allowing supported carrier vvm services to connect to the dialer with minimal configuration. visual voicemail allows users to easily check voicemail without making any phone calls. users can view a list of messages in an inbox-like interface, listen to them in any order, and delete them as desired.
Android 7.0 added the following configuration parameters to Visual Voicemail:
- voicemail prefetch controlled by key_vvm_prefetch_boolean
- control whether a cellular data connection is required by key_vvm_cellular_data_required_boolean
- voicemail transcription fetch
- voicemail quota search
This article provides an overview of what is provided, how operators can integrate it, and some implementation details.
visual voicemail (vvm) client
android 6.0 and higher includes a vvm omtp client, which (when provided with the correct configuration) will connect to carrier vvm servers and populate visual voicemail messages within the open source project (aosp) dialer ) from android. the vvm client:
- handles the sms messages used to activate/deactivate/query service status and the sms messages used to notify the device of events in the subscriber’s mailbox
- synchronizes the mailbox with imap server
- downloads voicemails when user chooses to listen to them
- gets voicemail transcripts
- gets voicemail quota details voice (total mailbox size and busy size)
- is integrated into the dialer for user functionality such as call back, view unread messages, delete messages, etc.
integrate with vvm client
implementation
The operator must provide a visual voicemail server that implements the omtp vvm specifications. current implementation of aosp vvm client supports core functions (read/delete voicemails, download/sync/listen) but additional tui functions (password change, voicemail greeting, languages) are not implemented. At this time, we only support omtp version 1.1 and do not use encryption for imap authentication.
To support transcripts, carriers must support the transcript attachment format (plain/text mime type) specified in the omtp 1.3 specification, item 2.1.3.
note: SMS messages originating from the server to the device (for example, status or synchronization) must be data SMS messages.
settings
For a carrier to integrate with the vvm service, the carrier must provide configuration details to the platform that the omtp client can use. these parameters are:
- destination number and port number for sms
- the package name of the visual voicemail application provided by the operator (if one is provided), so that the implementation of the platform can be disabled if that package is installed
These values are provided through the carrier configuration api. This functionality, released in Android 6.0, allows an application to dynamically provide telephony-related settings to the various platform components that need them. in particular, the following keys must have values defined:
- key_vvm_destination_number_string
- key_vvm_port_number_int
- key_vvm_type_string
- key_carrier_vvm_package_name_string
- key_vvm_prefetch_boolean
- key_vvm_mobile_data_required_boolean
see the carrier configuration article for more details.
implementation
vvm omtp client is implemented inside packages/services/telephony, in particular inside src/com/android/phone/vvm/
settings
- vvm client listens for #action_sim_state_changed or carrierconfigmanager#action_carrier_config_changed telephony intents.
- when adding a sim that has the correct carrier configuration values (key_vvm_type_string set to telephonymanager.vvm_type_omtp or telephonymanager.vvm_type_cvvm), the vvm client sends an activation sms to the value specified in key_vvm_destination_number_string.
- the server activates the visual voicemail service and sends the omtp credentials via status sms. when the vvm client receives the status sms, it registers the voicemail source and displays the voicemail tab on the device.
- omtp credentials are saved locally and the device begins a full sync, as described below.
synchronizing
There are a variety of ways the vvm client can sync with the operator’s server and vice versa.
- full syncs occur on initial download. vvm client gets voicemail metadata such as date and time; origin number; duration; voicemail transcripts, if available; and audio data if key_vvm_prefetch_boolean is true. full syncs can be triggered by:
- inserting a new sim
- rebooting the device
- returning to service
- receiving the email contract from voice.action_sync_voicemail broadcast
Note: Voicemail inbox quota values are retrieved during each sync.
download voice messages
When a user presses play to listen to a voicemail, the corresponding audio file is downloaded. if the user chooses to listen to voicemail, the dialer can transmit voicemailcontract.action_fetch_voicemail, which will receive the voicemail client, start downloading the content, and update the record in the platform’s voicemail content provider.
disable vvm
vvm service can be disabled or deactivated by user interaction, removal of a valid sim or replacement with a carrier vvm app. disabled means the local device no longer displays visual voicemail. disabled means that the service is disabled for the subscriber. user interaction may disable the service, removal of the sim card temporarily disables the service because it is no longer present, and carrier vvm replacement disables the aosp vvm client.
user interaction
The user can manually enable or disable visual voicemail. if a user disables visual voicemail, they are also disabling your service. when they disable visual voicemail, a disable sms is sent, the voicemail source is not registered locally, and the voicemail tab disappears. if they re-enable visual voicemail, your service is also reactivated.
sim removal
if there are changes to the device sim state (action_sim_state_changed) or carrier configuration values (action_carrier_config_changed), and a valid configuration no longer exists for the given sim, then the voicemail source is dropped locally and the voicemail tab disappears. if the sim is replaced, vvm will be re-enabled.
replaced by the vvm operator
a carrier visual voicemail application, if installed on the device, can disable the aosp vvm client. this is achieved by checking to see if a package with a name that matches the key_carrier_vvm_package_name_string parameter is installed.
vvm client can still be enabled via user interaction.
test
There is (since android 4.0) a suite of cts tests for voicemail provider api’s that allow an application to insert, query or delete voicemails on the platform. these are the same api that vvm uses to add/remove voicemails so that any dialer application can display them in the UI.
To test that your setup application is passing the omtp configuration correctly, you can test your code with:
- a sim card containing a valid certificate signature
- a device running android 6.0 with an unmodified version of the aosp phone framework