I’ve just posted a series of articles on selecting a VoIP PBX and setting it up under Microsoft Virtual Server. To read the series from the beginning, see Getting Into VoIP.
Setting up an Analog Terminal Adapter (ATA) for a VoIP system is normally something you do while configuring the PBX. However, since it is configured as a separate device using its own web interface, it seemed to warrant its own blog entry.
Unless you plan to exclusively use SIP phones and VoIP providers for your VoIP installation, you need to find a way to connect to analog telephone lines. You need hardware that has “FXO” ports to connect to the phone company’s lines (called PSTN lines). You may also need hardware that has “FXS” ports to connect to your existing analog phones. (It’s amazing what an analog phone can do when connected to an Asterisk VoIP system–there are feature codes like *97 for almost any imaginable function.)
My initial Trixbox installation a couple years ago runs on a physical machine and uses a Digium PCI card to provide 2 FXO and 2 FXS ports. That’s been working pretty well, though it would probably benefit from some updated drivers .
This time, encouraged by 3CX‘s decision to rely exclusively on network-attached devices, I decided to buy some ATAs. In fact, this is the only option when running in a virtual environment–there is no way that I know of to plug PCI cards directly into a virtual machine.
At first I tested the Grandstream HandyTone HT503. This device provides one FXO and one FXS port and is very reasonably priced–under $50 each. Unfortunately, I was unable to get past some Caller ID issues with these devices (Caller ID is a new capability in this relatively new model), so I ultimately returned the units.
I then chose to use the Linksys by Cisco SPA3102 instead. This product also supplies one FXO and one FXS port. It’s been on the market for some time so it is hopefully fairly mature. You can buy them new for about $75; sometimes they are available for less on eBay.
Configuring the SPA-3102
Aside from some basic WAN and LAN setup which applies to the entire device, the SPA3102 is really treated as two devices when setting it up for use with a PBX. The “Line 1” settings are used to configure the FXS side, which is used to connect an analog telephone. The “PSTN Line” setting are used to configure the FXO side, which are used to connect to the phone company line. Either side may be disabled if you only need part of the functionality.
Since both sides of the SPA3102 share the same IP address, each side must have its own port. By default, the Line 1 setup uses port 5060, while the PSTN Line uses port 5061.
One thing that I discovered in my testing is that often I could use the same or a very similar setup for different PBXs that I tested. The primary entries below refer to the PBX in a Flash (PiaF) settings, but there are also notes in [brackets] pointing out some differences for 3CX and sipXecs. One difference is that under 3CX and PiaF, both internal phones (FXS devices) and external PSTN lines (FXO) register with the PBX. Under sipXecs, only endpoints, that is, only FXS devices register with the PBX.
Here are the SPA3102 settings that I changed from the default to get them to work with the various PBXs. Of course your settings may differ depending on your environment. I’m indebted to the 3CX SPA3102 configuration guide for pointing out most of the necessary changes:
Wan Setup tab
Internet Connection Settings
– Connection Type: DHCP (use router to assign an IP address based on the device’s MAC address)
– Primary NTP Server: 192.168.1.2 (the Windows server on my network that provides NTP server service)
– Remote Management
– Enable WAN Web Server: Yes
Lan Setup tab
Networking Service: Bridge (use external router)
– RTP Packet Size: 0.020 – added 1/21/09 – see comments
Ring and Call Waiting Tone Spec
– Ring Waveform: Sinusoid (default is Trapezoid)
– Ring Frequency: 25 (default is 20) – 1/21/09: now back to 20 – see comments
– Ring Voltage: 80 (default is 85) – 1/21/09: now back to 85 – see comments
– Daylight Saving Time Rule: start=3/8/7/02:0:0;end=11/1/7/02:0:0;save=1
(should handle the new Daylight Saving rules; default was start=4/1/7;end=10/-1/7;save=1)
Line 1 tab
Proxy and Registration
– Proxy: 192.168.1.100 (the IP address that the router assigns to mypbx.mydomain.local)
– Display Name: Personal [SipX: 200 if using 3-digit extensions]
– User ID: 20 [SipX: 200 if using 3-digit extensions]
– Password: (phone extension password)
– Use Auth ID: no
PSTN Line tab
– SIP Port: 5061 [3CX: change the PSTN line in the 3CX web UI to use 5061, not 5060]
Proxy and Registration
– Proxy: 192.168.1.100 (the IP address that the router assigns to mypbx.mydomain.local) [SipX: leave blank]
– Register: Yes [SipX: No]
– Make Call Without Reg: No [SipX: Yes]
– Ans Call Without Reg: No [SipX: Yes?]
– Display Name: Personal [SipX: leave blank]
– User ID: Personal [SipX: leave blank]
– Password: (trunk password) [SipX: leave blank]
– Dial Plan 8: S0<:Personal> (dial trunk “Personal”)
[SipX: Dial Plan 8: S0<:email@example.com> (set to ring thru to ext. 200)]
PSTN-To-VoIP Gateway Setup
– PSTN Ring Thru Line 1: No
– PSTN CID For VoIP CID: Yes
– PSTN Caller Default DP: 8 (points to Dial Plan 8 above)
FXO Timer Values (Sec)
– PSTN Answer Delay: 5 (allow time for Caller ID and/or fax detection)