Programming Interfaces Guide

Shutting Down the SDP Session Structure

The functions in this section perform the following functions:

Deleting Fields From the SDP Session Structure

int sdp_delete_all_field(sdp_session_t *session, const char field);

The sdp_delete_all_field() function deletes all occurrences of the SDP field that is specified by the field parameter from the SDP structure. For example, if an SDP structure has three BANDWIDTH (b=) fields, calling this function with a value of SDP_BANDWIDTH_FIELD in the field parameter deletes all three BANDWIDTH fields from the session structure.

Return Values: The sdp_delete_all_field() function returns 0 when the function completes successfully. When the session argument is NULL or the field type is unknown, the function returns EINVAL. The value of errno does not change in the event of an error.

Deleting Fields From the SDP Media Structure

int sdp_delete_all_media_field(sdp_media_t *media, const char field);

The sdp_delete_all_media_field() function deletes all occurrences of the SDP field that is specified by the field parameter from the SDP media structure.

Return Values: The sdp_delete_all_media_field() function returns 0 when the function completes successfully. When the session argument is NULL or the field type is unknown, the function returns EINVAL. The value of errno does not change in the event of an error.

Deleting Media From the SDP Media Structure

int sdp_delete_media(sdp_media_t **l_media, sdp_media_t *media);

The sdp_delete_media() function deletes the media entry specified by the media parameter from the media list. This function finds the specified media entry by calling the sdp_find_media() function. This function frees the memory that is allocated to the media structure after deleting the media entry.

Return Values: The sdp_delete_media() function returns 0 when the function completes successfully. When the session argument is NULL or mandatory arguments do not exist, the function returns EINVAL. The value of errno does not change in the event of an error.

Deleting an Attribute From the SDP Media Structure

int sdp_delete_attribute(sdp_attr_t **l_attr, sdp_attr_t *attr);

The sdp_delete_attribute() function deletes the attribute specified by the attr parameter from the media list. This function finds the specified attribute by calling either the sdp_find_media_rtpmap() function or the sdp_find_attribute() function. This function frees the memory that is allocated to the attribute structure after deleting the attribute.

Return Values: The sdp_delete_attribute() function returns 0 when the function completes successfully. When the session argument is NULL or mandatory arguments do not exist, the function returns EINVAL. The value of errno does not change in the event of an error.

Deleting an Attribute From the SDP Media Structure

void sdp_free_session(sdp_session_t *session);

The sdp_free_session() function destroys the session specified by the session parameter and frees the resources that are associated with that structure.