Difference between revisions of "Ackis2.0/Protocol"

From Makers Local 256
Jump to: navigation, search
(Packet: add a provision for reporting errors of various types, also add in a tag for variable retrieval from the originator)
m (added related information)
 
(15 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
* Typically the only attribute in the <packet> tag
 
* Typically the only attribute in the <packet> tag
 
* String of a reasonable length
 
* String of a reasonable length
 +
==auth==
 +
===username===
 +
* the username, duh
 +
===hash===
 +
* this is a md5 hash of the username concatenated with the responseid and password in that order
  
 
==register==
 
==register==
Line 21: Line 26:
 
===data===
 
===data===
 
* contents of message
 
* contents of message
 +
===type===
 +
* type of message
 +
** targeted
 +
** triggered
 +
** emote
 +
** topic
 +
** mode
 +
** quit
 +
** join
 +
** part
 +
** none
  
==components?==
+
==component==
 +
If component is implemented, it must support at least action=list, type=types, and type=actions so you can get a listing of the types and actions supported.
 
===action===
 
===action===
 
* '''list'''
 
* '''list'''
 
** returns a list of all of the components of '''type'''
 
** returns a list of all of the components of '''type'''
  
* '''type'''
+
===type===
** '''module''' or '''resource''' or something the core will have listed.
+
* '''module''' or '''resource''' or something the core will have listed.
  
 
==resource==
 
==resource==
Line 37: Line 54:
 
* something like '''query''' for the database resource or '''convert''' for the image resource
 
* something like '''query''' for the database resource or '''convert''' for the image resource
  
===results===
+
===data===
 +
* this field can be used in both directions, or only the return direction depending on whether the resource needs bulk data along with the action
 
* rides on the responseid back to the calling component
 
* rides on the responseid back to the calling component
 
* maybe this is just a subset of <message>s?
 
* maybe this is just a subset of <message>s?
Line 43: Line 61:
 
==variable==
 
==variable==
 
* lets a component retrieve a variable from an other component that initiated a message
 
* lets a component retrieve a variable from an other component that initiated a message
* utilizes the same responseid that the originating message came in on?
 
 
===name===
 
===name===
 
* contains the name of the variable to be returned
 
* contains the name of the variable to be returned
 
===value===
 
===value===
 
* contains the value of the variable to be returned
 
* contains the value of the variable to be returned
==error==
+
===responseid===
This tag exists to describe errors encountered by either the core or a component and will typically close the connection.
+
* the responseid that the message came in on and identifies the transaction to the core and to the initiator
===type===
+
** the core MUST translate this forward and backward as necessary or the initiator will be unaware of the responseid
This describes the type of error such as "protocol" or whatever may be appropriate.
+
 
 +
==info==
 +
* describes an error encountered by either the core or a component and will close the connection in most cases.
 +
===number===
 +
* similar to HTTP error messages?
 +
** 2xx for general info
 +
*** 200 Acknowldegement
 +
** 4xx for user error
 +
*** 400 Missing or bad critical identifier (could be a responseid, a variable name, or a registration type)
 +
*** 401 Component not registered
 +
*** 402 Multiple component types (components are allowed multiple registrations, but only of a single type)
 +
*** 403 Must be authorized
 +
** 5xx for core error
 +
*** 500 Not Implemented
 +
 
 
===message===
 
===message===
This gives a more detailed description of the failure, such as "ResponseID not found in lookup table", "Duplicate responseid detected", or "Malformed XML".
+
* message describing the event that caused the info packet to be transmitted
 +
** "ResponseID not found in lookup table"
 +
** "Duplicate responseid detected"
 +
** "Malformed XML"
 +
** "Welcome to this Ackis2.0 server"
 +
** "You must authenticate with this server before proceeding"
 +
 
 +
==Related Information==
 +
*[[IRC bot for controlling an Asterisk server]]

Latest revision as of 12:17, 25 August 2011

Packet

responseid

  • Typically the only attribute in the <packet> tag
  • String of a reasonable length

auth

username

  • the username, duh

hash

  • this is a md5 hash of the username concatenated with the responseid and password in that order

register

  • There can be more then one of these for components

type

  • typically client or module or resource but not limited to such

callback

  • regular expressions for messages without previous responseids

mime

  • the mimetype for the types of messages that can be sent to this client.

message

mime

  • the mimetype of the message, common values are:
    • text/plain
    • image/jpeg

data

  • contents of message

type

  • type of message
    • targeted
    • triggered
    • emote
    • topic
    • mode
    • quit
    • join
    • part
    • none

component

If component is implemented, it must support at least action=list, type=types, and type=actions so you can get a listing of the types and actions supported.

action

  • list
    • returns a list of all of the components of type

type

  • module or resource or something the core will have listed.

resource

type

  • something like database or image

action

  • something like query for the database resource or convert for the image resource

data

  • this field can be used in both directions, or only the return direction depending on whether the resource needs bulk data along with the action
  • rides on the responseid back to the calling component
  • maybe this is just a subset of <message>s?

variable

  • lets a component retrieve a variable from an other component that initiated a message

name

  • contains the name of the variable to be returned

value

  • contains the value of the variable to be returned

responseid

  • the responseid that the message came in on and identifies the transaction to the core and to the initiator
    • the core MUST translate this forward and backward as necessary or the initiator will be unaware of the responseid

info

  • describes an error encountered by either the core or a component and will close the connection in most cases.

number

  • similar to HTTP error messages?
    • 2xx for general info
      • 200 Acknowldegement
    • 4xx for user error
      • 400 Missing or bad critical identifier (could be a responseid, a variable name, or a registration type)
      • 401 Component not registered
      • 402 Multiple component types (components are allowed multiple registrations, but only of a single type)
      • 403 Must be authorized
    • 5xx for core error
      • 500 Not Implemented

message

  • message describing the event that caused the info packet to be transmitted
    • "ResponseID not found in lookup table"
    • "Duplicate responseid detected"
    • "Malformed XML"
    • "Welcome to this Ackis2.0 server"
    • "You must authenticate with this server before proceeding"

Related Information