Iphone 5 is silent while calling or receiving calls unless switch to speaker!

I got an IPhone 5 when I call I cannot hear it ringing or no sound also when they call me I can hear it ringing but when answering it's silent unless I switch to speaker, any idea what part is bad here ,thank you please help!
You phone may 'think' that headphones are plugged in. Try cleaning out the headphone jack with something non-metallic such as a tooth pick. You'll be surprised how much fluff and gunk can get in there. Also do the lightning port.

Original thread: https://forums.imore.com/threads/iphone-5-is-silent-while-calling-or-receiving-calls-unless-switch-to-speaker.375996/