diff --git a/parser/sdp/sdp.c b/parser/sdp/sdp.c index 3f28d37b4b9..7e008ea350d 100644 --- a/parser/sdp/sdp.c +++ b/parser/sdp/sdp.c @@ -64,7 +64,7 @@ static inline sdp_info_t* new_sdp(void) /** * Alocate a new session cell. */ -static inline sdp_session_cell_t *add_sdp_session(sdp_info_t* _sdp, int session_num, str* cnt_disp) +static inline sdp_session_cell_t *add_sdp_session(sdp_info_t* _sdp, int session_num, str* cnt_disp, str body) { sdp_session_cell_t *session; int len; @@ -83,6 +83,8 @@ static inline sdp_session_cell_t *add_sdp_session(sdp_info_t* _sdp, int session_ session->cnt_disp.len = cnt_disp->len; } + session->body = body; + /* Insert the new session */ session->next = _sdp->sessions; _sdp->sessions = session; @@ -95,7 +97,7 @@ static inline sdp_session_cell_t *add_sdp_session(sdp_info_t* _sdp, int session_ * Allocate a new stream cell. */ static inline sdp_stream_cell_t *add_sdp_stream(sdp_session_cell_t* _session, int stream_num, - str* media, str* port, str* transport, str* payloads, int is_rtp, int pf, str* sdp_ip) + str* media, str* port, str* transport, str* payloads, int is_rtp, int pf, str* sdp_ip, str body) { sdp_stream_cell_t *stream; int len; @@ -125,6 +127,8 @@ static inline sdp_stream_cell_t *add_sdp_stream(sdp_session_cell_t* _session, in stream->ip_addr.s = sdp_ip->s; stream->ip_addr.len = sdp_ip->len; + stream->body = body; + /* Insert the new stream */ stream->next = _session->streams; _session->streams = stream; @@ -370,7 +374,7 @@ int parse_sdp_session(str *sdp_body, int session_num, str *cnt_disp, sdp_info_t* return -1; } /* Allocate a session cell */ - session = add_sdp_session(_sdp, session_num, cnt_disp); + session = add_sdp_session(_sdp, session_num, cnt_disp, body); if (session == NULL) return -1; /* Get origin IP */ @@ -442,7 +446,7 @@ int parse_sdp_session(str *sdp_body, int session_num, str *cnt_disp, sdp_info_t* } /* Allocate a stream cell */ - stream = add_sdp_stream(session, stream_num, &sdp_media, &sdp_port, &sdp_transport, &sdp_payload, is_rtp, pf, &sdp_ip); + stream = add_sdp_stream(session, stream_num, &sdp_media, &sdp_port, &sdp_transport, &sdp_payload, is_rtp, pf, &sdp_ip, tmpstr1); if (stream == 0) return -1; /* increment total number of streams */ diff --git a/parser/sdp/sdp.h b/parser/sdp/sdp.h index 316bf375eef..39ab3762e2f 100644 --- a/parser/sdp/sdp.h +++ b/parser/sdp/sdp.h @@ -46,6 +46,8 @@ typedef struct sdp_payload_attr { typedef struct sdp_stream_cell { struct sdp_stream_cell *next; + /**< body of the entire stream */ + str body; /* c=
*/ /**< connection address family: AF_INET/AF_INET6 */ int pf; @@ -93,6 +95,8 @@ typedef struct sdp_stream_cell { typedef struct sdp_session_cell { struct sdp_session_cell *next; + /**< body of the entire session */ + str body; /**< session index inside sdp */ int session_num; /**< the Content-Disposition header (for Content-Type:multipart/mixed) */