Background

The Linksys SPA3102/Sipura 3000 PSTN Gateways feature the ability to connect a standard telephone landline to IP-based data networks and can be configured as a SIP trunk for use with your LinuxMCE built-in telephony system.

Due to the area in which I live, there are no viable High Speed DSL/CABLE or other types of internet. I only have access to Satellite Internet, which due to the nature of the beast, has a very high latency (900 - 1400ms average) and I can not use a traditional VOIP provider like Broadvoice, Vonage, or the like. However as the telephony feature of LinuxMCE is a very cool perk to this system, I figured I would have a go at integrating my analog Verizon landline into the system. To create this SIP/Bridge I chose the Linksys SPA3102, however after scanning the FreePBX forums, I can assume they will work well with the Sipura 3000 as well. After many hours of breaking, and then fixing my phone setup, I have a working viable solution, and these steps will detail how to set up this product for use with LinuxMCE. Some of these settings are borrowed from the existing wiki's here on these products, but after using them and failing, I had a go on my own. as always if there is a better more efficient way to accomplish this, please EDIT this wiki. I am by no means an expert. :)

Required items to complete this process.

Linksys SPA3102 or Sipura SPA3000 - Average price between $40 and $80, depending on your source. I used Newegg, because "Once you've NewEgged...."

Adding your new Phone Line

Log into the webadmin of your core

From the left hand panel, choose "Phone Lines"

In the right panel, using the drop downs, select the new "Linksys SPA3102/SPA300" option.

You will now be presented with 4 boxes to enter data. use the settings I have below here. (They are not UberSecure, and you can change them to what you like, just remember the username and password for later, when we configure the SPA itself)

Host: dynamic <later in this wiki, when setting up the SPA, we will be setting a manual IP address, but this dynamic setting now, works some magic, lets leave it that way.>

Save the file

Second steps completed. Congratulations, you just set up your FreePBX trunk!! Beer.

Setting up the SPA3102/SPA3000

Factory reset your device (just to be on the same page.)

Plug your hardwire phone into the "Phone" jack on the SPA.

Pick up the receiver on your hardwired phone

Dial ****

When the voice comes on dial 7 3 7 3 8#

When prompted to confirm, press 1

Factory reset complete!

Plug a network cable from the "WAN" port on the SPA to the internal network on your core.

Plug a phone cable into the "Line" jack on the SPA to your wall jack.

Plug a network cable into the "LAN" port on the SPA into your laptop, netbook, or PC.

Once your device gets an IP address from the SPA, point your browser to http://192.168.0.1

By default the SPA has no passwords set for User, or Admin.

WAN Setup

Using the image below, set up all the areas in yellow - Summary:

Static IP

IP - 192.168.80.200

Netmask - 255.255.255.0

Gateway - 192.168.80.1

Hostname - SPA3102

Primary DNS - 192.168.80.1

Primary NTP - 192.168.80.1

Set WAN server to "Yes"

You can now, and always remember to, click "Apply All Changes" at the bottom, and if you like, disconnect your device from the LAN port, and re-connect to it from your MD or regular PC.

SIP Setup

The only thing we need to change here is the RTP packet size

RTP Parameters

RTP Packet Size - 0.020 - !!! Very important to do this !!!

Regional Set Up

Clear out all Vertical Service Activation Codes - We want FreePBX/LMCE to control these.

Vertical Service Activation Codes

Clear out all codes like shown below.

PSTN Tab

Using the image below, set up all the areas in yellow - Summary:

Line Enable - Yes

SIP Settings

SIP port - 5061

Proxy Settings

Proxy - 192.168.80.1

Register Expires - 300

Make Call Without Reg - Yes

Ans Call Without Reg - Yes

Subscriber Settings

Display Name - Unknown Caller (this is what is displayed when a call comes in without caller ID info)

UserID - spa3102 (this is what you set when creating the Phone Line in the LinuxMCE webmin)

Password - lmce (this is what you set when creating the Phone Line in the LinuxMCE webmin)

Dial Plans

A note here, do not change any of the default (xx.) settings other than Dial Plan 2 !!

Dial Plan 2 - (S0<:XXXXXXXXXX>) - where the X's are your 10 digit phone number including area code. - note to, that is a zero beside the S

VoIP-To-PSTN Gateway Setup

VoIP-To-PSTN Gateway Enable - Yes

VoIP Caller Auth Method - None

VoIP PIN Max Retry - 3

One Stage Dialing - Yes - Extremely inportant setting !!!

Line 1 VoIP Caller DP - none

VoIP Caller Default DP - none

Line 1 Fallback DP - none

PSTN-To-VoIP Gateway Setup

PSTN-To-VoIP Gateway Enable - Yes

PSTN Caller Auth Method - none

PSTN Ring Thru Line 1 - No

PSTN PIN Max Retry - 3

PSTN CID For VoIP CID - Yes

PSTN Caller Default DP - 2

Off Hook While Calling VoIP - No

Line 1 Signal Hook Flash To PSTN - Disabled

FXO Timer Values (sec)

VoIP Answer Delay - 0 (zero)

PSTN Answer Delay - 3

Detect CPC - No

Don't forget to "Submit All Changes"

For LinuxMCE 10.04 ------- CHANGE THE FOLLOWING: Thx to gbutters

Subscriber Information

User ID: XXXXXXXXXX <- your phone number including area code

Use Auth ID: yes

Auth ID: XXXXXXXXXX <- your phone number including area code

PSTN Tab setup complete!!! Congratualtions!! Beer!

Troubleshooting

Dial Rules vs Dial Patterns

One of the first issues I came across, was getting the "Your call can not be completed as dialed", and the "All circuits are busy now" Messages.
Here is what I did to overcome them.

Dial Rules

Log into the LinuxMCE webmin

From the top click Advanced > Configuration > Phones setup to get to the FreePBX admin screen.

In the left click on trunks

In the right click on the trunk you created for the spa3102

Look for Dial Rules:

Clear everything that is in it

Scroll to bottom, click "Submit Changes"

At the top of the FreePBX screen click "Apply Configuration Changes"

This does several things, including eliminating your significant other saying "Why do I have to Dial a 9 and a 1 to call next door" :)

Dial Patterns

In the left click "Outbound Routes"

In the right, click the button for your spa3102 outbound routes

An explanation here as to the difference between Dial Patterns, and Dial Rules.

Dial Rules are used to add a number/character to, or strip a number/character away from anything dialed on any extension in your home. I did not need anything like this as to dial long distance, I only need enter the area code and the number, no 1 and certainly no 9.
Dial patterns are how FreePBX knows how to send a particular call to a route. You may have a route just for local long distance, and you may have a route for international calls, and then another for local calls.
In my cituation, I only need 911, local 7 digit numbers, and long distance 10 digit numbers, so here is what is in my outbound route Dial Pattern:

N11 - For 911

NXXNXXXXXX - For 10 digit long distance

NXXXXXX - for regular old 7 digit local calls

That is it. I only have one trunk, and I only need it to do those 3 types of calls, so why complicate it right?
There is way more information available at:

Summary

You should now see something like this when looking at the "Info" tab:

You will notice here that I did not have my phone line plugged in at the time, LMCE was answering calls, and I had not had the routuing set up the way I want.

All required settings should now be applied. Try to make a test call. If your MD's are not set up for making some calls, try an IP phone if you have one, or a SIP device, like an Ekiga softphone Ekiga

In addition to the PSTN setup, I will also do a wiki on configuring the "Phone" jack coming out of the SPA as an extension in LinuxMCE phones set up.
Located here: Linksys_SPA3102_Line_1_Extension_Set_Up