This article describes how I successfully configured the Sipura SPA-3000 (fw 2.0.13) for use as a single line inbound/outbound trunk within Asterisk at Home (asterisk 1.2.1). Unlike the other examples I found, this configuration is fairly simple and does NOT require configuration of special extensions, etc. This configuration should be fairly secure, but any suggestions and/or feedback are very welcome!
When incoming calls are received by the SPA-3000, they are forwarded to the Asterisk PBX with CALLER ID information and can be routed like any other POTS trunk (ie: as per Incoming Calls config and/or Inbound Routing config by CID). When outgoing calls are placed through the SPA-3000, this device dials the number and connects the call. The person making the call WILL hear the DTMF tones (aka touch tones) that are dialed by the SPA-3000 just before the call is connected. I have not been able to find a way of preventing this (yet).
Configuring Trunk within Asterisk PBX using AMP
Login to AMP (Asterisk Management Portal). Navigate to Setup, Trunks, and choose “Add SIP Trunk”.
Outbound Caller ID: (leave blank - cannot be used by POTS line) Maximum Channels: 1 (required - see note below)
NOTE: Each SPA-3000 supports a single channel. You need to setup multiple trunks for multiple SPA-3000 devices.
Outgoing Dial Rules
Dial Rules: 1+NXXNXXXXXX ; prefix 10 digit dialing with "1" 1NXXNXXXXXX ; allow all 11 digit dialing as-is NXXXXXX ; allow all 7 digit dialing as-is
Trunk Name: pstn_spa01 Peer Details: auth=md5 context=from-pstn dtmfmode=inband fromuser=asterisk host=10.10.10.21 ; IP address of SPA device insecure=very nat=yes ; omit if no NAT exists between PBX and SPA port=5061 secret=012345678901 type=peer username=asterisk
User Context: spa01 User Details: allow=ulaw context=from-pstn disallow=all dtmfmode=inband host=10.10.10.21 ; IP address of SPA device insecure=very nat=yes ; omit if no NAT exists between PBX and SPA secret=KzBTALezmG1a type=friend
Register String: ; omit - not necessary to register w/ SPA device?
Configuring Outbound Routing within Asterisk PBX using AMP
Login to AMP (Asterisk Management Portal). Navigate to Setup, Outbound Routing, and choose “Add Route”.
Route Name: ; user preference, avoid special characters here? pstnspa1 Dial Patterns: ; dial 5 plus 11 digit, 10 digit, and 7 digit numbers ; omit each "5|" to use trunk without dialing prefix 5|1NXXNXXXXXX ; accept 5 + 11 digit dialing 5|NXXNXXXXXX ; accept 5 + 10 digit dialing 5|NXXXXXX ; accept 5 + 7 digit dialing Trunk Sequence: ; add each available SPA-3000 trunk SIP/pstn_spa01 SIP/pstn_spa02 SIP/pstn_spa03
Configuring the Sipura SPA-3000
The following example only illustrates changes to default settings. Start by performing a factory reset of your SPA-3000. Connect a handset to the PHONE jack on the SPA-3000 and dial “****” to access the configuration menu, then dial “73738#” (aka “RESET#”) to perform a factory reset.
Login to the web interface of your SPA-3000, click “Admin”, then click “Advanced”. Configuration changes for each tab/page are shown below.
USER PASSWORD: secretpwd ; secures the SPA web interface ; username 'user' or 'admin'? DHCP: no ; recommend static ip address STATIC IP: 10.10.10.21 NETMASK: 255.255.255.240 GATEWAY: 10.10.10.30 HOSTNAME: voip-spa1 ; optional DOMAIN: example.net ; optional PRIMARY DNS: 10.10.10.2 ; optional SECONDARY DNS: 10.10.10.3 ; optional PRI NTP: ntp1.example.net ; optional SEC NTP: ntp2.example.net ; optional
RTP Packet Size: 0.020 ; improves sound quality (was 0.030)?
TIME ZONE: GMT-05:00 ; Central Time Zone
NAT Mapping Enable: yes ; only change if NAT exists between PBX and SPA NAT Keep Alive Enable: yes ; only change if NAT exists between PBX and SPA PROXY: 10.10.10.24 ; IP address of Asterisk PBX USE OUTBOUND PROXY: yes REGISTER: no REGISTER EXPIRES: 3600 MAKE CALL W/O REG: yes ANSW CALL W/O REG: yes DISPLAY NAME: ; leave blank USER ID: 3501 ; optional? PASSWORD: ; leave blank DTMF Process INFO: Yes ; default value DTMF Process AVT: No ; resolve issues with DTMF DTMF Tx Method: Auto ; default value DIAL PLAN 8: (S0<:email@example.com:5060>) ; forwards incoming PSTN calls to PBX ; resolve issues with DTMF VOIP-TO-PSTN GW ENABLE: yes VOIP CALL AUTH METHOD: http digest ONE STAGE DIALING: yes LINE1 VOIP CALLER DP: none VOIP CALLER DEFAULT DP: none LINE1 FALLBACK DP: none VOIP USER 1 AUTH ID: asterisk VOIP USER 1 DP: none VOIP USER 1 PASSWORD: 012345678901 PSTN-TO-VOIP GW ENABLE: yes PSTN CALL AUTH METHOD: none PSTN RING THRU LINE 1: no ; incoming calls do not ring LINE1 PSTN CID FOR VOIP CID: yes PSTN CALLER DEFAULT DP: 8 PSTN ANSWER DELAY: 5 ; answer incoming PSTN call in X sec ; need to allow time for CALLER ID ; if no CID, you can safely set to 0 ; was set to 16
Note regarding FAX transmissions
We have not been able to successfully receive fax transmissions using this configuration, but not for lack of trying. We were also attempting to use a Digium TDM card to accept faxes for a while, with mixed results. We finally concluded that faxing capabilities of Asterisk were not reliable enough for production. Rather than moving to an Asterisk Fax solution, we moved from our older *NIX fax server to an online fax provider who accepts our faxes and forwards them as PDF images.
2006/10/15 – Jason Klein