Mishkat al-Masabih 989, 990
'Abdallah b. Mas'ud said:
Before we went to Abyssinia we used to greet God’s Messenger when he was engaged in prayer and he would respond to us, but when we returned from Abyssinia I came to him and found him praying. I greeted him and he did not respond to me, but when he finished his prayer he said, “God creates new commands as He wishes, and one of them is that you must not talk during prayer.” He then returned my greeting and said, “Prayer is solely for the purpose of reciting the Qur’an and making mention of God, so when you are engaged in it let that be what occupies your attention.” 

Abu Dawud transmitted it.
عَنْ عَبْدِ اللَّهِ بْنِ مَسْعُودٍ قَالَ: كُنَّا نُسَلِّمُ عَلَى النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَهُوَ فِي الصَّلَاةِ قَبْلَ أَنْ نَأْتِيَ أَرْضَ الْحَبَشَةِ فَيَرُدُّ عَلَيْنَا فَلَمَّا رَجَعْنَا مِنْ أَرْضِ الْحَبَشَةِ أَتَيْتُهُ فَوَجَدْتُهُ يُصَلِّي فَسَلَّمْتُ عَلَيْهِ فَلَمْ يَرُدَّ عَلَيَّ حَتَّى إِذَا قَضَى صَلَاتَهُ قَالَ: «إِنَّ اللَّهَ يُحْدِثُ مِنْ أَمْرِهِ مَا يَشَاءُ ن وَإِن مِمَّا أحدث أَن لَا تتكلموا فِي الصَّلَاة» . فَرد عَليّ السَّلَام
وَقَالَ: «إِنَّمَا الصَّلَاةُ لِقِرَاءَةِ الْقُرْآنِ وَذِكْرِ اللَّهِ فَإِذا كنت فِيهَا ليكن ذَلِك شَأْنك» . رَوَاهُ أَبُو دَاوُد