Module: sip-router Branch: master Commit: cbf2cb0c1d0301d63154834fbd9220e334b9c64c URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cbf2cb0c...
Author: Jason Penton <jaybeepee@jaybeepee-laptop.(none)> Committer: Jason Penton jason.penton@smilecoms.com Date: Thu Jan 10 14:33:54 2013 +0200
parser/sdp: fast-access pointer for raw SDP stream string - basically a pointer to the raw SDP stream
---
parser/sdp/sdp.c | 4 ++++ parser/sdp/sdp.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/parser/sdp/sdp.c b/parser/sdp/sdp.c index 67174b5..f46b8de 100644 --- a/parser/sdp/sdp.c +++ b/parser/sdp/sdp.c @@ -481,6 +481,10 @@ static int parse_sdp_session(str *sdp_body, int session_num, str *cnt_disp, sdp_ stream = add_sdp_stream(session, stream_num, &sdp_media, &sdp_port, &sdp_transport, &sdp_payload, is_rtp, pf, &sdp_ip); if (stream == 0) return -1;
+ /* Store fast access ptr to raw stream */ + stream->raw_stream.s = tmpstr1.s; + stream->raw_stream.len = tmpstr1.len; + /* increment total number of streams */ _sdp->streams_num++;
diff --git a/parser/sdp/sdp.h b/parser/sdp/sdp.h index 550a2d3..6521b2f 100644 --- a/parser/sdp/sdp.h +++ b/parser/sdp/sdp.h @@ -81,7 +81,8 @@ typedef struct sdp_stream_cell { str max_size; /**< RFC4975: max-size attribute */ str accept_types; /**< RFC4975: accept-types attribute */ str accept_wrapped_types; /**< RFC4975: accept-wrapped-types attribute */ - struct sdp_payload_attr **p_payload_attr; /**< fast access pointers to payloads */ + str raw_stream; /**< fast access to raw stream string */ + struct sdp_payload_attr **p_payload_attr; /**< fast access pointers to payloads */ struct sdp_payload_attr *payload_attr; int ice_attrs_num; /**< number of ICE attrs inside a stream */ /* add fast access pointers to ice attributes if you need them */