This tutorial is only for arm routers like RT-AC56U, RT-AC68U, RT-AC87U, RT-AC3200, RT-AC5300...
Asterisk will turn your AsusWRT router into a communications server :)
1 - Flash Rmerlin firmware from here
2a - Install Optware-NG from here
Install necessary packages
or
2b - Install Entware-NG from here
Install necessary packages
3 - Setup Debian Jessie from here
4 - Enter chrooted debian with:
5 - Update Debian
6 - Install Asterisk
7 - Create some user accounts, green color are phone numbers and red color are user names
[tutorial]
exten => 100,1,Dial(SIP/user1)
exten => 101,1,Dial(SIP/user2)
exten => 102,1,Dial(SIP/user3)
EOF
Press ENTER
8 - Add same user accounts to sip configuration file, in yellow color are the user passwords
cat >> /etc/asterisk/sip.conf << 'EOF'
[user1]
type = friend
defaultuser = user1
secret = pass1
host = dynamic
context = tutorial
nat = force_rport,comedia
[user2]
type = friend
defaultuser = user2
secret = pass2
host = dynamic
context = tutorial
nat = force_rport,comedia
[user3]
type = friend
defaultuser = user3
secret = pass3
host = dynamic
context = tutorial
nat = force_rport,comedia
EOF
Press ENTER
9 - Exit Debian
10 - Add Asterisk to chrooted services list
echo "asterisk" >>/opt/etc/chroot-services.list
chmod 755 /opt/etc/chroot-services.list
Press ENTER
11 - Add firewall rules (remove #!/bin/sh if you already have firewall-start script)
#!/bin/sh
# SIP on UDP port 5060. Other SIP servers may need TCP port 5060 as well
iptables -A INPUT -p udp -m udp --dport 5060 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 5060 -j ACCEPT
# IAX2- the IAX protocol
iptables -A INPUT -p udp -m udp --dport 4569 -j ACCEPT
# IAX - most have switched to IAX v2, or ought to
iptables -A INPUT -p udp -m udp --dport 5036 -j ACCEPT
# RTP - the media stream
# (related to the port range in /etc/asterisk/rtp.conf)
iptables -A INPUT -p udp -m udp --dport 10000:20000 -j ACCEPT
# MGCP - if you use media gateway control protocol in your configuration
iptables -A INPUT -p udp -m udp --dport 2727 -j ACCEPT
EOF
Press ENTER
12 - Open ports
13 - Start Asterisk from outside debian
Now login to your voip devices with accounts created at point 8 and start calling :) a good free android client is CSipSimple
HOW TO INSTALL ASTERISK-GUI
14 - Enter chrooted debian with:
15 - Instal necessary packages
16 - Download, compile and install Asterisk-Gui
git clone https://github.com/antirek/asterisk-gui.git
cd asterisk-gui
./configure
make
make install
rm -r /usr/share/asterisk/static-http
ln -s /var/lib/asterisk/static-http/ /usr/share/asterisk/
cp -r /etc/asterisk /etc/asterisk.backup
17 - Enable Gui access
sed -i 's|;prefix=asterisk|prefix=asterisk|g' "/etc/asterisk/http.conf"
sed -i 's|;enablestatic=yes|enablestatic=yes|g' "/etc/asterisk/http.conf"
sed -i 's|bindaddr=.*|bindaddr=0.0.0.0|g' "/etc/asterisk/http.conf"
sed -i 's/enabled = yes/enabled = yes\nwebenabled = yes/g' "/etc/asterisk/manager.conf"
sed -i 's|#include "manager.d|include "manager.d|g' "/etc/asterisk/manager.conf"
18 - Check Asterisk configuration to see if it will support the GUI
Should get something like
--- Checking Asterisk configuration to see if it will support the GUI ---
* Checking for http.conf: OK
* Checking for manager.conf: OK
* Checking if HTTP is enabled: OK
* Checking if HTTP static support is enabled: OK
* Checking if manager is enabled: OK
* Checking if manager over HTTP is enabled: OK
--- Everything looks good ---
* GUI should be available at https://RT-AC68U:8088/asterisk/static/config/index.html * Note: If you have bindaddr=127.0.0.1 in /etc/asterisk/http.conf
you will only be able to visit it from the local machine. Example: https://localhost:8088/asterisk/static/config/index.html * The login and password should be an entry from /etc/asterisk/manager.conf
which has 'config' permission in read and write. For example: [admin]
secret = mysecret18705
read = system,call,log,verbose,command,agent,config
write = system,call,log,verbose,command,agent,config --- Good luck! ---
root@RT-AC68U:/var/tmp/asterisk-gui#
19 - Create user name and password for Asterisk GUI
[admin]
secret = admin_password
read = system,call,log,verbose,command,agent,config
write = system,call,log,verbose,command,agent,config
EOF
Press ENTER
20 - Restart Asterisk
20 - Go to GUI page 192.168.1.1:8088/asterisk/static/config/index.html and input username and password from point 19
To be continued with the rest of setup if requested by user...
Enjoy...