This guide will show you how to install and run siproxd in the RAM of the router. Everytime your router boots it will download a file over the internet with everything that's needed to run siproxd. I had to go this route since there is not enough jffs space.
Put the following in your startup script:
cd /tmp/ sleep 30 wget http://members.shaw.ca/shareme/opt-backup.tar.gz tar xzf opt-backup.tar.gz /bin/mount -o bind /tmp/opt /opt /bin/rm /tmp/opt-backup.tar.gz #Replace the line below for proper configuration file /bin/mv /opt/etc/siproxd.conf.example /opt/etc/siproxd.conf /opt/etc/init.d/S98siproxd
Now i'll explain what each line does:
cd /tmp/ [CD into ram drive]
sleep 30 [wait for (in sec) internet connection to be up. You may play with this value. Make it bigger if siproxd doesn't start after reboot]
wget http://members.shaw.ca/shareme/opt-backup.tar.gz [get required files ~1MB]
tar xzf opt-backup.tar.gz [extract required files into ram drive]
/bin/mount -o bind /tmp/opt /opt [mount the directory extracted files to as 'opt']
/bin/rm /tmp/opt-backup.tar.gz [remove downloaded archive to save ram. We don't need it anymore after extraction]
/bin/mv /opt/etc/siproxd.conf.example /opt/etc/siproxd.conf [I supplied only unmodified configuration example file. This will rename it to a usable config, however this is for TESTING ONLY. It doesn't have proper variables for interfaces and rtp ports. You need to edit rtp ports that your VoIp provider uses. You can either edit the siproxd.conf, put it in the archive and reupload the whole archive to your webspace (many isps give you at least 20mb of free hosting), or upload just the siproxd.conf which can be downloaded separately. You will have to change the script accordingly). Another option would be to use a script to replace the values in the example file) Or use jffs to store it.Read below]
/opt/etc/init.d/S98siproxd [Launch siproxd]
Reboot the router and issue top command to see if siproxd is running. If it isn't, try increasing sleep
1. Enable jffs
2. Download http://members.shaw.ca/shareme/siproxd.conf
3. Edit rtp_port_low and rtp_port_high according to you VoIp provider. You might also have to change if_outbound = vlan2 to the WAN interface of your router. Do ifconfig and see what interface has your public ip listed under it.
4. Store that file in jffs
5. Replace the line " /bin/mv /opt/etc/siproxd.conf.example /opt/etc/siproxd.conf" in the script I provided above with
/bin/cp /jffs/siproxd.conf /opt/etc/siproxd.conf
6. Put this in Firewall script:
iptables -A INPUT -m udp -p udp -i vlan2 --dport 5060 -j ACCEPT iptables -A INPUT -m udp -p udp -i vlan2 --dport [your voip low rtp port]:[your voip high rtp port] -j ACCEPT
Don't forget to replace [your voip low rtp port]:[your voip high rtp port] with your rtp ports
Hope this will help somebody!