Tag Archives: SIP

This guide is about 90% complete.But should provide some basic information how to setup a SPA3000.

There are a lot of SPA3000 sale on ebay. I brought one from ebay and one from China. I could not confirm are they real or fake. But they do hang/freeze around once a month, and required a reboot made from it web interface.

I have also brought OBi110 but have not test it out yet. I will have a review/guide in the future.

Part 1 : Introduction

My parents and I live in Sydney. My sister lives in Hong Kong. My parents need to make phone calls to Hong Kong regularly and my sister needs to phone my mum everyday. So how to reduce the phone call cost?

If you are as lucky as me have homes at both places, and both have regular phone line and broadband services, then you can utilise your internet connection by using two SPA3000.

Part 2 : Terminology

2.1 ) ATA – Analog telephone adapter – a device to connect a telephone/land line to the internet. Some ATA only can connect a telephone device to the internet. Other advanced ATA allow you to call from the inernet to the ATA then route your call to the land line or vice versa.

2.2) Softphone – If you don’t want to buy a ATA, you can download a software to make / receive VoIP calls, most of them are free, and you can use it in MS Windows / Linux / Mac / Android / iPhone / Windows Mobile.

2.3 ) VoIP – Voice over Internet protocol – Don’t be fooled by its name, VoIP these 4 letters do not equal to a protocol. It is just a general description of something. To my understanding, these 4 letters = making phone call through Internet.

2.4 ) SIP – Session Initiation Protocol – Before you and your friend start talking, the ATA / softphone need to exchange information about how your voice is going to travel through the internet. That’s part of SIP job.

Also you definitely will come across with “SIP address”. SIP address like email address or phone number, that is what you pass to people, so they know how to find you. For example, SIP:grade2linux@iptel.org, you can type this address to a softphone or ATA to call me. (Okey, this is a fake address!!!)

2.5 ) VoIP service provider – the company / organization who provide VoIP service. Just like email, you will use Gmail, Hotmail. In the world of VoIP you can use Pennytel, iptel.org, etc.

2.6 ) DID – Direct inward dialing – if someone would like to call you from his mobile phone / land line, you cannot just give him your SIP address, you need a proper local phone number which they called DID. For example here in Sydney most VoIP provider will give you a local phone number for AU$5 a month.

2.7 ) PSTN – Public Switched Telephone Network – The network of your local telephone line

2.8 ) FXS – Foreign eXchange Station – The wall socket of your land line

3.1 ) Minimal : Using VoIP softphone in you computer. Those softphone work like Skype. So the only thing you have to do is open a port from your router/modem, install a software into your computer, register a account, then you are done.

The upside is you can register a paid VoIP service. With a paid service provider, you can make phone calls to mobile/home phone/overseas/land line around the world with a very competitive price from your computer. And usually you can call a person for free who use the same provider.

3.2 ) Low end ATA : With a ATA device, you can make calls without a computer, so you can remain using your cordless phone. The size of it is around half of a normal router / modem, which take not much space. With proper configuration to the ATA, you can use you phone as it is connected to normal phone line.

Low end ATA usually only have 2 connection ports, one is a 4 pin phone line port for your telephone device, the other is for the LAN cable to connect the internet.

3.3 ) Middle priced ATA : Usually it have 3 connection ports, one is a 4 pin telephone device port, one is a LAN port for internet, the other is another 4 pin phone line port for you to connect your ATA to you land line wall socket to your land line. This blog entry will mainly concentrate on how to setup a mid-priced Linksys SPA3000 ATA.

Part 4 : VoIP service provider

There are thousands of service provider around the world. Here in Sydney, most internet service provider also host VoIP service too. The best place to start is to find local service. Local provider usually have cheaper local call rate and cheaper DID monthly charge.

Be noted, this do not apply to Hong Kong. Hong Kong have numbers of land line service provider with very cheap fixed price for unlimited calls. Thus VoIP for local use is very rare. Thus both VoIP and DID in Hong Kong is not cheap at all.

