ios10 - CXPlayDTMFCallAction 不播放本地 dtmf 声音

标签 ios10 voip dtmf callkit

我正在将 CallKit 与 VOIP 应用集成。我能够拨入和拨出电话。我遵循了以下步骤:

  1. 配置 Audio Session
  2. 在(didActivate)中启动音频
  3. 在(didDeActivate)中停止音频

我已经实现了 DTMF 提供商委托(delegate)的回调,如下所示:

func provider(_ provider: CXProvider, perform action: CXPlayDTMFCallAction) {
    print("Provider - CXPlayDTMFCallAction")

    let dtmfDigts:String = action.digits

    for (index, _) in dtmfDigts.characters.enumerated() {
        let dtmfDigit = dtmfDigts.utf8CString[index]
        print("Processing dtmfDigit:\(dtmfDigit)" )
        self.softphone.dtmf(on:dtmfDigit)
    }

    self.softphone.dtmfOff()

    // Signal to the system that the action has been successfully performed.
    action.fulfill()
}

我在通话过程中按 native 通话 UI 上的数字时听不到按键音,即本地 dtmf 声音。

来自 https://developer.apple.com/reference/callkit/cxplaydtmfcallaction :

"CallKit automatically plays the corresponding DTMF frequencies for any digits transmitted over a call. The app is responsible for managing the timing and handling of digits as part of fulfilling the action."

这是已知问题还是 callkit 不播放本地 dtmf 按键音?

最佳答案

当按下 native 通话 UI 的“键盘”按钮中的键时,CallKit 应该在本地播放 DTMF 音调。但是 CallKit 应用程序负责通过其自己的网络接口(interface)将 DTMF 音发送到远程端。

如果您在 native 通话 UI 中听不到本地播放的音调,请 report a bug给苹果。

关于ios10 - CXPlayDTMFCallAction 不播放本地 dtmf 声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41132445/

相关文章:

ios - 即使应用程序未运行也能播放音频剪辑

uitableview - ‘NSRangeException’: row (1) beyond bounds (1) for section (0)

java - 我应该使用 Jain SIP (java) 中的哪些类来制作 SIP 客户端?

objective-c - 使用 Facebook SDK 4.15.1 在 iOS 10 上使用 Facebook SDK 登录、分享和点赞时获取空白页面

voip - VoIP 服务如何连接到固定电话?

javascript - Adobe DTM - Accordion 链接点击跟踪

java - 从 3GP 文件中检测 DTMF 数字

android - 如何通过我的耳机播放 DTMF 音调?

ios - 在模拟器中测试@1x View

triggers - 关于 fireDate 的 UNNotificationTrigger