3.1.5.8 Negotiating SRTP or SSRTP Optionally

To require SRTP encryption for a media stream, an application can use the SRTP, as specified in [RFC4568], to specify the secure audio video profile (SAVP) in an m= line of an SDP message as part of the SRTP negotiation. This is shown in the following example.

m=audio 50004 RTP/SAVP 8 97 101

This description, however, does not allow for the possibility to negotiate SRTP encryption optionally, in that the support of the SRTP encryption is desired but not required.

The mechanism described here to negotiate SRTP optionally also applies to SSRTP encryption.

To support SRTP or SSRTP encryption optionally, this protocol deviates from the specification in [RFC4568]; in a SIP INVITE request, an application MUST use audio video profile (AVP) in the m= line of the SDP offer, together with the a=crypto or a=cryptoscale attribute to negotiate media encryption using SRTP or SSRTP. The application SHOULD bypass the negotiation of SRTP or SSRTP encryption by not specifying any a=crypto and a=cryptoscale attributes. To acknowledge the ability to support the SRTP or SSRTP encryption, the remote peer MUST respond to the SIP request in a SIP 200 OK response with an SDP message specifying "SAVP" in the m= line and the a=crypto or a=cryptoscale attribute, respectively for SRTP or SSRTP, as part of the media description. All subsequent SIP re-INVITE requests MUST continue to have "SAVP". If the remote peer cannot support SRTP or SSRTP encryption, the remote peer MUST specify "AVP" in the m= line of the SDP answer and MUST NOT specify any a=crypto and a=cryptoscale attributes.

The following are examples of negotiating encryption.

The following example is a peer that sends an SDP offer in a SIP request to specify that it can support either SRTP or SSRTP encryption, but the support is not mandatory.

m=audio 50004 RTP/AVP 8 97 101
a=cryptoscale:1 client AES_CM_128_HMAC_SHA1_80 inline:vV5wrmv9u07pd0QvyHw7rf6yL8e3xXt07AI74T3J|2^31|1:1
a=crypto:2 AES_CM_128_HMAC_SHA1_80 inline:Oi0nVM8eJZ2bkLVNeRaqtUeqjXwGMXo0s0IrmoKh|2^31|1:1

If the peer is capable of supporting and does support, SRTP encryption, the following example is a response to the previous request with an SDP message.

m=audio 50014 RTP/SAVP 8 97 101
a=crypto:2 AES_CM_128_HMAC_SHA1_80 inline:v0ncVM8eKP2bkOINeRaqcFeqjXwGMXo0sRalidZc|2^31|1:1

If the peer is not capable of supporting or does not support SRTP encryption, the following example is a response to the previous request with an SDP message.

m=audio 50104 RTP/AVP 8 97 101

The following example is a peer that sends an SDP offer in a SIP request to mandate either SRTP or SSRTP encryption support.

m=audio 50004 RTP/SAVP 8 97 101
a=cryptoscale:1 client AES_CM_128_HMAC_SHA1_80 inline:vV5wrmv9u07pd0QvyHw7rf6yL8e3xXt07AI74T3J|2^31|1:1
a=crypto:2 AES_CM_128_HMAC_SHA1_80 inline:Oi0nVM8eJZ2bkLVNeRaqtUeqjXwGMXo0s0IrmoKh|2^31|1:1