[sr-dev] git:master: core: sdp parser - keep link to start and lenght of sdp content

Daniel-Constantin Mierla miconda at gmail.com
Wed Dec 21 17:43:03 CET 2011


Module: sip-router
Branch: master
Commit: d768eb5cc535efa47164a26e021f6741d974760d
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d768eb5cc535efa47164a26e021f6741d974760d

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Wed Dec 21 14:54:29 2011 +0100

core: sdp parser - keep link to start and lenght of sdp content

- useful in multi-part bodies and sdp operations

---

 parser/sdp/sdp.c |    5 +++++
 parser/sdp/sdp.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/parser/sdp/sdp.c b/parser/sdp/sdp.c
index 6a635f8..30de265 100644
--- a/parser/sdp/sdp.c
+++ b/parser/sdp/sdp.c
@@ -371,6 +371,11 @@ static int parse_sdp_session(str *sdp_body, int session_num, str *cnt_disp, sdp_
 	int parse_payload_attr;
 	str fmtp_string;
 
+	/* hook the start and lenght of sdp body inside structure
+	 * - shorcut useful for multi-part bodies and sdp operations
+	 */
+	_sdp->text = *sdp_body;
+
 	/*
 	 * Parsing of SDP body.
 	 * Each session starts with v-line and each session may contain a few
diff --git a/parser/sdp/sdp.h b/parser/sdp/sdp.h
index 353580c..a1fa8ce 100644
--- a/parser/sdp/sdp.h
+++ b/parser/sdp/sdp.h
@@ -101,6 +101,7 @@ typedef struct sdp_session_cell {
 typedef struct sdp_info {
 	msg_body_type_t type;
 	free_msg_body_f free;
+	str text; /**< link to start of sdp and its length */
 	int sessions_num;	/**< number of SDP sessions */
 	int streams_num;  /**< total number of streams for all SDP sessions */
 	struct sdp_session_cell *sessions;




More information about the sr-dev mailing list