Programming Interfaces Guide

Adding a Connection Field to the SDP Session Structure

int sdp_add_connection(sdp_conn_t **conn, const char *nettype, const char *addrtype, const char *address, uint8_t ttl, int addrcount);

The sdp_add_connection() function adds the CONNECTION (c=) SDP field to either the session structure (sdp_session_t) or the media structure (sdp_media_t) using the nettype, addrtype, address, ttl, and addrcount parameters. For IPv4 or IPv6 unicast addresses, set the values of the ttl and addrcount parameters to zero. For multicast addresses, set the value of the ttl parameter between zero and 255. A multicast address cannot have an addrcount parameter with a value of zero.

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_connection() 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.