|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Detailed DescriptionThis module implements SRTP as described by RFC 3711, using RFC 4568 as key exchange method. It implements Media Transport to integrate with the rest of PJMEDIA framework. As we know, media transport is separated from the stream object (which does the encoding/decoding of PCM frames, (de)packetization of RTP/RTCP packets, and de-jitter buffering). The connection between stream and media transport is established when the stream is created (we need to specify media transport during stream creation), and the interconnection can be depicted from the diagram below: I think the diagram above is self-explanatory. SRTP functionality is implemented as some kind of "adapter", which is plugged between the stream and the actual media transport that does sending/receiving RTP/RTCP packets. When SRTP is used, the interconnection between stream and transport is like the diagram below: So to stream, the SRTP transport behaves as if it is a media transport (because it is a media transport), and to the media transport it behaves as if it is a stream. The SRTP object then forwards RTP packets back and forth between stream and the actual transport, encrypting/decrypting the RTP/RTCP packets as necessary. The neat thing about this design is the SRTP "adapter" then can be used to encrypt any kind of media transports. We currently have UDP and ICE media transports that can benefit SRTP, and we could add SRTP to any media transports that will be added in the future. Enumeration Type Documentation
This enumeration specifies the behavior of the SRTP transport regarding media security offer and answer.
Function Documentation
Initialize SRTP library. This function should be called before any SRTP functions, however calling pjmedia_transport_srtp_create() will also invoke this function. This function will also register SRTP library deinitialization to pj_atexit(), so the deinitialization of SRTP library will be performed automatically by PJLIB destructor.
Initialize SRTP setting with its default values.
Create an SRTP media transport.
Manually start SRTP session with the given parameters. Application only needs to call this function when the SRTP transport is used without SDP offer/answer. When SDP offer/answer framework is used, the SRTP transport will be started/stopped by pjmedia_transport_media_start() and pjmedia_transport_media_stop() respectively. Please note that even if an RTP stream is only one direction, application will still need to provide both crypto suites, because it is needed by RTCP. If application specifies the crypto keys, the keys for transmit and receive direction MUST be different.
Stop SRTP session.
This is a utility function to decrypt SRTP packet using SRTP transport. This function is not part of SRTP transport's API, but it can be used to decrypt SRTP packets from non-network (for example, from a saved file) without having to use the transport framework. See pcaputil.c in the samples collection on how to use this function.
Query member transport of SRTP.
Copyright (C) 2006-2008 Teluu Inc.
| |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||