Hi this might help those who suffer from the similar issue. Finally, the problem is fixed and my phone is working fine now. I’ve seen this problem a lot in other forums. Seemingly it is faced while making/receiving calls only.
What might cause the problem :
o Some third party apps
o Operating system itself
o Hardware malfunction
Suggested fixes that you can try on your own:
1. Check to see if anything such as cover,case (or even dust or lint) etc is obstructing the microphone or earspeaker,if so try removing it and see if it helps.
2. Did you drop your phone,give it a jiggle. Remove the sim card and battery and reconnect them.
3. Problem may be with apps temporary data so clear the cache and check to see if the problem still persists.
4. Try to start your phone in “safe mode”, if this works “force stop” third party apps one by one in normal mode and figure out which app was causing the problem as I found after extensive research it was facebook messenger or OK Google in many cases.
5. Update the firmware.
6. As a last resort, reset your phone to factory setting. Make sure that your data is backed up on your google account before performing a factory data reset.
In my case I tried many things but what really worked for me was the number 4 that is “safe mode”.