Skip to content

feat(libapi): add RtpSecureMediaEnum for RTP/SRTP security modes#209

Open
brancan wants to merge 1 commit intohnimminh:masterfrom
brancan:pr/libreapi-rtp-secure-media-enum
Open

feat(libapi): add RtpSecureMediaEnum for RTP/SRTP security modes#209
brancan wants to merge 1 commit intohnimminh:masterfrom
brancan:pr/libreapi-rtp-secure-media-enum

Conversation

@brancan
Copy link
Copy Markdown

@brancan brancan commented May 7, 2026

Summary

This PR introduces a new RtpSecureMediaEnum to give explicit control over RTP/SRTP security in the MediaModel.

Changes

  • New enum RtpSecureMediaEnum with four modes:
    • mandatory: always SRTP
    • optional: SRTP if supported by remote
    • forbidden: never SRTP
    • false: no SRTP (current default behavior)
  • MediaModel extended with a rtp_secure_media field, defaulting to false to preserve backwards compatibility.

Why

The codebase already supports SRTP at the FreeSWITCH layer, but the libreapi data model lacks a first-class field to declare per-class media security policy. Exposing it via a typed Pydantic enum makes it straightforward for clients (WebUI, automation, ansible) to set it consistently and have the API validate the values.

Backward compatibility

Default false keeps the current behavior, so existing deployments are unaffected.

Test plan

  • Existing tests still pass (no behavioral change when rtp_secure_media=false).
  • New field accepted via API and persisted/loaded correctly.
  • Reject unknown values with a Pydantic validation error.

Cherry-picked from a downstream deployment branch where this addition has been running for a while.

Made with Cursor

- Introduced `RtpSecureMediaEnum` to define security modes for RTP/SRTP: mandatory, optional, forbidden, and false.
- Updated `MediaModel` to include `rtp_secure_media` field, allowing configuration of RTP/SRTP security settings.

This commit enhances media configuration capabilities by providing explicit options for RTP security modes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant