Hi,
I came across an IP camera which, in my opinion, behaves wrong when set to DHCP
on an Pv4 network.
The camera replies on a RTSP-setup command from a IPv4 address with a SDP-lines
like:
o=- 26064995877 26064995877 IN IP4 10.10.0.129
s=Media Presentation
e=NONE
b=AS:5050
t=0 0
a=control:rtsp://10.10.0.129/Streaming/channels/1/picture/
m=video 0 RTP/AVP 96
c=IN IP6 ::
b=AS:5000
a=recvonly
a=x-dimensions:1920,1080
a=control:rtsp://10.10.0.129/Streaming/channels/1/picture/trackID=1
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=420029; packetization-mode=1;
sprop-parameter-sets=Z00AKp2oHgCJ+WbgICAoAAADAAgAAAMBlCA=,aO48gA==
a=Media_header:MEDIAINFO=494D4B48010300000400000100000000000000000000000000000000000000000000000000000000;
a=appversion:1.0
And I think the o= line conflicts with the c= line. I know that the camera has
an IPv4 address (as can be seen in
the o= line) and the connect comes from an IPv4 address. So, in my opinion, the
camera should answer with
"c=IN IP4 0.0.0.0", if nothing special is required. Would answering with "c=IN
IP6 ::" be covered by the standard
in this case? I think not.
To make our client happy again, I came up with a quick hack, which I am
attaching here. I don't believe this
would be acceptable as patch into live555, but it solved my immediate problem.
And this leads to another question: would manipulating the SDP lines before
calling MediaSession::createNew
be a possible solution, too? It would still be a hack, I know, but when that's
a supported interface (and will
be available in the forseeable future as well), I would feel much better ;-)
CU,
Uli
Ulrich Teichert
Sr. Software Engineer, Technology Development Center VSS
Luminator Technology Group
P: +49 (4321) 539895-13
[email protected]
https://www.luminator.com
LTG Rastatt GmbH | Office Neumünster Oderstrasse 47 | DE - 24539 Neumünster
Geschäftsführer: Roald Greboval, Hans-Joachim Reich | Sitz der Gesellschaft:
D-76437 Rastatt, Amtsgericht: Mannheim, HRB 521501
USt.-IdNr: DE144752608, Steuer-Nr: 39487/30502
Index: liveMedia/MediaSession.cpp
===================================================================
--- liveMedia/MediaSession.cpp (revision 5294)
+++ liveMedia/MediaSession.cpp (working copy)
@@ -28,9 +28,11 @@
////////// MediaSession //////////
MediaSession* MediaSession::createNew(UsageEnvironment& env,
- char const* sdpDescription) {
+ char const* sdpDescription,
+ Boolean ip6Workaround) {
MediaSession* newSession = new MediaSession(env);
if (newSession != NULL) {
+ newSession->fIp6Workaround = ip6Workaround;
if (!newSession->initializeWithSDP(sdpDescription)) {
delete newSession;
return NULL;
@@ -640,6 +642,7 @@
fRTPSocket(NULL), fRTCPSocket(NULL),
fRTPSource(NULL), fRTCPInstance(NULL), fReadSource(NULL),
fReceiveRawMP3ADUs(False), fReceiveRawJPEGFrames(False),
+ fIp6Workaround(parent.fIp6Workaround),
fSessionId(NULL) {
rtpInfo.seqNum = 0; rtpInfo.timestamp = 0; rtpInfo.infoIsNew = False;
@@ -856,7 +859,7 @@
env().setResultMsg("Failed to create read source");
break;
}
-
+
SRTPCryptographicContext* ourCrypto = NULL;
if (useSRTP) {
// For SRTP, we need key management. If MIKEY (key management) state
wasn't given
@@ -1054,6 +1057,11 @@
fConnectionEndpointNameAddressFamily = AF_INET;
return True;
} else if (parseStringValue(sdpLine, "c=IN IP6 %[^/\r\n]",
fConnectionEndpointName)) {
+ if (fIp6Workaround && strcmp(fConnectionEndpointName, "::") == 0) {
+ delete[] fConnectionEndpointName;
+ fConnectionEndpointName = NULL;
+ return False;
+ }
fConnectionEndpointNameAddressFamily = AF_INET6;
return True;
}
Index: liveMedia/include/MediaSession.hh
===================================================================
--- liveMedia/include/MediaSession.hh (revision 5294)
+++ liveMedia/include/MediaSession.hh (working copy)
@@ -63,7 +63,8 @@
class MediaSession: public Medium {
public:
static MediaSession* createNew(UsageEnvironment& env,
- char const* sdpDescription);
+ char const* sdpDescription,
+ Boolean ip6Workaround = False);
static Boolean lookupByName(UsageEnvironment& env, char const* sourceName,
MediaSession*& resultSession);
@@ -147,7 +148,10 @@
char* fSessionName; // holds s=<session name> value
char* fSessionDescription; // holds i=<session description> value
char* fControlPath; // holds optional a=control: string
+public:
+ Boolean fIp6Workaround;
+protected:
// Optional key management and crypto state:
MIKEYState* fMIKEYState;
SRTPCryptographicContext* fCrypto;
@@ -362,6 +366,7 @@
RTPSource* fRTPSource; RTCPInstance* fRTCPInstance;
FramedSource* fReadSource;
Boolean fReceiveRawMP3ADUs, fReceiveRawJPEGFrames;
+ Boolean fIp6Workaround;
// Other fields:
char* fSessionId; // used by RTSP
_______________________________________________
live-devel mailing list
[email protected]
http://lists.live555.com/mailman/listinfo/live-devel