Hi I am Julien and will assist you today.
But to be sure that its not a software problem you have to do first then few steps :
1 - restart completely your phone by holding the power button 10 seconds and slide, then push again the power button.
2 - Verify the volume of you phone.
3 - Verify if you phone is up to date by going in Settings / General and Update it if its available
4 - Check on your screen if there is not any film protection or case or something wich is covering the mic on the bottom of the phone screen.
If nothing work after all this then your problem can be an hardware problem and in this case you wlll have to go to a proper iPhone fixing shop to change the mic which is solidaire to the screen. It can also be the cable inside the phone but in any case you will need hardware support assistance.
If you have any questions or would like any additional information, please don't hesitate to ask me back.
I can not help you much more because there is not so many settings for the volume on the phone.
Please could you rate me as 5 stars and click Submit at the top of this page ? It is the only way I will get pay buy Justanswer for helping you.
Thank you very much
Apple Certified Support Professional macOs 10.12 Sierra
Apple Certified Technical Coordinator
Apple Certified Macintosh Technician
Apple Certified IOS Technician