Programming Interfaces Guide

Adding a Key Field to the SDP Session Structure

int sdp_add_key(sdp_key_t **key, const char *method, const char *enckey);

The sdp_add_key() function adds the KEY (k=) SDP field to the session structure (sdp_session_t) or the media structure (sdp_media_t) using the method and enckey parameters. This field can go into the media or the session section of an SDP description. You must pass either &session->s_info or &media->m_info as the first argument to specify the section.

Return Values: The sdp_add_key() function returns 0 when the function completes successfully. When mandatory parameters are not present, the function returns EINVAL. When memory allocation fails, the function returns ENOMEM. The value of errno does not change in the event of an error.