X-Git-Url: https://git.defcon.no/?a=blobdiff_plain;f=doc%2Fapi-nodes.txt;h=a3cafc99bed7291c1dcd2e79a24b63fe280471a5;hb=3a833f7df0ff63d743e7d3099ba0b09d39bddb49;hp=03b82b6f867627e8d94dda5c729f35a6f4c6da71;hpb=60bf626a9d34dee29c5644a2a5c8c24829c87f13;p=hermes diff --git a/doc/api-nodes.txt b/doc/api-nodes.txt index 03b82b6..a3cafc9 100644 --- a/doc/api-nodes.txt +++ b/doc/api-nodes.txt @@ -250,6 +250,27 @@ user/get Returns 'failed' with 'cause' = 'nonexistant' if user does not exist.. Returns 'failed' with 'cause' = 'invalid' if SIP address is malformed. +user/location +------------------- + Required: + user=user@bar.bz * + + Description: + Return registered user agent locations for a given user, with + contact and user agent information. + + Return: + On success, returns the array 'locations', each element contianing: + 'contact' is the registration contact (the location) + 'useragent' is the UA string from the client + 'expires' is the expiration time of the registration, as unix timestamp + + Returns 'failed' with 'cause' = 'offline' if user is not registered ... + Returns 'failed' with 'cause' = 'invalid' if SIP address is malformed. + + TODO: + Add a return code for non-existant subscriber? + user/list ------------------- Optional: @@ -405,6 +426,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 +471,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 +507,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 +615,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. @@ -702,9 +726,26 @@ api/alias/list destination=foo@bar.bz e164=true TODO list: --------------------- +user/forward To set up permanent forwarding. Call forward is stored as a user + preference value in the kamailio database. Evample of diverting calls to + 'jonl@hig.no' to the number +4761135280': +insert into usr_preferences (username, domain, attribute, value, last_modified) values ( 'jonl', 'hig.no', 'cfu', '+4761135280', now()); + Some TODO's listed above ... Permissions! (user/permissions?user=...) +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.