I want to use RTSP protocol to connect to an IP Camera. I use Visual C++ for this purpose. I searched and find cURL library and downloaded rtsp.c from libcurl site.
I used CMake to convert codes of cURL to suitable sln file for Visual Studio then I created a solution and do other steps to run rtsp.c example.
Now I can connect to my IP Camera with rtsp.c and receives no run time error but I receive "ICMP Destination Unreachable (Port Unreachable)" on WireShark and no stream receives.
On the Other side I can connect to my IP Camera with VLC Player. I changed port numbers on rtsp.c but the problem isn't solved.
I read this but I don't know where is the problem? and how can i solve it?
EDITED:
I used this RTSP code and this RTP code and now I Receive only one RTP Packet that contains this message:
<?xml version="1.0" encoding="UTF-8"?>
<tt:MetaDataStream xmnls:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<tt:Event>
<wsnt:NotificationMessage>
<wsnt:Topic Dialect="http://www.onvif.org/ver10/tec/topicExpression/ConcreteSet">
tns1:Device/Tampering
</wsnt:Topic>
<wsnt:Message>
<tt:Message UtcTime="2016-05-03T00:14:33.775">
<tt:Source>
<tt:SimpleItem Name="VideoSourceConfigurationToken" Value="VideoSource0">
</tt:SimpleItem>
</tt:Source>
<tt:Data>
<tt:SimpleItem Name="Level" Value="Trigger">
</tt:SimpleItem>
<tt:SimpleItem Name="Percentage" Value="32">
</tt:SimpleItem>
</tt:Data>
</tt:Message>
</wsnt:Message>
</wsnt:NotificationMessage>
</tt:Event>
EDITED-2:
I searched and now I know above message is a Device Tampering message that shows an motion detection event on camera but I don't khow Why RTSP Play Command Receives Device Tampering Packet on RTP Port?