X-Git-Url: https://git.defcon.no/?a=blobdiff_plain;f=doc%2Fapi-nodes.txt;h=19dfa06e18f6184c4e8561896a1bf6c6207c56d3;hb=d84439cb61f1964534363219d800036e28112cd4;hp=a288bbda9639c1f5fa78943b8cf5377769d9e941;hpb=5e06b6865a488899dc997fbd3ee2d22e9c5569f4;p=hermes diff --git a/doc/api-nodes.txt b/doc/api-nodes.txt index a288bbd..19dfa06 100644 --- a/doc/api-nodes.txt +++ b/doc/api-nodes.txt @@ -80,8 +80,13 @@ user/change_email?user=foo@bar.bz&email=user@example.com user/remove?username=foo&domain=bar user/remove?user=foo@bar.bz Removes user account from Kamailio, if present, and removes user from - provisioning. Will fail if user has associated hardphones, remove - phones before removing user. + provisioning. + + Will fail if user has associated hardphones, remove phones before + removing user. + + TODO: Should fail if user has associated aliases. Remove aliases before + removing user. Returns 'ok' on success. @@ -94,8 +99,10 @@ user/available?user=foo@bar.bz Returns 'failed' with 'cause' = 'exists' if the address is in use. user/gen_pw - Test-node, generates a random password on the same form as that used by - user/add_local. May be used with the to-be-implemented change_pw node. + Generates a random password on the same form as that used by + user/add_local. + + Return is always a password in plain text, with no formatting. phone/get?mac=f00ba2ba5c00 phone/get?user=foo@bar.bz @@ -224,10 +231,57 @@ alias/remove?alias=foo@bar.bz Returns 'invalid' with 'cause' = 'address' if the given alias is not a valid SIP adress. +domain/list + Returns a list of configured and valid domains. May return an empty + list if no domains are configured for kamailio. No node is provided + to add domains, this is not a task for Hermes, but a kamailio + configuration task. + + Returns 'failed' on database errors. + +domain/get_servers?domain=bar.bz + Provides the default registrar/proxy/provisioning server information + for the given domain. + + Returns 'ok' with 'servers' set to a kvp-set on success, containing: + 'registrar', 'r_port', 'proxy', 'p_port', 'prov_url'. + + Returns 'failed' with 'cause' = 'nonexistant' if lookup of data for + given domain results in an empty set (not configured). + +domain/set_servers?domain=bar.bz®istrar=server.bar.bz&r_port=5060&proxy=proxy.bar.bz&p_port=5060&prov_url=http://server.bar.bz/hermes/prov + Sets the server data for the given domain. All of these parameters + are required: 'domain', 'registrar', 'r_port', 'proxy', 'p_port', 'prov_url'. + If no defaul server data is defined, the configuration is added. + If server configuration existed, the default data is updated. + + Returns 'ok' with 'servers' set as domain/get_servers on success. + + Returns 'failed' with 'cause' set to 'cause' set to 'parameters' + if one of these is true: + * Missing parameters + * One or more NULL/empty parameters + * Non-numeric values for port-numbers. + If you need to determine which of these triggered, the + 'description' contains a text describing the actual fail. + + Return 'failed' with 'cause' = 'error' on database failure. + +BUGS: +--------------------- + +api/alias/list?destination=foo@bar.bz&e164=true + should return an empty array, returns false TODO list: --------------------- +Add a node to test a destination (pre-flight testing of user/add and alias/add) + +Read list of kamailio domains (domains/list ?) RW? +Default server-settings for domains (domains/server ? ) (registrar, proxy, ports...) RW. +Permissions! (user/permissions?user=...) + authentication-mechanism :) Change all GET to POST