Asterisk, VoiceOne And Linksys SPA 3102
I have gotten the SPA 3102 to work with Asterisk using VoiceOne as the Asterisk configuration manager. The following are tested to be working correctly:
- PSTN calls to/from SIP phones connected to Asterisk via SPA 3102 .
- Using SPA 3102 as ATA to convert analog phone to SIP phone.
The description that follows assumes knowledge of accessing the web interfaces for both VoiceOne and SPA 3102. Only “advanced” and not “basic” settings should be used in configuring SPA 3102.
Also, only fields that are important to configuration are addressed here. Those fields not mentioned should retain their default values or are presumed meaningful enough that readers know what have be entered.
Here are the steps.
Outgoing Call Via SPA 3102
Configure SPA 3102:
Set up the static IP address for SPA 3102.
-
- Router->Wan Setup
- Connection Type: Static IP
- Static IP: IP Address for SPA 3102 according to your network plan. This address is needed by VoiceOne to configure a PSTN outgoing trunk via SPA 3102.
- Router->Wan Setup
Set up SPA 3102 to be able to make calls out to PSTN.
-
- Voice->PSTN Line
- Proxy and Registration->Make Call Without Reg:Yes. This means that a call can be made out to PSTN even when SPA 3102 is not registered as client to Asterisk.
- Dial Plans->Dial Plan 1: (xx.)
- VoIP-To-PSTN Gateway Setup->VoIP-To-PSTN Gateway Enable: Yes.
- VoIP-To-PSTN Gateway Setup->Line 1 VoIP Caller DP: 1. Link this to Dial Plan 1.
- Voice->PSTN Line
Configuration via VoiceOne:
This step is same as configuring a line to a VOIP provider. If SPA 3102 had provided such a VOIP provider interface, then this would be the only step needed to configure an outgoing/incoming PSTN trunk via SPA 3102.
However, as SPA 3102 does not offer such a VOIP provider interface, the result of doing this step is just to create an outgoing PSTN trunk via SPA 3102. Under Voiceone, this gives an identity to the outgoing trunk which can then be used under “Rules->Outgoing Rules”.
-
- Lines->Providers->New Voip provider
- Name: Sipura
- IPaddress: The IP address of SPA 3102 as set above.
- Port: 5061
- Technology: SIP
- Lines->Providers->Sipura->Add a new Account
- Name: SipuraOutgoing. This is the identity of the outgoing trunk.
- Port: 5061
- Username: sipura. This is dummy.
- Password: sipura. This is also dummy.
With the information entered, Asterisk repeatedly attempts to register with SPA 3102, with the latter not responding at all because it is not a VOIP provider. This is NOT important. As SPA 3102 has “Proxy and Registration->Make Call Without Reg” set to “Yes”, it is already ready to receive outgoing calls to PSTN.
- Lines->Providers->New Voip provider
As said earlier, the purpose of this step is just to create an identity for the outgoing trunk to be used under VoiceOne.
The next step is to have outgoing rules to make use of “SipuraOutgoing” trunk. You can do this under “Rules->Outgoing Rules”. It is presumed here that that reader understands how to configure rules under Voiceone.
When properly configured, it should then be possible to have a SIP phone connected to Asterisk to make a call to PSTN via “SipuraOutgoing” trunk.
Incoming Call Via SPA 3102
To receive incoming calls and pass on to VoiceOne/Asterisk, it is necessary to configure SPA 3102 as a SIP extension to Asterisk. The extension used for SPA 3102 as described here is “3102”. When a PSTN call come in, extension 3102 receives the call and following the dial plan bridges the call to extension “spa3102”, an application under VoiceOne, for call processing.
Configure SPA 3102:
-
- Voice->PSTN Line
- Proxy and Registration->Proxy: xxxxxxx. Enter the IP address of Asterisk.
- Proxy and Registration->Register: Yes. Register as SIP extension to Asterisk.
- Subscriber Information->Display Name: spa3102.
- Subscriber Information->User ID: 3102.
- Subscriber Information->Password: xxxxxx. As per defintion under VoiceOne.
- Dial Plans->Dial Plan 2: (S0<:spa3102). Bridge call to extension “spa3102” under VoiceOne.
- PSTN-To-VoIP Gateway Setup ->PSTN-To-VoIP Gateway Enable: Yes.
- PSTN-To-VoIP Gateway Setup->PSTN Caller Default DP: 2. Link this to Dial Plan 2.
- FXO Timer Values (sec) -> PSTN Answer Delay: x. Try values between 3 and 5. Small value may result in incorrect Caller ID detection and higher value means the call takes a longer time to get bridge to Asterisk. PSTN caller may have to wait too long.
- Voice->PSTN Line
Configuration via VoiceOne:
This step is to create an application to handle incoming calls from SPA 3102. To do that, a macro and application have to be created.
-
-
Applications->Macro->Add a new macro
-
Name: IncomingCall
-
Label: Incoming Call
-
Description: Pass control to selected incoming ruleset. This macro can be used to handle incoming calls from VOIP gateways like SPA 3102 and Dlink DVG 6004S.
-
Parameter: <param name=”context” type=”INCOMING_RULE” label=”Incoming Ruleset” description=”Ruleset to accept incoming call.” />
-
Code:
-
-
exten = s,1,NoOp(Incoming call ${ARG1})
exten = s,n,AGI(incoming.php,answered=s,rule=${ARG1})
-
-
Applications->Application->Add a new Application
-
Name: Sipura Incoming
-
Description: Incoming From PSTN to Linkys Spa 3102
-
Extension: spa3102
-
Execute the macro: Incoming Call
-
Incoming Ruleset: Choose whatever that you like.
-
-
-
This step is to create an extension for SPA 3102.
-
-
Extensions->New extension
-
Name: SipuraIncoming
-
Extension: 3102
-
Password: xxxxx. Enter what you like.
-
-
When properly configured, all calls coming from PSTN via SPA 3102 is then handled by the appropriate incoming ruleset.
Using SPA 3102 as ATA to convert analog phone to SIP phone
Configuration via VoiceOne:
Create an extension to represent the SIP phone.
-
-
Extensions->New extension
-
Name: User 12345. Enter whatever the user name.
-
Extension: 1007. Enter the extension for this user.
-
Password: xxxxx. Enter the password for the extension.
-
-
Configure SPA 3102:
The step here is to have “Line 1” fo SPA 3102 register as a SIP client to Asterisk.
-
-
Voice->Line1
-
Line Enable: Yes
-
Proxy and Registration->Proxy: xxxxxx. The IP address of Asterisk.
-
Proxy and Registration->Register: Yes.
-
Subscriber Information->Display Name: xxxx. Name of user of this phone.
-
Subscriber Information->User ID: 1007. As per defintion entered via VoiceOne.
-
Subscriber Information->Password: xxxxxx. As per defintion under VoiceOne.
-
-
The step here is to disable the analog phone from picking up calls from PSTN. As described earlier, all PSTN incoming calls are redirected to Asterisk.
-
-
Voice->PSTN Line
-
PSTN-To-VoIP Gateway Setup->PSTN Ring Thru Line 1: No.
-
-
Connect an analog phone to the “Phone” port of SPA 3102 and this phone becomes a SIP ready phone.
What Is Not Fully Tested
Passing of Caller ID from PSTN to SIP phones is not tested. Handling of incoming fax from PSTN is also not tested.
Conclusion
As more VOIP gateway products come into the market, it would be good if there is a consistent way of interfacing to these products. A neat way would be to have these products provide a consistent VOIP provider type of interface. If that happens, configuration of these products for Asterisk can be made a lot simpler.