API, HTTP - Interface Specification

Revision: 3.0
Date: 2011-Aug-12


TABLE OF CONTENTS

TABLE OF CONTENTS. 1

DOCUMENT HISTORY.. 1

1 OVERVIEW... 1

1.1 Product and firmware versions. 1

2 REFERENCES. 2

3 DEFINITIONS. 2

3.1 General notation. 2

3.1.1 General abbreviations. 2

3.1.2 Style convention. 2

3.1.3 General CGI URL syntax and parameters. 2

3.1.4 Parameter value convention. 2

4 INTERFACE SPECIFICATION.. 2

4.1 Server responses. 2

4.1.1 HTTP status codes. 2

5 API GROUPS. 2

5.1 General 2

5.1.1 Add, remove, update and list parameters and their values. 2

5.1.2 Hard factory default 2

5.1.3 Backup. 2

5.1.4 Restore. 2

5.1.5 Firmware upgrade. 2

5.1.6 Reboot server 2

5.1.7 Language pack upload. 2

5.2 JPEG.. 2

5.2.1 JPEG image request 2

5.2.2 JPEG image (snapshot) CGI request 2

5.2.3 JPEG image response. 2

5.3 PTZ.. 2

5.3.1 PTZ set 2

5.3.2 PTZ configuration. 2

5.4 Motion/Audio Detection Level 2

5.5 I/O.. 2

5.5.1 Input 2

5.5.2 Output 2

5.6 Audio data transmit 2

5.7 RTSP. 2

5.7.1 Unicast request 2

5.7.2 Unicast response. 2

5.7.3 Multicast request 2

5.7.4 Multicast response. 2

5.8 HTTP event 2

5.8.1 Test event server availability. 2

5.9 Secure socket level 2

5.9.1 Create self-signed certificate. 2

5.9.2 Read certificate information. 2

5.10 Wireless. 2

5.10.1 Site survey. 2

5.10.2 Get IP address. 2

5.11 Network storage. 2

5.11.1 Test network storage server. 2

5.12 Sequence number 2

5.12.1 Clear sequence number 2

5.13 Serve test 2

5.13.1 Test for SMTP. 2

5.13.2 Test for FTP. 2

5.14 File access. 2

5.14.1 File read. 2

5.14.2 File write. 2

               5.15 SD CARD

                    5.15.1 SD State

                    5.15.2 Download file of SD card

 


 

DOCUMENT HISTORY

Version

Date

Comment

3.0

2011-Aug-12

Initial version

 

 

 

 

 

 

 

1 OVERVIEW

This document specifies the external HTTP-based application programming interface of the IP camera and video servers with M2 firmware.

The HTTP-based video interface provides the functionality for requesting single and multi-part images and for getting and setting internal parameter values. The image and CGI-requests are handled by the built-in Web server in the camera and video servers.

1.1 Product and firmware versions

The support for the HTTP API is product and firmware dependent. Please refer to the Release Notes for the actual product for compliance information.

 

2 REFERENCES

HTTP protocol

  1. Hypertext Transfer Protocol -- HTTP/1.0

 

3 DEFINITIONS

This section contains information on general usage of this document.

3.1 General notation

3.1.1 General abbreviations

The following abbreviations are used throughout this document

CGI

Common Gateway Interface - a standardized method of communication between a client (e.g. a web browser) and a server (e.g. a web server).

TBD

To be done/designed - signifies that the referenced section/subsection/entity is intended to be specified, but has not reached a level of maturity to be public at this time.

N/A

Not applicable - a feature/parameter/value is of no use in a specific task

URL

RFC 1738 describes the syntax and semantics for a compact string representation for a resource available via the Internet. These strings are called "Uniform Resource Locators" (URLs).

URI

A Uniform Resource Identifier (URI) is a compact string of characters for identifying an abstract or physical resource. RFC 2396 describes the generic syntax of URI.

 

3.1.2 Style convention

In URL syntax and in descriptions of CGI parameters, text in italics within angle brackets denotes content that should be replaced with either a value or a string. When replacing the text string, the angle brackets must also be replaced. An example of this is the description of the name for the server, denoted with <servername> in the URL syntax description below, which is replaced with the string myserver in the URL syntax example, also shown below.

URL syntax is written with the word "Syntax:" shown in bold face, followed by a box with the referred syntax, as shown below. The name of the server is written as <servername>. This is intended to be replaced with the name of the actual server. This can either be a name, e.g. "thecam" or "thecam.adomain.net" or the associated IP number for the server, e.g. 192.168.1.100.

Syntax:

http://<servername>/cgi-bin/view/image?index=<View Area Index>&res=<Resolution>

A description of returned data is written with "Return:" in bold face, followed by the returned data in a box. All data returned as HTTP-formatted, i.e. starting with the string HTTP, is line-separated with a Carriage Return and Line Feed (CRLF) printed as \r\n.

Return:

HTTP/1.0 <HTTP code> <HTTP text>\r\n

URL syntax examples are written with "Example:" in bold face, followed by a short description and a light grey box with the example.

Example: Request default image.

http://myserver/cgi-bin/vew/image?index=0&res=320x240

Examples of what can be returned by the server from a request are written with "Example:" in bold face, followed by a short description and a light grey box with an example of the returned data.

Example: Returned data after a successful request.

HTTP/1.0 200 Ok\r\n

 

3.1.3 General CGI URL syntax and parameters

