Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) narrates: I went out for some need at a time when we used to greet one another with salam during the prayer. When I returned, I greeted (him), but he did not respond, and he said: "Indeed, in the prayer there is an occupation."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10095