Chosen Solution

My phone is stuck on speaker phone and when someone calls or I call someone there is no sound

Seems like this may be an Audio IC issue which has become increasingly common on iPhone 6s and iPhone 7/7+.This is not an easy repair and something you’ll likely need to get done at a professional repair shop. The audio IC is a very small integrated-circuit, hence the name IC, and it is soldered to the logic board of the device. This can be repaired or replaced by an experienced engineer capable of microsoldering for typically around $100-200.