It is narrated from Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) that he went out to the land of Abyssinia at a time when people used to greet one another with salam during the prayer. When Sayyiduna Abdullah (may Allah be pleased with him) returned, he greeted the Prophet (peace and blessings be upon him) with salam, but he did not respond. When the Messenger of Allah (peace and blessings be upon him) finished the prayer, he said: "I seek refuge in Allah from the anger of Allah and the anger of His Messenger. I greeted you, but you did not return my greeting." The Messenger of Allah (peace and blessings be upon him) said: "Indeed, in the prayer there is an occupation."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10089