[asterisk-users] SIP connections over OpenVPN connection get one-way voice.

Duncan Turnbull duncan at e-simple.co.nz
Tue Apr 18 19:21:57 CDT 2017

Sent from my iPhone

> On 19/04/2017, at 11:43 AM, Ernie Dunbar <maillist at lightspeed.ca> wrote:
>> On 2017-04-18 03:38 PM, Duncan Turnbull wrote:
>> ------ Original Message ------
>> From: "Ernie Dunbar" <maillist at lightspeed.ca>
>> To: "'Asterisk Users Mailing List - Non-Commercial Discussion'" <asterisk-users at lists.digium.com>
>> Sent: 19-Apr-17 10:25:59 AM
>> Subject: [asterisk-users] SIP connections over OpenVPN connection get one-way voice.
>>> Hi everyone. I'm having some trouble with an OpenVPN tunnel that isn't working *quite* as well as we'd hoped.
>>> First, here's our technical details:
>>> The OpenVPN server (v2.3.4-5+deb8u1) is a Debian 8 box behind a NAT router. The router has UDP port 1194 forwarded to our           server. This server also runs our office Asterisk PBX, so there isn't any networking hardware or firewall between the VPN tunnel and the Asterisk PBX.
>> Asterisk maybe replying from the TUN address which may confuse your sip client - if you set the TUN address as a proxy that seems to solve it. If asterisk is bound to every address then implicitly it shouldn't matter where it replies from, but in the openvpn case it seems to reply from a different address to the one it was called on and that can definitely fool clients. tcpdump on the tunnel can help you see whats happening
> I think I'll need a bit more detail about how to set the TUN address as a proxy. Is this done on the OpenVPN server, or at the client     end? I'm also going to tell Asterisk to bind to all IPs and then restart it when there's no calls in progress, perhaps that's all I need to do?

Set it as a proxy server in your sip phone client, we found using the tun ip on the vpn server works, we keep the actual asterisk address as the sip server and use the tun ip as the proxy server

Asterisk is probably already bound to all the addresses netstat -nupl should show you the addresses it's listening on for udp, if it says it means all addresses

sudo tcpdump -i tun0 -s0 -A udp port 5060

Should show you the sip messages going through the tunnel and you can check the reply addresses 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20170419/179941aa/attachment.html>

More information about the asterisk-users mailing list