feat(libapi): add RtpSecureMediaEnum for RTP/SRTP security modes#209
feat(libapi): add RtpSecureMediaEnum for RTP/SRTP security modes#209brancan wants to merge 2 commits into
Conversation
- 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.
|
Gentle ping on this one — happy to make any changes if there's feedback. Let us know if there's anything blocking it. |
hnimminh
left a comment
There was a problem hiding this comment.
SRTP (secured media) will be enable automatically if SIP TLS is enabled.
have you try it?
…ound legs The Pydantic field existed but nothing read it: callng only forced SRTP automatically when the SIP transport was TLS, hardcoded to mandatory. inMediaProcess/outMediaProcess now set rtp_secure_media from the media class (mandatory/optional), and the legacy TLS-triggered auto-mandatory block only fires when the class is unset or explicitly 'false', so it never overrides an explicit mandatory/optional/forbidden choice. Validated with a standalone Lua harness (mocked rdbconn/DxLeg) against the exact extracted function source, covering all four enum values on both legs plus the TLS-gate interaction.
|
You're right that SRTP auto-enables today whenever SIP transport is TLS (hardcoded to mandatory in We only noticed because our own production Redis already had Pushed a commit that wires it up: Validated with a standalone Lua harness (mocked |
Summary
This PR introduces a new
RtpSecureMediaEnumto give explicit control over RTP/SRTP security in theMediaModel.Changes
RtpSecureMediaEnumwith four modes:mandatory: always SRTPoptional: SRTP if supported by remoteforbidden: never SRTPfalse: no SRTP (current default behavior)MediaModelextended with artp_secure_mediafield, defaulting tofalseto 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
falsekeeps the current behavior, so existing deployments are unaffected.Test plan
rtp_secure_media=false).Cherry-picked from a downstream deployment branch where this addition has been running for a while.
Made with Cursor