     // MARK: AVAudioSession
     func routeAudioToSpeaker() {
         do {
-            try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, with: .defaultToSpeaker)
+            try AVAudioSession.sharedInstance().overrideOutputAudioPort(.speaker)
         } catch {
             NSLog(error.localizedDescription)
         }

        }
        
        do {
            try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, with: .defaultToSpeaker)
        } catch {
            NSLog(error.localizedDescription)
        }

    
    func playRingtone() {
        do {
            try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback)
        } catch {
            NSLog(error.localizedDescription)
        }
        
        self.routeAudioToSpeaker()
        
        self.ringtonePlayer?.volume = 1.0
        self.ringtonePlayer?.play()
