See mediastreamer2!322 (diffs) : the filter detect() function will now use the IOS availableInputs() function to get a real list of MSSndCards available.
However, availableInputs() will not list everything we want if the AVAudioSession category is not playback & record.
So, when we detect a change of AudioRoute, we reload to make sure the list is up to date with reality, then if needed set the current output audio device to match the new audio route. This should ensure that calls to linphone_call_get_output_audio_device and linphone_core_get_output_audio_device match the reality.