If encountered this problem you may first check the speaker or install a new replacement spare on it. If the speaker seems working fine, you may refer the below solution.
The solution below shows the connection line paths and connected components of the ringer speaker.
Samsung S5300 Ringer Speaker Not Working
Samsung GT-S5300 Speaker Buzzer Track, Ways, Jumper, Path Repair
Solution For Samsung S5300 Ringer Problem