Sipura ATA's and IP device setup
Sipura (now Linksys) manufacture and market a range of Analogue Terminal Adapters and IP Phones which are highly functional but have a not undeserved reputation for being difficult to set-up, particularly with Asterisk. Many are provided as OEM CPE front-ends by VOIP ISP's and they are delivered in a "locked" state. Unless the device can be unlocked, it can't be used to connect to your SAIL/Asterisk server.
About ATA's.
Analogue Terminal Adapters, typically with one or two FXS ports, were invented to allow regular analogue telephones to act like SIP devices, allowing them to make and receive VOIP calls. With SARK/SAIL the entire provisioning process is automated for Linksys (Sipura) ATA's. You simply need to define the ATA to SARK/SAIL and then plug the device in to your network and SARK/SAIL will automatically set the ATA up for you with a base setting which will work first time. You may then wish to "tweak" the settings to your own requirements. For a full discussion of automatic provisioning see
DocChapter254. If you just want to provision your spa3k, see below.
Linksys have a range of ATA's in their range, the spa-1xxx the spa-2xx, the
PAP2T? (which is a variant of the 2xxx) and the spa-3xxx. The spa-1xxx is a simple single FXS port box, the 2xxx and the
PAP2T? have 2 FXS ports and the 3xxx has 1 FXS and 1 FXO. The spa-9000 which, is essentially an extended 2002 with fairly advanced on-board PBX facilities has been a spectacular flop in the marketplace due to its complexity. A small PBX in its own right, in our view it is just too difficult a proposition for a non-technical or domestic user to set-up. There is no automated support for the 9000 in SARK/SAIL but you can still set one up manially if the mood takes you.
The 3xxx is by far the most complex of the three pure ATA's, being a mini PBX in its own right. It allows an ordinary phone to be hooked into a VOIP network and the regular telephone system at the same time. It is particularly interesting to Asterisk users because it can be inverted to make a cheap analogue trunk gateway. However, it's quite a complex task to set it up for this role, both from the spa side and the Asterisk side. In SAIL we have automated the Asterisk set-up for the
SPA3K? . Below we will show you how to get a base set-up for the 3000 both automatically and manually.
Setting up the spa-3xxx as an Asterisk Analogue Gateway
Setting up SAIL/Asterisk.
To SAIL/Asterisk, the spa3K looks like two separate devices, a SIP extension and a SIP trunk. Begin by clicking on extensions and adding a new extension. In the phone-type drop-down choose SPA-3000FXS. You can then fill out the extensions entry just like any other extension. If you want SARK/SAIL to automatically set up the SPA3000 unit for you via it's on-board TFTP server, then be sure to fill in the MAC address of the unit (the mac address can be found on the base of the spa3K).
Once saved, select the trunks entry from the server-manager panel. In the select carrier panel, choose SPA-3000FXO.
Next, in the gateway menu; fill in the full area-code and number for the trunk line which this ATA is going to control. If you want SARK/SAIL to automatically set up the SPA3000 unit for you via it's on-board TFTP server, then be sure to fill in the MAC address of the unit (the mac address can be found on the base of the spa3K).
Press Save and you're done with the SAIL side of the set-up.
Setting up the spa-3xxx
Automatic set-up using DHCP 66 and TFTP
If you have elected to have SARK/SAIL automatically provision the SPA3xxx for you then there is nothing further to do. Simply plug the SPA3xxx into your network switch and it will automatically retrieve its identity and base settings from the SARK/SAIL TFTP Server. You may still need to change some of the PSTN hang-up detection settings and ring-tones for your PTT/Country. If you change these settings then you must turn off DHCP/TFTP provisioning on the device in order to prevent your changes from being overwritten by SARK/SAIL the next time you reboot it.
Manual Set-up
Plug the spa3K into your network switch using an RJ45 patch lead. It will get an address from DHCP. To discover the IP address, plug a regular phone into the ext RJ11 port. LEAVE THE LINE PORT UNATTACHED. Take the phone off-hook and dial
****. The spa3K has its own on-board IVR. You will hear the spa3k reception greeting. Dial 110# and the spa3k will speak its IP address.
Fire up your browser and type in the ip address of the spa3k followed by /admin/advanced. So if for example the spa3k is running at 192.168.1.100 then type;
-
- 192.168.1.100/admin/advanced
This will fetch up the spa3k web-server app. Click on the "Line 1" tab...
In SIP Settings ensure that the SIP Port and SIP ext Port are set to 5060.
Fill out the
Proxy and Registration section as shown. The IP addresses point to the asterisk server. Alternatively, if you are running a local name server, you can turn the
Use DNS Serv flag on and refer to the server by name.
In
Subscriber Information, set the display name to whatever you want (we've used the extension number in the example), User ID and Password should match the Asterisk extension number and secret.
Further down the page, find the DTMF Tx Method and Hook Flash Tx Method. Set them both to INFO.
Finally, at the bottom of the page, set Autov PSTN Fallback to Yes. This means that the phone will behave as a normal analogue handset and connect directly through to the phone line when Asterisk is not running.
The spa3k has its own dialplans which it uses to route calls during conventional (i.e. non-Asterisk-Gateway) operation. Remove the default plan and replace it with a general plan that sends everything through to Asterisk as shown. You can now save your changes and click on the PSTN Line tab.
IN the SIP Settings section, set the
SIP Port and
EXT SIP Port to 5060. In the Proxy and Registration section, set the
Proxy IP address to point to your Asterisk server.
<

/a>
IN Subscriber Information, set the Display Name to whatever you like (we've used the PSTN line number), set User-ID to the same number you used to set up the Asterisk Gateway (see above) and set the Password. The SAIL default is to set this value to
asterisk when the SIP entry is created (see above).
In Dialplans, code dialplan 2 as shown but substituting the correct PSTN number for the line (this should be the same number you used in the Gateway definition in SAIL and in the User ID field above. Set
VOIP-to-PSTN Gateway Enable to Yes.
Set
PSTN-to-VOIP Gateway Enable to Yes. Set
PSTN CID for VOIP CID to Yes (this will only have any effect if your PSTN line is CID capable/enabled. You may need to speak to your carrier to obtain CID and it may be chargeable. Set
PSTN Caller Default Dial-plan to 2.
The final three sections will vary from site to site and carrier to carrier. The Disconnect Detection settings for a particular country/carrier can usually be found on the web. If all else fails, you can use a long silence delay to detect a disconnect, however, this method is usually less than satisfactory. The
Spa3K? , at least at the software releases we have, does not seem to be able to detect monotones. Unfortunately, here in the UK, one of our largest cable carriers, NTL, uses a 5 second 400Hz tone to signal disconnect and the spa3k just will not recognise it.
Why "far-end" Disconnect Detection is important
99% of the time, i.e. during a normal terminated call, disconnect detection is irrelevant because even if the far-end disconnect isn't detected the near-end disconnect certainly will be. However, consider this scenario. An external caller places an inbound call which is routed to an unattended extension. The extension rings for a while and then falls to Voicemail. The caller decides not to leave a message and hangs up while the voicemail greeting is playing. Without far-end disconnect detection, voicemail does not know that the call has gone on-hook so it now goes into its record phase. In the absence of any other controls, it will record until the available disk space is exhausted. It will also leave the line in a busy state throughout this period, denying any other users access to this precious resource. It is possible (and recommended) to set a maximum message length in voicemail.conf, however, while this solves the runaway disk space problem, it is still annoying for your users to receive long voicemail messages with nothing in them. SAIL uses another little trick to reduce the incidence of these annoying "ghost" voicemails. It sets the maximum silence to 6 seconds and the minimum message length to 8 seconds in voicemail.conf.
It is rare for a caller to leave a voicemail of less than 8 seconds (at least in the business environment). Thus when a ghost voicemail event occurs, the system will only record for 6 seconds. Then the less-than-8-second rule applies and the voicemail is discarded.
Connecting your spa-3000 to Asterisk.
After you have made your changes to the spa-3000 and saved them the spa will restart and attempt to register with Asterisk. Provided you've done everything right then this is what you will see at the Asterisk console (assuming you have verbose logging enabled);
-- Registered SIP '01924477260' at 192.168.1.75 port 5060 expires 180
-- Saved useragent "Sipura/SPA3000-2.0.13(GWg)" for peer 01924477260
-- Registered SIP '5000' at 192.168.1.75 port 5060 expires 180
-- Saved useragent "Sipura/SPA3000-2.0.13(GWg)" for peer 5000
As you can see, two registrations arrive; one for the trunk and one for the extension. Pick up the extension phone and check its extension number by dialling
*56*;
-- Executing AGI("SIP/5000-3c92", "selintra|*56*") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/selintra
-- AGI Script Executing Application: (Playback) Options: (vm-extension)
-- Playing 'vm-extension' (language 'en')
-- Playing 'digits/5' (language 'en')
-- Playing 'digits/0' (language 'en')
-- Playing 'digits/0' (language 'en')
-- Playing 'digits/0' (language 'en')
-- AGI Script selintra completed, returning 0
-- Executing Hangup("SIP/5000-3c92", "") in new stack
== Spawn extension (internal, h, 1) exited non-zero on 'SIP/5000-3c92'
Next dial-in to the trunk using a separate line/phone, or if you are well-off, you can use your mobile.
-- Executing AGI("SIP/01924477260-4b8a", "selintra|Inbound|01924477260") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/selintra
-- AGI Script Executing Application: (Ringing) Options: ((null))
-- AGI Script Executing Application: (Wait) Options: (5)
.....etc
Finally, define a route for the spa and try an outbound call across the Gateway. Now, if that works, go and have a well-earned cup of java, 'cos that's a wrap...