自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
具有畫面的語音信箱
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Android 6.0 (Marshmallow) 推出了視覺語音信箱 (VVM) 支援功能,並整合至撥號程式,讓相容的電信業者 VVM 服務可透過最少的設定連結至撥號程式。視覺化語音信箱可讓使用者在不撥打電話的情況下,輕鬆查看語音信箱。使用者可以在類似收件匣的介面中查看訊息清單,以任何順序聆聽訊息,並視需要刪除訊息。
Android 7.0 已在視覺語音信箱中新增下列設定參數:
- 語音留言預先載入功能由
KEY_VVM_PREFETCH_BOOLEAN
控制 - 控制
KEY_VVM_CELLULAR_DATA_REQUIRED_BOOLEAN
是否需要行動數據連線 - 擷取語音信箱語音轉錄稿
- 擷取語音留言配額
本頁面將概略說明提供的內容、電信業者如何整合,以及實作方式的部分細節。
視覺化語音信箱 (VVM) 用戶端
Android 6.0 以上版本包含 OMTP VVM 用戶端,在提供正確設定的情況下,可連線至電信業者 VVM 伺服器,並在 Android 開放原始碼計畫 (AOSP) 撥號應用程式中填入 VVM 訊息。VVM 用戶端:
- 處理用於啟用/停用/查詢服務狀態的簡訊,以及用於通知裝置訂閱者信箱中的事件的簡訊。
- 將信箱與 IMAP 伺服器同步
- 在使用者選擇聽取語音留言時下載語音留言
- 擷取語音留言轉錄內容
- 擷取語音信箱配額的詳細資料 (信箱總大小和已用大小)
- 整合至撥號應用程式,提供使用者功能,例如回撥、查看未讀訊息、刪除訊息等。
與 VVM 用戶端整合
實作
電信業者必須提供視覺化語音信箱伺服器,並導入 OMTP
VVM 規格。AOSP VVM 用戶端目前的實作內容支援核心功能 (讀取/刪除語音信箱、下載/同步/聆聽),但未實作其他 TUI 功能 (變更密碼、語音信箱問候語、語言)。目前我們僅支援 OMTP 1.1 版,且不會為 IMAP 驗證使用加密功能。
如要支援轉錄稿,電信業者必須支援 OMTP 1.3 規格第 2.1.3 項所指定的轉錄稿附件格式 (MIME 類型為 plain/text)。
注意:伺服器傳送至裝置的簡訊 (例如 STATUS 或 SYNC) 必須是資料簡訊。
設定
如要讓電信業者整合 VVM 服務,電信業者必須向 OMTP 用戶端可用的平台提供設定詳細資料。這些參數如下:
- SMS 的目的地號碼和通訊埠號碼
- 電信業者提供的視覺化語音信箱應用程式套件名稱 (如果有提供),這樣一來,如果安裝該套件,就能停用平台實作
這些值會透過 Carrier Config API 提供。這項功能已在 Android 6.0 推出,可讓應用程式為需要的各種平台元件,動態提供與電話相關的設定。特別是下列鍵必須定義值:
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_CELLULAR_DATA_REQUIRED_BOOLEAN
詳情請參閱「電信業者設定」。
實作
OMTP VVM 用戶端是在 packages/services/Telephony
中實作,特別是在 src/com/android/phone/vvm/
中
設定
- VVM 用戶端會監聽
TelephonyIntents#ACTION_SIM_STATE_CHANGED
或 CarrierConfigManager#ACTION_CARRIER_CONFIG_CHANGED
。 - 新增含有正確電信業者設定值的 SIM 卡時 (
KEY_VVM_TYPE_STRING
設為 TelephonyManager.VVM_TYPE_OMTP
或 TelephonyManager.VVM_TYPE_CVVM
),VVM 用戶端會傳送啟用簡訊至 KEY_VVM_DESTINATION_NUMBER_STRING
中指定的值。 - 伺服器會啟用視覺語音信箱服務,並透過 STATUS SMA 傳送 OMTP 憑證。VVM 用戶端收到 STATUS SMS 後,會註冊語音信箱來源,並在裝置上顯示語音信箱分頁。
- OMTP 憑證會儲存在本機,裝置會開始進行完整同步處理,如下所述。
正在同步處理
VVM 用戶端可以透過多種方式與電信業者伺服器同步,反之亦然。
- 系統會在初次下載時執行完整同步處理作業。VVM 用戶端會擷取語音信箱中繼資料,例如日期和時間、來源號碼、持續時間、語音信箱轉錄內容 (如有),以及音訊資料 (如果
KEY_VVM_PREFETCH_BOOLEAN
為 True)。完整同步處理作業可由下列項目觸發:
- 插入新的 SIM 卡
- 重新啟動裝置
- 恢復服務
- 接收
VoicemailContract.ACTION_SYNC_VOICEMAIL
廣播
- 使用者與語音信箱互動 (讀取或刪除) 時,系統會執行上傳同步處理。上傳同步處理結果會導致伺服器變更資料,以便與裝置上的資料相符。舉例來說,如果使用者讀取語音留言,系統會在伺服器上將其標示為已讀;如果使用者刪除語音留言,系統會在伺服器上刪除該留言。
- 當 VVM 用戶端收到電信業者傳送的「MBU」(信箱更新) SYNC 簡訊時,就會發生下載同步處理。SYNC 訊息包含新訊息的中繼資料,可儲存在語音信箱內容提供者中。
注意:系統會在每次同步處理期間擷取語音信箱配額值。
下載語音留言
當使用者按下播放鍵來聽取語音留言時,系統會下載對應的音訊檔案。如果使用者選擇聆聽語音留言,撥號程式可以廣播 VoicemailContract.ACTION_FETCH_VOICEMAIL
,讓語音留言用戶端接收,並啟動內容下載作業,以及更新平台語音留言內容供應器中的記錄。
停用 VVM
視覺化語音信箱服務可透過使用者互動、移除有效的 SIM 卡,或由電信業者的視覺化語音信箱應用程式取代而停用或停用。停用表示本機裝置不再顯示視覺化語音信箱。「已停用」表示已為訂閱者關閉這項服務。使用者互動可停用服務,SIM 卡移除會暫時停用服務,因為該服務已不存在;電信業者 VVM 替換作業會停用 AOSP VVM 用戶端。
使用者互動
使用者可以手動啟用或停用視覺化語音信箱。如果使用者停用 Visual Voicemail,也表示他們已停用這項服務。使用者停用 Visual Voicemail 時,系統會傳送 DEACTIVATE 簡訊,語音信箱來源會在本機取消註冊,語音信箱分頁也會消失。如果他們重新啟用視訊語音信箱,服務也會重新啟用。
移除 SIM 卡
如果裝置的 SIM 狀態 (ACTION_SIM_STATE_CHANGED
) 或電信業者設定值 (ACTION_CARRIER_CONFIG_CHANGED
) 有所變更,且指定 SIM 卡的有效設定不再存在,則語音信箱來源會在本機取消註冊,語音信箱分頁也會消失。如果更換 SIM 卡,系統會重新啟用 VVM。
已由電信業者 VVM 取代
如果裝置上安裝了電信業者的視覺化語音信箱應用程式,即可停用 AOSP VVM 用戶端。這可透過檢查是否已安裝名稱與 KEY_CARRIER_VVM_PACKAGE_NAME_STRING
參數相符的套件來達成。
使用者仍可透過互動啟用 VVM 用戶端。
測試
自 Android 4.0 以來,VoicemailProvider API 就已針對這類 API 建立一組 CTS 測試,可讓應用程式將語音信件插入/查詢/刪除至平台。這些 API 與 VVM 用來新增/刪除語音信箱的 API 相同,因此任何撥號應用程式都能在 UI 中顯示語音信箱。
如要測試設定應用程式是否正確傳遞 OMTP 設定,您可以使用以下方式測試程式碼:
- 內含有效憑證簽名的 SIM 卡
- 搭載 Android 6.0 的裝置,且使用未經修改的 AOSP 手機架構
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Visual voicemail\n\nAndroid 6.0 (Marshmallow) brought an implementation of visual voicemail (VVM)\nsupport integrated into the Dialer, allowing compatible carrier VVM services to\nhook into the Dialer with minimal configuration. Visual voicemail lets users\neasily check voicemail without making any phone calls. Users can view a list of\nmessages in an inbox-like interface, listen to them in any order, and can\ndelete them as desired.\n\nAndroid 7.0 added the following configuration parameters to visual voicemail:\n\n- Prefetching of voicemails controlled by `KEY_VVM_PREFETCH_BOOLEAN`\n- Control of whether a cellular data connection is required by `KEY_VVM_CELLULAR_DATA_REQUIRED_BOOLEAN`\n- Fetching of voicemail transcriptions\n- Fetching of voicemail quota\n\nThis page gives an overview of what is provided, how carriers can integrate\nwith it, and some details of the implementation.\n\nVisual voicemail (VVM) client\n-----------------------------\n\nAndroid 6.0 and above includes a OMTP VVM client, which (when provided with the correct\nconfiguration) connects to carrier VVM servers and populates VVM\nmessages within the Android Open Source Project (AOSP) Dialer. The VVM client:\n\n- Handles the SMS messages used to activate/deactivate/query status of the service and the SMS messages used to notify the device of events in the subscriber's mailbox\n- Syncs the mailbox with the IMAP server\n- Downloads the voicemails when the user chooses to listen to them\n- Fetches voicemail transcriptions\n- Fetches details of voicemail quota (total mailbox size and occupied size)\n- Integrates into the Dialer for user functionality such as calling back, viewing unread messages, deleting messages, etc.\n\nIntegrate with the VVM client\n-----------------------------\n\n### Implementation\n\nThe carrier must provide a visual voicemail server implementing the\n[OMTP\nVVM specifications](http://www.gsma.com/newsroom/wp-content/uploads/2012/07/OMTP_VVM_Specification_1_3.pdf). The current implementation of the AOSP VVM client supports the core\nfeatures (read/delete voicemails, download/sync/listen) but the additional TUI\nfeatures (password change, voicemail greeting, languages) are not implemented.\nAt this time, we only support OMTP version 1.1 and do not use encryption for\nIMAP authentication.\n\nTo support transcriptions, carriers must support the transcription attachment\nformat (MIME type plain/text) specified in the OMTP 1.3 spec, item 2.1.3.\n\n**Note:** Server-originated SMS messages to the device\n(e.g. STATUS or SYNC) must be data SMS messages.\n\n### Configuration\n\nIn order for a carrier to integrate with the VVM service, the carrier must\nprovide configuration details to the platform that the OMTP client can use.\nThese parameters are:\n\n- Destination number and port number for SMS\n- The package name of the carrier-provided visual voicemail app (if one is provided), so that the platform implementation can be disabled if that package is installed\n\nThese values are provided through the\n[Carrier Config API](https://developer.android.com/reference/android/telephony/CarrierConfigManager.html).\nThis functionality, launched in Android 6.0, lets an app\ndynamically provide telephony-related configuration to the various platform\ncomponents that need it. In particular the following keys must have values\ndefined:\n\n- `KEY_VVM_DESTINATION_NUMBER_STRING`\n- `KEY_VVM_PORT_NUMBER_INT`\n- `KEY_VVM_TYPE_STRING`\n- `KEY_CARRIER_VVM_PACKAGE_NAME_STRING`\n- `KEY_VVM_PREFETCH_BOOLEAN`\n- `KEY_VVM_CELLULAR_DATA_REQUIRED_BOOLEAN`\n\nSee [Carrier configuration](/docs/core/connect/carrier)\nfor details.\n\nImplementation\n--------------\n\nThe OMTP VVM client is implemented within `packages/services/Telephony`,\nin particular within `src/com/android/phone/vvm/`\n\n### Setup\n\n1. The VVM client listens for `TelephonyIntents#ACTION_SIM_STATE_CHANGED` or `CarrierConfigManager#ACTION_CARRIER_CONFIG_CHANGED`.\n2. When a SIM is added that has the right Carrier Config values (`KEY_VVM_TYPE_STRING` set to `TelephonyManager.VVM_TYPE_OMTP` or `TelephonyManager.VVM_TYPE_CVVM`), the VVM client sends an ACTIVATE SMS to the value specified in `KEY_VVM_DESTINATION_NUMBER_STRING`.\n3. The server activates the visual voicemail service and sends the OMTP credentials through STATUS SMA. When the VVM client receives the STATUS SMS, it registers the voicemail source and displays the voicemail tab on the device.\n4. The OMTP credentials are saved locally and the device begins a full sync, as described below.\n\n### Syncing\n\nThere are a variety of ways that the VVM client can sync with the carrier\nserver and vice versa.\n\n- **Full syncs** occur upon initial download. The VVM client fetches voicemail metadata like date and time; origin number; duration; voicemail transcriptions, if available; and audio data if `KEY_VVM_PREFETCH_BOOLEAN` is True. Full syncs can be triggered by:\n - Inserting a new SIM\n - Rebooting the device\n - Coming back in service\n - Receiving the `VoicemailContract.ACTION_SYNC_VOICEMAIL` broadcast\n- **Upload sync** happens when a user interacts with a voicemail to read or delete it. Upload syncs result in the server changing its data to match the data on the device. For example, if the user reads a voicemail, it's marked as read on the server; if a user deletes a voicemail, it's deleted on the server.\n- **Download sync** occurs when the VVM client receives a \"MBU\" (mailbox update) SYNC SMS from the carrier. A SYNC message contains the metadata for a new message so that it can be stored in the voicemail content provider.\n\n**Note:** The voicemail inbox quota values are\nretrieved during every sync.\n\n### Voicemail download\n\nWhen a user presses play to listen to a voicemail, the corresponding audio file\nis downloaded. If the user chooses to listen to the voicemail, the Dialer can\nbroadcast `VoicemailContract.ACTION_FETCH_VOICEMAIL`, which the\nvoicemail client receives, initiate the download of the\ncontent, and update the record in the platform voicemail content provider.\n\n### Disable VVM\n\nThe VVM service can be disabled or deactivated by user interaction, removal of\na valid SIM, or replacement by a carrier VVM app. *Disabled* means that the\nlocal device no longer displays visual voicemail. *Deactivated* means that\nthe service is turned off for the subscriber. User interaction can\ndeactivate the service, SIM removal temporarily disables the service because\nit's no longer present, and carrier VVM replacement disables the AOSP VVM client.\n\n#### User interaction\n\nThe user may manually enable or disable visual voicemail. If a user disables\nvisual voicemail, they are also deactivating their service. When they disable\nvisual voicemail, a DEACTIVATE SMS is sent, the voicemail source is\nunregistered locally, and voicemail tab disappears. If they re-enable visual\nvoicemail, their service is reactivated as well.\n\n#### SIM removal\n\nIf there are changes to the device's SIM state (`ACTION_SIM_STATE_CHANGED`)\nor Carrier Config values (`ACTION_CARRIER_CONFIG_CHANGED`), and\na valid configuration for the given SIM no longer exists, then the\nvoicemail source is unregistered locally and the voicemail tab disappears. If\nthe SIM is replaced, VVM is re-enabled.\n\n#### Replaced by carrier VVM\n\nA carrier visual voicemail app, if installed on the device, can disable the\nAOSP VVM client. This is achieved by checking if a package with a name\nmatching the `KEY_CARRIER_VVM_PACKAGE_NAME_STRING` parameter is installed.\n\nThe VVM client can still be enabled through user interaction.\n\nTesting\n-------\n\nThere is an existing (since Android 4.0) set of CTS tests for the\nVoicemailProvider APIs that allow an app to insert/query/delete voicemails into\nthe platform. These are the same APIs that VVM uses to add/delete voicemails so\nthat any Dialer app can display them in the UI.\n\nTo test your configuration app is passing the OMTP configuration\ncorrectly you can test your code with:\n\n- A SIM containing a valid certificate signature\n- A device running Android 6.0 with an unmodified version of the AOSP phone framework"]]