HOME TEAM ARCHITECTURE API IMPLEMENTATION RESEARCH

Client API

General Messaging Structure

{
"event" : "eventname",
"client" : "some client id"
"parameter": { ... }
}

General event structure is to use the event description as trigger for some event.

Optional but recommended is a client id to be set, which identifies a client.

Each event defines an own set of parameters to be used.

General Answer Structure

{
"event" : "eventname",
"request" : { "request as send to the server"}
"response": { ... }
"error" : {
"type" : number
"description" : "error description"
}
}

Each event will be answered with the structure of the event itself, the request send to the server and a response, which may be empty.

Absence of an error means the request was handled successfully.

An error tag included will describe the error which happened.

Client Logout

{
"event" : "logout",
"client" : "some client id"
"parameter": {}
}

Client logout is using the event logout, without any additional parameters set. The clientid is optional, but recommended to be used.

Client Login

{
"event" : "login",
"client" : "some client id"
"parameter":
{
"user" : "user_id",
"password" : "user_password"
}
}

Client login requires the parameter set of user and password. The password is sent in cleartext from client to server and will be checked against the server directive, which may be direct authentication within the core DB or autentication using LDAP.

Update Login

{
"event" : "update_login",
"client" : "some client id"
"parameter":
{
"user" : "user_id",
"session" : "session_id"
}
}

Update login may be used to update some login for some session. The session id is transmitted back to the client during login. An update is a keepalive of the session within the system. The session token is used to validate the session instead of the user's password. This allows updates and session state persistance over multiple logins. (A client may loose the connection and relogin with the session token as password, instead of the actuall user password). This way a passwords may be used once during initial login, but must not be stored within the client for automatic relogins.

media

{
"event" : "media",
"client" : "some client id"
"parameter":
{
"sdp" : "",
"type" : "request"
}
}

The media event will be used to request a media session or answer some media offer by the system.

A media event will always contain the session description as well as the type of event, which may be request, offer or answer.

candidate

{
"event" : "candidate",
"client" : "some client id"
"parameter":
{
"candidate" : "",
"SDPMlineIndex" : "1",
"SDPMid" : "1",
"user" : ""
}
}

Candidate events are used to transfer WebRTC ICE candidates from the browser to the system. The candidate interface MUST be used to generate the media session.

end_of_candidates

{
"event" : "end_of_candidates",
"client" : "some client id"
"parameter": {}
}

End of candidates indication is used to transfer the message that no more candidates are to be expected and candidate gathering is finished at client side.

Authorize

{
"event" : "authorize",
"client" : "some client id"
"parameter":
{
"role" : "role_id"
}
}

Authorization events are used to authorize the role the user has selected over it's interface.

user_roles

{
"event" : "user_roles",
"client" : "some client id"
"parameter": {}
}

User_roles event is used to transmit all the roles the user is allowed to select as some list.

role_loops

{
"event" : "role_loops",
"client" : "some client id"
"parameter": {}
}

Role_loops is used to transmit all the loops a role has configured back to the client as some list.

get

{
"event" : "get",
"client" : "some client id"
"parameter":
{
"type" : "user"
}
}

Get user event is used to get the user description for the user logged in to the system. The user description may contain information like name, color, picture or other additional user information required by the client.

switch_loop_state

{
"event" : "switch_loop_state",
"client" : "some client id"
"parameter":
{
"loop" : "loop id to switch"
"state" : "loopstate to switch to"
}
}

Switch loop state is the core event of the system, which switches a loop to a desired state. Valid states are Monitor, Talk and None.

switch_loop_volume

{
"event" : "switch_loop_volume",
"client" : "some client id"
"parameter":
{
"loop" : "loop id to switch"
"volume" : "volume to switch to"
}
}

Switch loop volume changes the volume within a loop.

talking

{
"event" : "talking",
"client" : "some client id"
"parameter":
{
"loop" : "loop id"
"state" : "on/off"
}
}

Talking is the PTT indication used to transmit systemwide PTT information. Valid states are On and Off to trigger PTT and to untrigger the PTT click.

Logo of openvocs

© 2024 openvocs - All rights reserved.