Struct sdp::description::session::SessionDescription [−][src]
pub struct SessionDescription {Show 14 fields
pub version: Version,
pub origin: Origin,
pub session_name: SessionName,
pub session_information: Option<Information>,
pub uri: Option<Url>,
pub email_address: Option<EmailAddress>,
pub phone_number: Option<PhoneNumber>,
pub connection_information: Option<ConnectionInformation>,
pub bandwidth: Vec<Bandwidth>,
pub time_descriptions: Vec<TimeDescription>,
pub time_zones: Vec<TimeZone>,
pub encryption_key: Option<EncryptionKey>,
pub attributes: Vec<Attribute>,
pub media_descriptions: Vec<MediaDescription>,
}
Expand description
SessionDescription is a a well-defined format for conveying sufficient information to discover and participate in a multimedia session.
Fields
version: Version
origin: Origin
o=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address>
session_name: SessionName
s=<session name>
session_information: Option<Information>
i=<session description>
uri: Option<Url>
email_address: Option<EmailAddress>
e=<email-address>
phone_number: Option<PhoneNumber>
p=<phone-number>
connection_information: Option<ConnectionInformation>
c=<nettype> <addrtype> <connection-address>
bandwidth: Vec<Bandwidth>
b=<bwtype>:<bandwidth>
time_descriptions: Vec<TimeDescription>
time_zones: Vec<TimeZone>
z=<adjustment time> <offset> <adjustment time> <offset> ...
encryption_key: Option<EncryptionKey>
attributes: Vec<Attribute>
media_descriptions: Vec<MediaDescription>
Implementations
Reset cleans the SessionDescription, and sets all fields back to their default values
API to match draft-ietf-rtcweb-jsep Move to webrtc or its own package? NewJSEPSessionDescription creates a new SessionDescription with some settings that are required by the JSEP spec.
WithPropertyAttribute adds a property attribute ‘a=key’ to the session description
WithValueAttribute adds a value attribute ‘a=key:value’ to the session description
WithFingerprint adds a fingerprint to the session description
WithMedia adds a media description to the session description
get_codec_for_payload_type scans the SessionDescription for the given payload type and returns the codec
get_payload_type_for_codec scans the SessionDescription for a codec that matches the provided codec as closely as possible and returns its payload type
Attribute returns the value of an attribute and if it exists
Marshal takes a SDP struct to text
https://tools.ietf.org/html/rfc4566#section-5
Session description v= (protocol version) o= (originator and session identifier) s= (session name) i=* (session information) u=* (URI of description) e=* (email address) p=* (phone number) c=* (connection information – not required if included in all media) b=* (zero or more bandwidth information lines) One or more time descriptions (“t=” and “r=” lines; see below) z=* (time zone adjustments) k=* (encryption key) a=* (zero or more session attribute lines) Zero or more media descriptions
Time description t= (time the session is active) r=* (zero or more repeat times)
Media description, if present m= (media name and transport address) i=* (media title) c=* (connection information – optional if included at session level) b=* (zero or more bandwidth information lines) k=* (encryption key) a=* (zero or more media attribute lines)
Unmarshal is the primary function that deserializes the session description message and stores it inside of a structured SessionDescription object.
The States Transition Table describes the computation flow between functions (namely s1, s2, s3, …) for a parsing procedure that complies with the specifications laid out by the rfc4566#section-5 as well as by JavaScript Session Establishment Protocol draft. Links: https://tools.ietf.org/html/rfc4566#section-5 https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24
https://tools.ietf.org/html/rfc4566#section-5
Session description v= (protocol version) o= (originator and session identifier) s= (session name) i=* (session information) u=* (URI of description) e=* (email address) p=* (phone number) c=* (connection information – not required if included in all media) b=* (zero or more bandwidth information lines) One or more time descriptions (“t=” and “r=” lines; see below) z=* (time zone adjustments) k=* (encryption key) a=* (zero or more session attribute lines) Zero or more media descriptions
Time description t= (time the session is active) r=* (zero or more repeat times)
Media description, if present m= (media name and transport address) i=* (media title) c=* (connection information – optional if included at session level) b=* (zero or more bandwidth information lines) k=* (encryption key) a=* (zero or more media attribute lines)
In order to generate the following state table and draw subsequent deterministic finite-state automota (“DFA”) the following regex was used to derive the DFA: vosi?u?e?p?c?b*(tr*)+z?k?a*(mi?c?bk?a)* possible place and state to exit: ** * * * ** * * * * 99 1 1 1 11 1 1 1 1 3 1 1 26 5 5 4 4
Please pay close attention to the k
, and a
parsing states. In the table
below in order to distinguish between the states belonging to the media
description as opposed to the session description, the states are marked
with an asterisk (“a*”, “k*”).
+--------+----+-------+----+-----+----+-----+---+----+----+---+---+-----+---+---+----+---+----+
| STATES | a* | a*,k* | a | a,k | b | b,c | e | i | m | o | p | r,t | s | t | u | v | z |
+--------+----+-------+----+-----+----+-----+---+----+----+---+---+-----+---+---+----+---+----+
| s1 | | | | | | | | | | | | | | | | 2 | |
| s2 | | | | | | | | | | 3 | | | | | | | |
| s3 | | | | | | | | | | | | | 4 | | | | |
| s4 | | | | | | 5 | 6 | 7 | | | 8 | | | 9 | 10 | | |
| s5 | | | | | 5 | | | | | | | | | 9 | | | |
| s6 | | | | | | 5 | | | | | 8 | | | 9 | | | |
| s7 | | | | | | 5 | 6 | | | | 8 | | | 9 | 10 | | |
| s8 | | | | | | 5 | | | | | | | | 9 | | | |
| s9 | | | | 11 | | | | | 12 | | | 9 | | | | | 13 |
| s10 | | | | | | 5 | 6 | | | | 8 | | | 9 | | | |
| s11 | | | 11 | | | | | | 12 | | | | | | | | |
| s12 | | 14 | | | | 15 | | 16 | 12 | | | | | | | | |
| s13 | | | | 11 | | | | | 12 | | | | | | | | |
| s14 | 14 | | | | | | | | 12 | | | | | | | | |
| s15 | | 14 | | | 15 | | | | 12 | | | | | | | | |
| s16 | | 14 | | | | 15 | | | 12 | | | | | | | | |
+--------+----+-------+----+-----+----+-----+---+----+----+---+---+-----+---+---+----+---+----+
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for SessionDescription
impl Send for SessionDescription
impl Sync for SessionDescription
impl Unpin for SessionDescription
impl UnwindSafe for SessionDescription
Blanket Implementations
Mutably borrows from an owned value. Read more