Version

Payload and Media Handling

In SIP (Session Initiation Protocol) communications, handling the payload and media correctly is crucial for establishing and maintaining high-quality communication sessions. This part delves into SIP header fields related to payload and media handling, ensuring that media streams are properly negotiated, encoded, and transmitted.

Content-Type (c)
The Content-Type header field specifies the media type of the SIP message body. It's essential for the receiving party to understand the format and type of the payload contained in the message, which is particularly important for INVITE requests carrying session descriptions.
Format Example: Content-Type: application/sdp

Content-Length (l)
The Content-Length header indicates the size of the SIP message body in octets. This header ensures that the complete message body is received and correctly processed by the recipient.
Format Example: Content-Length: 159

Content-Encoding
The Content-Encoding header field is used to encode the message body of a SIP message, usually to facilitate message body compression. This header specifies what encodings have been applied to the message body and must be decoded accordingly by the recipient.
Format Example: Content-Encoding: gzip

Content-Disposition
The Content-Disposition header field indicates how the message body or a part of the message body should be processed by the receiving user agent. It can specify whether the content is an attachment or if it should be handled inline.
Format Example: Content-Disposition: session; handling=required

Content-Language
The Content-Language header field specifies the natural language(s) of the intended audience for the enclosed entity. This header is useful for localization of media descriptions and other textual information in SIP messages.
Format Example: Content-Language: en-US

 

Additional Considerations for Media Handling

Session Description Protocol (SDP)

SDP, as defined in RFC8866, is often used in conjunction with SIP and utilized within SIP messages (primarily INVITE requests and 200 OK responses) to describe multimedia session parameters. SDP conveys essential information for initiating and managing multimedia communications, such as voice or video calls. The structure of an SDP message is composed of various lines, known as fields or headers, each beginning with a single character followed by an equals sign (=) and the field's value. Here, we'll delve into the crucial SDP headers important for session negotiation:  

SDP Headers for Negotiation: 

Version (v=): This header specifies the version of SDP in use. Although there is rarely a version other than 0, it is mandatory as the first line of any SDP message. 

Origin (o=): The origin header is crucial for session initiation, providing information about the session creator, including a unique identifier for the session and the session version. It helps in identifying the session and managing session states. 

Session Name (s=): While not directly involved in negotiation, the session name provides a human-readable description of the session. It's required but can be set to a default value like "-" if not used. 

Connection Information (c=): This header provides details about the network type, address type, and connection address (usually the IP address). It's vital for determining where media should be sent. 

Time Description (t=): Indicates the session's start and stop times. For live sessions, these are often set to 0, denoting an unspecified time, but this header is still crucial for session establishment. 

Media Description (m=): One of the most critical headers for negotiation, the media description specifies the media type (audio, video, etc.), port, protocol (usually RTP/AVP for audio and video), and media format (payload types). This line is essential for understanding what media is proposed, how to receive it, and what codecs are supported. 

  

Important Attributes for Negotiation: 

Although SDP attributes (a=) are not headers in the strict sense, they provide additional information important for session negotiation: 

 a=rtpmap: Describes the payload type, codec, and clock rate. It's essential for determining which codecs are supported by the session participants. 

a=sendrecv / a=sendonly / a=recvonly / a=inactive: These attributes indicate the desired media direction, influencing how media streams should be managed. 

a=fmt: Lists the supported formats for a given media description. It’s particularly important for negotiating compatible media codecs. 

a=candidate: Part of the ICE process, these attributes list potential candidates for media paths, facilitating NAT traversal and direct media connections. 

Handling the payload and media correctly in SIP communications is fundamental to providing flexible, efficient, and high-quality VoIP and multimedia services. The headers discussed play a pivotal role in ensuring that media sessions are established and maintained according to the preferences and capabilities of all parties involved.

Start innovating with Mobius

What's next? Let's talk!

Mobius Software

As a company you'll get:

  • Get started quickly

  • Support any business model

  • Join millions of businesses

Questions? websupport@mobius.com