Sunan Ibn Majah - سنن ابن ماجه
3. The Book of the Adhan and the Sunnah Regarding It - كتاب الأذان والسنة فيها
7) Chapter: If The Adhan Is Called And You Are In The Mosque, Then Do Not Leave
It was narrated that 'Uthman said:
"The Messenger of Allah said: 'Whoever hears the Adhan when he is in the mosque, then goes out and does not go out for any (legitimate) need and does not intend to return, is a hypocrite.'"
7) باب إِذَا أُذِّنَ وَأَنْتَ فِي الْمَسْجِدِ فَلاَ تَخْرُجْ
حَدَّثَنَا حَرْمَلَةُ بْنُ يَحْيَى، حَدَّثَنَا عَبْدُ اللَّهِ بْنُ وَهْبٍ، أَنْبَأَنَا عَبْدُ الْجَبَّارِ بْنُ عُمَرَ، عَنِ ابْنِ أَبِي فَرْوَةَ، عَنْ مُحَمَّدِ بْنِ يُوسُفَ، مَوْلَى عُثْمَانَ بْنِ عَفَّانَ عَنْ أَبِيهِ، عَنْ عُثْمَانَ، قَالَ قَالَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ . " مَنْ أَدْرَكَهُ الأَذَانُ فِي الْمَسْجِدِ ثُمَّ خَرَجَ لَمْ يَخْرُجْ لِحَاجَةٍ وَهُوَ لاَ يُرِيدُ الرَّجْعَةَ فَهُوَ مُنَافِقٌ "