CGI URLs are written in lower-case. CGI parameters are written in lower-case and as one word. When the CGI request includes internal camera parameters, the internal parameters must be written exactly as named in the camera or video server. The CGIs are organized in function related directories under the cgi-bin directory. The file extension of the CGI is required.

Syntax:

http://<servername>/cgi-bin/<subdir>[/<subdir>...]/<cgi>
[?<parameter>=<value>[&<parameter>=<value>...]]

Example: List the Network parameters.

http://<servername>/cgi-bin/operator/param?action=list&group=Network

 

3.1.4 Parameter value convention

In tables defining CGI parameters and supported parameter values, the default value for optional parameters is system configured.

 

4 INTERFACE SPECIFICATION

4.1 Server responses

4.1.1 HTTP status codes

The built-in Web server uses the standard HTTP status codes.

Return:

HTTP/1.0 <HTTP code> <HTTP text>\r\n

with the following HTTP code and meanings

HTTP code

HTTP text

Description

200

OK

The request has succeeded, but an application error can still occur, which will be returned as an application error code.

204

No Content

The server has fulfilled the request, but there is no new information to send back.

302

Moved Temporarily

The server redirects the request to the URI given in the Location header.

400

Bad Request

The request had bad syntax or was impossible to fulfill.

401

Unauthorized

The request requires user authentication or the authorization has been refused.

404

Not Found

The server has not found anything matching the request.

409

Conflict

The request could not be completed due to a conflict with the current state of the resource.

500

Internal Server Error

The server encountered an unexpected condition that prevented it from fulfilling the request.

503

Service Unavailable

The server is unable to handle the request due to temporary overload.

Example: Request includes invalid file names.

HTTP/1.0 404 Not Found\r\n

 

5 API GROUPS

To make it easier for developers to get an idea of which API requests are supported for different products, the requests have been grouped together. Information about which groups are supported can be found in the product-specific release notes document.

5.1 General

The requests specified in the General section are supported by all video products with firmware version 4.00 and above.

5.1.1 Add, remove, update, and list parameters and their values

Note:  

  1. These requests have different security levels. The security level for each parameter is specified in the parameter document.
  2. The URL must follow the standard way of writing a URL, (RFC 2396: Uniform Resource Identifiers (URI) Generic Syntax); that is, spaces and other reserved characters (";", "/", "?", ":", "@", "&", "=", "+", "," and "$") within a <parameter> or a <value> must be replaced with %<ASCII hex>. For example, in the string My camera, the space will have to be replaced with %20, My%20camera.

Method: GET/POST

Syntax:

http://<servername>/cgi-bin/view/param?
<parameter>=<value>[&<parameter>=<value>...]
http://<servername>/cgi-bin/operator/param?
<parameter>=<value>[&<parameter>=<value>...]
http://<servername>/cgi-bin/admin/param?
<parameter>=<value>[&<parameter>=<value>...]

with the following parameter and values

<parameter>=<value>

Values

Description

action=<string>

 

add, remove, update or list

Specifies the action to take. Depending on this parameter, various parameters may be set, as described in the following sections.

 

5.1.1.1 List parameters

Syntax:

http://<servername>/cgi-bin/view/param?action=list
[&<parameter>=<value>...]
http://<servername>/cgi-bin/operator/param?action=list
[&<parameter>=<value>...]
http://<servername>/cgi-bin/admin/param?action=list
[&<parameter>=<value>...]

with the following parameter and values

<parameter>=<value>

Values

Description

group=<string>[,<string>...]

<group[.name]>[,<group[.name]>...]

Returns the value of the camera parameter named <group>.<name>. If <name> is omitted, all the parameters of the <group> are returned.

The camera parameters must be entered exactly as they are named in the camera or video server.

Wildcard (*) can be used when listing parameters. See example below.

If this parameter is omitted, all parameters in the device are returned.

Responseformat

rfc

Get the HTTP response format according to standard. 

Response format:
HTTP/1.0 200 OK\r\n
Content-Type: text/plain\r\n
\r\n
<parameter pair>



Example: List the Network parameters.

http://myserver/cgi-bin/admin/param?action=list&group=General.Network

 

5.1.1.2 List output format
HTTP/1.0 200 OK\r\n
Content-Type: text/plain\n
\n
<parameter pair>

where <parameter pair> is

<parameter>=<value>\n
[ <parameter pair> ]



Example: Network query response.

HTTP/1.0 200 OK\r\n
Content-Type: text/plain\n
\n
root.General.Network.eth0.IPAddress=191.168.1.100\n
root.General.Network.eth0.SubnetMask=255.255.255.0\n



If the CGI request includes an invalid parameter value, the server returns no message.
Return:  

HTTP/1.0 200 OK\r\n
Content-Type: text/plain\n
\n

 

 

5.1.1.3 Update parameters

Syntax:

