I started Asterisk VoIP server over OpenVPN in Tor hidden service.
It's working with 1s delay.
First create OpenSSL CA with Easy-RSA or OpenSSL for OpenVPN.
This is OpenVPN server configuration file:
tls-server
port 1194
proto tcp
dev tun
ca /etc/ssl/ca.crt
cert /etc/ssl/server.crt
key /etc/ssl/server.key
dh /etc/ssl/dh2048.pem
topology subnet
server 10.0.0.0 255.255.0.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
cipher AES-256-CBC
max-clients 100
persist-key
persist-tun
status /var/log/openvpn-status.log
log /var/log/openvpn.log
log-append /var/log/openvpn-append.log
verb 3
auth SHA512
This is OpenVPN client configuration file:
client
dev tun
proto tcp
remote svntrqfgsa7jgnpm.onion 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /home/norbert/new/ca.crt
cert /home/norbert/new/demo-alice.crt
key /home/norbert/new/demo-alice.key
cipher AES-256-CBC
auth SHA512
verb 3
socks-proxy 127.0.0.1 9050
remote-cert-tls server
This is Asterisk sip.conf configuration file:
[general]
transport=udp
port=5060
bindaddr=10.0.0.1
disallow=all
allow=ulaw
allow=alaw
allow=gsm
directmedia=no
nat=yes
localnet=10.0.0.0/255.255.0.0
[friends_internal](!)
type=friend
host=dynamic
context=from-internal
disallow=all
allow=ulaw
allow=alaw
allow=gsm
[demo-alice](friends_internal)
secret=password
[demo-bob](friends_internal)
secret=password
This is Asterisk extensions.conf configuration file:
[from-internal]
exten=>6001,1,Dial(SIP/demo-alice,20)
exten=>6002,1,Dial(SIP/demo-bob,20)
This is Tor hidden service server torrc configuration file:
HiddenServiceDir /usr/local/torhs/winternight/
HiddenServicePort 1194 127.0.0.1:1194
This is Tor client configuration file:
SOCKSPort 9050
That's all. It's working with 1s delay.
Documented in these tutorials:
Enjoy. :)