Parsing the SDP Session Structure
int sdp_parse(const char *sdp_info, int len, int flags, sdp_session_t **session, uint_t *p_error);
The sdp_parse
()
function parses the SDP description
in the sdp_info
parameter and populates the sdp_session_t
structure. The len
parameter specifies
the length of the character buffer sdp_info
. The function
allocates the memory required for the sdp_session_t
structure.
To free that memory, call the sdp_free_session
()
function. For more information, see Deleting an Attribute From the SDP Media Structure.
Example 2-5 Parsing an SDP Session Structure
In this example, the SDP session structure is as follows:
v=0\r\n o=jdoe 23423423 234234234 IN IP4 192.168.1.1\r\n s=SDP seminar\r\n i=A seminar on the session description protocol\r\n e=test@example.com c=IN IP4 192.168.90.1\r\n t=2873397496 2873404696\r\n
After calling the sdp_parse_t
()
function, the resulting sdp_session_t
structure is as follows:
session { sdp_session_version = 1 s_version = 0 s_origin { o_username = "jdoe" o_id = 23423423ULL o_version = 234234234ULL o_nettype = "IN" o_addrtype = "IP4" o_address = "192.168.1.1" } s_name = "SDP seminar" s_info = "A seminar on the session description protocol" s_uri = (nil) s_email { value = "test@example.com" next = (nil) } s_phone = (nil) s_conn { c_nettype = "IN" c_addrtype = "IP4" c_address = "192.168.90.1" c_addrcount = 0 c_ttl = 0 c_next = (nil) } s_bw = (nil) s_time { t_start = 2873397496ULL t_stop = 2873404696ULL t_repeat = (nil) t_next = (nil) } s_zone = (nil) s_key = (nil) s_attr = (nil) s_media = (nil) }