 thepirate
join:2008-04-25 Huntsville, AL
| DD-WRT Installation steps GV with Asterix integration
DD-WRT Installation Install DD-WRT 2.4sp1 MEGA on your router
Enable JFFS: 1) Go to the Web Page-> Admin -> Enable JFFS 2) Click Apply 3) Wait a few seconds 4) Check Clean JFFS 5) Click SAVE (not apply) 6) Wait a few seconds 7) Reboot
[b]Enable CIFS[b] Create a share on a server somewhere pc or linux box with samba Mount the Share on DD-WRT in the Web interface Admin->CIFS Automount Enable Fill in the parameters. You can leave "Start Script" blank
Setup ipkg Make a directory for ipkg (bug in dd-wrt)
Code: mkdir -p /jffs/tmp/ipkg/lists ipkg update ipkg install kmod-loop ipkg install kmod-ext2 insmod /jffs/lib/modules/2.4.30/loop.o insmod /jffs/lib/modules/2.4.30/ext2.o Do a lsmod to make sure ext2 and loop is loaded If not, repeat the insmod commands above
Prep Partition File
1) create a file to make into an ext2 file system partition to be loop mounted
Code: dd if=/dev/zero of=dd-wrt-opt.ext2 bs=1M count=200 * (where dd-wrt-opt.ext2 is the file and location mounted on your dd-wrt
2) Create a ext2 filesystem in the file you just created
Code: echo y | mke2fs -L optware dd-wrt-opt.ext2 Mount the file as a loop filesystem
Code: mount -o loop /tmp/smbshare/dd-wrt-opt.ext2 /opt *remember to change /tmp/smbshare/dd-wrt-opt.ext to your path and file
Install Optware
Code: wget »www.3iii.dk/linux/optware/optwar···ddwrt.sh -O - | tr -d '\r' > /tmp/optware-install.sh sh /tmp/optware-install.sh Install Asterisk
Code: /opt/bin/ipkg-opt --tmp-dir /tmp install asterisk14 Install each or all of the following sets. Depending on what your ATA/softphone supports for codecs.
Code: /opt/bin/ipkg-opt --tmp-dir /tmp install asterisk14-moh-freeplay-g729 /opt/bin/ipkg-opt --tmp-dir /tmp install asterisk14-core-sounds-en-g729 /opt/bin/ipkg-opt --tmp-dir /tmp install asterisk14-extra-sounds-en-g729
/opt/bin/ipkg-opt --tmp-dir /tmp install asterisk14-moh-freeplay-ulaw /opt/bin/ipkg-opt --tmp-dir /tmp install asterisk14-core-sounds-en-ulaw /opt/bin/ipkg-opt --tmp-dir /tmp install asterisk14-extra-sounds-en-ulaw Install Python Code: /opt/bin/ipkg-opt --tmp-dir /tmp install python
Install Management Scripts
FIVN's collection of management scripts [fivn.com]. We are concerned with "3. Install Asterisk for DD-WRT"
Install optware startup scripts Commands->Command Shell. Paste into the box and click "Save Startup" * if you have an existing script, you'll have to figure out how you want to incorporate
Code: #!/bin/sh
insmod /jffs/lib/modules/2.4.30/loop.o insmod /jffs/lib/modules/2.4.30/ext2.o mount -o loop /tmp/smbshare/dd-wrt-opt.ext2 /opt
# Start all init scripts in /opt/etc/init.d # executing them in numerical order. # for i in /opt/etc/init.d/S??* ; do
# Ignore dangling symlinks (if any). [ ! -f "$i" ] && continue
case "$i" in *.sh) # Source shell script for speed. ( trap - INT QUIT TSTP set start . $i ) ;; *) # No sh extension, so fork subprocess. $i start ;; esac done Asterisk Startup scripts Code: Install startup scripts
mkdir -p /opt/etc/init.d cd /opt/etc/init.d wget »www.fivn.com/scripts/S50asterisk wget »www.fivn.com/scripts/S51astadmin chmod 755 S50asterisk S51astadmin Install Asterisk Management script tmp mv tmp asterisk.sh chmod 755 asterisk.sh Reboot
Asterisk Web Interface Location would be: Code: »/user/cgi-bin/asterisk.sh
Asterisk Configuration:
I cheated and just copied the files from a PiaF install on Virtualbox. Install and configure as normal. Then copy the following files over to /opt/etc/asterisk
Code: extensions.conf extensions_additional.conf extensions_custom.conf extensions_override_freepbx.conf features.conf features_applicationmap_additional.conf features_applicationmap_custom.conf features_featuremap_additional.conf features_featuremap_custom.conf features_general_additional.conf features_general_custom.conf globals_custom.conf sip.conf sip_additional.conf sip_custom.conf sip_custom_post.conf sip_general_additional.conf sip_general_custom.conf sip_nat.conf sip_registrations.conf sip_registrations_custom.conf pygoogle Integration Grab the install-gv-new script from: Code: wget »bestof.nerdvittles.com/applicati···l-gv-new Patch it with the following diff
Save the patch as gv.patch
Code: patch install-gv-new > /etc/asterisk/extensions_custom.conf -echo "[custom-gv]" >> /etc/asterisk/extensions_custom.conf -echo "exten => _X.,1,Wait(1)" >> /etc/asterisk/extensions_custom.conf -echo "exten => _X.,n,Set(ACCTNAME=$acctname)" >> /etc/asterisk/extensions_custom.conf -echo "exten => _X.,n,Set(ACCTPASS=$acctpass)" >> /etc/asterisk/extensions_custom.conf -echo "exten => _X.,n,Set(RINGBACK=$ringback)" >> /etc/asterisk/extensions_custom.conf -echo "exten => _X.,n,Set(CALLPARK=$callpark)" >> /etc/asterisk/extensions_custom.conf -echo "exten => _X.,n,Playback(pls-wait-connect-call)" >> /etc/asterisk/extensions_custom.conf -echo "exten => _X.,n,System(gvoice -e \${ACCTNAME} -p \${ACCTPASS} call \${EXTEN} \${RINGBACK})" >> /etc/asterisk/extensions_custom.conf -echo "exten => _X.,n,Set(PARKINGEXTEN=\${CALLPARK})" >> /etc/asterisk/extensions_custom.conf -echo "exten => _X.,n,Park()" >> /etc/asterisk/extensions_custom.conf -echo " " >> /etc/asterisk/extensions_custom.conf -echo "[custom-park]" >> /etc/asterisk/extensions_custom.conf -echo "exten => s,1,Wait(4)" >> /etc/asterisk/extensions_custom.conf -echo "exten => s,2,Set(GVNUM=$gvnum)" >> /etc/asterisk/extensions_custom.conf
-echo "exten => s,3,Set(CALLPARK=$callpark)" >> /etc/asterisk/extensions_custom.conf -echo "exten => s,4,NoOp(**CALLERID: \${CALLERID(number)})" >> /etc/asterisk/extensions_custom.conf -echo 'exten => s,5,GotoIf($["${CALLERID(number)}"="${GVNUM}"]?6:7)' >> /etc/asterisk/extensions_custom.conf -echo "exten => s,6,ParkedCall(\${CALLPARK})" >> /etc/asterisk/extensions_custom.conf -echo "exten => s,7,Goto(from-trunk,gv-incoming,1)" >> /etc/asterisk/extensions_custom.conf -echo " " >> /etc/asterisk/extensions_custom.conf +echo " " >> /opt/etc/asterisk/extensions_custom.conf +echo "[custom-gv]" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => _X.,1,Wait(1)" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => _X.,n,Set(ACCTNAME=$acctname)" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => _X.,n,Set(ACCTPASS=$acctpass)" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => _X.,n,Set(RINGBACK=$ringback)" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => _X.,n,Set(CALLPARK=$callpark)" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => _X.,n,Playback(pls-wait-connect-call)" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => _X.,n,System(/opt/local/bin/gvoice -e \${ACCTNAME} -p \${ACCTPASS} call \${EXTEN} \${RINGBACK})" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => _X.,n,Set(PARKINGEXTEN=\${CALLPARK})" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => _X.,n,Park()" >> /opt/etc/asterisk/extensions_custom.conf +echo " " >> /opt/etc/asterisk/extensions_custom.conf +echo "[custom-park]" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => s,1,Wait(2)" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => s,2,Set(GVNUM=$gvnum)" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => s,3,Set(CALLPARK=$callpark)" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => s,4,NoOp(**CALLERID: \${CALLERID(number)})" >> /opt/etc/asterisk/extensions_custom.conf +echo 'exten => s,5,GotoIf($["${CALLERID(number)}"="${GVNUM}"]?6:7)' >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => s,6,ParkedCall(\${CALLPARK})" >> /opt/etc/asterisk/extensions_custom.conf +echo "exten => s,7,Goto(from-trunk,gv-incoming,1)" >> /opt/etc/asterisk/extensions_custom.conf +echo " " >> /opt/etc/asterisk/extensions_custom.conf
echo "Reloading Asterisk dialplan..." -asterisk -rx "dialplan reload" +/opt/sbin/asterisk -rx "dialplan reload" echo " "
if [ -e "/usr/bin/gvoice" ] @@ -71,20 +71,23 @@ echo "Installing Python add-ons..." cd /root #yum install mercurial -yum -y install python-setuptools -easy_install simplejson +#/opt/bin/ipkg-opt --tmp-dir /tmp install py25-setuptools +#yum -y install python-setuptools +#easy_install simplejson +/opt/bin/ipkg-opt --tmp-dir /tmp install py25-simplejson #hg clone »https://pygooglevoice.googlecode.com/hg/ pygooglevoice
echo " " echo "Installing pygooglevoice..."
wget »bestof.nerdvittles.com/applicati···oice.tgz +cd /tmp tar zxvf pygooglevoice.tgz
cd pygooglevoice -python setup.py install +/opt/bin/python setup.py install
-sed -i 's| help(|# help(|' /usr/bin/gvoice +sed -i 's| help(|# help(|' /opt/local/bin/gvoice
fi Fire Up Asterisk /opt/etc/S50asterisk stop /opt/etc/S50asterisk start
You should now have a working Asterisk Server with GV integration
I am not the one who developed these scripts.I just copied and paste the information from some blogs. Thanks |