The PhoneBoy Blog

Simplifying Telecom, Mobile Phones, Gadgets, Health, and More!

Extending your PSTN Line over IP

A question I’ve been asked on more than one occasion is how to connect, say, a Sipura SPA-2000 and a Sipura SPA-3000 together without using a service provider. Why might you want to connect a SPA-2000 to a SPA-3000? Think of it as a way to extend your telephone line over IP. While it is certainly possible to do (I’ve done it), there are two huge hurdles in this process — dynamic addresses and network address translation.

This problem of “dynamic addresses” reared its ugly head in a different problem I was attempting to solve — setting things up so my mother-in-law could access a computer in a remote location so she can work from home. Problem is: both locations have dynamic IP addresses and NAT firewalls. Solution: GoToMyPC. The computer that needs accessing can be set up to periodically “phone GoToMyPC.” It is then possible for someone connecting via GoToMyPC to connect to this computer. Nobody needs to know anyone’s IP address or open up any special ports on their firewalls. It all works using essentially outbound HTTPS connections from each site, which is permitted by most firewalls and proxy servers.

In much the same way that GoToMyPC solves the remote access problem, free VoIP providers such as Free World Dialup and SIPphone provide the means to connect two VoIP endpoints together. FWD and SIPphone provide mechanisms to connect two endpoints together that may be behind firewalls and address translation. Through the use of either an outbound proxy or STUN, they are able to get VoIP clients to talk to each other.

If a provider isn’t involved and you’re just doing SIP IP-to-IP directly, then you have to solve these problems yourself. If you’re a major geek like I am, solving those problems is fairly easy, albeit time consuming. You have to either get a static IP or use something like Dynamic DNS to provide a static reference to each endpoint of the conversation. You may also have to enable various configuration settings in the Sipura and your firewall for things to work. While none of this stuff would be impossible for the “average person” to do with the right help, this is far beyond the effort most people are willing to expend.

If you are going to connect two VoIP endpoints over IP, do yourself a favor and use something Free World Dialup to help do a lot of this heavy lifting.

Now, for the part about connecting a SPA-2000 to a SPA-3000. Let’s assume you’re going to use Free World Dialup to do this. You will need a seperate Free World Dialup account for each endpoint. Let’s assume that one of the lines on the SPA-2000 will be configured with the FWD account 12345 and the SPA-3000 will be configured with the FWD account 67890.

The SPA-2000′s dial plan should be modified to “hard code” dial the SPA-3000′s FWD account, which should be (<S0:67890>). This basically means when you pick up the phone, it will automatically call #67890 on FWD.

The SPA-3000′s PSTN Line config should be modified as follows:

VoIP-To-PSTN Gateway Enable: Yes
VoIP Caller Auth Method: PIN
VoIP Caller Default DP: None
VoIP Access List: 12345
VoIP Caller 1 Pin: whatever you want
VoIP Caller 1 DP: None
VoIP Answer Delay: 1

What this will do is allow all calls from FWD# 12345 to be given a second dial tone. If anyone else dials FWD # 67890, they will be prompted for a PIN. If you don’t want anyone else to take advantage of this gateway, then set the VoIP Caller ID Pattern to 12345. This means calls from other locations will simply ring without being answered.

Also, anyone that does connect to the VoIP to PSTN gateway will be able to dial any number they choose. If you want to restrict what numbers they will dial, you will have to set up a Dial Plan X and refer to that Dial Plan instead of using ‘None’ above.

To allow PSTN calls to get forwarded to your SPA-3000, you will need to make similar changes to the PSTN Tab:

PSTN-To-VoIP Gateway Enable: Yes
PSTN Caller Auth Method: None
PSTN CID For VoIP CID: Yes (to pass thru PSTN Caller ID)
PSTN Caller Default DP: Y
PSTN Answer Delay: 5 (to ensure Caller ID is read)
Dial Plan Y: (<S0:12345>)

(Where Y is a dial plan from 1 to 8)

What will happen is when your PSTN Line rings, after 5 seconds, the PSTN line will be answered and an outbound call will be immediately placed to FWD number 12345. If nobody answers that number, and you have voicemail enabled for FWD# 12345, the call will go to voicemail.

I’m sure I messed something up here, so I welcome your comments.

#Cybersecurity Evangelist, Podcaster, #noagenda Producer, Frequenter of shiny metal tubes, Expressor of personal opinions, and of course, a coffee achiever.