Blog

Adding IP phones to my rack (Part 1)

In this first installment of my IP telephony project, I detail the process of setting up a private PBX system using Asterisk on a Raspberry Pi Zero 2W. I walk through the configuration of SIP extensions and the integration of a Cisco SPA942 IP phone into my home network, highlighting the challenges of hardware compatibility and cable management. While the initial setup successfully enabled internal calling, a hardware failure with my PoE adapter serves as a reminder of the trials inherent in DIY homelab projects.

9 min read 255 views Leer en español

Adding IP phones to my rack (Part 1)

More Gadgets for the Rack: IP Telephony (Part 1)

Follow a non-expert in IP telephony as he explores the world of PBX systems and physical IP phones, including Asterisk configuration and Zoiper integration.

I got familiar with the world of PBX systems a while ago. I originally compiled Asterisk on my server, "The Beast," toward the end of 2024, but I never actually used it. Then, in 2025, after buying a Raspberry Pi Zero 2W, I tried Asterisk on it: it worked, but only halfway (plot twist: I had a bad network configuration).

Zoiper demo
Figure 1: Zoiper demo

Back then, I mostly used it to play with my four-year-old nephew from my iPhone while he used my mother's iPad. We would only dial 103, 104, and so on, to listen to his voice or let him listen to mine, but there was not much more to it.

Minecraft servers
Figure 2: Minecraft servers

At the time, I was selling Minecraft hosting, and, as any good businessman would, I had to get something out of it for myself too, right? So I set up a Bedrock server because I played on Windows while he played on an iPad, meaning we could not use the Java version. So there I was, playing with my nephew in the world I had created for him.

Bedrock vs. Java
Figure 3: Bedrock vs. Java

I know this is a screenshot taken in an idle state and that comparing them this way is not entirely relevant, but this single image lets us see the difference between Java and Bedrock as server clients, as well as the difference between Java and C++. We all know that Minecraft Java has a legendary and unmatched legacy, but I would bet that its performance and code are garbage. I cannot vouch for Bedrock, but the fact that it is developed in C++ rather than Java makes me think it is more efficient and faster, even if it does not have as many features as the Java version.

Now, back to today's topic: this time, I am going to describe in detail the process I followed to set up a PBX on my server and configure it for use with Zoiper, but this time without softphones. Instead, I will be using physical IP phones, which is what I am really interested in.

1. Project Components

  • Raspberry Pi Zero 2W (Asterisk PBX): a low-power, compact computer that I use to run Asterisk, an open-source IP telephony system. Asterisk can manage calls, voicemail, conferences, and other telephony features.
  • Cisco SPA942 (IP phone): connects to the network and allows calls to be made and received through Asterisk. It offers advanced features such as conferencing, call transfers, and support for multiple lines. I found it at a cheap price and thought, "Let's give it a shot." It is a mid-range phone with good audio quality and support for standard VoIP protocols.
  • Cisco 7911 (the dinosaur of IP telephony): older than the SPA942, but still functional. It offers basic IP telephony features. When I bought it, I did not know whether it actually used SIP because of the whole Skinny Client Control Protocol (SCCP) situation. Physically, I think it looks quite nice, to be honest.
  • PoE (Power over Ethernet) adapters: allow the IP phones to be powered through the network cable, eliminating the need for a separate power adapter. They simplify the installation and reduce cable clutter. (I still do not have the phone cables or a PoE switch, so for now the adapters are enough. Later on, I would like to add a secondary PoE switch dedicated to a network of more phones and interesting gadgets.)
  • Huawei WiFi AX2 (my home router): the main provider of DHCP and the local network. It assigns an IP address to both the Raspberry Pi and the IP phones, while also giving me internet access. It is a WiFi 6 router with support for multiple devices and high connection speeds.

I have all port forwarding blocked on the router, so I cannot access my PBX from outside my local network. That is not a problem for me since I only want to use it inside my home. This helps me avoid vulnerabilities and possible external attacks, keeping my IP telephony system secure and private.

2. User Plan

For this telephony system, I wanted to keep things simple because I do not need many extensions or users. My idea is to have only five users: my family members (who may not even use it) and me, as the administrator and primary user of the PBX. The users are:

NameUsernameID
Marcos Reyesmarcos16031603
T\\\ A\\\t\\\0\\\0\\\*
C\\\ R\\\c\\\0\\\0\\\*

I prefer not to share my family members' full names for privacy reasons, but I have no problem explaining how this configuration works.

Extension Configuration

Each family member is assigned an extension based on their name and date of birth, following this format:

first name (lowercase) + date of birth (MMDD)

For example, my extension is marcos1603 because my name is Marcos and I was born on March 16, 2003. The same format is used for the other family members, ensuring that each extension is unique and easy to remember.

Since Chile uses the DD/MM/YYYY date format, my nephew's extension, given that he was born on \ / \ / \*, would be t***0*** (name + \\ + \\).

The first thing I did was create the extensions by modifying Asterisk's configuration file, specifically /etc/asterisk/pjsip.conf, where the extensions and their credentials are defined. Each extension has a username, a password, and an associated extension number.

; ============================================================
; JOHN DOE SWITCHBOARD
; PJSIP CONFIGURATION
; ============================================================

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060


; ============================================================
; JOHN DOE
; Extension: 3004
; SIP user: john3004
; ============================================================

[john3004]
type=endpoint
context=familia-john-doe
disallow=all
allow=ulaw,alaw
auth=john3004-auth
aors=john3004
callerid="John Doe" <3004>
identify_by=auth_username,username

