Minimal SDP answer builder and helpers for the browser spike (mix xgw.spike).
Summary
Functions
Builds a minimal WebRTC answer from an offer and local ICE/DTLS parameters.
Host candidate IPs for the spike answer: loopback plus non-loopback IPv4 locals.
Coerces a codec atom or header string to :opus | :pcmu | :pcma | :g722.
Parses the browser's ICE ufrag and pwd from an offer SDP.
Functions
Builds a minimal WebRTC answer from an offer and local ICE/DTLS parameters.
Opts may include :codec as :opus | :pcmu | :pcma | :g722 (default :opus).
The answer lists only that codec so the browser is forced onto it.
When the offer includes an SCTP application m-line, the answer BUNDLEs a matching
m=application with a=sctp-port / a=max-message-size.
@spec detect_advert_ips() :: [:inet.ip_address()]
Host candidate IPs for the spike answer: loopback plus non-loopback IPv4 locals.
@spec normalize_codec(term()) :: :opus | :pcmu | :pcma | :g722
Coerces a codec atom or header string to :opus | :pcmu | :pcma | :g722.
Parses the browser's ICE ufrag and pwd from an offer SDP.
Uses the last match so media-level credentials win over session-level duplicates.