Static-key SRTP for inter-edge trunk pipes.
What problem this solves
Trunk edges exchange write-key pairs over the control plane, then protect RTP/RTCP on the UDP pipe without DTLS. Each edge encrypts with its local write key and decrypts with the far edge's write key.
RFCs
- RFC 3711 -- SRTP encrypt / decrypt
Summary
Functions
Lab alias: shared master material for both directions (local == remote).
Builds an XGW.SRTPSession from directional write keys.
Encrypts RTCP.
Encrypts RTP; returns ciphertext and updated session.
Decrypts SRTCP.
Decrypts SRTP to %Rtp{}.
Functions
@spec new(binary(), binary()) :: XGW.SRTPSession.t()
Lab alias: shared master material for both directions (local == remote).
@spec new(binary(), binary(), binary(), binary()) :: XGW.SRTPSession.t()
Builds an XGW.SRTPSession from directional write keys.
Encrypt uses local_write_* (SRTP server write). Decrypt uses
remote_write_* (SRTP client write). The far edge passes the swapped pair.
@spec protect_rtcp(XGW.SRTPSession.t(), XMediaLib.Rtcp.t()) :: {:ok, binary(), XGW.SRTPSession.t()} | {:error, XGW.SRTPSession.t()}
Encrypts RTCP.
@spec protect_rtp(XGW.SRTPSession.t(), XMediaLib.Rtp.t()) :: {:ok, binary(), XGW.SRTPSession.t()} | {:error, XGW.SRTPSession.t()}
Encrypts RTP; returns ciphertext and updated session.
@spec unprotect_rtcp(XGW.SRTPSession.t(), binary()) :: {:ok, term(), XGW.SRTPSession.t()} | {:error, XGW.SRTPSession.t()}
Decrypts SRTCP.
@spec unprotect_rtp(XGW.SRTPSession.t(), binary()) :: {:ok, XMediaLib.Rtp.t(), XGW.SRTPSession.t()} | {:error, XGW.SRTPSession.t()}
Decrypts SRTP to %Rtp{}.