When using WebRTC video call on the latest iOS version, the loudspeaker audio isn't working, we have to listen to it on the earpiece.
Below is the code to set the loudspeaker.
do {
try self.rtcAudioSession.setCategory(AVAudioSession.Category.playAndRecord.rawValue)
try self.rtcAudioSession.setMode(AVAudioSession.Mode.default.rawValue)
try self.rtcAudioSession.overrideOutputAudioPort(.speaker)
} catch {
print("error with loud speaker")
}