Module: sip-router Branch: master Commit: 88a8eb348359f05a1ff14371f8e323cf086d6497 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=88a8eb34...
Author: Juha Heinanen jh@tutpro.com Committer: Juha Heinanen jh@tutpro.com Date: Mon Dec 31 18:16:23 2012 +0200
parser/sdp: added 'a:remote-candidates' media stream attribute
---
parser/sdp/sdp.c | 9 +++++++-- parser/sdp/sdp.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/parser/sdp/sdp.c b/parser/sdp/sdp.c index ab04d60..93440bf 100644 --- a/parser/sdp/sdp.c +++ b/parser/sdp/sdp.c @@ -369,6 +369,7 @@ static int parse_sdp_session(str *sdp_body, int session_num, str *cnt_disp, sdp_ sdp_payload_attr_t *payload_attr; int parse_payload_attr; str fmtp_string; + str remote_candidates = {"a:remote-candidates:", 20};
/* hook the start and lenght of sdp body inside structure * - shorcut useful for multi-part bodies and sdp operations @@ -553,6 +554,9 @@ static int parse_sdp_session(str *sdp_body, int session_num, str *cnt_disp, sdp_ set_sdp_payload_fmtp(payload_attr, &fmtp_string); } else if (parse_payload_attr && extract_candidate(&tmpstr1, stream) == 0) { a1p += 2; + } else if (parse_payload_attr && extract_field(&tmpstr1, &stream->remote_candidates, + remote_candidates) == 0) { + a1p += 2; } else if (extract_accept_types(&tmpstr1, &stream->accept_types) == 0) { a1p = stream->accept_types.s + stream->accept_types.len; } else if (extract_accept_wrapped_types(&tmpstr1, &stream->accept_wrapped_types) == 0) { @@ -822,7 +826,7 @@ void print_sdp_stream(sdp_stream_cell_t *stream, int log_level) sdp_payload_attr_t *payload; sdp_ice_attr_t *ice_attr;
- LOG(log_level , "....stream[%d]:%p=>%p {%p} '%.*s' '%.*s:%.*s:%.*s' '%.*s' [%d] '%.*s' '%.*s:%.*s' (%d)=>%p (%d)=>%p '%.*s' '%.*s' '%.*s' '%.*s' '%.*s' '%.*s'\n", + LOG(log_level , "....stream[%d]:%p=>%p {%p} '%.*s' '%.*s:%.*s:%.*s' '%.*s' [%d] '%.*s' '%.*s:%.*s' (%d)=>%p (%d)=>%p '%.*s' '%.*s' '%.*s' '%.*s' '%.*s' '%.*s' '%.*s'\n", stream->stream_num, stream, stream->next, stream->p_payload_attr, stream->media.len, stream->media.s, @@ -838,7 +842,8 @@ void print_sdp_stream(sdp_stream_cell_t *stream, int log_level) stream->path.len, stream->path.s, stream->max_size.len, stream->max_size.s, stream->accept_types.len, stream->accept_types.s, - stream->accept_wrapped_types.len, stream->accept_wrapped_types.s); + stream->accept_wrapped_types.len, stream->accept_wrapped_types.s, + stream->remote_candidates.len, stream->remote_candidates.s); payload = stream->payload_attr; while (payload) { LOG(log_level, "......payload[%d]:%p=>%p p_payload_attr[%d]:%p '%.*s' '%.*s' '%.*s' '%.*s' '%.*s'\n", diff --git a/parser/sdp/sdp.h b/parser/sdp/sdp.h index dc0dede..550a2d3 100644 --- a/parser/sdp/sdp.h +++ b/parser/sdp/sdp.h @@ -86,6 +86,7 @@ typedef struct sdp_stream_cell { int ice_attrs_num; /**< number of ICE attrs inside a stream */ /* add fast access pointers to ice attributes if you need them */ sdp_ice_attr_t *ice_attr; + str remote_candidates; /**< ICE a:remote-candidates */ } sdp_stream_cell_t;
typedef struct sdp_session_cell {