Whenever the Messenger of Allah ﷺ heard the muezzin say, "Allah is the Greatest, Allah is the Greatest," he would repeat the same words. When the muezzin said, "I bear witness that there is no god but Allah," he would repeat the same words. When the muezzin said, "I bear witness that Muhammad is the Messenger of Allah," he would repeat the same words.
حدثنا يونس حدثنا حماد عن عاصم بن بهدلة عن أبي صالح
أن رسول الله ﷺ كان إذا سمع المؤذن يقول الله أكبر الله أكبر قال مثل قوله وإذا قال أشهد أن لا إله إلا الله قال مثل قوله وإذا قال أشهد أن محمدا رسول الله قال مثل قوله