Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:3359ʿAlī b. Muḥammad b. ʿAbdullāh b. Bishrān> Abū Jaʿfar al-Razzāz > Aḥmad b. al-Walīd al-Faḥḥām > Abū Aḥmad al-Zubayrī > Sufyān > Abū al-Zubayr > Jābir

[Machine] Smiling does not invalidate the prayer, but laughing out loud is what is prohibited and is considered a disruption. This ruling has been stated by Thabit ibn Muhammad al-Zahid and it is a consensus among scholars.  

البيهقي:٣٣٥٩أَخْبَرَنَا عَلِيُّ بْنُ مُحَمَّدِ بْنِ عَبْدِ اللهِ بْنِ بِشْرَانَ بِبَغْدَادَ أنبأ أَبُو جَعْفَرٍ الرَّزَّازُ ثنا أَحْمَدُ بْنُ الْوَلِيدِ الْفَحَّامُ ثنا أَبُو أَحْمَدَ الزُّبَيْرِيُّ ثنا سُفْيَانُ عَنْ أَبِي الزُّبَيْرِ عَنْ جَابِرٍ قَالَ

التَّبَسُّمُ لَا يَقْطَعُ الصَّلَاةَ وَلَكِنِ الْقَرْقَرَةُ هَذَا هُوَ الْمَحْفُوظُ مَوْقُوفٌ وَقَدْ رَفَعَهُ ثَابِتُ بْنُ مُحَمَّدٍ الزَّاهِدُ وَهُوَ وَهْمٌ مِنْهُ