Linksys 3102 for Dummies

How does SIP work

http://www.sipcenter.com/sip.nsf/html/What+Is+SIP+Introduction

?'s for Voice items

SIP

PSTN Line

To allow incoming PSTN calls to ring an IP PBX server, you must enable "PSTN-to-VoIP Gateway", and configure the "Proxy and Registration", "Subscriber Information". Apparently, there's no need to add anything else (eg. PIN number + dial plan)

Line1/PSTN Line

What are the "User1" and "PSTN User" tabs?

Speed Dial, Call Forward for both VoIP (User 1) and PSTN (PSTN User), service flags and other advanced settings.

Additional parameters for Line 1 (User1) and PSTN Line (PSTN User). The Line 1 speed dials are here.

User1

PSTN User

What is the "NAT Support Parameters" section, including the VIA information?

These settings offer various methods for the SPA3102 to discover its own external IP address which is necessary for some type of VoIP calls, specifically IP Dialling.

The only settings you might need to use here are STUN Enable and STUN Server but if your VoIP is already working properly leave them alone.

If you have a static IP address you can use EXT IP in this section to enter the IP address.

Different settings for the adapter to help the adapter to determine its external ip address and external port number. Good description here.

Why have a range of "SIP TCP Port Min/Max" instead of a single port, eg. UDP 5060?

Allows you to specify a range of ports to use for SIP.

Sip over TCP is a special case that is not widely used. I think this was setup for Yahoo Voice but it isn't documented.

What are "SIP Port" and "EXT SIP Port" for?

SIP Port is the current SIP port and EXT SIP Port allows you to specify (force) the external SIP port.

These are parameters on the Line 1 and PSTN tab used to set the sip port address for the adapter. I haven't seen EXT SIP port used.

PSTN Line Section: NAT Settings

NAT Mapping Enable is whether to use the adapter's internal network address or external ip address (if the adapter can figure it out) in the sip messages. If your Asterisk server is on the same local network as the SPA3102 you would not use this setting.
NAT Keep Alive Enable is whether or not to send a message every 15 seconds to the proxy to keep your sip port open in your local router for an incoming call.

PSTN Line section: Proxy and Registration: What are "Outbound proxy" (to use a different server for outbound calls?), "Use OB Proxy in Dialog", and "Make/Ans Call Without Registration"?

Only change these if advised by your VSP.

To give you the flexibility to use a different proxy or domain from the registration proxy.

What are "VoIP-To-PSTN Gateway Setup" and "PSTN-To-VoIP Gateway Setup"?

Control incoming (PSTN-To-VoIP) and outgoing (VoIP-To-PSTN) PSTN calls and other advanced stuff. Just make sure that both Gateways are enabled.

Parameter settings for the bridging of calls between incoming/outgoing calls on the FXO port and voip.

Introduction

The Linksys SPA-3102 is the younger brother of Sipura's 3000. Sipura is now part of Linksys, which is itself part of Cisco. The main difference between the 3000 and the 3102 is that the latter can act as a NAT router. This is typically meant so you can connect your PC to the Linksys, and the Linksys to the LAN, without needing two LAN ports.

The 3102 unit offers the following features:

It's important to keep in mind of couple of things: This unit is...

Making sense of the 3102

The 3102 has Internet and Ethernet ports because it can be used as a NAT router between two networks, or more realistically, between the Linksys and your PC. Setting the Router > Lan to "Bridge" just turns it into a bridge, ie. both plugs use the same IP so you can then access the 3102 through either plugs.

Once the embedded web server is up and reachable, configuring the 3102 means making changes in the Voice tab while in Advance Admin mode:

Setup

Important: If you already have a router, and hence, will use the 3102 as just a VoIP gateway, enable the WAN's web server, and use this interface to plug the unit to the switch/hub. Alternatively, you can set the LAN from NAT to Bridge, and plug the unit using either the WAN or LAN interfaces ("Internet" or "Ethernet").

  1. Make sure the unit is connected to the switch through its blue Internet plug
  2. Connect a handset to the Phone plug, and type **** to enter the configuration menu
  3. To check the unit's IP address, dial 110#
  4. Dial 7932# followed by 1#, and 1 to enable access to the embedded web server through the Internet plug
  5. Aim your browser to http://linksys-ip/admin/voice/advanced . Some of the settings are country-specific, so you'll have to google or ask in forums for settings that those where you live.
  6. If you lost the admin's password, reset the unit with **** followed by 73738#, and confirm with 1
  7. The latest updates can be found here
  8. Sysros Syslog Desktop is a free syslog server for Windows

