CISCO/Linksys ATA/SPA(3102, 3100 etc) Configuration Hints and Tips

The Cisco/Linksys SPA are extremely flexible and sophisicated SIP based Analogue Telephone Adaptors (ATA), however this flexibility comes at the price of very difficult configuration. I have collected my various findings on configuring the divice here.

Starting Point for Basic Configuration:

The configuration scenarios I wished to support is as follows:

Here is a list of areas where there were problems and and how to get around them.. this could be helpful in trouble shooting your configuration.

NOTE: All the configuration example are in XML provisioning format as generated via our config/conversion utility):

Issue
Resolution More Information
Syslog Configuration

The first step to help diagnose and debug issues with SPA is to turn on Syslog debugging. The relevant configuration items are:

<!-- 'tab' : 'System' -->
<!-- 'group' : 'Miscellaneous Settings' -->
<Syslog_Server ua="rw">xx.xx.xx.xx</Syslog_Server>
<Debug_Server ua="rw">xx.xx.xx.xx</Debug_Server>
<Debug_Level ua="rw">0</Debug_Level><!-- options: { (0|0) (1|1) (2|2) (3|3) } -->

<!-- 'tab' : 'Line 1' (_1_) -->
<!-- 'group' : 'SIP Settings' (_1_) -->
<SIP_Debug_Option_1_ ua="rw">none</SIP_Debug_Option_1_><!-- options: { (none|none) (1-line|1-line) (1-line excl. OPT|1-line excl. OPT) (1-line excl. NTFY|1-line excl. NTFY) (1-line excl. REG|1-line excl. REG) (1-line excl. OPT|NTFY|REG|1-line excl. OPT|NTFY|REG) (full|full) (full excl. OPT|full excl. OPT) (full excl. NTFY|full excl. NTFY) (full excl. REG|full excl. REG) (full excl. OPT|NTFY|REG|full excl. OPT|NTFY|REG) } -->

<!-- 'tab' : 'PSTN Line' (_2_) -->
<!-- 'group' : 'SIP Settings' (_2_) -->
<SIP_Debug_Option_2_ ua="rw">none</SIP_Debug_Option_2_><!-- options: { (none|none) (1-line|1-line) (1-line excl. OPT|1-line excl. OPT) (1-line excl. NTFY|1-line excl. NTFY) (1-line excl. REG|1-line excl. REG) (1-line excl. OPT|NTFY|REG|1-line excl. OPT|NTFY|REG) (full|full) (full excl. OPT|full excl. OPT) (full excl. NTFY|full excl. NTFY) (full excl. REG|full excl. REG) (full excl. OPT|NTFY|REG|full excl. OPT|NTFY|REG) } -->

As with everything on SPA the configuration options allow a lot of flexibility, but but also signficant complexity...

Having set up the required syslog levels, if you are using a UNIX flavor syslog server, you will be surprised to find that nothing is being logged. There are two likely reasons for this: the first is that you need to configure your syslog server to accept messages from the SPA (via IP address) and the second is that by default UNIX syslog server accepts UDP messages on port 514 only and expects the message source port to also be 514, while the SPA does not send from port 514. So you need to configure your syslog server to accept messages from any UDP port.

The relevant configuration files is: /etc/syslog.conf:

*.* /var/log/all.log

