SIP over TLS and SRTP: How to Secure VoIP Signaling and Media
To secure a VoIP call you need two layers: SIP over TLS to encrypt the signaling, and SRTP to encrypt the audio. Using only one leaves the other exposed. Signaling reveals who is calling whom, and credentials; media reveals what was said.
What Each Layer Protects
| Layer | Protocol | Protects |
|---|---|---|
| Signaling | SIP over TLS (SIPS, typically TCP 5061) | Caller and callee identity, headers, authentication, key exchange |
| Media | SRTP (or DTLS-SRTP for WebRTC) | The audio payload itself |
Without TLS, SRTP keys sent in SDP are visible to anyone who can read the signaling. Pair them. Background on SRTP is in RTP and SRTP voice encryption.
Setting It Up
1. Certificates. Use a certificate from a trusted CA for the public name of your SIP service, and automate renewal. Expired certificates are the number one cause of outages in TLS SIP deployments.
2. Enable TLS listeners. On Kamailio, load the tls module and define a TLS socket; on FreeSWITCH, configure the Sofia profile with a TLS port and certificate chain.
3. Require TLS where possible. Accept plain UDP only from known peers that cannot do better, and prefer TLS for end-user devices.
4. Negotiate SRTP. Offer SRTP using SDES (keys in SDP, requires TLS) or DTLS-SRTP, and decide whether plain RTP is allowed as a fallback. Mandatory SRTP is stricter but breaks calls to peers that do not support it.
5. Set a minimum TLS version and disable weak ciphers.
Common Interop Problems
- Certificate name mismatch. The device validates the server name, so the certificate must match the hostname it dials.
- Incomplete chain. Missing intermediate certificates work in some clients and fail in others.
- SRTP offered but not accepted. Some carriers require plain RTP, so an SBC often bridges SRTP on one side to RTP on the other (see SBC architecture).
- Re-INVITE crypto changes causing audio to drop mid-call.
- NAT and TLS keep-alives. TCP connections time out in firewalls, so use persistent connections with keep-alives.
Performance
Encryption adds modest CPU cost. At high call volume, plan capacity and test (see SIP trunking load testing). Media encryption is usually the larger cost because it applies to every packet.
Compliance Context
Regulated sectors typically expect encryption in transit, plus access control and audit logging. See HIPAA-compliant VoIP requirements and financial services VoIP compliance. Encryption is necessary but not sufficient on its own.
Verification
- Capture traffic and confirm signaling is unreadable.
- Confirm RTP is replaced by SRTP and cannot be played back.
- Test certificate renewal before it matters.
- Broader hardening is covered in VoIP security best practices.
Rolling out encrypted voice across carriers and endpoints? Our Kamailio and SBC engineering team builds secure edges that translate between encrypted and legacy peers.
Related Services
Keep Reading
Discussion
0Join the conversation
Sign in with your preferred account to comment, reply, and keep the discussion useful for other engineers.
Takes a few seconds. No separate password required.
Controva LLC
Engineering Team
We build digital empires that scale. Specializing in high-performance web architecture, AI automation, and headless commerce.
Work with us