If I understand your post correctly, the voice quality you are talking about is on outside POTS lines???
If your internal calls are fine, but outside calls are not, then you need to adjust the line settings on your gateway. It will take some time and you will have to do each line individually.
There is a post in this forum called "Static and Advanced Settings", read that and see if that helps your quality issues. It cleared up 95% of mine.
Good luck.