|It has been suggested that this article or section be merged with Linksys SPA3102|
The Sipura (now bought out by Linksys) spa 3000 is a pstn (analog phone line) to Asterisk gateway device that provides a SIP interface for 1 FXO port (analog phone line) and 1 FXS port (analog phone). This allows you to use the Telecom section of LMCE, and use Asterisk to send/recieve/route phone calls.
Most office environments have a phone in each room with their own extension number. Most homes, however, are set up with 1 common line (extension) that all phones are connected to - when a call comes in, all phones ring together. LMCE will allow you to have either setup (if you have enough FXS ports/SIP Phones to support the number of extensions you want). Since the spa 3000 has only 1 FXS port, I am going to show you how to set it up so that all phones on the main house phone line will be treated as one extension and ring together. The picture below illustrates the installation method that I'm going to outline here.
Another interesting feature of the spa3000, is that if the LMCE network goes down, or if there is a loss of power, the spa3000 will bridge the FXO and FXS ports, bypassing LMCE and Asterisk altogether, so that you will still have use of your phones in such emergencies.
Also, please realize that these instructions are for manually setting up the spa3000. In the near future, the process will be automated, and if this feature is available at the time you are reading this, then you should go the automatic route.
Please set aside some time to do this manual setup - as you will see, there are a lot of steps involved and it may take you quite some time!
We are going to accomplish this setup in 3 steps: 1- Configuring the Phone Line in the web admin (FreePBX) 2- Adding the device for the internal phone line (FXS port) 3) Configuring the spa3000 (as we will need information from the previous 2 steps to complete)
Step 1 - Configuring the Phone Line
First, log into the web admin at 192.168.80.1, then navigate to Advanced->Configuration->Phones Setup. This will bring you to the FreePBX Admin page On the left hand side, click on "Trunks", then click "Add SIP Trunk" on the page the follows. You will now have to fill out the folowing information:
Outbound Caller ID: House Line
Never Override Caller ID: leave unchecked
Maximum Channels: 1 (this must be set to 1 as a pstn line can only handle 1 call at a time)
Disable Trunk: leave unchecked
Monitor Trunk Failures: leave the Enable checkbox unchecked
Dial Rules: Leave blank
Dial rules wizards: leave this alone
Outbound Dial Prefix: leave blank
Trunk Name: House Line
allow=ulaw canreinvite=no context=from-trunk disallow=all dtmfmode=rfc2833 host=dynamic incominglimit=1 nat=never port=5061 qualify=yes secret=lmce type=friend username=House Line
USER Context: leave blank
USER Details: leave blank
Register String: Leave blank
go ahead and save the changes now!
Next, we are going to setup the Outbound Routes. In FreePBX, on the left, click on "Outbound Routes", and add the following for the new route:
Route Name: House Line Out
Route Password: leave blank
Emergency Dialing: leave unchecked
Intra Company Route: leave unchecked
Music On Hold?: leave at default
112 411 911 9|.XXX
Dial Patterns Wizards: leave this alone
Trunk Sequence: select the SIP/House Line option from the drop down at the top position (this is the trunk we created earlier). If you already have VOIP setup, and you are adding the pstn as a second line, you may want to change the sequence order to suit your needs. All this sequence does, is if a call fails while trying the first sequence, then the call will be tried with the next one, and so on.
Submit your changes!
Next, we will setup the inbound routes. In FreePBX, click on "Inbound Routes", and add the following for the new route:
Description: Leave blank
DID Number : your line phone number, I.e. 800-555-1212
Caller ID Number: leave blank
Zaptel Channel: Leave blank
Fax Handling Section - leave these as-is
Privacy Manager : No
Options Settings: Leave as-is
lastly, in the Set Destination settings, select the last radio button, Custom App. Type the following in the text box for Custom App: custom-linuxmce,102,1
submit your changes.
One last thing to do while we are in FreePBX. You should see towards the top of the page an orange bar that should say "Apply Configuration Changes". Click this, then when prompted, select to continue with reload.
Next, go to Wizard->Devices->Phone Lines (on the left pane in the LMCE web admin, not in FreePBX). We are going to add a dummy line (NOTE: this is a temporary hack for now! I won't go into too many details other than saying that it will allow you to use the "Settings" link next to the listing to do some call routing on your pstn line!) Use the dropdown to select broadvoice. Once you do this, you will see a form to fill in some data. Just put whatever you want in the fields, they won't be used with this hack! After you are done, you will see it listed as a phone line - use the "settings" link next to it to do call routing depending on security mode! (Note: After creating this "dummy" phone line, go back to the FreePBX admin, and look at the Incoming Route for the broadvoice line. Look at the Custom App option at the bottom of the page. It should contain that same custom-linuxmce,102,1. If it does not, go back to the Incoming Route for the House Line, and change its custom app line to be the same as this one! From my tests, it should be the same (though the 3 digit number can change, so check this to be sure).
Step 2 - Adding the device template for the FXS port (your internal phone/phones) In the web admin, on the left pane under devices, select Phones. On the resulting page, you should see all of the Orbiter Embedded Phones that your system already has. At the bottom of this page, click the "Add Device" button, then select "Generic Phone" from the Device Template picker. Click the "Pick device template" button. Now notice that you have a new phone device in you list. Change the name to something like "House Line", set the PK_FloorplanObjectType to Pluto Telephone, set the Phone Type to SIP. Notice that the PhoneNumber is already filled out. LEAVE THIS ALONE AND REMEMBER IT! This will be the extension of your internal analog phones (or whatever single phone you have plugged into the FXS Port!) Also, you can assign this phone a room (it really doesn't matter which one you choose) and make sure the "Controlled By" column says Asterisk. If it does not say "Asterisk", click on it and choose Asterisk (Asterisk) - from the dropdown. When finished, Hit the Update button at the bottom of the screen to save these changes. You will have to reload your router, and do a quick regen on all orbiters manually (from the Devices->Orbiters section)
Step 3 - Configuring the spa3000 (almost done!) This part assumes a factory default starting point. To do this, hook up an analog phone to the FXS (phone) port, and dial **** When prompted, enter 73738# from the telephone keypad. This will reset the unit to factory defaults.
Now go ahead and connect the spa3000's LAN port to your internal network switch. We have to assign it a static IP address, so again dial **** from the connected handset. When prompted, enter 110# and the IP address will be spoken back to you. Write it down. Open up a web browser on the network, and enter the IP address to go to the spa3000 admin page. In the upper right hand corner, click on the links for both Admin Login and Advanced.
Go to the System tab. Under "Internet Connection Type" do the following:
DHCP: no Static IP: enter a static IP address. I used 192.168.80.253 Netmask: 255.255.255.0 Gateway: 192.168.80.1
Update for SPA-3102
Router -> WAN Setup
set WAN Web Server to YES
disconnect the LAN port from the network and connect the WAN port to the network.
Next, go to the SIP tab. Change the following:
RTP Packet Size: 0.020
Next, go to the Line 1 tab. Change the following:
Line Enable: Yes
SIP Port: 5060
Register Expires: 300
Make Call Without Reg: yes
Ans Call Without Reg: yes
Display Name: <extension number LMCE assigned your Generic Phone device> (mine was 206 for example)
UserID: <again, extension number LMCE assigned your Generic Phone device>
Password: <once again, extension number LMCE assigned your Generic Phone device>
Use AuthID: no
Preferred Codec: make sure its set to G711u
Lastly, go to the PSTN Line tab. Ensure the following settings:
Line Enable: Yes
SIP Port: 5061
Register Expires: 300
Make Calls Without Reg: Yes
Ans Calls Without Reg: Yes
Display Name: PSTN Call (this will be displayed in place of unknown caller ID's. You may want to name this "Unknown Call" or similar)
user ID: House Line (this must match the trunk name you did in the FreePBX setup!)
Use Auth ID: no
Preferred Codec: make sure it is set to G711u
DTMF Process INFO: yes
DTMF Process AVT: yes
DTMF TxMethod: Auto
Dial Plan 2: (S0<:phone_number_here>) i.e. (S0<:800-555-1212>) (this is very important - it must match the DID number entered in FreePBX)
VoiP-To-PSTN Gateway Enable: yes
Voip Caller Auth Method: None
Voip PIN Max Retry: 3
One Stage Dialing: yes
Line1 VoIP Caller DP: None
ViOP Valler Default DP: None
Line1 Fallback DP: None (this may need changed to make sure incoming calls come in when the power goes out - will experiment)
PSTN-To-VoIP Gateway Enable: yes
PSTN Caller Auth Method: none
PSTN Right Thru Line 1: no
PSTN Pin Max Retry: 3
PSTN CID for VioP CID: yes
PSTN Caller Default DP: 2 (this is the dialplan 2 that we set up above!)
Off Hook While Calling VoIP: no
Line 1 Signal Hook Flash to PSTN: Disabled
VoIP Answer Delay: 0
PSTN Answer Delay: 3 (this allows enough time for the caller ID information to be passed along)
SPA to PSTN Gain and PSTN to SPA Gain - these can be adjusted to amplify the incoming/outgoing volume to a comfortable level. I like mine set at 6
That should be it! Enjoy LMCE Telecom on your old analog phone line!
Please note any bugs, improvements, fixes or Suggestions below so I can make sure it gets included in the final plug-and-play setup!
- Upon power outtage, or network failure/core crash, the FXO and FXS lines are bridged so you can still use the phones. Dialing out works fine (just unplug the power and/or network cable from your spa3000 to see!). However, incoming calls in this failsafe mode only ring once. (not yet fixed)
- Incoming calls don't directly ring the house phone extension. All orbiters alert of the call, and the call can be directed to go to the house line, but I would have expected that the houseline would ring and could be picked up on a call with no orbiter interaction at all. (not quite sure if this a bug or not, of if this is how LMCE should handle it. Can anyone with VoIP confirm the behavior?) (UPDATE: Found the problem. This will not work until do the web admin portion of this - it will essentiall fix its self when I implement that code)