-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vagrant-provision.sh
76 lines (55 loc) · 2.55 KB
/
Vagrant-provision.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
echo "Provisioning VOIP virtual machine..."
#echo "deb http://archive.debian.org/debian/ squeeze main contrib non-free" > /etc/apt/sources.list
echo "Running apt-get"
apt-get update
apt-get install -y subversion
apt-get install -y autoconf
apt-get install -y build-essential
apt-get install -y sox
apt-get install -y postgresql
apt-get install -y postgresql-client
apt-get install -y openssl
apt-get install -y libh323-1.24.0v5
apt-get install -y libh323plus-dev
apt-get install -y speex
apt-get install -y libgsm-tools
apt-get install -y libpq5
apt-get install -y libpq-dev
apt-get install -y default-libmysqlclient-dev
apt-get install -y rsync
apt-get install -y vim
apt-get install -y doxygen
#echo "Setup postgres host access"
echo "listen_addresses = '*'" >> /etc/postgresql/9.6/main/postgresql.conf
echo "host all all 172.28.128.1/24 trust" >> /etc/postgresql/9.6/main/pg_hba.conf
service postgresql restart
echo "Downloading Yate"
cd /usr/src/
mkdir yate
cd yate
svn checkout http://voip.null.ro/svn/yate/tags/RELEASE_6_0_0
cd RELEASE_6_0_0
echo "Building Yate"
./autogen.sh
./configure --prefix=/opt/yate/
make
make install
echo "/opt/yate/lib" > /etc/ld.so.conf.d/yate.conf
ldconfig
mkdir /var/log/yate
ln -s /vagrant/cmd/inline/inline /opt/yate/share/yate/scripts/yatego-inline
ln -s /vagrant/cmd/callflow-static/callflow-static /opt/yate/share/yate/scripts/yatego-callflow-static
ln -s /vagrant/cmd/callflow-json/callflow-json /opt/yate/share/yate/scripts/yatego-callflow-json
ln -s /vagrant/cmd/callflow-vars/callflow-vars /opt/yate/share/yate/scripts/yatego-callflow-vars
ln -s /vagrant/cmd/callflow-dynamic/callflow-dynamic /opt/yate/share/yate/scripts/yatego-callflow-dynamic
ln -s /vagrant/cmd/callflow-http-switch/callflow-http-switch /opt/yate/share/yate/scripts/yatego-callflow-http-switch
echo "Yate config"
rsync -avz /vagrant/deployments/vagrant/configs/yate/ /opt/yate/
printf "\n[41587000201]\npassword=milan" >> /opt/yate/etc/yate/regfile.conf
printf "\n^900$=tone/congestion\n^920$=external/nodata/yatego-inline" >> /opt/yate/etc/yate/regexroute.conf
printf "\n^921$=external/nodata/yatego-callflow-static" >> /opt/yate/etc/yate/regexroute.conf
printf "\n^922$=external/nodata/yatego-callflow-json" >> /opt/yate/etc/yate/regexroute.conf
printf "\n^923$=external/nodata/yatego-callflow-vars" >> /opt/yate/etc/yate/regexroute.conf
printf "\n^924$=external/nodata/yatego-callflow-dynamic" >> /opt/yate/etc/yate/regexroute.conf
printf "\n^925$=external/nodata/yatego-callflow-http-switch" >> /opt/yate/etc/yate/regexroute.conf