I cant send dtmf via IOS Swift webrtc

113 views
Skip to first unread message

Bilal Şimşek

unread,
Jul 2, 2021, 11:43:05 AM7/2/21
to discuss-webrtc
Hi all,
I am developing mobile app that uses janus gateway, I coded both ios and android identical, on android dtmf works fine but on ios its not successful to send dtmf but there is no error. 
is there anyway that I can check if dtmf reached to janus gateway. 

in the link code shows preparing peerconnection  and sending dtmf functions.
I also tried add track to directly peerconnection instead of stream but no success. 

any idea will be appriciated. 

Bilal Şimşek

unread,
Jul 6, 2021, 2:53:10 AM7/6/21
to discuss-webrtc
adding operation to queue solved my problem.

func insertDTMF(_ tone:String){
      
        
        var audioSender: RTCRtpSender?

        for rtpSender in peerConnection.senders {
          if rtpSender.track?.kind == "audio" {
            audioSender = rtpSender
          }
        }
        
        if let audioSender = audioSender {
           let queue = OperationQueue()
           queue.addOperation({
             audioSender.dtmfSender?.insertDtmf(tone, duration: TimeInterval(0.2),interToneGap: TimeInterval(0.5))
           })
        }

    }

2 Temmuz 2021 Cuma tarihinde saat 18:43:05 UTC+3 itibarıyla Bilal Şimşek şunları yazdı:
Reply all
Reply to author
Forward
0 new messages