Currently I am using a free service from iptel.org and an independent provider called WorldDialPoint. You may wonder why do I need iptel if I am using paid service. Firstly, many paid service don’t offer personalise user name, what you get will be a set of account number only. Secondly, what if you change provider? You have to notify all your friends again. That is iptel come to rescue. I can have my user name at my choice, eg. grade2linux@iptel.org, and forward all calls to the paid service. Of course iptel is free!!!.

Part 5 : How do Linksys/Cisco SPA3000 works

5.1.1 ) SPA3000 can login and ready to receive calls from two VoIP account at the same time.

5.1.2 ) Five additional outgoing accounts can be register for making calls. ( Good for using different provider in different country )

5.1.3 ) One PSTN phone input line. So you can make and receive normal phone calls from you land line.

5.2.3 ) When you pick up the phone and want to make a call, “VoIP1 (Line 1)” will decide which way to go.

5.2.3 ) Red Line :

[1] Make call to internet via VoIP1.

[2] Receive call from internet via VoIP1 and phone will ring.

5.2.4 ) Blue Line :

Make land line call. As stated above all call you make will process via VoIP1.

5.2.5 ) Purple Line = PSTN-to-VoIP Disabled.

Incoming land line call will be processed by VoIP2. Since no special settings were made, VoIP2 will forward call to VoIP1 then phone will ring.

5.2.6.1 ) Green Line = PSTN-to-VoIP Enabled.

[1] Incoming land line call will be processed by VoIP2. VoIP2 will forward call to VoIP1 then phone will ring.

[2] After determined time ( changeable in settings page ), for example after 30 seconds if no one pick up the phone, VoIP2 will take back the call and forward it to the internet depends on settings.

Scenario : I am in out on the street in Sydney and would like to call my sister VoIP phone in Hong Kong. However I don’t want to make a long distance call from my mobile, so I make a phone call to my home phone land line number, then SPA3000 start ringing the phone at home. After 30 seconds, VoIP2 take back my call and prompt me to input password. If my password is correct, SPA3000 will send me a dial tone, now I can input my sister VoIP phone number.

5.2.6.2 ) Green Line = VoIP-to-PSTN Enabled.

Incoming call from internet to VoIP2. VoIP2 will forward it to the land line depends on settings.

Part 6 : Setup

6.1 ) Service provider I am using:

Hong Kong:

Home phone – PCCW

Internet – 和記電訊 Three Hutchison Global Communications VDSL – 100Mb/s

VoIP – iptel.org

Sydney:

Home phone – TPG bundle

Internet – TPG ADSL2+ up to 20Mb/s

VoIP (Paid) – WorldDialPoint

VoIP (Free) – iptel.org

6.2 ) In my setup, I am using two SPA3000, one in Sydney, one in Hong Kong.

6.3 ) Register 4 account from a free VoIP service provider. Most service provider allow user to make free call to other members within the same company. Later you will find how I make use all of them. For simple illustration, here are 4 fake account names for my examples.

SIP:hk-home@iptel.com, 001@iptel.org

SIP:hk-forward@iptel.com, 002@iptel.org

SIP:au-home@iptel.com, 100@iptel.org

SIP:au-forward@iptel.com, 200@iptel.org

6.4 ) Port forward is a MUST for VoIP to work. No matter using a softphone or a ATA.

Please forward TCP/UDP 5060 and 5061 to your SPA3000 ip address

6.5 ) Find out the IP address of SPA3000

[1] Plugin all cables. Please be careful when connecting phone lines. DO NOT connect you land line wall socket to SPA3000 Phone Port, which may badly damage your device.

[2] Pick up your phone and dial ****

[3] When a man speak to you, dial 110#

[4] Then he will tell you the IP address

6.6 ) Open your web browser, go to the SPA3000 web page

Click “Admin Login”

Then Click “Advanced”

And now should look like this

6.7 ) Common Settings for both Hong Kong and Sydney ATA on the “SIP” page

RTP Packet Size: 0.040

AVT Dynamic Payload: 101

6.8 ) “System” page

[1] Remember to set password for both user and admin

[2] Hong Kong settings – HCG Broadband

DHCP: YES

Domain: hgcbroadband.com

–> If your ATA is directly connect to the VDSL modem, you have to put this in to gain IP address

NTP: hk.pool.ntp.org

–> NTP = Network Time Protrocol = auto update time from Internet

