[reSIProcate] Does this a SDP parse compatible problem with RFC ?
Hi all, I have countering a problem with SDP parse, it's seems a compatible bug with RFC.
When I received a INVITE with SDP as this:
v=0
o=- 55 0 IN IP4 192.168.11.205
s=-
t=0 0
m=audio 21758 RTP/AVP 0 101
c=IN IP4 192.168.11.13
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/0
a=ptime:20
a=sendrecv
m=video 41140 RTP/AVP 125
c=IN IP4 192.168.11.13
a=rtpmap:125 H264/90000
a=fmtp:125 profile-level-id=42e015
This SDP have two c= line, and the t= line is before c= line, when I try to got the connection IP by this code:
sdp.session().connection().getAddress()
it's return empty value. I have search the mail list and found this:
I think thread Soctt has said "Here is a note from RFC2327. t= line before c= line is not valid."
With the RFC 4566 and RFC 2327. In both
is written
this:
5 - last paragraph before SDP example:
The connection ("c=") and attribute ("a=") information in the
session-level section applies to all the media of that session unless
overridden by connection information or an attribute of the same name
in the media description. For instance, in the example below, each
media behaves as if it were given a "recvonly" attribute.
5.7. Connection Data ("c=")
c=<nettype> <addrtype> <connection-address>
The "c=" field contains connection data.
A session description MUST contain either at least one "c=" field in
each media description or a single "c=" field at the session level.
It MAY contain a single session-level "c=" field and additional "c="
field(s) per media description, in which case the per-media values
override the session-level settings for the respective media.
The reSIProcate stack is done in this way. It parses all values, and the c=
parameter is
optional. Required parameters are parsed in other way.
if (!pb.eof() && *pb.position() == 'c')
{
mConnection.parse(pb);
}
When it tries to get the Media connection value, it looks into its values,
and when the connection is not present, the session value is returned.
According to this, (especially the 5 section of RFC), the value of c= in
session description should
be overwritten with the value from media section. If not, the SIP stack is
not compatible with RFC.
Thanks