Sunday 3 October 2010

Linksys SPA3102


The Linksys SPA3102 is an amazingly powerful analogue telephone adaptor, which makes making calls over the internet completely transparent.

It is capable of routing telephone calls through one or more Voice over IP (VOIP) providers networks, or routing them over the landline Public Switched Telephone Network (PSTN).

Summary

8/10 - The Linksys SPA3102 is amazingly powerful, and can be used for more than just routing telephone calls over the internet. It is extremely flexible, but with that, it brings a "difficult to get to grips with" configuration - hopefully this blog entry will solve much of that!

Overview

It is configured to recognise dialed number patterns, and rules enure that the call is routed through the correct service. It isn't only linked to VOIP, it can also route calls through calling card companies too! Here's the sort of things it can do:
  • Route calls through the normal landline.
  • Block numbers (e.g. 0898 premium rate numbers).
  • Automatically route specific calls through calling card providers.
  • Automatically route specific calls through up to 4 different VOIP providers.
  • Automatically route specific calls to other VOIP phones (internet calls), by dialing the appropriate prefix.
  • With VoIPTalk, you get an 0843 incomming number for free, which is great for receiving tele-marketing calls, as they pay you!
  • Use the phone to dial US 1-800 numbers from outside the US.
  • You can also use the adaptor as an exchange to divert your incomming PSTN calls to another VOIP phone (not covered in this blog)
When you read online about the adaptor, you will see lots of people confused over how to set it up. It is confusing, because it is very powerful, but once you get your head round dialing plans, it becomes much simpler.

Typical Connection



The SPA3102 is designed to sit between your broadband connection (ADSL modem is shown in the diagram) and your telephone.

In order to initially configure the SPA3102, you can do one of two things: plug your PC into the Ethernet port (shown as yellow). If you like, you can leave this configuration, as the SPA3102 will route PC packets to the internet. In this configuration, you can configure the SPA3102 using a web browser and connecting to 192.168.0.1.

Alternatively, leave your PC connected directly to the ADSL modem, and enable the configuration server on the blue 'internet' port by dialling **** on your phone handset, selecting menu option 7932#, and then 1# to enable the web server, and press 1 to save. You can also select menu option 110# to find out what IP address has been allocated to the ADSL modem, so that you can connect to it with your web browser.

If you are in the UK, you will notice that although the adaptor comes with a UK mains plug, it does not come with any UK style phone cables. This is only really a problem if you have a very old phone, as most modern phone cables are actually unpluggable, and they have an RJ11 conector on one end. All you need to do in this instance is swap some cables around (see the diagram above).

Configuring the SPA3102

Some of the configuration is quite straight forward, and other parts are quite confusing. I will take you through the configuration I have set up with BT and VoIPTalk:
  • I took the adaptor out of its packaging, and connected it up as shown in the diagram above.
  • I checked that the firmware was the most up-to-date here, selecting a 3.x.x firmware (not a 5.x.x US version).
  • I set up a pay as you go account with VoIPTalk here, which gave me 10 minutes credit, and my own 0843 number - no credit card details were needed.
  • Using my PC and a web browser, I connected to http://192.168.0.1/, and got the configuration page of the adaptor.
  • I set the adaptor to use VoIPTalk using their guide.
  • I phoned my new 0843 number from my mobile, and my house phone received the call.
  • I dialled 902 from my house phone and got the VoIP test answer.
  • I set the adaptor to enable me to access the router from my laptop:
    Router / WAN Setup / Advanced / Enable WAN Server = yes
  • I then set up some Dial Plan rules:
    Voice / Line 1 / Advanced / Dial Plan
  • I then tried calling out from my house phone, 1471, local numbers, national numbers etc. and watched the 'Line' LED on the adaptor to make sure that the right calls were going the right way.
  • I then modified the busy tones and engaged tones, so that they match the UK (see tones below).
Gotchas