http://<servername>/cgi-bin/operator/param?action=update
[&<parameter>=<value>...]
http://<servername>/cgi-bin/admin/param?action=update
[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

<string>=<string>

<group.name>=<value>

 

Assigns <value> to the parameter <group.name>.

The <value> must be URL-encoded when it contains non-alphanumeric characters.

The camera parameters must be entered exactly as named in the camera or the video server.

Example: Set the image resolution to 320x240 pixels.

http://myserver/cgi-bin/admin/param?action=update&StreamProfile.I0.Video.Resolution=320x240

 

5.1.1.4 Add parameters

Syntax:

http://<servername>/cgi-bin/operator/param?action=add
[&<parameter>=<value>...]
http://<servername>/cgi-bin/admin/param?action=add
[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

group=<string>

<group name>

The group node will be added the parameters.

template=<string>

<template name>

Assign a template you want add. The template must be supported by IPCam.

Example: Add one preset position parameters.

http://cgi-bin/operator/param?action=add&group=EPTZ.PresetGroup.S0.PresetPos&template=PresetPos

 

5.1.1.5 Remove parameters

Syntax:

http://<servername>/cgi-bin/operator/param?action=remove
[&<parameter>=<value>...]
http://<servername>/cgi-bin/admin/param?action=remove
[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

group=<string>

<group name>

The group node will be removed.

Example: Remove a group of parameter.

http://myserver/cgi-bin/admin/param?action=remove&group=PTZ.PresetPos.P0

 

5.1.2 Hard factory default

Reload factory default. All parameters are set to their factory default value.

Note: This request requires administrator access (administrator authorization).

Method: GET

Syntax:

http://<servername>/cgi-bin/admin/hardfactorydefault

 

5.1.3 Backup

Download a unit specific backup of /etc/device.conf.

Note: This requires administrator access (administrator authorization).

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/backup



Return:  

HTTP/1.0 200 OK\r\n
Content-Type: application/x-tar\r\n
Content-Disposition: attachment; filename=backup\r\n
\r\n
<file content of backup>

 

5.1.4 Restore

Upload a unit specific backup previously created by the backup command.

Note: This requires administrator access (administrator authorization).

Method: POST

Syntax:  

http://<servername>/cgi-bin/admin/restore

 

The file content is provided in the HTTP body according to the format given in RFC 1867. The body is created automatically by the browser if using HTML form with input type "file".


Example: Upload of backup, where "\r\n" has been omitted in the HTTP body.

POST /cgi-bin/admin/restore? HTTP/1.0\r\n
Content-Type: multipart/form-data; boundary=123456789\r\n
Content-Length: <content length>\r\n
\r\n
--123456789\r\n
<file content of backup>
\r\n
--123456789--\r\n

 

 

5.1.5 Firmware upgrade

Upgrade the firmware version.

Note: This requires administrator access (administrator authorization).

Method: POST

Syntax:  

http://<servername>/cgi-bin/admin/firmwareupgrade[?action=<value>]



with the following parameters and values

<parameter>=<value>

Values

Description

action=<string>

preset,
default,

progress

Specifies the type of firmware upgrade.

preset = Pre-process for firmware upgrade.
default = Upgrade and reset all settings.

progress = report current upgrade status.

 

The file content is provided in the HTTP body according to the format given in RFC 1867. The body is created automatically by the browser if using HTML form with input type "file".


Example:

POST /cgi-bin/admin/firmwareupgrade?action=preset&action=default HTTP/1.0\r\n
Content-Type: multipart/form-data; boundary=oivazoivaz\r\n
Content-Length: <content length>\r\n
\r\n
--oivazoivaz\r\n
<firmware file content>
\r\n
--oivazoivaz--\r\n

 

 

5.1.6 Reboot server

Reboot server.

Note: This requires administrator access (administrator authorization).

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/reboot

 

5.1.7 Language pack upload

upload the language pack

Note: This requires administrator access (administrator authorization).

Method: POST

Syntax:  

http://<servername>/cgi-bin/admin/language

The file content is provided in the HTTP body according to the format given in RFC 1867. The body is created automatically by the browser if using HTML form with input type "file".


Example:

POST /cgi-bin/admin/language HTTP/1.0\r\n
Content-Type: multipart/form-data; boundary=---------------------------7d82deac0f3a\r\n
Content-Length: <content length>\r\n
\r\n
---------------------------7d82deac0f3a\r\n
<language pack content>
\r\n
---------------------------7d82deac0f3a\r\n

 

5.2 JPEG

The requests specified in the JPEG/MJPG section are supported by those video products that use JPEG and MJPG encoding.

5.2.1 JPEG image request

Returns an image with the default resolution and compression as defined in the system configuration.

Method: GET

Syntax:

http://<servername>/jpg/image.jpg

Example: Request JPEG image from default camera with default resolution and compression.

http://myserver/jpg/image.jpg

 

5.2.2 JPEG image (snapshot) CGI request

Request a JPEG image (snapshot) with specified properties.

Method: GET

Syntax:

http://<servername>/cgi-bin/jpg/image

product/release-dependent.  

Example: Request a JPEG image .

http://myserver/cgi-bin/jpg/image

 

5.2.3 JPEG image response

When a JPEG image is requested, the server returns either the specified JPEG image file or an error.

Return:

HTTP/1.0 200 OK\r\n
Content-Type: image/jpeg\r\n
\r\n
OK\r\n

Example: Requested JPEG image.

HTTP/1.0 200 OK\r\n
Content-Type: image/jpeg \r\n
\r\n
OK\r\n

 

5.3 PTZ

The requests specified in the PTZ section are supported by those video products that have support for Pan/Tilt/Zoom devices.

5.3.1 PTZ set

To control the Pan, Tilt and Zoom behavior of a PTZ unit, the following PTZ control URL is used. This URL has view access rights.

Important: 
Some PTZ units automatically reduce pan and tilt movements as the zoom factor increases. Therefore, the actual movement may be less than what is requested of these units.
The PTZ control is device-dependent. For information about supported parameters and actual parameter values, please check the specification of the PTZ driver you intend to use. The following table is only an overview.

Note:
The URL must follow the standard way of writing a URL, (RFC 2396: Uniform Resource Identifiers (URI) Generic Syntax); that is, spaces and other reserved characters (";", "/", "?", ":", "@", "&", "=", "+", "," and "$") within a <parameter> or a <value> must be replaced with %<ASCII hex>. For example, in the string My camera, the space will have to be replaced with %20, My%20camera.

Method: GET

Syntax:

http://<servername>/cgi-bin/operator/ptzset?<parameter>=<value>[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

center=<int>,<int>

<x>,<y>

Absolute: Used to send the coordinates for the point in the image where the user clicked. This information is then used by the server to calculate the pan/tilt move required to (approximately) center the clicked point.


Relative: Used to send the coordinates for the point in the image where the user clicked. This information is then used by the server to calculate the direction and number of degrees to move. The number of degrees increases with the distance from the center of the image to the point clicked.

imagewidth=<int>

1, ... 1

Required in conjunction with center if the image width displayed is different from the default size of the image, which is product-specific.

imageheight=<int>

1, ... 1

Needed in conjunction with center if the image height is different from the default size, which is product-specific.

move=<string>

home,
up,
down,
left,
right,
upleft,
upright,
downleft,
downright,
repeat,
stop,

reset

 

Absolute: Moves the device 5 degrees in the specified direction. If add move=repeat to URL, it will continue move in the specified direction until receive move=stop URL.


Relative: Move the device approx. 50-90 degrees2 in the specified direction.

Note: Home is only valid if any home position has been previously set with "home=yes".

Note: Reset means motor calibration.

zoom=<string>

0,
1,

out,

in

Absolute: Zoom the device for one second in the specified direction. ‘0’ means zoom-out. ‘1’ means zoon-in.


Relative: n/a

focus=<string>

0,
1,

near,

far

Absolute: Move focus lens for one second. ‘0’ means move toward near. ‘1’ means move toward far.


Relative: n/a

gotoserverpresetname=<string>

<preset name>3

Move to the position associated with the <preset name>.

gotoserverpresetno=<int>

0, ..., 31

Move to the position associated with the specified preset position number.

runservertourno=<int>

0~3

Start a patrol associated with the specified tour number.

stopservertourno=<int>

0~3

Stop a patrol associated with the specified tour number.

stream=<int>

index of view area

Note: Used to control EPTZ, for control physical PTZ is no need this parameter.

1 Product-dependent. Check the product's specification.
2 Actual values are device driver-specific.
3 <preset name> is a string with a maximum of 31 characters, ~ is not allowed.

Example: Request moves the device left and continue.

http://myserver/cgi-bin/operator/ptzset?move=left&move=repeat

 

5.3.2 PTZ configuration

Configure PTZ preset positions.. 

Note: This request requires operator access (operator authorization).

Method: GET

Syntax:

http://<servername>/cgi-bin/operator/ptzconfig?
<parameter>=<value>[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

setserverpresetname=<string>

<preset name>1

Associates the current position to <preset name> as a preset position in the server.

setserverpresetno=<int>

0, ..., 31 

Saves the current position as a preset position number in the server.

home=<string>

yes

Makes the current position the home position for the camera. Used with setserverpresetname or  setserverpresetno.

removeserverpresetname=<string>

<preset name>1

Remove the specified preset position associated with <preset name>.

removeserverpresetno=<int>

0, ..., 31

Remove the specified preset position.

removeallpreset

 

Remove all preset.

stream=<int>

index of view area

Note: Used to control EPTZ, for control physical PTZ is no need this parameter.

1 <preset name> is a string with a maximum of 31 characters, ~ is not allowed.

 

5.4 Motion/Audio Detection Level

Retrieve the current motion/audio detection level from all or specific motion detection include windows. Alternatively, retrieve all motion detection levels related to a specific motion detection window configuration. A motion detection window is defined by a dynamic parameter group Motion.M<group number>.

Method: GET

Syntax:

http://<servername>/cgi-bin/ admin/detection?
<parameter>=<value>[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

mode=<string>

single

If specified to single, data only sent once. (This parameter must be add to cgi first)

type=<string>

motion, audio

Specify the detection type.

group=<int>[,<int>,…]

<group number>[,<group number>, …]

Specify the motion/audio detection windows that are of interest. Excluding the group argument will return all motion detection level information from all motion detection windows Exclude window are ignored.

1 <preset name> is a string with a maximum of 31 characters, ~ is not allowed.

Return:

HTTP Code: 200 OK
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Body:
--<boundary>
<motion/audio levels>

where the returnd <motion/audio levels> part is

Content-Type: text/plain

and the <monitor data> part is

<motion/audio level for window with lowest group number>
--<boundary>

and <motion/audio level for window with group number n> is

Group=<group number n>;level=<motion level for n>;threshold=<threshold level for n>;
[ <motion/audio level for window n+1> ]

 

Example: Get motion detection levels related to motion detection windows defined within Motion.M0 and Motion.M1.

http://myserver/cgi-bin/admin/detection? type=motion&group=0,1

The example returns the following.

HTTP Code: 200 OK

Content-Type: multipart/x-mixed-replace;boundary=detection

Body:

--detection
Content-Type: text/plain
 
 
group=0;level=28;threshold=45; 
group=0;level=43;threshold=25;
--detection
Content-Type: text/plain
 
 
group=0;level=12;threshold=45; 
group=0;level=33;threshold=25;
--detection
Content-Type: text/plain
 
 
group=0;level=56;threshold=45; 
group=0;level=3;threshold=25;
--detection
 

 

5.5 I/O

The requests specified in the I/O section are supported by those products that have Input/Output connectors.

5.5.1 Input

Digital Input

Method: GET

Note: This request requires administrator access (administrator authorization).

Syntax:  

http://<servername>/cgi-bin/admin/input?
<parameter>=<value>[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

check=<int>[,<int>, ...]

<id1>[,<id2>, ...] 1

Returns the status (1 or 0) of one or more inputs numbered id1 ,id2, ....

checkactive=<int>[,<int>, ...]

<id1>[,<id2>, ...] 1

Returns the status (active or inactive) of one or more inputs numbered  id1,id2, ....

monitor=<int>[,<int>, ...]2

<id1>[,<id2>, ...] 1

Returns a multipart stream of "check" inputs (see return description below).

1 Number of inputs may differ for different cameras and video servers. See the product's specification.
2 Support for this parameter is product/release-dependent.

Return: "monitor", i.e., multipart "check" parameter

HTTP/1.0 200 OK\r\n
Content-Type: multipart/x-mixed-replace;boundary=<boundary>\r\n
\r\n 
--<boundary>\r\n
<monitor data>

where the proposed boundary <boundary> is

ioboundary

and the <monitor data> part is

Content-Type: text/plain\r\n
\r\n
<check data>
--<boundary>\r\n

and <check data> is

IO<n>:<action char>\r\n

and <n> is the I/O port number and <action char> is the action character described in the table above.
Note: The output can contain extra blank lines, i.e., extra
\r\n within the sections.

Example: Monitor data on input ports 1, 2, 3, and 4.

http://myserver/cgi-bin/admin/input?monitor=1,2,3,4

Example: Monitor data on input port 1.

HTTP/1.0 200 OK\r\n
Content-Type: multipart/x-mixed-replace; boundary=ioboundary\r\n
\r\n
\r\n
\r\n
\r\n
--ioboundary\r\n
Content-Type: text/plain\r\n
\r\n
IO0:/\n
\r\n
\r\n
--ioboundary\r\n
Content-Type: text/plain\r\n
\r\n
IO0:H\n
\r\n
--ioboundary\r\n
Content-Type: text/plain\r\n
\r\n
\r\n
IO0:\\n
\r\n
\r\n
--ioboundary\r\n
Content-Type: text/plain\r\n
\r\n
\r\n                      
\r\n
\r\n
--ioboundary\r\n
Content-Type: text/plain\r\n
\r\n
\r\n
 .
 .
 .

 

5.5.2 Output

Digital Output

Method: GET

Note: This request requires administrator access (administrator authorization).

Syntax:

http://<servername>/cgi-bin/admin/output?
<parameter>=<value>[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

check=<int>[,<int>, ...]

<id1>[,<id2>, ...] 1

Returns the status (1 or 0) of one or more outputs numbered id1 ,id2, ....

checkactive=<int>[,<int>, ...]

<id1>[,<id2>, ...] 1

Returns the status (active or inactive) of one or more outputs numbered id1 ,id2, ....

monitor=<int>[,<int>, ...] 2

<id1>[,<id2>, ...] 1

Returns a multipart stream of "check" outputs (see return description below).

action=<string>

[<id>1]:<a>[<wait> <a> ...]

Sets the output relay <id> active or inactive and waits <wait> milliseconds. Note that only one output relay can be activated/deactivated per request.

<id> = Output number. If omitted, output 1 is selected.

<a> = Action character: / or \
/ = active, \ = inactive.

<wait> = Delay in milliseconds.

1 Number of outputs may differ for different cameras and video servers. See the product's specification.
2 Support for this parameter is product/release-dependent.

 

Example: Set output 1 active.

http://myserver/cgi-bin/admin/output?action=1:/

Example: Set two 300 ms pulses with 500 ms delay between the pulses on output 1.

http://myserver/cgi-bin/admin/output?action=1:/300\500/300\

Example: Wait 1 second before setting output 1 active.

http://myserver/cgi-bin/admin/output?action=1:1000/

 

5.6 Audio data transmit

Transmit a Singlepart/Multipart Audio data stream.

Method: POST

Syntax:  

http://<servername>/cgi-bin/admin/transmit

 

There are no valid parameters and values.

Example: Singlepart/Multipart Audio data

http://myserver/cgi-bin/admin/transmit

 

5.7 RTSP

The requests specified in the RTSP section are supported by those products that support Real Time Streaming Protocol.

5.7.1 Unicast request

Method: GET

Syntax:  

rtsp://<servername>:<rtsp port>/video.pro1*

*Example: Request a RTSP Description file

http://myserver:554/video.pro1*

*The actual file name should be got from parameter. Check parameter document for reference.

5.7.2 Unicast response

When RTSP unicast is requested, the server returns a descript file of RTSP video/audio streams. The content type is " application/sdp". Then client can parse the descript file to SETUP, PLAY and TEARDOWN the RTSP stream

Return:

RTSP/1.0 200 OK\r\n
CSeq: 1\r\n
Date: Mon Nov 1 11:42:19 2008 GMT\r\n
Content-base: rtsp://<servername>:<rtsp port>/video.pro1/\r\n
Content-Type: application/sdp\r\n
Content-Length: <descript file size>\r\n
\r\n
<descript file body>\r\n

Example: Requested RTSP Description file.

RTSP/1.0 200 OK\r\n
CSeq: 1\r\n
Date: Mon Nov 1 11:42:19 2008 GMT\r\n
Content-base: rtsp://192.168.1.8:554/video.pro1/\r\n
Content-Type: application/sdp\r\n
Content-Length: <sdp length>\r\n
\r\n
v=0\r\n
o=RTSP 424238335 0 IN IP4 <server_ip>\r\n
s=QStream\r\n
c=IN IP4 0.0.0.0\r\n
t=0 0\r\n
a=range:npt=0-\r\n
a=control:*\r\n
m=video 0 RTP/AVP 99\r\n
a=rtpmap:99 H264/90000\r\n
a=fmtp:99 profile-level-id=42A01E;packetization-mode=1;sprop-parameter-sets=Z0IAKOkAoAQMgA==,aM44gA==\r\n
a=control:trackID=0\r\n
m=audio 0 RTP/AVP 0\r\n
a=control:trackID =1\r\n
\r\n

5.7.3 Multicast request

Method: GET

Syntax:  

rtsp://<servername>:<rtsp port>/multi.pro1*

Example: Request a RTSP Description file

http://myserver:554/multi.pro1*

*The actual file name should be got from parameter. Check parameter document for reference.

5.7.4 Multicast response

When RTSP multicast is requested, the server returns a descript file of RTSP video/audio streams. The content type is " application/sdp". Then client can parse the descript file to SETUP, PLAY and TEARDOWN the RTSP stream.

Return:

RTSP/1.0 200 OK\r\n
CSeq: 1\r\n
Date: Mon Nov 1 11:42:19 2008 GMT\r\n
Content-base: rtsp://<servername>:<rtsp port>/multi.pro1/\r\n
Content-Type: application/sdp\r\n
Content-Length: <descript file size>\r\n
\r\n
<descript file body>\r\n

Example: Requested RTSP Description file.

RTSP/1.0 200 OK\r\n
CSeq: 1\r\n
Date: Mon Nov 1 09:23:42 2008 GMT\r\n
Content-base: rtsp://192.168.1.8:554/multi.pro1/\r\n
Content-Type: application/sdp\r\n
Content-Length: <sdp length>\r\n
 
v=0
o=RTSP 1101513929 0 IN IP4 <multicast_ip>\r\n
s=QStream\r\n
c=IN IP4 <multicast_ip>\r\n
t=0 0\r\n
a=range:npt=0-\r\n
a=control:*\r\n
m=video <multicast_video_port> RTP/AVP 99\r\n
a=rtpmap:99 H264/90000\r\n
a=fmtp:99 profile-level-id=42A01E;packetization-mode=1;sprop-parameter-sets=Z0IAKOkAoAQMgA==,aM44gA==\r\n
a=control:trackID=0\r\n
m=audio 0 RTP/AVP 0\r\n
a=control:trackID=1\r\n
\r\n

5.8 HTTP event

If an event handling server is available, user can configure the CGI parameters and/or messages sent to the event server when event occurred.

5.8.1 Test event server availability

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/testhttp?
<parameter>=<value>[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

url=<string>

 

Event server address.

cgipath=<string>

 

CGI path and CGI name.

port=<int>

1, ... 65535

Event server port.

username=<string>

 

User name.

userpass=<string>

 

User password.

proxyaddr=<string>

 

Proxy address.

proxyport=<int>

1, ... 65535

Proxy port.

proxyuser=<string>

 

User name of proxy server.

proxypass=<string>

 

Password of proxy server.

Return: HTTP code from event server.

HTTP/1.0 200 OK\r\n
Content-Type: text/plain\n
\n
 
 

Example:

http://myserver/cgi-bin/admin/testhttp?
url=192.168.1.10&cgipath=/cgi/serverhandler&port=80&username=user&userpass=password

 

5.9 Secure socket level

Create a certificate or read the content of SSL(secure socket level) certificate.

5.9.1 Create self-signed certificate

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/sslselfsign?
<parameter>=<value>[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

CNTR=<string>

 

2-letter country code of subject that conforms to ISO-3166.

STAT=<string>

 

State or province of subject.

LOCA=<string>

 

Locality of subject.

ORGA=<string>

 

Organization of subject.

ORUN=<string>

 

Organizational unit of subject.

CMNM=<string>

 

Common name of subject (The URL of product).

VALI=<int>

1, ... 1000

Validity period of certification.

Return:

HTTP/1.0 200 OK\r\n
Content-Type: text/plain\n
\n
 

Example:

http://myserver/cgi-bin/admin/sslselfsign?CNTR=TW&STAT=Taipei&LOCA=TaipeiCity&ORGA=company&ORUN=organization&CMNM=192.168.1.10&VALI=365

 

5.9.2 Read certificate information

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/sslcertinfo

Return: Content of certificate.

HTTP/1.0 200 OK\r\n
Content-Type: text/plain\n
\n

Certificate: \n
    Data:
\n
        Version: 4 (0x3)
\n
        Serial Number: 0 (0x0)
\n
        Signature Algorithm: md5WithRSAEncryption
\n
        Issuer: C=TW, ST=Taipei, L=TaipeiCity, O=company, OU=organization, CN=192.168.1.10
\n
        Validity
\n
            Not Before: Nov 14 11:29:50 2007 GMT
\n
            Not After : Nov 13 11:29:50 2008 GMT
\n
        Subject: C=TW, ST=Taipei, L=TaipeiCity, O=company, OU=organization, CN=192.168.1.10
\n
        Subject Public Key Info:
\n
            Public Key Algorithm: rsaEncryption
\n
            RSA Public Key: (1024 bit)
\n
                Modulus (1024 bit):
\n
                    00:a1:54:8b:4a:90:3b:bb:14:dd:0d:d7:e1:f0:72:
\n
                    6c:24:d7:59:d7:ea:16:02:88:fa:4c:19:d4:7b:04:
\n
                    9d:ee:c2:89:ad:11:ab:a6:a0:05:ca:63:60:6a:5e:
\n
                    13:97:b2:5c:1d:84:ab:96:90:2a:c7:82:25:15:0c:
\n
                    ef:09:26:cb:c2:f5:aa:ce:63:cc:7f:55:92:f3:35:
\n
                    02:a9:4e:33:90:ea:dd:7c:1c:b5:98:2a:ef:e9:6e:
\n
                    34:09:16:1f:34:97:a4:f7:10:80:62:a1:a0:ae:f9:
\n
                    56:28:70:6d:53:1b:06:70:2c:4b:6b:49:ca:b5:11:
\n
                    01:65:0a:11:0a:59:e5:07:73
\n
                Exponent: 65537 (0x10001)
\n
    Signature Algorithm: md5WithRSAEncryption
\n
        77:e3:bd:d4:28:75:99:f2:a1:9c:d3:6d:72:ec:b9:c8:14:ab:
\n
        b6:df:e9:ba:8a:b5:41:ff:2d:be:92:46:60:28:08:ee:a5:16:
\n
        cb:b9:96:bf:60:63:38:cc:18:cd:0e:a4:7a:86:4e:6f:ec:86:
\n
        60:72:50:ce:6f:93:ec:7b:0a:4d:0f:e6:3d:60:77:aa:e8:9e:
\n
        e6:88:28:14:50:9c:55:7c:21:c8:3f:48:1c:41:0a:d2:aa:1a:
\n
        e9:96:66:06:d8:53:be:58:7a:83:24:71:9f:38:de:c7:51:36:
\n
        9e:cd:5d:da:43:bb:75:2d:bc:51:c9:d8:16:59:22:1b:4d:c3:
\n
        59:e9
\n

 

Example: Read the content of current certificate.

http://myserver/cgi-bin/admin/sslcertinfo

 

5.10 Wireless

The requests specified in the Wireless section are supported by those products that support wireless.

5.10.1 Site survey

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/sitesurvey

Return:

HTTP/1.1 200 OK
Content-type: text/plain
 
<Channel> <SSID> <Signal Strength> <Mode> <Authentication> <Security> <Bit Rate>

the return parameters

Parameter

Valid values

Description

<Channel>

A Integer

Specify the AP channel.

<SSID>

A string

Specifies the Service Set ID.

<Signal Strength >

A Integer

Specify the AP signal strength.

<Mode>

Infra,
AdHoc

Enable\disable security

 ‘Infra’ = ‘Managed’

 ‘AdHoc’ = ‘AdHoc’

<Authentication>

WPA-PSK,
Open,
SharedKey

Specifies the authentication mode

‘WPA-PSK’ = ‘Open’

‘Open’ = ‘Open’

‘SharedKey’ =  ‘SharedKey’

<Security>

NONE,
TKIP,
WEP.

Specifies the security mode

‘NONE’ = ‘NoSecurity’

’TKIP’ = ‘WPA-PSK’

‘WEP’ = ‘WEP’

<Bit Rate>

A Integer

Specify the AP transmit bit rate.

 

Example:

http://<servername>/cgi-bin/admin/sitesurvey

 5.10.2 Get IP address

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/ipgetwlan

Return:

HTTP/1.1 200 OK
Content-type: text/plain
 
<IP address>

Example:

http://<servername>/cgi-bin/admin/ipgetwlan

 

5.11 Network storage

5.11.1 Test network storage server.

 Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/netstoragetest?
<parameter>=<value>[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

fstype=<string>

 cifs, nfs

Type of network storage

location=<string>

 

IP and directory of server.

username=<string>

 

User name.

password=<string>

 

Password.

workgroup=<string>

 

Workgroup.

Return:

HTTP/1.0 200 OK\r\n
Content-Type: text/plain\n
\n
#Network storage test OK

Example:

/cgi-bin/admin/netstoragetest?&fstype=cifs&location=//10.0.0.56/ns&username=usr&password=pas&workgroup=none

 

5.12 Sequence number

The sequence number is used for the suffix of file name in ftp client, SMTP, network storage, and memory card.

5.12.1 Clear sequence number

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/seqclear?<parameter>=<value>

with the following parameters and values

<parameter>=<value>

Values

Description

Clear.ftp=<int>

An integer

Set sequence number of ftp alarm.

Clear.ftp_p=<int>

An integer

Set sequence number of ftp periodical.

Clear.smtp=<int>

An integer

Set sequence number of SMTP alarm.

Clear.smtp_p=<int>

An integer

Set sequence number of SMTP periodical.

Clear.storage=<int>

An integer

Set sequence number of network storage alarm.

Clear.storage_p=<int>

An integer

Set sequence number of network storage periodical.

Clear.sdcard=<int>

An integer

Set sequence number of memory card alarm.

Clear.sdcard_p=<int>

An integer

Set sequence number of memory card periodical.

Return:

HTTP/1.1 200 OK
Content-type: text/plain\n
File write OK: /mnt/mtd/seqno.txt\n

Example:

http://<servername>/cgi-bin/admin/seqclear?Clear.ftp=0

 

5.13 Serve test

This CGI is to verify connection of FTP client or SMTP server and make sure the parameters are correct.

5.13.1 Test for SMTP

The process of SMTP test should be as follows:

1.      Write mail title to /tmp/subject.txt and mail message to /tmp/message.txt via filewrite command (See section 5.14 for reference).

2.      Send CGI command.

3.      Read file /testsmtp.log for test result via fileread command (See section 5.14 for reference).

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/servetest?<parameter>=<value>

with the following parameters and values

<parameter>=<value>

Values

Description

cmd=<string>

smtp,
clearsmtp

smtp: Test SMTP setting.
clearsmtp: Abort current test.

ServerName=<string>

An string

Server name.

ServerPort=<int>

An integer

Server port.

ServerSSL=<string>

on, off

Specify if connect with SSL protocol.

UserName=<string>

A string

User name.

Password=<string>

A string

User password.

RcptToAddr1=<string>

A string

Receiver mail address.

AdminAddr=<string>

A string

Transmitter mail address.

Return:

HTTP/1.1 200 OK
Content-type: text/plain\n
\n

Example:

http://<servername>/cgi-bin/admin/servetest?cmd=smtp&ServerName=mailserver.com&ServerPort=25&ServerSSL=off&UserName=user &Password=pass&RcptToAddr1=receive@mail.com&AdminAddr=admin@mail.com
 
Content of testsmtp.log:
smtp: Connect to host 
   
smtp: Start AUTH  
  smtp: AUTH CRAM-MD5
   success
smtp: MAIL FROM:<admin@mail.com>
   
smtp: RCPT TO:<receive@mail.com>
   
smtp: Send message   message sent
smtp: QUIT
   
..............SMTP Test Success..............

 

5.13.2 Test for FTP

The process of FTP test should be as follows:

1.      Write an arbitrarily string to /var/ftptest via filewrite command (See section 5.14 for reference).

2.      Send CGI command.

3.      Read file /testftp.log for test result via fileread command (See section 5.14 for reference).

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/servetest?<parameter>=<value>

with the following parameters and values

<parameter>=<value>

Values

Description

cmd=<string>

ftp,
clearftp

ftp: Test FTP setting.
clearftp: Abort current test.

ServerName=<string>

A string

Server name.

UserName=<string>

A string

User name.

Password=<string>

A string

User password.

Passive=<string>

on, off

Passive mode.

SourceName=<string>

A string

Path and filename of file to be transmitted.

TargetName=<string>

A string

File name on FTP server.

Return:

HTTP/1.1 200 OK
Content-type: text/plain\n
\n

Example:

http://<servername>/cgi-bin/admin/servetest?cmd=ftp&ServerName=192.168.10.10&UserName=user&Password=user&Passive=off&SourceName=/var/ftptest&TargetName=testfile
 
Content of testftp.log:
Send file to ftp://user:xxxxx@192.168.10.10:21/testfile
Connecting to 192.168.10.10:21... ! connected
Logging in as user ... Logged in!
File transmit : 
 
    success
Transfered 7 bytes in 1 file
..............FTP Test Success..............

 

5.14 File access

5.14.1 File read

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/fileread?<parameter>=<value>

with the following parameters and values

<parameter>=<value>

Values

Description

READ.filePath=<string>

A string

File name and path to be read.

Return:

HTTP/1.1 200 OK
Content-type: text/plain\n
\n

Example:

http://<servername>/cgi-bin/admin/fileread?READ.filePath=/testftp.log

5.14.2 File write

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/filewrite?<parameter>=<value>

with the following parameters and values

<parameter>=<value>

Values

Description

SAVE.filePath=<string>

A string

File name and path to be write to.

SAVE.fileData=<string>

A string

File data to be write to.

Return:

HTTP/1.1 200 OK
Content-type: text/plain\n
\n

Example:

http://<servername>/cgi-bin/admin/filewrite?SAVE.filePath=/var/ftptest&SAVE.fileData=testtest

 

5.15 SD Card

5.15.1 SD State

Method: GET

Syntax:  

http://<servername>/cgi-bin/admin/sdstate?<parameter>=<value>[&<parameter>=<value>...]

with the following parameters and values

<parameter>=<value>

Values

Description

action=<string>

cardsize
filelist
format
delete
savetonfs

cardsize: Get card total size and available size.
filelist: List file of card.
format: Format the card.
delete: Delete the file.
savetonfs: Save file to network storage.

directory=<string>

A string

Directory to be list.

filename=<string>

A string

File to be delete or save to network storage.

Return:

HTTP/1.1 200 OK
Content-type: text/plain\n
\n
Line-based text data: text/plain
<card size> <file list>

Example:

http://<servername>/cgi-bin/admin/sdstate?action=cardsize
 
Content of text data:

3850676/3854980 KB

 
http://<servername>/cgi-bin/admin/sdstate?action=filelist&directory=IPCamera001BFE02706B
 
Content of text data:

drwxr-xr-x    2 root     root         4096 Jan  1  1980 Alarm/

drwxr-xr-x    4 root     root         4096 Jan  1  1980 Backup/

drwxr-xr-x    3 root     root         4096 Feb 15 10:52 Period/

 
http://<servername>/cgi-bin/admin/sdstate?action=format
 
http://<servername>/cgi-bin/admin/sdstate?action=delete&filename=IPCamera001BFE02706B/Period/19700101/10/test.avi
 
http://<servername>/cgi-bin/admin/sdstate?action=savetonfs&filename=IPCamera001BFE02706B/Period/19700101/10/test.avi

 

5.15.2 Download file of SD card

Method: GET

Syntax:  

http://<servername>/sd/IPCamera<MAC address>/<directory path>/filename

Example:

http://<servername>/sd/IPCamera001BFE02706B/Period/20110215/09/20110215091005.avi