Replacing a Sipura SPA-3000
with a Grandstream HT-503

I first started using Asterisk in my home PBX over ten years ago. I am still using the 1.2 version of Asterisk. It works for me and I never had time to muck through the changes I would need to make to upgrade. I have written many scripts to run things like X10 and weather interfaces with Asterisk. My first ATA was a Sipura (Linksys) SPA-3000. I interfaced the FXO side to my PSTN line and the FXS side to my analog phones. Later I also added purely digital phones. It was first time interfacing FXO/FXS devices and I had just started using Asterisk, so it was a real learning experience. I was never quite happy with the SPA-3000. It would sometimes not catch caller ID even when setup correctly. Echo was often a problem and it would sometimes go into a stuttering packet loss distortion. I was always blaming it on something else but finally after almost ten years I had enough. I considered buying the current Linksys product, the SPA-3102, but after all the problems I had with my first one I decided to try another manufacturer.

The Grandstream HT-503 is physically about the same size as the SPA3000 and it has the same connections, Ethernet, Line (FXO), Phone (FXS), and power. It is not however a plug and play replacement for the SPA-3000, some configuration and Asterisk changes need to be made. Once configured though in my opinion it performs far better than my SPA-3000 ever did.

I do everything in Asterisk in command line mode just like I write web pages using notepad++. No fancy editors or graphics screens. So the first thing I did was backup my sip.conf and extensions.conf files so I could easily go back to the SPA-3000 if needed. Then I added sections in my sip.conf file for the HT-503 FXO and FXS ports. I also made the changes necessary in the HT-503 and finally in extensions.conf. In sip.conf I added the following -

; Grandstream HT503 FXO Port [ht503fxo] type=peer username=ht503fxo secret=xxxxxxxx (replace with your PW) canreinvite=no host=dynamic nat=no port=5062 disallow=all allow=alaw allow=ulaw dtmf=rfc2833 qualify=yes (can be no) context=default ;Grandstream HT503 FXS Port [ht503fxs] type=friend username=ht503fxs secret=xxxxxx (replace with your PW) host=dynamic nat=no dtmf=rfc2833 port=5060 canreinvite=no disallow=all allow=alaw allow=ulaw qualify=yes (can be no) context=default mailbox=405,406 (Mailbox extensions for signaling MWI - change to suit)

Note that most all of the sip settings can be changed based on your configuration. This is what worked for me.

In my extensions.conf file -

My physical phone extensions are in the 40x range. Since the HT-503 requires an extension number to transfer an incoming PSTN call I added an extension to do this. When using the SPA3000 I simply had a context=from-pstn in the sip.conf FXO section and it went there. I struggled with this with the HT-503 because I had left context=from-pstn in the FXO section and it would never ring through or or show anything in a trace. Then I did a sip debug and saw that it was trying to go to the extension I requested in "from-pstn" which did not exist there. So I set context=default and defined the extension to go to the original "from-pstn"

exten => 401,1,goto(from-pstn,s,1)

"from-pstn" runs the incoming call through all of my checks, blacklisted number, time of day to ring or send to VM, etc. It is the master processing of incoming PSTN calls.

The most relevant things that were changed in the HT-503 configuration were the following -

In the basic configuration section at the bottom unconditionally direct all incoming PSTN calls to the defined extension in the extensions.conf file. In my example extension 401. The IP address is the local Asterisk IP address and port is typically 5060.

In the FXO configuration section make sure that PSTN ring thru is set to NO otherwise calls will directly ring the FXO port of the HT-503 and will not be directed to Asterisk. The number of rings and ring through delay can be adjusted down but must be long enough for the HT-503 to acquire CID. Typically this is at least 2 rings. These rings are lost, the first ring passed to Asterisk is really the third incoming ring. If you don't care about CID this could be set to 0 for no delay. This is done much the same way on the SPA3000 only the HT-503 seems to get CID right more often.

Also in the FXO section you usually want to "wait for dialtone" If NO is selected the beginning digits of the dialed number can be cut off. In most cases you will want one stage dialing. This causes the HT-503 to immediately dial the number sent to it.

Of course other things need to be setup in the HT-503 as they would in any new ATA like IP address, FXO and FXS SIP username and PW, CODECS and DTMF types, date and time, etc.

I hope this was helpful. There are many examples on the web but no single one seemed to pull it together. If anyone has any comments or questions contact me via email at doug at

This page last updated 10/10/2013

© 2013 - WA3DSP