]> git.defcon.no Git - hermes/blobdiff - doc/api-nodes.txt
Added tool to list users... ALL users...
[hermes] / doc / api-nodes.txt
index fd8d3b9c0ec165d8ce14a4f54c2058c3f383b9dd..42150590925c825d644b25e79df5daac69314888 100644 (file)
@@ -1,6 +1,6 @@
 General description on API protocol:
 =========================================================================
-All API nodes currently use GET requests for all parameters.
+All API nodes currently use POST requests for all parameters.
 All API nodes return JSON data unless explicitly noted , 
 and all JSON results will contain  a 'response' element.
 The 'response' may be set to:
@@ -405,6 +405,7 @@ user/available
 
   Return:
        Returns 'ok' with 'cause' = 'nonexistant' if the address is available.
+       TODO: Returns 'failed' with 'cause' = 'domain' if the domain is not a kamailio domain.
        Returns 'failed' with 'cause' = 'exists' if the address is in use.
        Returns 'failed' with 'cause' = 'invalid' if SIP address is malformed.
 
@@ -449,7 +450,9 @@ phone/list
        a subset matching on the MAC addresses.
 
   Return:
-       TODO: Document this.
+       Returns 'list' as a simple array of registered MAC-adresses on success,
+       the list will be limited to addresses matching the search if provided.
+       
 
 phone/add
 -------------------
@@ -483,7 +486,7 @@ phone/remove
        are identical to the phone/add node.
 
   Return:
-       TODO: Document additional info provided on 'result' = 'ok'
+       Returns 'mac', 'username' and 'domain' on success.
        Returns 'failed' with 'cause' = 'invalid' if SIP address is malformed.
        Returns 'failed' with 'cause' = 'invalid' if MAC address is malformed.
        Returns 'failed' with 'cause' = 'nonexistant' on no such registration.
@@ -591,8 +594,8 @@ alias/list
        (naturally).
 
   Return:
-       Returns 'ok' on success, with an array of 'destination' and 'alias'
-       pairs.
+       Returns 'ok' on success, with an array 'aliases' containing
+       'destination' and 'alias' pairs.
        Returns 'ok' with an empty array if the search gave no results.
        Returns 'ok' with an empty array if the database search fails.
        Returns 'failed' with 'cause' = 'invalid' on invalid SIP addresses.
@@ -705,10 +708,18 @@ TODO list:
 Some TODO's listed above ...
 
 Permissions! (user/permissions?user=...)
-
-Change all GET to POST
-
-Implement test-tool for POST-based communication ;)
+The permissions bit-flag seems to be:
+       NOCALLS        1
+       EMERGENCY      2 
+       INTERNAL       4
+       VOIP           8 
+       NATIONAL       16
+       SERVICES       32      
+       INTERNATIONAL  64      
+       OTHERS         128
+
+can_write() checks!
+can_read_full() checks!
 
 Improve robustness of change_pw: fetch old password for rollback/testing.