Zum Inhalt springen
Technologie 7. November 2026 11 Mindestlesezeit

SIP TLS and SRTP: Encrypting a SIP Trunk

How to encrypt a SIP trunk: TLS for signalling on port 5061, SRTP for media, SDES vs DTLS-SRTP keying, certificates, and why calls fail once you switch it on.

D
7. November 2026

Kurze Antwort

To encrypt a SIP trunk you need two layers. TLS, by default on port 5061, protects the SIP signalling. SRTP protects the voice media, with confidentiality, authentication and replay protection. With SDES the SRTP key travels inside the SDP, so it must only ever cross TLS. With DTLS-SRTP the key is agreed on the media path. Both ends must offer the same mode and a matching crypto suite, or the call fails.

Most SIP trunks start life unencrypted: signalling on UDP port 5060 and audio as plain RTP. That works, and for a private, IP-restricted link between two known servers it is a common starting point. But when a trunk crosses the public internet, or when your policies ask for encryption in transit, you add TLS and SRTP. The change is small on paper and surprisingly easy to get wrong in practice, because two separate mechanisms have to agree, and a mismatch tends to show up as a call that will not connect, or connects with silence.

This guide is carrier-neutral. It explains what each layer protects, how SRTP keys are exchanged, which ports are involved, what to check on certificates, why calls fail when you turn encryption on, and how to confirm that encryption is really active. It is technical guidance, not legal advice or a guarantee of any compliance outcome.

What TLS protects and what SRTP protects

A SIP call has two halves. The signalling sets the call up: the INVITE, the responses, the headers that say who is calling, and the SDP body that describes which codecs and addresses the audio will use. The media is the audio itself, carried as RTP packets. They normally travel on different ports and sometimes on different paths, so each needs its own protection.

  • TLS protects signalling. It wraps the SIP messages in an encrypted, authenticated connection. RFC 3261 describes a call made to a SIPS URI as one that guarantees secure, encrypted transport (TLS) is used to carry all SIP messages from the caller to the domain of the callee; from there to the callee, the security mechanisms depend on that domain's policy (RFC 3261, section 4).
  • SRTP protects media. RFC 3711 describes SRTP as a profile of RTP that can provide confidentiality, message authentication and replay protection to the RTP traffic, and to RTCP, the control protocol that travels with it (RFC 3711, abstract). Its default cipher is AES in segmented integer counter mode, and the default message authentication is HMAC-SHA1 (RFC 3711, sections 5.1 and 5.2).
LayerWas es umfasstWhat it does not cover
TLS (signalling)SIP messages, headers, SDP body, credentials in transitThe RTP audio stream
SRTP (media)The audio packets and RTCP: confidentiality, authentication, replay protectionThe signalling, and the call metadata in it

Encrypting only one layer leaves the other open. A trunk with TLS and plain RTP hides who called whom but not what was said. A trunk with SRTP and plain UDP signalling hides the audio, but exposes the call details, and, as the next section explains, can expose the key itself.

Keying: SDES versus DTLS-SRTP

SRTP needs a secret key on both ends. There are two common ways to get it there.

SDES: the key travels in the SDP

SDP Security Descriptions (RFC 4568) define an SDP attribute, a=crypto, that carries the crypto suite and key. The RFC's own example uses the suites AES_CM_128_HMAC_SHA1_80 and AES_CM_128_HMAC_SHA1_32, each followed by an inline: field holding the base64 key and salt, a key lifetime of 2^20 packets and a master key identifier (MKI) with its length (RFC 4568, sections 4.5 and 6.1). A simplified offer looks like this:

m=audio 16384 RTP/SAVP 0 8
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:(base64 key and salt)

Because the key is in the SDP, the signalling carries a secret. RFC 4568 is direct about this: when an inline master key is present, the message carrying it needs to be encrypted, and without that the SRTP protection is useless in practically all circumstances (RFC 4568, section 8.3). In plain terms: SDES is only safe over TLS. If you enable SDES on a UDP or unencrypted TCP trunk, you have published the key to anyone who can read the signalling.

DTLS-SRTP: the key is agreed on the media path