[john3004-auth]
type=auth
auth_type=userpass
username=john3004
password=JohnDoe.

[john3004]
type=aor
max_contacts=1
remove_existing=yes

I repeated this for each extension, changing the usernames, passwords, and extension numbers as needed. I also configured the familia-john-doe context in /etc/asterisk/extensions.conf, where I defined the dialing rules and the features available to each extension.

[general]
static=yes
writeprotect=no
clearglobalvars=no

[globals]


; ============================================================
; JOHN DOE FAMILY
; ============================================================

[familia-john-doe]

exten => 0722,1,Dial(PJSIP/john0722,30)
 same => n,Hangup()

exten => 1119,1,Dial(PJSIP/john1119,30)
 same => n,Hangup()

exten => 0527,1,Dial(PJSIP/john0527,30)
 same => n,Hangup()

exten => 0935,1,Dial(PJSIP/john0935,30)
 same => n,Hangup()

exten => 1603,1,Dial(PJSIP/marcos1603,30)
 same => n,Hangup()

Of course, the difference is that I replaced "John Doe" and those details with my family's real information, but I will not include it here for privacy reasons.

3. The Hardware

Mystery box
Figure 4: Mystery box

Everything arrived while I was working, so you can imagine how curious I was. As soon as I got home, I started opening the mystery box. Inside, I found the first IP phone, the Cisco SPA942. Another package contained the PoE adapters, which are necessary to power the phones through the network cable.

Cisco SPA942
Figure 5: Cisco SPA942
PoE adapters
Figure 6: PoE adapters

As I mentioned, these are second-hand items, but they are in good condition and, best of all, they work perfectly. The next step was to connect the IP phone to the network and configure it to connect to the Asterisk PBX on the Raspberry Pi Zero 2W. To do this, I connected the phone to the PoE adapter and then to the network switch, making sure it received a valid IP address from the Huawei WiFi AX2 router.

Temporary connection
Figure 7: Temporary connection

This setup is improvised because I still need to create a new connection on my patch panel to connect the IP phone in a more permanent and organized way. For now, the temporary connection lets me test the telephony system and make sure everything is configured correctly before making changes to the network infrastructure.

Those who saw the photo of the temporary connection probably noticed that there is a yellow cable and a blue one. The thing is, at that point I did not have two CAT-6 cables, so I used a CAT-5e cable and a CAT-6 cable together. This caused some problems; I will tell you about them now.

4. Connecting to the SIP Server and Problems

SIP server
Figure 8: SIP server

Thanks to the mighty Chappie, the mighty ChatGPT, I was able to configure the IP phone correctly so that it could connect to the SIP server. Without its help, I probably would have spent hours trying to understand the error messages and the required configuration parameters.

But before that, there was a problem...

Network loop in the temporary connection
Figure 9: Network loop in the temporary connection

The phone got stuck as shown in the image, displaying the message Initializing network..., and would not go any further. This indicated that there was a problem with the network connection caused by mixing CAT-5e and CAT-6 cables. I did not know that at the time, so I started looking for cables around the house, but nope, I could not find two CAT-6 cables. That is how bad the economy is, haha.

In the end, I used two CAT-5e cables and the phone was finally able to initialize the network correctly, avoiding the network loop that had formed earlier.

The Huawei WiFi AX2 router successfully provided DHCP, assigning a valid IP address to the IP phone and allowing it to connect to the SIP server without any problems.

Working network
Figure 10: Working network

As you can see, the little yellow cable from the switch is negotiating at 100 Mbps, which is enough for IP phone communication and ensures a stable connection to the SIP server.

This made two things clear to me:

  • Get a PoE (Power over Ethernet) switch to power the IP phones directly from the switch, avoiding the need for additional power adapters.
  • Make sure I have cables from the same category (preferably CAT-6) to avoid connection problems and network loops.

I even connected the adapter to my CAT-6 wall jack (I did not take any pictures), and it was even worse. That confirmed, the hard way, that cable categories should never be mixed.

The phone
Figure 11: The phone

With the adapter connected and all that, I simply entered the phone's IP address in a web browser to access its configuration interface and check that everything was working correctly.

Admin Login → Advanced → Ext 1

I entered the extension details configured on the SIP server, including the extension number, username, and corresponding password. After saving the changes, the IP phone registered correctly with the SIP server, and I was able to make and receive calls without any problems.

SIP Settings → NAT Settings / Proxy

Enter the IP address and port, press Submit, and the phone will restart. That is it.

Working perfectly.

The phone
Figure 12: The phone

Everything seemed to be working correctly, and I could finally enjoy a fully operational IP phone on my home network.

But here comes the plot twist of this post:

The adapter...

Explosion
Figure 13: Explosion

Well, damn, the adapter burned out. Luckily, I bought two, but I am not going to risk using the other one until the Cisco 7911 arrives, which, apparently, should be tomorrow.

That is why I decided to split this post into two parts. The first part covers the configuration and operation of the IP phone, while the second part will cover the arrival of the Cisco 7911 and how to deal with the burned-out adapter.

Stay tuned for Part 2!

To be continued
Figure 14: To be continued

Post images

Image 1 Image 2 Image 3 Image 4 Image 5 Image 6 Image 7 Image 8 Image 9 Image 10 Image 11 Image 12 Image 13 Image 14
Share X LinkedIn Facebook
← All posts