Facing a new task of standardizing SIP protocols for the Kedacom conference Endpoints.
So I digged into some RFC document recently. Here are some key notes for RFC3264: An OfferAnswer Model with the Session Description Protocol (SDP)
1. Capatibility comparison – Direction
—————————————–
If “a=sendrecv” attribute does not exist, or been omitted, that means the direction is sendrecv, since sendrecv is the default.
2. [Offering] RTP Port in m
—————————————–
RTP port in m line for recvonly and sendrecv streams, while RTCP port for sendonly streams.
For recvonly and sendrecv streams, the port number and address in the
offer indicate where the offerer would like to receive the media
stream. For sendonly RTP streams, the address and port number
indirectly indicate where the offerer wants to receive RTCP reports.
Unless there is an explicit indication otherwise, reports are sent to
the port number one higher than the number indicated. The IP address
and port present in the offer indicate nothing about the source IP
address and source port of RTP and RTCP packets that will be sent by
the offerer.
3. [Offering] Switching media format if multiple formats supported**
—————————————–
If multiple formats are listed, it
means that the offerer is capable of making use of any of those
formats during the session. In other words, the answerer MAY change
formats in the middle of the session, making use of any of the
formats listed, without sending a new offer.
[Offering] Capatibility comparison – Preference
——————————————
In all cases, the formats in the “m=” line MUST be listed in order of
preference, with the first format listed being preferred. In this
case, preferred means that the recipient of the offer SHOULD use the
format with the highest preference that is acceptable to it.
[Offering] Capatibility comparison – Preference 2
—————————————–
For sendrecv RTP
streams, the payload type numbers indicate the value of the payload
type field the offerer expects to receive, and would prefer to send.
However, for sendonly and sendrecv streams, the answer might indicate
different payload type numbers for the same codecs, in which case,
the offerer MUST send with the payload type numbers from the answer.
* This is what SIP different with H.323, the payload type value in H.245 OLC mean’s the request will send the payload with this payload type value, while in SDP it means you should send your payload with the value I specified in my SDP.
[Offering] Bandwidth description
—————————————–
If the bandwidth attribute is present for a stream, it indicates the
desired bandwidth that the offerer would like to receive. A value of
zero is allowed, but discouraged. It indicates that no media should
be sent. In the case of RTP, it would also disable all RTCP.
[Offering] A typical usage example for multiple media streams
—————————————–
A typical usage example for multiple media streams of the same type
is a pre-paid calling card application, where the user can press and
hold the pound (“#”) key at any time during a call to hangup and make
a new call on the same card. This requires media from the user to
two destinations – the remote gateway, and the DTMF processing
application which looks for the pound. This could be accomplished
with two media streams, one sendrecv to the gateway, and the other
sendonly (from the perspective of the user) to the DTMF application.
[Answering] Answering SDP must have at least one media format while rejecting
—————————————–
To reject an offered
stream, the port number in the corresponding stream in the answer
MUST be set to zero. Any media formats listed are ignored. At least
one MUST be present, as specified by SDP.
[Answering] Stream marked as recvonly can suggest a new format for the offerer
—————————————–
For streams marked as recvonly in the answer, the “m=” line MUST
contain at least one media format the answerer is willing to receive
with from amongst those listed in the offer. The stream MAY indicate
additional media formats, not listed in the corresponding stream in
the offer, that the answerer is willing to receive.
Similarly, just like recvonly streams, sendrecv streams can suggest new formats for the offerer (of course, it will not be able to send them at this time, since it was not listed in the offer).
[Answering]Capability comparison – RECOMMENDED Order for answerer
—————————————–
If a stream in the offer lists
audio codecs 8, 22 and 48, in that order, and the answerer only
supports codecs 8 and 48, it is RECOMMENDED that, if the answerer has
no reason to change it, the ordering of codecs in the answer be 8,
48, and not 48, 8.
[Answering]Prefer RTP payload type with the value in the offer rather than in the answer
—————————————–
In the case of RTP, it MUST use the payload type numbers
from the offer, even if they differ from those in the answer.
[multicast] ??? How to handle participants in a some conference but with different format support ???
—————————————–
The set of media formats in the answer MUST be equal to or be a
subset of those in the offer. Removing a format is a way for the
answerer to indicate that the format is not supported.
[Processing Answer]
—————————————–
It(Call offerer) MUST send using a media format listed in the answer,
and it SHOULD use the first media format listed in the answer when it
does send.The reason this is a SHOULD, and not a MUST (its also a SHOULD,
and not a MUST, for the answerer), is because there will
oftentimes be a need to change codecs on the fly. For example,
during silence periods, an agent might like to switch to a comfort
noise codec. Or, if the user presses a number on the keypad, the
agent might like to send that using RFC 2833 [9]. Congestion
control might necessitate changing to a lower rate codec based on
feedback.
[Modifying the Session] Session version of REINVITE
—————————————–
When issuing an offer that modifies the session,
the “o=” line of the new SDP MUST be identical to that in the
previous SDP, except that the version in the origin field MUST
increment by one from the previous SDP. If the version in the origin
line does not increment, the SDP MUST be identical to the SDP with
that version number.
[Modifying the Session] Rules for m(Media stream) line of REINVITE
—————————————–
If an SDP is offered, which is different from the previous SDP, the
new SDP MUST have a matching media stream for each media stream in
the previous SDP.
[Modifying the Session] Adding a Media Stream in REINVITE
—————————————–
New media streams are created by new additional media descriptions
below the existing ones, or by reusing the “slot” used by an old
media stream which had been disabled by setting its port to zero.
[Modifying the Session] Changing the Set of Media Formats in REINVITE
—————————————–
For example, if A generates an offer
with G.711 assigned to dynamic payload type number 46, payload type
number 46 MUST refer to G.711 from that point forward in any offers
or answers for that media stream within the session. However, it is
acceptable for multiple payload type numbers to be mapped to the same
codec, so that an updated offer could also use payload type number 72
for G.711.The mappings need to remain fixed for the duration of the session
because of the loose synchronization between signaling exchanges
of SDP and the media stream.
[Modifying the Session] Sending Media Stream after REINVITE is done
—————————————–
Similarly, as described in Section 6, as soon as it sends
its answer, the answerer MUST begin sending media using any formats
in the offer that were also present in the answer
Similarly, when the offerer receives the
answer, it MUST begin sending media using any formats in the answer
[Modifying the Session] Rules of ceasing use of an old media format for Agents
—————————————–
When an agent ceases using a media format (by not listing that format
in an offer or answer, even though it was in a previous SDP) the
agent will still need to be prepared to receive media with that
format for a brief time.
[Modifying the Session] Hold on a call
—————————————–
Hold on a call means request the other participant(s) stop sending streams to it.
If the stream to be placed on hold was previously a sendrecv media
stream, it is placed on hold by marking it as sendonly. If the
stream to be placed on hold was previously a recvonly media stream,
it is placed on hold by marking it inactive.Certain third party call control scenarios do not work when an
answerer responds to held SDP with held SDP.
[Modifying the Session] Hold on a call 2
—————————————–
Does it mean the sending of the Hold on requester will continue? The answer is no.
Typically, when a user “presses” hold, the agent will generate an
offer with all streams in the SDP indicating a direction of sendonly,
and it will also locally mute, so that no media is sent to the far
end, and no media is played out.