DTLS-SRTP (RFC 5764) runs a DTLS handshake on the media path and feeds the resulting keying material into the SRTP stack. RFC 5764 states that the DTLS keying happens on the media path, independent of any out-of-band signalling channel (RFC 5764, abstract). The client offers SRTP protection profiles in a use_srtp extension and the server picks one (RFC 5764, section 4.1). How to signal DTLS-SRTP in SIP and SDP, and how to authenticate the endpoints with certificate fingerprints, is covered in a companion document, RFC 5763 (RFC 5764, section 3). RFC 5763 has each endpoint use the SDP setup attribute and a certificate fingerprint attribute (RFC 5763, section 5). WebRTC requires this mode: RFC 8827 says DTLS-SRTP must be offered for every media channel and that WebRTC implementations must not offer SDP security descriptions (SDES) or select them if offered (RFC 8827, section 6.5). Some SIP equipment supports DTLS-SRTP too.

FrageSDES (RFC 4568)DTLS-SRTP (RFC 5764)
Where is the key agreed?In the SDP, in the signallingIn a DTLS handshake on the media path
Depends on signalling security?Yes: TLS is required for it to mean anythingKeys do not travel in signalling
Where you typically meet itCarrier SIP trunks, IP phones, PBXsBrowser and WebRTC media (required by RFC 8827)
Signal in the SDPAn a=crypto lineA fingerprint and setup attribute instead of keys

Die praktische Regel: ask your carrier which keying method they support, and use that one. Do not assume the two are interchangeable; a carrier that offers only SDES will not complete a DTLS-SRTP offer.

Ports and transports

RFC 3261 sets the defaults for the Via header: 5060 for UDP, TCP and SCTP, and 5061 for TLS (RFC 3261, section 18.1.1). Three things follow.

  1. Port 5061 is a default. Carriers often publish their own TLS port. Use what they document.
  2. Port and transport are separate settings. Switching a trunk to port 5061 while leaving the transport on UDP does not give you TLS; it gives you a trunk that sends plain UDP to a port that expects a TLS handshake. Set both.
  3. The media ports are separate again. SRTP uses the same kind of UDP port range as RTP. Your firewall rules for the media range stay in place when you switch to SRTP; only the packet contents change.

Certificates, TLS versions and mutual TLS

TLS depends on certificates, and most TLS trouble is certificate trouble.

  • The server certificate must match the name you dial. RFC 3261 says that proxies, registrars and redirect servers should hold a site certificate whose subject matches their canonical hostname, and that every SIP element supporting TLS must have a way to validate the certificates it receives (RFC 3261, section 26.3.1). In practice: connect to the carrier by its hostname, not a bare IP, and check that the certificate names that host.
  • The chain must be complete and trusted. If the carrier uses a private certificate authority, you need that authority's certificate in your trust store. Turning off certificate verification makes the handshake pass but removes the protection, because you no longer know who you are talking to. Treat it as a short diagnostic step at most, never a final setting.
  • Dates matter. An expired certificate fails the handshake. Put the expiry date of every certificate in your calendar. A clock that is wrong on the server has the same effect.
  • Versions must overlap. Both ends must share a TLS version. Check which versions your carrier accepts; a device limited to an older version cannot connect to a server that no longer offers it.
  • Mutual TLS. RFC 3261 requires proxies and registrars to support both mutual and one-way TLS authentication, and notes that user agents may hold certificates of their own for mutual authentication (RFC 3261, section 26.3.1). In mutual TLS you present a client certificate and the carrier uses it to identify you. Ask which certificate authority signs yours, how long it lasts and how to renew it before it expires.

Common failures and how to read them

The TLS handshake fails

Symptoms: no SIP response at all, or a connection that opens and closes at once. Work through these in order:

  1. Can you reach the port at all? A plain TCP connection test to the TLS port tells you if a firewall is in the way.
  2. Is the transport set to TLS and not UDP or TCP?
  3. Does the hostname match the certificate, and is the chain trusted?
  4. Has the certificate expired, or is the system clock wrong?
  5. Do both sides share a TLS version?
  6. If mutual TLS is required, is your client certificate installed, signed by the right authority and still valid?

488 Not Acceptable Here after enabling SRTP

When a side cannot accept the offered media, it rejects the INVITE. RFC 3261 says a UAS rejecting an offer in an INVITE should return 488 (RFC 3261, section 13.3.1.3). That response code is how a media mismatch usually shows up. Capture the failed INVITE and compare:

  • The media profile. RTP/AVP is plain RTP. RTP/SAVP is secure RTP. If you offer SAVP to a carrier that only accepts AVP, or the reverse, expect a rejection.
  • The crypto suites. The suites in your a=crypto lines must overlap with the suites the other side supports.
  • Codecs. A 488 can also be a plain codec mismatch unrelated to encryption. See SIP 488 Not Acceptable Here: codec mismatch to separate the two.

