2019 Routing, Linux & First VoIP · intermediate
My First Asterisk Lab Was Mostly a Networking Lab
Two softphones and one Asterisk server were enough to show that a phone call is really several network problems stacked together: registration, signaling, media and NAT.
My first useful Asterisk setup was not ambitious. I wanted two softphones to register to one server and call each other. That sounded like a telephony exercise, but most of the initial failures were still ordinary networking problems: wrong addresses, a service bound to the wrong interface, a firewall rule, or one endpoint trying to reach an address that only made sense from another part of the network.
The setup had one Linux machine running Asterisk and two clients on the same lab network. Each client had an extension and credentials. Before attempting a call, I checked whether the Asterisk process was listening on the expected SIP port and whether the clients could reach the server IP. Only then did I look at registration state from the PBX side. Seeing an endpoint registered was the first proof that the signaling path and credentials were at least partly correct.
The next surprise was that a successful registration did not mean a call would have working audio. SIP signaling and RTP media are separate flows. The INVITE can reach the PBX, the remote phone can ring, and the call can answer while RTP is missing in one or both directions. That was my first real encounter with the difference between control traffic and media traffic in a communications system.
A packet capture made the layers visible. The SIP messages were text and easy to follow: REGISTER, responses, INVITE, provisional responses, a final success response and ACK. The media packets were a separate UDP stream with a different purpose and often different ports. Once I saw that separation, 'the call works but there is no audio' stopped being contradictory. The signaling session can succeed while the media path is broken.
NAT immediately made the lab more interesting when one endpoint moved behind another router. A SIP message can contain addresses and ports describing where the endpoint expects media, while the IP packet carrying that SIP message has its own source address. If those views disagree because of NAT, the PBX or peer can be told to send RTP somewhere unreachable. I did not fully understand every SIP NAT option yet, but I could see why VoIP had a reputation for being sensitive to network topology.
Asterisk logs and the CLI were useful, but I tried not to let the PBX become the only source of truth. If a phone said registration failed, I wanted to know whether the REGISTER reached the server. If Asterisk sent a response, I wanted to know whether the response left the correct interface and reached the client. That kept the troubleshooting process tied to observable traffic instead of only application messages.
The small lab changed the direction of my networking study. Routing, NAT, DNS, UDP and packet capture were suddenly part of something interactive: a phone call. The PBX was not replacing networking knowledge. It was forcing several pieces of it to work at the same time.