If you messed things up and can't connect to the embedded web server, unplug everything, power off the unit for at least 30 seconds to let capacitors drain, replug cables, and go through the above procedure to enable web access over the WAN port and get the IP address used by the unit.

Router

WAN Setup

LAN Setup

Application

Voice

System

SIP

Provisioning

Regional (for France)

More information:

Line 1

PSTN Line

... and hit Submit All Changes

Securing the 3102

Make sure no one can make calls from the Net to the PSTN line, or from the PSTN line to a VoIP gateway

No connection to the embedded web server from the Net

Adding a Linksys VoIP gateway to Asterisk

Here, we'll use an external box like the Linksys 3102 to act as VoIP gateway, ie. interface between a PSTN line and the network. If you only use SIP, you don't need to compile and configure zaptel and libpri. You'll just need to build sip.conf, extensions.conf, and voicemail.conf.

First, edit sip.conf to add an extension so the Linksys can connect to the Asterisk server:

[fxo]
type=friend
secret=fxo
qualify=yes ; Qualify peer is no more than 2000 ms away
nat=no ; This phone is not natted
host=dynamic ; This device registers with us
canreinvite=no ; Asterisk by default tries to redirect
context=internal ; the internal context controls what we can do

Next, edit extensions.conf to create a group extension so that incoming PSTN calls ring multiple phones:

[internal]
exten => 200,1,Dial(SIP/200)
exten => 201,1,Dial(SIP/201)
exten => 202,1,Dial(SIP/202)
exten => group,1,Dial(SIP/200&SIP/201&SIP/202)

Finally, connect to the Linsys embedded web server, and go to Voice > PSTN Line to add the IP address of the Asterisk server in "Proxy and Registration" > Proxy, and fill the "Subscriber Information" section with the login/password set in sip.conf for the device.

Also edit the default dial plan "Dial Plan 1" under "Dial Plans" so that the Linksys knows which extension to call when it detects an incoming call:

(S0<:group@IP-address-of-Asterisk-server>)

Launch Asterisk in console mode, type "reload" to... reload the configuration files, reboot the Linksys, and type "sip show peers" to check that the Linksys device registered correctly.

Now, call into the Linksys from a PSTN phone: The extensions listed in extensions.conf should ring.

Stuff I learned while trying to use a 3102 as a PSTN gateway on a private network, with remote IP phones behind their own NAT router and connecting to Asterisk:

Error messages with firmware 5.1.7 while booting:

<159>system request reboot
<143>
<134>++++ sip skt[0]= INVALID
<134>++++ sip skt[0]= INVALID
<151>[5061]STUN trying 0
<159>IDBG: st-0
<134>YM:ERR:AuthServerNotConfig
<134>YM:ERR:AuthServerNotConfig
<151>[5061]STUN trying 1
<151>[5061]STUN trying 0
<151>[5061]STUN trying 1
<151>[5061]STUN trying 2
etc.

Recent update to the 3000. Once you know its IP address by hooking up a phone to its PHONE interface and typing **** followed by 110#, make sure you uploaded the latest firmware to the unit.

Next, hit its embedded web server, and switch to Admin > Advanced. Here are things you need to change to have it work with a PBX application:

Router

Voice

System: Type the IP address of a syslog server to which the Linksys will send debug messages. For Windows, I recommend the free and no-brainer Sysrose' Syslog Desktop.

SIP: If the 3102 is sitting behind a NAT firewall and uses a private, non-routable IP address, in "NAT Support Parameters", STUN Enable=Yes, and STUN Server=stun.fwdnet.net (or any STUN server you want.)

Regional: This is where you fill country-specific informations that fit the PSTN network to which the unit is connected. Also scroll down to Miscellaneous, and set Time Zone, DST, (for France) Caller ID Method=ETSI FSK

Line 1: This is the FXS port, ie. the handset that you connect to the unit if you want to turn an analog phone into an IP phone. If you only use the 3102 for its FXO capability, set Line Enable to No.

PSTN Line: This is the FXO port, ie the connection between the 3102 and an analog phone line:

What is Outbound Proxy? What is registration? Where can country-specific telecom information be found?

Regional settings

Regional settings for France

References: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf, World PSTN Tone Database, and here.

Information: "le codec standard (en Europe et dans le reste du monde, sauf en Amérique du Nord et au Japon) est le G711 a-law, appelé aussi PCMA; il correspond à un échantillonnage de la voix sur une échelle logarithmique, à une fréquence de 8 kHz et sur 8 bits (le codec standard utilisé en Amérique du Nord et au Japon étant le G711 µ-law, appelé aussi PCMU; la différence entre le PCMA et le PCMU réside, entre autres, dans la fonction d'interpolation) le débit correspondant à la voix est alors de 64 kbit/s - équivalent à une communication analogique -, tout le reste correspond à des overheads pour le transport sur la couche IP"