A useful half-way setting exists on many systems: an optional SRTP mode that offers encrypted media but accepts plain RTP if the other side declines. It is good for a first test, and a poor final state if your policy requires encryption, because a silent fallback to plain RTP defeats the purpose. Move to required once the route is proven.

One-way audio or silence after the switch

The call connects, but one side hears nothing. Typical causes after turning on SRTP:

  • One side encrypts and the other sends plain RTP, so each discards the other's packets.
  • The two sides negotiated different keys or suites for each direction, and a media device in the middle rewrote one of them.
  • A device that previously inspected or anchored the RTP, such as a session border controller, cannot read encrypted media and stops relaying it.
  • A NAT or firewall rule applied to the old RTP behaviour no longer matches.

Unser one-way audio troubleshooting guide covers the NAT and media-path causes in order. A Session Border Controller is the usual place where TLS and SRTP are terminated and re-originated, so check its settings for each leg.

Re-keying and long calls

SRTP master keys have a lifetime counted in packets. With SDES, the crypto line can state it: the RFC 4568 example uses 2^20 packets, which at 50 packets a second (20 ms packets) is about 5.8 hours of one media stream. The field is optional; when it is left out, SRTP's defaults apply, which RFC 4568 lists as 2^48 SRTP packets for the AES_CM_128_HMAC_SHA1_80 suite (RFC 4568, sections 6.1 and 6.2). A stream that reaches a short lifetime needs a new key, and a device that handles that badly can drop audio mid-call. If calls fail only after a certain duration, check the lifetime in the crypto lines and include long calls in your test plan.

How to verify that encryption is really on

Silence reads as health, so prove it:

  1. Check the signalling. In a packet capture, a TLS trunk shows a TLS handshake and then encrypted application data; you should not be able to read the INVITE. If you can read SIP text on port 5060 or 5061, signalling is not encrypted.
  2. Check the SDP in the logs. Your platform's own SIP trace will show the decrypted SDP. Confirm the media line says RTP/SAVP and an a=crypto line was accepted in the answer.
  3. Check the media. In a capture, SRTP payloads look like random bytes. Plain RTP payloads can be decoded as audio by common analysis tools. If a tool can play the stream, it is not encrypted.
  4. Test fallback. With SRTP set to required, a call to a deliberately plain-RTP endpoint should fail, not succeed quietly.
  5. Repeat per route. Each carrier route, and each direction, can behave differently.

Where encryption ends

TLS and SRTP protect each SIP hop that supports them, between two defined endpoints. They do not make the whole path from caller to callee encrypted by themselves. When your carrier hands a call to the public telephone network, or to another network that uses plain RTP, the protection on your leg does not extend to the next one. Ask your carrier, in writing, which legs are encrypted, whether the inbound and outbound directions differ, and what happens when a downstream hop cannot do SRTP. Then document the answer, so your own privacy and security statements say only what is true.

Wie DialerBee passt

DialerBee's bring-your-own-carrier gateways accept SIP over UDP, TCP or TLS with SRTP media encryption, and offer IP ACL, digest authentication or TLS client certificates as authentication modes (see Nutzen Sie Ihren eigenen Anbieter). In the gateway form, TLS Version offers TLS 1.2 and TLS 1.3, and Verify TLS Cert is on by default. The Media tab has an SRTP Mode setting that defaults to Disabled, with Optional and Required, and the setup guide advises Required with TLS transport when encrypting media (see So verbinden Sie Ihren SIP Trunk (BYOC Einrichtung)). The setup guide also says to prefer TLS wherever the carrier supports it.

For recordings, encryption of the call in transit is one part of a wider picture that includes consent and retention; see the Leitfaden zur Compliance bei Anrufaufzeichnung. DialerBee offers compliance-supporting controls and does not provide legal advice.

Encryption checklist

  • Carrier confirms in writing: TLS port, TLS versions, keying method (SDES or DTLS-SRTP), crypto suites, authentication mode.
  • Transport set to TLS, port set to the carrier's TLS port.
  • Connect by hostname; certificate subject matches; chain trusted; verification left on.
  • Certificate expiry dates diary-noted for both server and client certificates.
  • SRTP on Optional for the first test call, then Required.
  • Captures reviewed: signalling unreadable, media not playable.
  • Failing test: required SRTP against a plain endpoint is rejected.
  • Long-call test to cover re-keying.
  • Firewall: TLS port and media range open; no rule still assumes plain RTP.
  • Carrier answer on downstream encryption recorded.

