Maseches Rosh Hashanah, Chapter 3, Mishnah 7. This mishnah deals with two cases in which it is up to the listener himself to determine whether he has fulfilled his obligation of hearing: one who hears the sounding of the shofar from within a hollow space that produces an echo, and one who hears the sound of the shofar or of the Megillah while standing outside the shul.
"Hatokea l'toch habor o l'toch hados o l'toch hapitas":
Bor - an ordinary pit dug in the ground.
Dos - very similar to a pit. According to one opinion, the only difference between them is that the walls of the dos are lined with stone or brick; and some understand that a dos is a structure built of stone or brick in the form of a pit, except that it sits on top of the ground rather than being dug into it.
Pitas - a very large earthenware vessel, and the one blowing sounds the shofar into it.
In all of these scenarios the mishnah rules: "Im kol shofar shama - yatza, v'im kol havarah shama - lo yatza" - if he heard the sound of the shofar itself, he has fulfilled the mitzvah; and if he heard the sound of the echo rather than the sound of the shofar, he has not fulfilled it. This raises the question: how is the listener to determine what he heard?
The Gemara explains that one who stands inside the pit, or inside any of these hollow spaces, has certainly fulfilled his obligation, since at the very least he heard the sound of the shofar itself in addition to the echo. Based on this, the Rosh understands that the mishnah means that those sitting inside the hollow space, whether in the pit or inside the vessel, are the ones who have fulfilled their obligation, while those standing outside have not, because they are unable to distinguish whether they heard the sound of the shofar or the sound of the echo.
The second case - one who passes behind the shul:
The mishnah continues with a related matter, in which the listener's own judgment is likewise required in order to determine whether he has fulfilled the mitzvah of hearing: "V'chein mi shehayah over achorei beis haknesses, o shehayah beiso samuch l'veis haknesses, v'shama kol shofar o kol Megillah - im kivein libo yatza, v'im lav lo yatza" - that is, a person who passes behind the shul, or whose house is next to it, and hears the sound of the shofar blast or of the reading of the Megillah while he is standing outside and not inside the shul: if he directed his heart to fulfill the mitzvah through this hearing, he has fulfilled it; and if he did not, he has not.
And even though the one blowing the shofar or reading the Megillah has no knowledge at all of the person standing outside, and does not intend to fulfill his obligation for him, since he is a shliach tzibbur, an agent of the community, his intent automatically extends to all who hear him, whether they are inside the shul or not. It emerges that everything depends on the listener: if he had intent, he has fulfilled the mitzvah; and if he happened to hear without intent, he has not fulfilled it and has not performed the mitzvah.
On this the mishnah concludes: "Af al pi shezeh shama v'zeh shama, zeh kivein libo v'zeh lo kivein libo". The parallel to the first case in the mishnah is clear: in both cases two people heard a sound, and the determination is left to their own judgment. There the question is whether they heard the sound of the shofar or the echo; and here both heard the very same shofar sound and the very same Megillah reading, except that one directed his heart to fulfill the mitzvah and the other did not.
Explaining "kivein libo":
Intent to fulfill a mitzvah - some understand that "kivein libo" in the mishnah means intent to fulfill the mitzvah, and this fits with the opinion that mitzvos require intent: without intent to fulfill a mitzvah, the mitzvah is not fulfilled.
Paying attention - and others hold that mitzvos do not require intent, and that whoever in fact performed the mitzvah has fulfilled his obligation regardless. In their view, "kivein libo" in the mishnah does not mean intent to fulfill the mitzvah, but rather that he paid attention to what he was hearing, in contrast to someone who is not aware of it at all.
In practical terms, according to this opinion: someone for whom the sound of the Megillah or the shofar was merely background noise - he heard it, but paid no attention to it at all and was occupied with something else - is included among those who did not have intent. Intent, by contrast, means that the person took note of the very fact that a shofar is being sounded, and not necessarily that he intended to fulfill a mitzvah thereby.
In summary: in this mishnah we learned of two cases in which the determination of whether one has fulfilled his obligation is left to the listener. In the first case - one who blows the shofar into a pit, a dos or a pitas - the condition is that he hear the sound of the shofar itself and not the sound of the echo, and according to the Rosh only those standing inside the hollow space have fulfilled their obligation. In the second case - one who passes behind the shul or whose house is next to it - everything depends on the listener's intent, since the shliach tzibbur automatically intends to fulfill the obligation of all who hear him. And regarding the meaning of "kivein libo" there is a difference of opinion: whether it refers to intent to fulfill the mitzvah, in line with those who hold that mitzvos require intent, or whether it is enough that he paid attention to what he was hearing.