mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
816 B
Swift
24 lines
816 B
Swift
import WebRTC
|
|
|
|
extension WebRTCWrapper {
|
|
|
|
public func handleICECandidate(_ candidate: RTCIceCandidate) {
|
|
print("[Calls] Received ICE candidate message.")
|
|
candidateQueue.append(candidate)
|
|
}
|
|
|
|
public func handleRemoteSDP(_ sdp: RTCSessionDescription) {
|
|
print("[Calls] Received remote SDP: \(sdp.sdp).")
|
|
peerConnection.setRemoteDescription(sdp, completionHandler: { [weak self] error in
|
|
if let error = error {
|
|
SNLog("Couldn't set SDP due to error: \(error).")
|
|
} else {
|
|
guard let self = self,
|
|
sdp.type == .offer, self.peerConnection.localDescription == nil else { return }
|
|
// Answer the call
|
|
self.answer().retainUntilComplete()
|
|
}
|
|
})
|
|
}
|
|
}
|