Ajoy Karmakar
Ajoy Karmakar

Reputation: 31104

How to send DTMF in Linphone ios SDK

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.

Upvotes: 0

Views: 545

Answers (1)

sbca68
sbca68

Reputation: 25

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

Upvotes: 0

Related Questions