Häufig gestellte Fragen

Which port does SIP over TLS use?

RFC 3261 gives the default as 5061 for TLS, against 5060 for UDP, TCP and SCTP. These are defaults, not rules: a carrier can publish a different port, so use whatever your carrier documents. The port only selects the transport. It does not by itself encrypt the audio, which needs SRTP on top.

Is SIP TLS enough to encrypt my calls?

No. TLS protects the SIP signalling: who is calling whom, the headers, and the SDP that describes the media. The voice itself travels separately as RTP. Unless that media is also secured with SRTP, anyone who can capture the media path can still replay the conversation.

What is the difference between SDES and DTLS-SRTP?

Both set up SRTP keys. With SDES (RFC 4568) the key is written into the SDP as an a=crypto line, so the signalling must be encrypted or the key is exposed. With DTLS-SRTP (RFC 5764) the keys are agreed in a DTLS handshake on the media path itself, independent of the signalling channel. SDES is common on SIP trunks and IP phones, while WebRTC media in browsers must use DTLS-SRTP and must not offer SDES (RFC 8827, section 6.5).

Why did calls fail the moment I switched SRTP on?

The usual cause is that one side offers encrypted media and the other expects plain RTP, or the two sides share no crypto suite. The answering side may reject the call, often with 488 Not Acceptable Here. Read the SDP of the failed INVITE: the media line profile (RTP/AVP against RTP/SAVP) and any a=crypto lines show what each side offered.

Do I need a client certificate for a SIP trunk?

Only if the carrier asks for mutual TLS. In one-way TLS the carrier proves its identity to you. In mutual TLS you also present a certificate, so the carrier can identify you without relying on an IP address or password. Many trunks use IP allow-listing or digest authentication instead. Follow what your carrier agreed in writing.

Does encrypting my trunk encrypt the call all the way to the phone?

Not necessarily. TLS and SRTP protect each hop that supports them. If the carrier hands the call on to the public telephone network, or to a hop that uses plain RTP, the encryption stops there. Ask your carrier which legs are encrypted and in which direction.

Quellen

  1. RFC 3261, SIP: Session Initiation Protocol (sections 4, 13.3.1.3, 18.1.1, 26.3.1). rfc-editor.org/rfc/rfc3261 (abgerufen am 7. November 2026)
  2. RFC 3711, The Secure Real-time Transport Protocol (SRTP). rfc-editor.org/rfc/rfc3711 (abgerufen am 7. November 2026)
  3. RFC 4568, Session Description Protocol (SDP) Security Descriptions for Media Streams. rfc-editor.org/rfc/rfc4568 (abgerufen am 7. November 2026)
  4. RFC 5764, Datagram Transport Layer Security (DTLS) Extension to Establish Keys for SRTP. rfc-editor.org/rfc/rfc5764 (abgerufen am 7. November 2026)
  5. RFC 5763, Framework for Establishing a Secure Real-time Transport Protocol (SRTP) Security Context Using Datagram Transport Layer Security (DTLS) (section 5: setup and fingerprint attributes). rfc-editor.org/rfc/rfc5763 (abgerufen am 7. November 2026)
  6. RFC 8827, WebRTC Security Architecture (section 6.5: DTLS-SRTP must be offered; SDES must not be offered). rfc-editor.org/rfc/rfc8827 (abgerufen am 7. November 2026)

This article is technical guidance. DialerBee does not provide legal advice or guarantee regulatory compliance. Check encryption and security obligations that apply to you with qualified advisers.

Weiterführende Lektüre

Bereit, DialerBee in Aktion zu sehen?

Fordern Sie eine 15-minütige Live-Demo an oder starten Sie eine 14-tägige kostenlose Testphase – ohne Folien, ohne Verpflichtung. Das Telefonieren beginnt, sobald Ihr eigener SIP-Trunk oder Ihre TK-Anlage verbunden und freigegeben ist.

14-tägige kostenlose Testphase · kostenloses KI-Guthaben · keine Kreditkarte · 11 Sprachen · BYOC · Kontrollen zur Unterstützung der Compliance

Vollständige Website auf Englisch ansehen →