And change syslogd, startup flags to specify IP address and all ports (on FreeBSD this is done via /etc/rc.conf:

syslogd_enable="YES"
syslogd_flags="-a xx.xx.xx.0/24:* -v -v" /* where xx.0/24 - IP address range, * is port wild card */

Whirlpool Discussion Thread: Linksys spa3201 gateway (gw1-4)
"Line 1" Australian Dial Plan

Most of the documentation you will find on Dial Plan, does little to explain them and also tends to be targetted at US or UK users. Here is "Line 1" Dial Plan configuration and its explanation. The "Line 1" dial plan configures how the SPA responds to dialing requests made via the handset connected to the FXS or Handset port.

In this configuration gw0 == PSTN Line (or FXS port) and gw2 == external VoIP/SIP service provider (see Line 1, Gateway Accounts below).

<!-- 'tab' : 'Line 1' (_1_) -->
<Line_Enable_1_ ua="rw">yes</Line_Enable_1_><!-- options: { (1|yes) (0|no) } -->
...

<!-- 'group' : 'Proxy and Registration' (_1_) -->
<Proxy_1_ ua="rw">SIP.Proxy.DNS.Name</Proxy_1_>
<Outbound_Proxy_1_ ua="rw"></Outbound_Proxy_1_>
<Use_Outbound_Proxy_1_ ua="rw">no</Use_Outbound_Proxy_1_><!-- options: { (1|yes) (0|no) } -->
<Use_OB_Proxy_In_Dialog_1_ ua="rw">no</Use_OB_Proxy_In_Dialog_1_><!-- options: { (1|yes) (0|no) } -->
<Register_1_ ua="rw">yes</Register_1_><!-- options: { (1|yes) (0|no) } -->
<Make_Call_Without_Reg_1_ ua="rw">yes</Make_Call_Without_Reg_1_><!-- options: { (1|yes) (0|no) } -->
<Register_Expires_1_ ua="rw">3600</Register_Expires_1_>
<Ans_Call_Without_Reg_1_ ua="rw">yes</Ans_Call_Without_Reg_1_><!-- options: { (1|yes) (0|no) } -->
<Use_DNS_SRV_1_ ua="rw">yes</Use_DNS_SRV_1_><!-- options: { (1|yes) (0|no) } -->
<DNS_SRV_Auto_Prefix_1_ ua="rw">yes</DNS_SRV_Auto_Prefix_1_><!-- options: { (1|yes) (0|no) } -->
<Proxy_Fallback_Intvl_1_ ua="rw">3600</Proxy_Fallback_Intvl_1_>
<Proxy_Redundancy_Method_1_ ua="rw">Normal</Proxy_Redundancy_Method_1_><!-- options: { (Normal|Normal) (Based on SRV Port|Based on SRV Port) } -->
<Voice_Mail_Server_1_ ua="rw"></Voice_Mail_Server_1_>
<Mailbox_Subscribe_Expires_1_ ua="rw">2147483647</Mailbox_Subscribe_Expires_1_>
<!-- 'group' : 'Subscriber Information' (_1_) -->
<Display_Name_1_ ua="rw">SIP Display Name</Display_Name_1_>
<User_ID_1_ ua="rw">Internal.ID</User_ID_1_>
<Password_1_ ua="rw">*************</Password_1_>
<Use_Auth_ID_1_ ua="rw">no</Use_Auth_ID_1_><!-- options: { (1|yes) (0|no) } -->

...
<!-- 'group' : 'Gateway Accounts' (_1_) -->
...
<Gateway_2_1_ ua="rw">ID@xx.xx.xx.xx</Gateway_2_1_>
<GW2_NAT_Mapping_Enable_1_ ua="rw">no</GW2_NAT_Mapping_Enable_1_><!-- options: { (1|yes) (0|no) } -->
<GW2_Auth_ID_1_ ua="rw">ID</GW2_Auth_ID_1_>
<GW2_Password_1_ ua="rw">*************</GW2_Password_1_>
...
<!-- 'group' : 'Dial Plan' (_1_) -->
<Dial_Plan_1_ ua="rw">(<#0:><:@gw0>|1[2-9]xxx.<:@gw0>|001161[2-9]xxxxxxxxS0<:@gw0>|0[2-9]xxxxxxxxS0<:@gw0>|9xxxxxxxS0<:@gw0>|<0011:>xxx.<:@gw2>|61xxxS0|61xxxxS0)</Dial_Plan_1_>
<Enable_IP_Dialing_1_ ua="rw">yes</Enable_IP_Dialing_1_><!-- options: { (1|yes) (0|no) } -->
<Emergency_Number_1_ ua="rw">000</Emergency_Number_1_>

Dial Plan explanation:

Dial Plan Description/Comments
<#0:><:@gw0> Dialing #0 - results in getting native PSTN line dial tone, but only if you have configured PSTN Line/VoIP-To-PSTN Gateway Set/Line 1 VoIP Caller DP" to "None" as per note below.
1[2-9]xxx.<:@gw0> Send all the 1800, 1300, 1900 and various variations to PSTN line (FXS), as these are all free calls and not point is doing then via VoIP. It is simplest just to let all 1xxx numbers through to keeper, if the number is invalid then the PSTN dial will simply fail and that is easier than trying to configure for all know cases.
001161[2-9]xxxxxxxxS0<:@gw0> Allows for Australian calls using full international the international dialling (ie prefix is "0011" and "61" is Australian international code). As there is no VoIP cost savings call is sent to PSTN line (gw0).
0[2-9]xxxxxxxxS0<:@gw0> Here we handle typical Australian STD call where the number is of form 03 FNN (Victoria), 02 FNN (NSW) etc. As per above just use PSTN for these calls
9xxxxxxxS0<:@gw0> This is an Australian Local Call, which begins with a 9, people might also find that some CBD area have 8 as perfix... (the 8 case is not handled via Dial Plan, instead just have callers use full STD number or change to [8-9]).
<0011:>xxx.<:@gw2>

Here we have Australian international call (prefix "0011"), which is stripped off and the international number is send to GW2. Gateway 2 is configured as the VoIP SIP provider (see "Gateway Accounts" configuration example above which has "Gateway_2_1_" configured as VoIP international call gateway.

See "Line 1" Gateway Accounts below for more details explanation of Gateway configuration.

61xxxS0 These abbreviated dailing codes go through to the internal SIP server, which provides the organisations internal PBX. As this is a SIP server this can result in calls being redirected all over the world via VoIP. This works by using a convention of all internally allocated VoIP numbers having "61' followed by either 3 or 4 digits (below case).
61xxxxS0

As above this is for internal VoIP calls which go to the organisations SIP Server and means you can call your workers using VoIP.

Note: these calls may in turn end up on old fashioned Telephone handset via additional ATAs or dedicated VoIP handset or softphone.

NOTE: The "Line 1" Dial Plan is not en-acted transparently, the configuration of the "PSTN Line/VoIP-To-PSTN Gateway Setup/Line 1 VoIP Caller DP" will impact how "Line 1" behaves. This is an example of how the various configuration items, have subtle cross-depenencies which can make for unexpected and difficult to debug behaviors. To ensure that the Dail Plan configuration behaves transparently, this should be set to "None":

<!-- 'tab' : 'PSTN Line' (_2_) -->
<Line_Enable_2_ ua="rw">yes</Line_Enable_2_><!-- options: { (1|yes) (0|no) } -->
...
<!-- 'group' : 'VoIP-To-PSTN Gateway Setup' (_2_) -->
...
<Line_1_VoIP_Caller_DP_2_ ua="rw">none</Line_1_VoIP_Caller_DP_2_><!-- options: { (none|none) (1|1) (2|2) (3|3) (4|4) (5|5) (6|6) (7|7) (8|8) } -->

Whirlpool Discussion Thread: Linksys spa3201 gateway (gw1-4)
"Line 1" Gateway Accounts

From the above example here is the Line 1 Gateway Account configuration:

<!-- 'tab' : 'Line 1' (_1_) -->
<Line_Enable_1_ ua="rw">yes</Line_Enable_1_><!-- options: { (1|yes) (0|no) } -->

...
<!-- 'group' : 'Gateway Accounts' (_1_) -->
...
<Gateway_2_1_ ua="rw">ID@xx.xx.xx.xx</Gateway_2_1_>
<GW2_NAT_Mapping_Enable_1_ ua="rw">no</GW2_NAT_Mapping_Enable_1_><!-- options: { (1|yes) (0|no) } -->
<GW2_Auth_ID_1_ ua="rw">ID</GW2_Auth_ID_1_>
<GW2_Password_1_ ua="rw">*************</GW2_Password_1_>
...

GW2 is configured using an IP address rather than name, as I found that DNS resolution failed when I had GW2 configured using name. Use "nslookup" or "dig" to manually get IP addres. This results in a fragile configuration, as IP addresses might change.

Only machines configured via "Proxy and Registration" configuration can use SRV based DNS lookup to do SIP server discovery. The implication of this is that none of the gateway account machines will gain benefit of server failover support provided via SRV configuration or support for load balancing via DNS "Round Robin" configuration.

If you are using DNS machines names for gateways then the "401 Unuthourized" & "407 Proxy Authentication Required" responses WWW-Authenticate will include the host name in the "realm". This appeared to cause problems with opensips SIP server, as authentication of user when machine was included always appears to fail (i.e. joe@domain.com.au was OK, but joe@host.domain.com.au FAILS) which results in an INVITE/407 Proxy Authentication Required loop to occur.

In my example configuration (Line 1 Australian Dial Plan above), only international calls are diverted to the VoIP provider. The reason I am using GW2 is that the "Line 1" SIP Registration is configured to register with an internal SIP server. This allows call to be diverted to internal SIP based PBX (using internal abbreviated dialing VoIP numbers) and for PSTN calls received to be redirected to this ID (see later notes on redirecting PSTN call to SIP provider).

NOTE: For this to work, your SIP provider must allow you to make calls without doing a "SIP Register". You should check and test with you particular VoIP provider.

Whirlpool Discussion Thread: Linksys spa3201 gateway (gw1-4)
Using SPA as VoIP-To-PSTN Gateway.

To confgure the SPA so it can be used as a Gateway to the PSTN you need to configure the "PSTN Line" to act as a listening SIP Server. You can then either access this directly via a SIP client or have your internal SIP server re-direct calls that need to go to the SPA so it can in turn dial out to the PSTN via the FXO line.

In my configuration I have confgured "Line 1" to register with internal SIP Server, which acts as organisational VoIP PABX, and as this is configured to use Port 5060 and takes the inbound PSTN calls which are redirected as incoming VoIP calls... So to avoid conflict, PSTN Line SIP Server is configured on Port 5061.

This configuration gets quite complicated to allow for the various call scenarios... Here is sample configure:

<!-- 'tab' : 'PSTN Line' (_2_) -->
<Line_Enable_2_ ua="rw">yes</Line_Enable_2_><!-- options: { (1|yes) (0|no) } -->
...
<!-- 'group' : 'SIP Settings' (_2_) -->
<SIP_Transport_2_ ua="rw">UDP</SIP_Transport_2_><!-- options: { (UDP|UDP) (TCP|TCP) (TLS|TLS) } -->
<SIP_Port_2_ ua="rw">5061</SIP_Port_2_>
...
<!-- 'group' : 'Proxy and Registration' (_2_) -->
<Proxy_2_ ua="rw">Internal-SIP-PABX</Proxy_2_>
<Outbound_Proxy_2_ ua="rw"></Outbound_Proxy_2_>
<Use_Outbound_Proxy_2_ ua="rw">no</Use_Outbound_Proxy_2_><!-- options: { (1|yes) (0|no) } -->
<Use_OB_Proxy_In_Dialog_2_ ua="rw">no</Use_OB_Proxy_In_Dialog_2_><!-- options: { (1|yes) (0|no) } -->
<Register_2_ ua="rw">no</Register_2_><!-- options: { (1|yes) (0|no) } -->
<Make_Call_Without_Reg_2_ ua="rw">yes</Make_Call_Without_Reg_2_><!-- options: { (1|yes) (0|no) } -->
<Register_Expires_2_ ua="rw">3600</Register_Expires_2_>
<Ans_Call_Without_Reg_2_ ua="rw">yes</Ans_Call_Without_Reg_2_><!-- options: { (1|yes) (0|no) } -->
<Use_DNS_SRV_2_ ua="rw">yes</Use_DNS_SRV_2_><!-- options: { (1|yes) (0|no) } -->
<DNS_SRV_Auto_Prefix_2_ ua="rw">yes</DNS_SRV_Auto_Prefix_2_><!-- options: { (1|yes) (0|no) } -->
<Proxy_Fallback_Intvl_2_ ua="rw">3600</Proxy_Fallback_Intvl_2_>
<Proxy_Redundancy_Method_2_ ua="rw">Normal</Proxy_Redundancy_Method_2_><!-- options: { (Normal|Normal) (Based on SRV Port|Based on SRV Port) } -->
<!-- 'group' : 'Subscriber Information' (_2_) -->
<Display_Name_2_ ua="rw">SPA3102 (pots-gw/pstn)</Display_Name_2_>
<User_ID_2_ ua="rw">PABX-Dialing-ID</User_ID_2_>
<Password_2_ ua="rw">*************</Password_2_>
....
<!-- 'group' : 'Dial Plans' (_2_) -->
<Dial_Plan_1_2_ ua="rw">(xx.)</Dial_Plan_1_2_>
<Dial_Plan_2_2_ ua="rw">(<+61:0>xx.|<61:0>xx.|0[2-9]xxxxxxxx|9xxxxxxx|1[0-9]xx.|000)</Dial_Plan_2_2_>
<Dial_Plan_3_2_ ua="rw">([#*x].!)</Dial_Plan_3_2_>
<Dial_Plan_4_2_ ua="rw">(xx.<:@gw0>)</Dial_Plan_4_2_>
<Dial_Plan_5_2_ ua="rw">(xx.)</Dial_Plan_5_2_>
<Dial_Plan_6_2_ ua="rw">(xx.)</Dial_Plan_6_2_>
<Dial_Plan_7_2_ ua="rw">(xx.)</Dial_Plan_7_2_>
<Dial_Plan_8_2_ ua="rw">(S0<:VoIP-PABX-Number>)</Dial_Plan_8_2_>
<!-- 'group' : 'VoIP-To-PSTN Gateway Setup' (_2_) -->
<VoIP-To-PSTN_Gateway_Enable_2_ ua="rw">yes</VoIP-To-PSTN_Gateway_Enable_2_><!-- options: { (1|yes) (0|no) } -->
<VoIP_Caller_Auth_Method_2_ ua="rw">HTTP Digest</VoIP_Caller_Auth_Method_2_><!-- options: { (none|none) (PIN|PIN) (HTTP Digest|HTTP Digest) } -->
<VoIP_PIN_Max_Retry_2_ ua="rw">3</VoIP_PIN_Max_Retry_2_>
<One_Stage_Dialing_2_ ua="rw">yes</One_Stage_Dialing_2_><!-- options: { (1|yes) (0|no) } -->
<Line_1_VoIP_Caller_DP_2_ ua="rw">none</Line_1_VoIP_Caller_DP_2_><!-- options: { (none|none) (1|1) (2|2) (3|3) (4|4) (5|5) (6|6) (7|7) (8|8) } -->
<VoIP_Caller_Default_DP_2_ ua="rw">3</VoIP_Caller_Default_DP_2_><!-- options: { (none|none) (1|1) (2|2) (3|3) (4|4) (5|5) (6|6) (7|7) (8|8) } -->
<Line_1_Fallback_DP_2_ ua="rw">4</Line_1_Fallback_DP_2_><!-- options: { (none|none) (1|1) (2|2) (3|3) (4|4) (5|5) (6|6) (7|7) (8|8) } -->
...
<!-- 'group' : 'VoIP Users and Passwords (HTTP Authentication)' (_2_) -->
<VoIP_User_1_Auth_ID_2_ ua="rw">SPALoginID</VoIP_User_1_Auth_ID_2_>
<VoIP_User_1_DP_2_ ua="rw">2</VoIP_User_1_DP_2_><!-- options: { (none|none) (1|1) (2|2) (3|3) (4|4) (5|5) (6|6) (7|7) (8|8) } -->
<VoIP_User_1_Password_2_ ua="rw">*************</VoIP_User_1_Password_2_>
...

...
<!-- 'group' : 'PSTN-To-VoIP Gateway Setup' (_2_) -->
<PSTN-To-VoIP_Gateway_Enable_2_ ua="rw">yes</PSTN-To-VoIP_Gateway_Enable_2_><!-- options: { (1|yes) (0|no) } -->
<PSTN_Caller_Auth_Method_2_ ua="rw">none</PSTN_Caller_Auth_Method_2_><!-- options: { (none|none) (PIN|PIN) } -->
<PSTN_Ring_Thru_Line_1_2_ ua="rw">yes</PSTN_Ring_Thru_Line_1_2_><!-- options: { (1|yes) (0|no) } -->
<PSTN_PIN_Max_Retry_2_ ua="rw">3</PSTN_PIN_Max_Retry_2_>
<PSTN_CID_For_VoIP_CID_2_ ua="rw">no</PSTN_CID_For_VoIP_CID_2_><!-- options: { (1|yes) (0|no) } -->
<PSTN_CID_Number_Prefix_2_ ua="rw"></PSTN_CID_Number_Prefix_2_>
<PSTN_Caller_Default_DP_2_ ua="rw">8</PSTN_Caller_Default_DP_2_><!-- options: { (1|1) (2|2) (3|3) (4|4) (5|5) (6|6) (7|7) (8|8) } -->

Explanation to follow....

 

 

Once you have a working configuration, you can extract this from the device as XML using this "SPA Configuration Extraction and Conversion Web-tility"

All materials (C) Copyright Dokmai Pty Ltd, unless otherwise noted.


Send any questions or comments regarding this site to info at graphica.com.au
Last Updated: Wednesday 6th July, 2011.