-
getMediaStream() was deducing the index of the stream by casting the stream type into integer, which was wrong since the steams can be reordered on first incoming INVITE parsing. Fixed by using getStreamIndex(LinphoneStreamType) instead of cast.
-
getStreamIndex() had to be rewriten because it was using getMediaStream(), which would cause infinite recursive calls.