Phones Connected through VPN have poor sound quality

I have two locations that are using phones. The FreePBX server is located at one store and the second store is connected to the phone system through a VPN.

The store connected through the VPN can call internal extensions at the site and the sound quality is great. However, if they try and make a call, or recieve a call, from someone outside of the network the sound quality is terrible. The store where the pbx is located has no sound quality issues.

The site where the PBX is located has a 25mbps fiber connection up and down and the other site is on a 12mbps download speed and a 2mbps upload speed.

I have a dedicated speed of 2mbps download and upload on the PBX side and 1 mbps upload and 2mbps download on the VPN side.

The sound quality issue is only heard on the phone outside of the network. The people at the remote store hear no sound issues.

I am running asterisk 1.8.

Does anyone have any idea what could be causing the connection issue?


Perhaps the firewall that is performing the encryption/decryption for the VPN tunnel does not have the processing power required to adequately keep up with the voice traffic without introducing latency? what sort of hardware/software combination are you using to establish the tunnels?

Have you tried using a lower bandwidth codec, such as GSM or g.729?

Also, you do not state what sort of VPN you are using. IPSec, OpenVPN, PPTP, L2TP?

We send multiple calls through multiple IPSec tunnels using a g.729 codec and have minimal problems, though we are using hardware that can handle the load of encrypting and decrypting all of that traffic without introducing latency.


You should consider setting up two IAX Trunks that connect the two locations using their public IP addresses, and bypass the VPN altogether. If done properly, IAX Trunks should use encryption.

Trunk Name (Peer Details): Office1

Peer Details:


Note: Reverse Office1 and Office2 at the other location, use the same password, and change the host= line to reference the IP address of other location. This will work fine even if both systems are behind a NAT.

BTW- The reason it probably doesn’t work well is that VPN routers often don’t have the processing power to fully utilize the bandwidth provided by the ISP. For example, the Cisco RV042s cannot do much more than 1 MBps via VPN, even if you have a 20 MBps connection.

Also, VPNs make almost no effort to eliminate jitter, which is a major cause of VOIP quality problems.

Only three reasons for poor quality:

1 - Packet loss
2 - Excessive Jitter (out of order packets)
3 - Excessive Latency (least problematic, with little loss 400MS is tolerable)

A simple tool like mtr can identify the source of the impairment quickly.

Thanks for the responses. I was able to increase sound quality by doing a firmware upgrade on my router. I am only having issues now when the stores try and reach each other by external DIDs (internal extension numbers work fine, not sure why this is). I will try and set up the IAX extensions and see if that works better.

Please provide some more information:

What type of routers are you using?

What codec are you using?

Does the codec change if you make an internal call versus an external call? That could explain the difference between the two types of calls.

I 100% aggree with this post.

I had the same problems as OP running a phone through VPN. showed lots of bandwidth. ping showed low-(ish) latency. However, the issue was jitter.

I turned on jitter buffer (in softphone, in this case) and the problem was 100% solved, from terrible to terrific.

I have a sonicwall NSA 3500 on one side and a sonicwall tz210w on the other side.

I’m not sure what codecs are being used on either types of calls. The codecs enabled under asterisk sip settings are ulaw, alaw, g726, and gsm.

The phones are aastra 6755i at both locations.

The calls are coming in and out of PRIs.