Skip to content

Commit

Permalink
[Bug Fix] - Call Active state During Ringing
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacd3v committed Jun 1, 2023
1 parent 9f4f7f5 commit 5d2cb3a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion TelnyxRTC/Telnyx/WebRTC/Call.swift
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,18 @@ public class Call {
Logger.log.e(message: "Call:: connected")
})
}

private func onMediaPlayBack(sdp: String) {
let remoteDescription = RTCSessionDescription(type: .answer, sdp: sdp)
self.peer?.connection?.setRemoteDescription(remoteDescription, completionHandler: { (error) in
if let error = error {
Logger.log.e(message: "Call:: Error setting remote description: \(error)")
return
}
self.updateCallState(callState: .RINGING)
Logger.log.e(message: "Call:: connected")
})
}

//TODO: We can move this inside the answer() function of the Peer class
private func incomingOffer(sdp: String) {
Expand Down Expand Up @@ -470,7 +482,7 @@ extension Call {
Logger.log.w(message: "Call:: .MEDIA missing SDP")
return
}
self.answered(sdp: remoteSdp)
self.onMediaPlayBack(sdp: remoteSdp)
}
//TODO: handle error when there's no SDP
break
Expand Down

0 comments on commit 5d2cb3a

Please sign in to comment.