Raspberry Pi VOIP with Cisco SPA3102

In this tutorial, we will setup a VOIP server using Raspberry Pi 4, Cisco Linksys SPA3102 and RasPBX.

Cisco SPA3102

Cisco Linksys SPA3102

Install RaspBX on Raspberry Pi 4 (4 GB Memory)

RaspBX Images

Setup the Voice Modem Gateway

The main important point here is the connection to the Raspberry Pi (IVR server). The Line port connected to the RJ-11 in the DSL/Cable Modem router. The Phone port connected to your analog phone and the Internet port connected to the DSL/Cable Modem router. Follow diagram shown below.

Cisco SPA3102 Setup

Cisco SPA3102 acts as a VoIP gateway between the PSTN line and network.

Once you have done the above step, connect a handset to phone plug and press **** to enter the configuration menu.

  • To get the IP address:
    dial 110# and note down the IP address
  • To enable Web Interface:
    dial 7932# followed by 1# and 1
  • To reset the admin’s password, press **** followed by 73738# and confirm with 1

For guideline, my SPA IP address is 192.168.0.13 and Raspberry Pi IP address is 192.168.0.114. Open the web browser and type the SPA IP address. Click Admin Login and advanced.

1. Router Tab

Status
  • Wan Setup
Wan Setup
  • Lan Setup
LAN Setup
  • Application
Application

2. Voice Tab

Info
  • System
System
  • SIP
SIP
  • Provisioning
Provisioning
  • Regional
Regional
  • Line 1
    SIP Settings
    > SIP Port: 5060
    Proxy and Registration > Proxy: {Raspberry_Pi_IP_Address}
    Subscriber Information >Display Name: Line1, User ID: line1, Password: {password_for_line1}, Use Auth ID: No
Line 1
  • PSTN Line
    SIP Settings
    > SIP Port: 5061
    Proxy and Registration >
    Proxy: {Raspberry_Pi_IP_Address}:5160
    Subscriber Information > User ID: pstn, Password: {password_for_pstn}, Use Auth ID: yes, Auth ID: pstn
PSTN Line
  • User 1
User 1
  • PSTN User
PSTN User

Setup the RasPBX

FreePBX Dashboard

Configure Trunks

Trunk 123

Trunk line1

For PEER Details:

disallow=all
type=friend
host=dynamic
context=from-pstn
username=line1
secret=secretpassword
mailbox=line1@internal
nat=force_rport,comedia
canreinvite=no
dtmfmode=rfc2833
qualify=yes
allow=g722&silk8&silk16&silk24&ulaw&alaw&gsm&h263
videosupport=yes

Inbound Routes

to-pstn

My PSTN Line

Outbound Routes

Install Soft Phone

Create new account and add the following:

  • Account Name: line1
  • SIP Server: {Raspberry_PI_IP_Address}: 5160
  • SIP User ID: line1
  • SIP Authentication: line1
  • Password: {password_for_line1}

When you make an outgoing call, just key in the phone number directly and no need extension 9.

In the next tutorial, we will going to discuss how to install OpenVPN and configure the router, so we can access VOIP server outside home.

Reference