USE AT YOUR OWN RISK!!!
Setup the NSLU2
Follow http://www.nslu2-linux.org/ and install the latest Unlung version of Linux. I am using Unslung 6.8 Beta. Note that when it's done and you login the console will say:
Welcome to Unslung V2.3R63-uNSLUng-6.8-beta
---------- NOTE: THIS SYSTEM IS CURRENTLY UNSLUNG ----------
BusyBox v0.60.4 (2005.03.22-06:52+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
Threw me for a loop as I thought "UNSLUNG" meant it didn't work, but it just means the system is good to go.
Setup ssh
ipkg install openssh
and turn telnet off from the NSLU2 web interface. All these instructions are on the NSLU2's excellent web page. Once your NSLU2 is unslung you can install the Asterisk packages using the ipkg installer.
Installing Software Packages
Step 1
Install the following ipkgs:
asterisk14 - 1.4.21.2-2 - Asterisk is an Open Source PBX and telephony toolkit.
asterisk14-core-sounds-en-alaw - 1.4.8-1 - asterisk-core-sounds-en-alaw
asterisk14-core-sounds-en-g729 - 1.4.8-1 - asterisk-core-sounds-en-g729
asterisk14-core-sounds-en-gsm - 1.4.8-1 - asterisk-core-sounds-en-gsm
asterisk14-core-sounds-en-ulaw - 1.4.8-1 - asterisk-core-sounds-en-ulaw
asterisk14-extra-sounds-en-alaw - 1.4.7-1 - asterisk-extra-sounds-en-alaw
asterisk14-extra-sounds-en-g729 - 1.4.7-1 - asterisk-extra-sounds-en-g729
asterisk14-extra-sounds-en-gsm - 1.4.7-1 - asterisk-extra-sounds-en-gsm
asterisk14-extra-sounds-en-ulaw - 1.4.7-1 - asterisk-extra-sounds-en-ulaw
asterisk14-gui - 0.0.0svn-r2036-3 - Asterisk-GUI is a framework for the creation of graphical interfaces for configuring Asterisk.
sendmail - 8.14.2-1 - The most classic SMTP server.
Optional, to make your life easier:
man - 1.5p-4 - unix manual page reader
bash - 3.2.17-1 - A bourne style shell
diffutils - 2.8.1-6 - contains gnu diff, cmp, sdiff and diff3 to display differences between and among text files
Note: Additional packages other than the above will be automatically installed if needed.
Step 2
Check to see if Asterisk is installed correctly by typing:
# /opt/sbin/asterisk -vvvc
If it starts up OK give a Ctrl-C and continue on.Step 3
Backup the following files:
# cd /opt/etc/asterisk
# cp -p extensions.conf extensions.conf.org
# cp -p users.conf users.conf.org
# cp -p http.conf http.conf.org
# cp -p manager.conf manager.conf.org
# cp -p voicemail.conf voicemail.conf.org
Step 4
You can add this code to a file called
/opt/etc/init.d/S99asteriskto have asterisk start up automatically at reboot:
#!/bin/sh
if [ -f /opt/var/run/asterisk.pid ] ; then
kill `cat /opt/var/run/asterisk.pid`
else
killall asterisk
fi
rm -f /opt/var/run/asterisk.pid
umask 077
/opt/sbin/asterisk
Setting up the Linksys 3102 ATA
Update: I recommend flashing your SPA3102 with the latest Linksys firmware. I was having some problems with only the Caller ID number being passed to Asterisk (not the Caller ID name). Moving to the 5.1.7 firmware appears to have solved the problem.
Check the SPA3102 Linksys 3102 for Dummies guide from the blog roll links. It is the best on the Internet IMHO.
Step 1
Connect the ATA to your Ethernet jack on your PC or Mac, set the interface for DHCP and connect the other end of the cable to the Internet port of the SPA3102.
Plug the 3102 in and navigate to:
192.168.0.1
Under Subscriber InformationStep 2
Click on Admin login in the upper right hand side. You won't be prompted for a password as the SPA3102 has not had one set yet.
Now click on the advanced config button on the lower left hand side. Linksys/Cisco need to do some work on their human interface design!
Step 3
Click on the Wan Setup tab
For network type choose either DHCP or Static depending on your preferences.
Enter a couple of ntp time servers under optional settings:
Primary NTP Server: 0.pool.ntp.org
Secondary NTP Server: 1.pool.ntp.org
Click yes for Remote Management. You will need this to access the SPA3102 from your LAN.
That's all we will do here. Click Submit all Changes.
Step 4
Click on the Lan Setup tab
Network Service: Select Bridge
This will turn the SPA3102 into a single port switch and there is no need to enter any other settings.
Click Submit all Changes.
NOTE: When you save the setting here the SPA3102 will not be available from your computer. You will need to plug it into your LAN, and browse to the DHCP assigned or static address you entered in the Wan tab.
Step 5
Let's configure the Voice side of things by logging in as you did in Step 2.
Click on the Voice/Regional tab and set your time zone and make sure Daylight Savings is OK for you. I found the default gain settings to be too low. I adjusted them to:
from the default -3 and -3 You can experiment. I'm still unclear about these settings, however!
FXS Port Input Gain: -3
FXS Port Output Gain: -6
The rest of the settings in the Regional tab should be OK.
Step 6
Click on the Voice/PSTN Line tab
Proxy and Registration
Proxy: Enter IP of your NSLU2 Asterisk server.
Subscriber Information
Display Name: LinksysFXO
User ID: LinksysFXO
Password: whateveryouwant
Dial Plans
Dial Plan 1: (S0<:s>)
PSTN-To-VoIP Gateway Setup
The last entry corresponds to the dial plan you selected above.
PSTN Ring Thru Line 1: no
PSTN CID for VoIP CID: yes
Off Hook While Calling VoIP: no
PSTN Caller Default DP: 1
FXO Timer Values (sec)
PSTN Answer Delay: 5
The Answer Delay value is important to enable the SPA3102 to capture the Caller ID information from the PSTN. I needed to tweak this setting a few times and YMMV!
International Control
SPA To PSTN Gain: 0
PSTN To SPA Gain: 10
There has been some discussion about voicemail audio levels for incoming calls from the PSTN on Asterisk (VOIP to VOIP callers leaving voicemail are always OK) and the PSTN to SPA Gain setting allows you to tweak this. You might find that maxing out this setting at 12 will cause some annoying echo. Experiment!
Optional Step
If you want an analog phone attached to the Line 1 port and have it act as a VoIP phone follow these steps. If you are just going to have the SPA3102 act as a VoIP gateway you can ignore this.
Click on the Voice/Line 1 tab
Under Proxy and Registration
Enter IP of your NSLU2 Asterisk server.
Display Name: LinksysFXS
User ID: 6001
Password: whateveryouwant
Click Submit all Changes. The SPA3102 is now set up.
Step 7
Edit users.conf and add the following entry.
[LinksysFXO]
type=friend
secret=whateveryouwant
qualify=yes ; Qualify peer is no more than 2000 ms away
nat=no ; This phone is not natted
host=dynamic ; This device registers with us
canreinvite=no ; Asterisk by default tries to redirect
If you followed the optional step you must also add a similar entry.
Step 8
Start Asterisk and if thing are going OK you should be able to navigate to the SPA3102 Info tab and see that the PSTN Line Status is registered and if you followed the optional step you'll see that Line1 is registered.
6 comments:
FYI...For Step 3 on the 'First Step' page, you should be in the /opt/etc/asterisk directory -- this is the default location for the configuration files.
Thanks very much! I'll make the change and elaborate a bit.
does the S99asterisk file need to be chmod'd to +x?
Will this work without the Linksys 3102 ATA, I mean just to configure the server and use a softphone, like Zoiper ?
I think you giving great advice for playwrights staring out.Very nicely described your thoughts here.I like to read more about this.
I had some problems with that, thx buddy, awesome post.
Post a Comment