In bilingual regions often there's a phenomenon known as code switching, when people swap codes when confronted with a person that uses a different language of their own, even when both people are bilingual. Occasionally the conversation continues with every person using their own language, without switching to the other person's one.
In Galicia, Spain, it's quite common hearing people speaking Galician with people answering in Spanish. This is not usually a problem since Galician and Spanish are languages with a high mutual intelligibility. I've heard the same happened often in the old Yugoslavia and Czechoslovakia, which were countries with a few languages.
I assume every person involved knows every language used, so no code-switching is "needed", per se.
Is there any studies on the conditions for this to occur?