I set up a few local and external sip endpoints and they work fine.
Then i tried to configure PSTN gateway (i'm using openvox, it's in the same network) and audio quality for remote side is very bad, voice sounds more metal, but local extension sound is good.
endpoints codec - 722,alaw,ulaw...