[3] Sydney Settings – TPG Internet

DHCP: NO

–> If you do not use DHCP, you must fill in all the follow data.

Static IP: 192.168.1.2

–> Assign a fixed local IP address

Netmask: 255.255.255.0

Gateway: 192.168.1.1

–> IP address of your router/modem

Host name: SPA3000

Primary DNS: 203.12.160.35

Secondary DNS: 203.12.160.36

–> DNS server at TPG Internet

NTP: au.pool.ntp.org

–> NTP = Network Time Protrocol = auto update time from Internet

6.9 ) “Regional” page

[1] Hong Kong settings

Time Zone: GMT +08:00

FXS Port Impedance: 600

–> 600 is for PCCW, you can try on HKBN or HGC

FXS Port Input Gain: 0

–> Volume of your mic.

–> Higher = louder your friend will hear you

–> Default = -3

FXS Port Output Gain: 0

–> Volume of your speaker.

–> Higher = louder you hear from your friend

–> Default = -3

Caller ID Method: BellCore(N.Amer,China)

[2] Sydney settings

Time Zone: GMT +10:00

Daylight Saving Time Rule: start=3/-1/7/3;end=10/-1/7/2;­ save=­­-1

FXS Port Impedance: 220+820||115nf

–> This setting should be fine for all Australian telco

FXS Port Input Gain: 0

–> Volume of your mic.

–> Higher = louder your friend will hear you

–> Default = -3

FXS Port Output Gain: 0

–> Volume of your speaker.

–> Higher = louder you hear from your friend

–> Default = -3

Caller ID Method: BellCore(N.Amer,China)

6.10 ) “Line 1” page

Line Enable: YES

NAT Mapping Enable: YES

NAT Keep Alive Enable: YES

SIP Port: 5060

Proxy: sip.iptel.org

–> This field is not just only proxy server address, also register server address.

Use Outbound Proxy: NO

Register: YES

Register Expires: 240

Make Call Without Reg: NO

Ans Call Without Reg: NO

Display Name: Grade2Linux

–> Name of your choice. This name will show as you VoIP1 caller display name.

User ID: hk-home / au-home

–> These are my fake example accounts, as you can see, if the ATA is in Hong Kong, I will use the hk-home account, vice versa.

Use Auth ID: NO

–> Some service provider required Auth ID for ATA to register to server, usually it is the same as you user ID.

Preferred Codec: G771u

–> Most provider allow different codec to be used. Personally, I have experienced problem when receiving call when NOT using G771u. The down side of G771a/u is more bandwidth needed, but voice quality I think is the best.

Gateway Accounts are additional VoIP provider that you can use, e.g., Gateway 1 with company A for making calls to Canada, Gateway 2 with company B for USA. So you can always use the cheapest one.
Be aware, gateway accounts only allow you to make calls ONLY, not receiving calls.

