Jump to content

AndyLasers

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by AndyLasers

  1. Hello requinix Sadly no, I cannot connect to the camera with basic auth, or at least I could not find any details on how to do that. It seams that basic auth is out dated. I do see a lot of curl expamples and I tried loads, but none I found work with a camera behind a forwarded port like 554, using curl is quite common but as I understand it is reading via a html connection not rtsp. Of course I could also be wrong. I use delphi mostly so PHP is mind boggling for me. As I understand it, the camera is basically asking me to login. How I send the login data is what I am stuck with. So far I am creating a socket to communicate with the camera then perform a basic request "Describe" to the camera Socket Create result: Success Sent to the Camera:DESCRIBE rtsp://IP:554 RTSP/1.0 CSeq: 1 The Camera Responded with RTSP/1.0 401 Unauthorized CSeq: 1 WWW-Authenticate: Digest realm="Login to 3E072F5PAL00180", nonce="f683e059c7c09ca8511322793dc99d2c" NONCE :f683e059c7c09ca8511322793dc99d2c REALM :Login to 3E072F5PAL00180 I then extract nonce and realm from the camera response into these parts $nonce and $realm, I think then I should combine these with the username, password and send back to the camera as a message to perform the login. It is that message that I am lost how to do.
  2. Trying for days to communicate to an IP camera from an apache server using PHP I do get responses from the camera RTSP/1.0 401 Unauthorized CSeq: 1 WWW-Authenticate: Digest realm="Login to 3E072F5PAL00180", nonce="bf2693784e774fb41b569ca02d8abe54" The nonce changes each time I refresh, I guess that is exactly what It should do. I read that I must MD5 the user and password along with some other data and create a string that goes back to the camera to authenticate and once done the camera replies RTSP/1.0 200 OK Somebody has a small bit of code to build the required answer from strings? I am not big in PHP, I did find this on a page but it is way over my head, I do not have anything called $data. $A1 = md5($data['username'] . ':' . $realm . ':' . $users[$data['username']]); $A2 = md5($_SERVER['REQUEST_METHOD'].':'.$data['uri']); $valid_response = md5($A1.':'.$data['nonce'].':'.$data['nc'].':'.$data['cnonce'].':'.$data['qop'].':'.$A2); I get the idea of sending commands with an existing socket. socket_write($socket,$answer); NONCE :62d72a3d3b35bb5440ba29222e3669aa REALM :Login to 3E072F5PAL00180 User : Password : I have assigned directly as strings the password and user.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.