0

Calling functionality is working fine but the SendDTMF isn't working. Here is my minimal code that can help to understand the situation.

class AnswerCallViewController: UIViewController {
var call: Call!
var proxy_cfg: ProxyConfig!
    
let coreManager1 = LinphoneCoreManager()
var lc: Core?
let coreManager2 = LinphoneCoreManager2()
var mIterateTimer: Timer?
var cPtr: OpaquePointer?

 @IBAction func btnsAppend(_ sender: UIButton) {
            
    let digit1 = sender.currentTitle!
    print("digit1", digit1)

    let cchar = (sender.currentTitle!.cString(using: String.Encoding.utf8)?[0])!

    do {
       try call?.sendDtmf(dtmf: cchar)
    } catch {
        print("DTMF failed because \(error)")
    }
}

It's should work but it's always return error. The error log is -

liblinphone-warning-linphone_call_send_dtmf(): invalid call, canceling DTMF
sendDtmf and Returns: -1 on error. 

Other Information -

Linphone SDK - Version 5 (compiled  with g729 codec.)

Xcode - Version 12.4 (12D4e)

Any help will be appreciated.

Ajoy Karmakar
  • 22,555
  • 3
  • 10
  • 12

1 Answers1

0

Please ensure that you call is defined and call.state == .StreamsRunning

sbca68
  • 25
  • 4