1. If the adptor does not automatically get the correct time,you probably don't have a working internet connection from it.  Check:

  • You have the correct cables in the correct sockets
  • You have a correct netmask and router specified
  • You have a correct DNS specified (particularly applicable if you are using static IP, as the DNS is not optional.

2. If you choose to set a password on the adaptor, the username to use is 'admin'

3. If you want to reset the adaptor to its factory defaults:
  • Disconnect the 'Line' cable (if you have 'Auto PSTN Fallback' enabled, and do not have a VoIP connection, the **** gets routed out of your PSTN interface).
  • Using your telephone, dial '****'
  • Dial 7 3 7 3 8 #
  • Press 1 to confirm
  • hang up and the ATA will reboot
  • Re-connect the 'Line' cable.
4. If you are doing a firmware upgrade using Linux, put the bin file somewhere on a webserver, and then connect to your ATA using: http://192.168.0.1/upgrade?http://hostname/path_to_upgrade.bin. The power LED will flash slowly when downloading, and flash quickly when programming - do not switch off whilst flashing!

5. When defining a dialling plan, don't forget that there are 3 ways to dial a number (in the UK): locally, e.g. 123123; nationally, e.g. 01480 123123; and internationally, e.g. 0044 1480 123123. make sure you cater for all combinations to be sure your routing decisions are not overridden. You may also want to consider other potential prefixes, such as 141 (withold caller ID) - see this page on some typical UK prefix codes for more ideas.

6. If you try to set the FXS Port Impedence, and the option you want is not there, double check that the correct country firmware is installed, e.g. 5.1.10(GW) does not support the UK impedences, but 3.3.6(GW) does.

7. If you enable the "Auto PSTN Fallback", in the event that your broadband is down, all your calls will be routed out of the normal phone line. You may not want this, and you may wish to disable the feature. If you do this, you will not be able to make any normal calls if the broadband is down either. I have already contacted Cisco about this, and they are looking at implementing a patch.

Setting Ring Tones and Port Impedence

Connect to the SPA3102 webserver, select admin and advanced, and on the Voice/Regional tab and Voice/PSTN Line tab (for the disconnect tone), set the dial tones as shown on this post.

On the Voice/Regional tab, make sure that the FXS Port impedence is set to 370 + 620 || 310nf (These numbers have come from BT's document SIN351). If you don't see this in the list, make sure you have the correct version of the firmware installed.

Calling other Internet Phones

Just like normal telephone systems, the internet consits of many different companies, all providing VoIP services. The way to dial anothe VOIP account is to dial their account number @ voip provider. Clearly, this is complicated to type into a phone, and this is where SIPBroker comes in. They provide the equivalent of area codes, so all you need to dial is * area code account number.

The easiest way to set up the rule for SIPBroker is to set up a rule to interpret anything starting with a * to be routed directly to sipbroker.com, e.g.
*xx.<:@sipbroker.com>.

So, for example, a person with a freenum.org account 88888888 has a VoIP phone number of *01288888888 - the rule would translate this to
*01288888888@sipbroker.com.

Note that I have had intermittant success with this method. An alternative solution is to see if your VOIP provider has a sipbroker prefix - for me with VoIPTalk, the prefix is **473, so I have the following rule: <*:**473*>xx.

This will convert *01288888888 with **473*01288888888, and dial using the sipbroker prefix.

Dialing Plans

The Dialing plan is the engine in the middle of the Linksys SPA3102, which is responsible for deciding which calls get routed through which operator. It is set up in the adaptor as a series of tests separated by vertical bars or pipes '|'. The first matching number is used. Each test is in the following format:
<a:b>c<:@dd>

<aa:bb> - Look for aa, and replace with bb
cc - Match the supplied sequence
dd - Identify the address of the destination.

where:
@dd is blank when the default VoIP gateway is to be used
@dd is @gw0 when the PSTN line is to be used
@dd is @gwx when additional VoIP provider on gateway x is to be used
@dd can also be a domain name or IP address, optionally followed by :port number.
[123] Match any of the numbers in the square brackets
[3-5] Match the range in the square brackets
x Match a single digit (0-9)
# Match hash
* match asterisk
. Match the previous digit 0 or more times
S0 - Identifies the end of the test, and means dial immediately (found at the end of cc)
! - Means number is to be blocked (found at the end of cc)
Dx - Insert a delay of x (found in bb or cc)
Example 1:

Use the PSTN for local and national calls, route calls to France through Alpha Telecom (calling card), route all other international calls through VoIP, and provide '#' short codes to override automatic decisions.
(<*:**473*>xx. | lt;0044:0>xx.<:@gw0> | <0033:18330033>xx.<:@gw0> | 00xx. | <#1:>xx.<:@gw0> | <#2:>[*x][*x]. | <#3:1833>xx.<:@gw0> | xx.<:@gw0> )
<*:**473*>xx. - Insert **473 prefix to route any * calls through SipBroker
<0044:0>xx.<:@gw0> - Replace 0044 with 0 and dial through PSTN
<0033:18330033>xx.<:@gw0> - Route calls to France via AlphaTelecom on PSTN
00xx. - Route all other country codes through the default VOIP provider
<#1:>xx.<:@gw0> - Interpret #1 as force through PSTN
<#2:>[*x][*x]. - Interpret #2 as force through the default VOIP provider
(and allow '*' in numbers).
<#3:1833>xx.<:@gw0> - Interpret #3 as force through AlphaTelecom on PSTN
xx.<:@gw0> - Route all other calls through PSTN

Example 2:

Detect and handle VoIP numbers, use the PSTN for local numbers and emergency numbers (e.g. 999), ban premium rate numbers, route national calls through the default VoIP provider, and all other calls through a different provider.
( *xx.<:@sipbroker.com> | [2-8]xxxxxxxS0<:@gw0> | [19]xx.<:@gw0> | 0898! | 0044xx. | 0[1-9]xx. | xx.<:@gw1> )
*xx.<:@sipbroker.com> - Use SIPBroker to route calls starting with *
[2-8]xxxxxxxS0<:@gw0> - Dial local 6 digit numbers using PSTN
[19]xx.<:@gw0> - Dial numbers starting with 1 and 9 through PSTN
0898! - Ban 0898 numbers
0044xx.| 0[1-9]xx. - National calls through Default VoIP Provider
xx.<:@gw1&gt; - Route all other calls through Gateway 1

Example 3:

Using VOIP only, route calls starting with a * via SIPBroker, prefix any 8-digit calls starting with 2-8 with 01480 (a local dialling code).
( <*:**473*>xx. | <:01480>[2-8]xxxxxS0 | xxx. )
<*:**473*>xx. - Insert **473 prefix to route any * calls through SipBroker
<:01480>[2-8]xxxxxxxS0 - Prefix 2xxxxxxx - 8xxxxxxx with 01480
xxx. - Route all other calls through the VOIP connection.

Test Numbers

These test numbers assume you have put SIPBroker in your dial-plan.
  • *011 188888 - SipBroker Test Announcement (Verifies SipBroker routing works)
  • *013 43 720 0101010 - Connects to ENUM Test Gateway
  • *10004 415 1595 - Echo Test / Music (Iceland)
  • *9876 7 xxxx - Conference Call (enter 4 digit pin and # when prompted)
  • *850 100 xxxxxxx - Conference Call without pin numbers
  • *850 8463 - Time Announcer (Bahamas) 
  • *18xx xxxxxxx / *013 18xx xxxxxxx - US/Canada 1-800, 1-866, 1-877, 1-888 Numbers
  • *013 44800 xxxxxx - UK 0800 Numbers
  • *1800 992 7433 - US Aviation Weather Center Weather Reports (1-800)
If you can't get through, check with SipBroker as to whether the VoIP provider is currently active.

Visit http://www.sipbroker.com/sipbroker/action/callIn, and put your SIP account in to the dialog box. Your account must be in the format of account@sipprovider. The web page will cause your phone to be rung.

Links

2 comments:

  1. I'm also visiting this site regularly, this web site is really nice and the users are genuinely sharing good thoughts.
    uk area codes

    ReplyDelete
  2. Nice article, Thank You I Was searching for details about Virtual Phone System and found it here.

    ReplyDelete