PSTN Line
Regional

Reliable IP Phones

Those phones are known to work well, although they'll have the same issues if there's a non-VoIP-friendly NAT firewall in the way to the Internet...

Tips & Tricks

Take an RJ11 cable, plug one end into the FXS (Line1) port on your SPA, and the other end into the FXO (PSTN) port on the SPA. That way, you have a cheap PSTN line simulator which allows you to configure the caller ID standard (by changing the Line 1 settings). Calling the number people call to reach you on Line1, will then trigger a "PSTN" call that comes in to your PSTN port.

In case of echo when using the PSTN line

If you're hearing your own voice, the problem lies at the other end of the line, ie. the remote party on the PSTN network: "In a normal phone conversation, the latency is so low that you don't notice it. Your brain automatically tunes out to its own voice when you’re talking (as long as the delay between talking and hearing isn't too long)."

Here are a few things to try if you or the remote party hear their own voice when going through the PSTN network. This issue can occur with a handset connected to the 3102 through the Phone interface:

If all else fails, use the 3102 only for outgoing calls.

If going through a VoIP provider instead of using a 3102, you could use ping and traceroute to check how many hops you are from your VoIP provider and its PSTN gateway.

Echo Analysis for Voice over IP

Q&A

Caller ID is not showing

In the PSTN Line section, under FXO Timer Values, make sure PSTN Answer Delay is set to a value superior to 3 seconds.

If no caller ID name is sent by the telco, you can set what caller ID name will be sent to the PBX in the PSTN Line > Subscriber Information section (Display Name).

My syslogd is not getting debug information from Linksys

There are two locations under the Voice section:

"When PSTN stops ringing, it takes a few seconds before my Line 1 stops ringing. Why?

The SPA rings a PSTN call through Line 1 by making an internal SIP call to Line 1. When PSTN ring stops, the SPA will take a few seconds to realize that the ring has truly stopped (due to some quiet period between rings), before it can tear down the corresponding internal SIP call to Line 1. This delay should be larger than the expected quiet period between 2 PSTN rings. You can configure this delay in the < PSTN Ring Timeout > parramter. The default value is 5 (s)."

Issues

Information

How to make direct IP calls with a Linksys 3102?

GrandStream : "Note:- You will need to have SIP Server field blank, along with NAT traversal set to NO, no STUN Server configured and Use Random Ports set to NO. You can make calls between public IPs and Private IPs under the same LAN." http://www.grandstream.com/FAQ/DirectIPCalling_b.htm

... so as to avoid using an SIP PBX, and just have the Linksys ring a remote IP phone through the Net when a PSTN call comes in?

Enable IP Dialing Enable IP Dialing no

Note: If IP dialing is enabled, one can dial [user-id@]a.b.c.d[:port], where "@", ".", and ":" are dialed by entering "*", user-id must be numeric (like a phone number) and a, b, c, d must be between 0 and 255, and port must be larger than 255. If port is not given, 5060 is used. Port and User-Id are optional. If the user-id portion matches a pattern in the dial plan, then it is interpreted as a regular phone number according to the dial plan. The INVITE message, however, is still sent to the outbound proxy if it is enabled.

Provisioning tab: Should I disable this?

You only need to disable this if you're having problems with settings (particularly dial plan) reverting to vendor defaults every 24 hours. If the Profile Rule is the default (shown below), leave it.

Profile Rule: /spa$PSN.cfg

I would disable it. It is mostly used by voip providers to remotely configure the adapter.

Recommended settings for France

Set Time Zone to "GMT+01:00"

DST : start=3/-1/7/2;end=10/-1/7/3;save=1

The ATA Administration Guide has a lengthly discussion of the setting. I fussed with it and eventually got it to work after I put save=+1.

You can setup an NTP server on one of the Router tabs so the adapter will get the correct time from an Network Time Protocol server when you boot it up.

"FXO Timer Values (sec)", "PSTN Disconnect Detection", "International Control": What are recommended settings for France?

Linksys ATA Administrator Guide

Parameters that pertain to the pstn line attached to the FXO port of the adapter.

The ATA Administration Guide is the basic technical manual for the SPA3102. The manual has impedance and disconnect tone settings for France. Other regional tone settings will work with the default settings, however changes can be made to them so the sound is similiar to local settings. The Voxilla site used to have a "localization wizard" but it looks like that is now gone. The "3am" database has tone settings for a number of countries.

PSTN settings for France here.

Also, French progress tones (Dial, Busy, etc.) here.


This Voxilla site has a useful configuration wizard for a SPA3102 with Asterisk.

Resources

More information: