= SRTP Support in PJSIP = Support for SRTP was included in PJSIP in version 0.9 (r...). == Requirements == SRTP feature in PJSIP uses [http://sourceforge.net/projects/srtp/ libsrtp] created by David A. !McGrew of Cisco Systems, Inc. Copy of [http://sourceforge.net/projects/srtp/ libsrtp] is included in PJSIP source tree. There is no other software to download. [http://sourceforge.net/projects/srtp/ libsrtp] is distributed under BSD-like license, you must satisfy the license requirements if you incorporate SRTP in your application. Please see [http://www.pjsip.org/licensing.htm PJSIP licensing] page for more information about this and other third party libraries used in PJSIP. ---- == Building PJSIP with SRTP Support == === Availability === SRTP feature is currently available in: - Visual C++ 6 and 2005 (for Windows targets) - GNU based build system (for Linux, Mingw, MacOS X, and *nix based platforms) Support for WinCE/Windows Mobile targets and Symbian will be added very soon. === Building === libsrtp is always built by default, from {{{third_party/build/srtp}}} directory. Support for SRTP is enabled by default in PJMEDIA and PJSUA-LIB. To '''disable''' this feature, declare this in your {{{config_site.h}}}: {{{ #define PJMEDIA_HAS_SRTP 0 }}} ---- == Implementation Notes == #changes === Changes in Media Transport Interface === Since the availability of SRTP changes contents of SDP (Session Description Protocol) and the SDP negotiation, we need to add new interfaces in PJMEDIA transport API to allow media transport to modify and negotiate SDP. Incidently this would work well with ICE too (previously we treat ICE as a special kind of media transport so it is treated differently, but with this new interfaces, all media transports will behave uniformly (anyway that's what API abstraction is for!)). New interfaces in media transport are as follows (please consult the PJMEDIA transport documentation for more info): media_create:: This callback is called by application (or PJSUA-LIB) to allow the media transport to add more information in the SDP offer, before the offer is sent to remote. Additionally, for answerer side, this callback allows the media transport to reject the offer from the remote before this offer is processed by the SDP negotiator. media_start:: This callback is called after offer and answer are negotiated, and before the media is started. For answerer side, this callback will be called before the answer is sent to remote, to allow media transport to put additional info in the SDP. The media transport also has the final chance to negotiate the offer and answer before media is really started. media_stop:: This callback is called when the media is stopped, to allow the media transport to release its resources. simulate_lost:: This has nothing to do with SRTP, but since all media transports support this feature (packet loss simulation), we add this as a new interface. === pjmedia_transport_srtp Implementation === ---- == Using SRTP Transport == === Using SRTP in PJSUA-LIB === === Using SRTP Transport Directly ===