Dial Plan contain rules of what to do with the digits that you have keyed into your phone. Rules are written in a list, so the number will be check from the top of the list, if not met, then will check with the next rule until the end of the list.
--> The whole dial plan start with a "(" and end with a ")".
--> Rules are written in a single horizontal line, each rule is separated by a "|" sign, so it is a bit hard to read.
--> SPA3000 will wait around 1 second after you have enter the last digit before making a call, this will ensure you have enough time to key in all numbers. However, you can override the 1 second rule by using example 1.
--> Here is my dial plan for my Australia ATA
(000S0<:@gw0>|<999:000>S0<:@gw0>|13xx.<:@gw0>|18xx.<:@gw0>|1900x.!|0[2-9]xxxxxxxx|<:02>xxxxxxxx|<*1:001185298765432><:@gw1>|xx.|<#9,:>xx.<:@gw0>)
--> Example 1, 000S0<:@gw0>
This mean immediately after the third "0" is pressed, make that call through gw0 (Gate Way 0, land line) immediately. 000 is the emergency number in Australia.
And, remember if you try to dial 00036454, you will not make it. Since it will make the call immediately when the third "0" is pressed, that is what "S0" mean, wait zero second.
--> Example 2, <999:000><:@gw0>
"<aaa:bbb>" in front is a number replacement instruction. This mean when 999 is enter, replace it with 000 and make it through gw0.
The reason I put this in is for my parents, they have been living in Hong Kong for their whole life, and the emergency number in Hong Kong is 999, so in case of emergency, they may subconsciously dial 999, which mean nothing here in Australia.
--> Example 3, 13xx.<:@gw0>
This mean number started with 13 and followed by two or more digits, make it through gw0.
"xx." means two or more digits. So 1398, 13987 or 139876 will fall into this rule, but 132 will not.
--> Example 4, 1900x.!
This mean block all numbers started with 1900. "!" mean reject this call.
--> Example 5, 0[2-9]xxxxxxxx
This mean when the first digit is "0", the second digit is any number between two to nine, and followed by exactly eight digit ( x can be 0,1,2,3.....) .
So you must have entered 10 digit in order to fall into this rule.
You wonder why there is no "<:@gw0>" or "<:@gw1>". If none of the gate way is specified, it will go through VoIP1 service provider.
The whole line mean all Australian land line calls (e.g. 02 98765432, 03 98765432, 04 98765432) will go through VoIP1.
Example 6, <:02>xxxxxxxx
This rule is different to example 5. This rule mean, if only 8 digits is entered, tread this as a local call.
Most VoIP service provider required you to input state prefix even you are not making interstate call. So "<:02>" is replacing the imaginary empty space before xxxxxxxx with "02". So when I enter 98765432, 02 will be automatically append in front. And no "<:@gw0>" specified, so this will go through VoIP1.
Example 7, <*1:001185298765432><:@gw1>
This is another number replacement instruction, which I use this as an quick dial instruction. The first part "<*1:001185298765432>", When *1 in entered, *1 will be replaced with 001185298765432, and it will go through gateway 1.
Example 8, xx.
This I call the default option. That is a phone number that is 2 digit or longer, at the same time do not meet any previous rules will fall into the rule. Which will go through VoIP1.
Example 9, <#9,:>xx.<:@gw0>
Most office will required user to input a prefix before making outside call. SPA3000 can simulate this. In plain English it when #9 is pressed, the call will go through the land line.
"#9," mean, when "#9" is pressed, the normal dial tone will be changed into a special dial tone in the speaker. This is triggered by the ",".
Be noted, this special tone do not change anything other than changing the dial tone. Which just tell the user he/she is doing something "special".
"<#9,:>" is an number replacement instruction, meaning "#9," will be replaced by empty space.

In the "Line 1" setting page, what we are doing is to control how calls are make. Which is most ATA basically can do.
Here in the "PSTN Line" setting page, we will see the true power of the SPA3000 of how to control/redirect incoming calls.

Proxy: sip.iptel.org

–> This field is not just only proxy server address, also register server address.

Use Outbound Proxy: NO

Register: YES

Register Expires: 240

Make Call Without Reg: NO

Ans Call Without Reg: NO

Display Name: Grade2Linux_Redirect

–> Name of your choice. This name will show as you VoIP2 caller display name.

User ID: hk-forward / au-forward

–> These are my fake example accounts, as you can see, if the ATA is in Hong Kong, I will use the hk-forward account, vice versa.

Use Auth ID: NO

–> Some service provider required Auth ID for ATA to register to server, usually it is the same as you user ID.

Preferred Codec: G771u

–> Most provider allow different codec to be used. Personally, I have experienced problem when receiving call when NOT using G771u. The down side of G771a/u is more bandwidth needed, but voice quality I think is the best.

You may wonder why there are 8 dial plans. This is because, depends on the password that a incoming caller have keyed in, it can limit that caller to one specified dial plan.

Dial Plan 2 : (S0<:001><:@gw1>)
–> If you read further down, you will find I have link this dial plan to one of the PSTN-to-VoIP password.
–> For example, if a make a call from my mobile to home. After 30 seconds, no one pick, SPA3000 will take the call back and promte me to enter the password. If the correct password have been enter, the associate dial plan will be executed.
–> This dial plan one have one rule. And this rule will trick SPA3000 to make a call automotically. In plain English, this rule mean: Wait zero second, replace imaginary empty space with “001”, then dial it through gw1.
–> So this will call “001” when that password has entered.