Session CGI
Version / Author / Date | Modify |
---|---|
1.0/David/2013-03-30 | First edition |
Outline
Users can create, maintain, end and query the Session through the CGI interface. Users can got the returned Session ID after a Session is created, user can pass in the Session lifetime.A Session`s survival period is 10 minutes, users can authenticate if they use the session`s ID during their lifetime. Then if the user call within 10 minutes, the lifetime of the Session will be extended by 10 minutes from the moment.Again and again, Session survival can be maintained constantly. The login username/password which required in the mode of Parameter authentication. For example: Users to create Session http://192.168.0.188/create_session.cgi?user=visitor&pwd = IP Camera Back var session = 268480091; var group = 65475; Then the user as long as the call within 10 minutes http://192.168.0.188/get_status.cgi?session=268480091 The lifetime of the Session will be extended by 10 minutes from the moment. The cycle can be achieved to maintain Session viable role.
Create Session
create_session.cgi
- Permission requirements:
Visitors
- Syntax:
/create_session.cgi[?user=&pwd=&session=&group=&json=&jsonp_callback=]
- Parameters:
user/pwd:parameter authentication methods required to login username/password session/group:the return of the corresponding variable name set json/jsonp_callback:return the json type of data set
- Returns:
session:Creating a Session ID, 0 on behalf of Create Session failed. group:Create Session with permission, -1 means to create Session failed. Other values are as follows: Managers 0x1ffff Visitors Bit0:whether have the permission to access video Bit1:whether have the the permission to take photoes Bit2:whether have the the permission to take video Bit3:whether have the the permission to access audio Bit4:whether have the the permission to dialogue Bit5:whether have the the permission to control
- Example:
http://192.168.0.188/create_session.cgi?user=visitor&pwd= IP Camera Returns: var session=268480091; var group=65475; http://192.168.0.188/create_session.cgi?user=admin&pwd=&session=s&group=g IP Camera Returns: var s=1891048766; var g=131071;
- Description:
create_session.cgi has some difference from other CGI,if you use the authentication method of HTTP Basic Authentication to use create_session.cgi,it does not pop up a dialog box to prompt for a username / password,instead back directly: var session=0; var group=-1;
End Session
close_session.cgi
- Permission requirements:
No
- Syntax:
/close_session.cgi?session=[&next_url=&json=&jsonp_callback=]
- Parameters:
session:To end the Session ID next_url: return to the page after the successful operation json/jsonp_callback:return the json type of data set
- Returns:
Operating results of text information or specified page
- Example:
http://192.168.0.188/close_session.cgi?session=268480091
Query list of current IP Camera Session
get_session_list.cgi
- Permission requirements:
Managers
- Syntax:
/get_session_list.cgi[?user=&pwd=&session=&session_user=&session_ip=&number=&json=&jsonp_callback=]
- Parameters:
user/pwd:parameter authentication method required to login username / password session:Session authentication method required to Session ID session_user/session_ip/number: returns the corresponding variable names Settings json/jsonp_callback:return the json type of data set
- Returns:
If back js text: session_user:array variables, create the Session User Name session_ip:array variables, create Session IP address number:the number of variables in the array If the return json text Session array of objects, user and ip session objects include two elements
- Example:
http://192.168.0.188/get_session_list.cgi?session=1891048766&session_user=user&session_ip=ip
- IP Camera Returns:
var user=new Array(); var ip=new Array(); user[0]='visitor'; ip[0]='192.168.0.16'; user[1]='admin'; ip[1]='192.168.0.16'; var number=2;