WhisperSystems/RedPhone — pull request #241 by sanchi (2014-01-04 21:54:33+00:00)
Title: b/f: set RTP payload of outgoing RTP packets to dynamic pt 96 for RTP in...

...terop

Currently, the RTP payload type field in the RTP header of outgoing RTP
packets is not set, and the payload type of incoming RTP packets is
ignored; apparently the codec/samplerate is expected to be always the
same (speex nb).

In oder to achieve limited interoperability with standard RTP endpoints,
this patch sets the payload type to 96 (the first of the dynamic PTs).

In SIP, payload type is negotiated using SDP. Interop with those clients
will fail, except if the client is configured to use 96 for speex (e.g.,
in Jitsi if the speex codec is set to first in the preference). It's not
possible to change the PT in a relay without breaking the SRTP MAC.

A proper, SIP interoperable solution would include the following
- the initiate signal should list supported codecs, samplerates and their payload
types (e.g. SPEEX/8000 96, SPEEX/16000 97, OPUS/8000 98, ...)
- the response to the initiate signal would list codecs supported by the remote
end
- CallManager would setup codecs and payload types in RtpAudioSender/RtpAudioReader
through CallAudioManager
Note that with SDP offer/answer assymetric payload types may be negotiated. Each
party declares what it wants to receive. Thus the separate PTs for sending
and receiving.