Index: res/res_jabber.c =================================================================== --- res/res_jabber.c (revision 66997) +++ res/res_jabber.c (working copy) @@ -170,7 +171,7 @@ /*! * \brief Deletes the aji_client data structure. - * \param obj is the structure we will delete. + * \param obj aji_client The structure we will delete. * \return void. */ static void aji_client_destroy(struct aji_client *obj) @@ -194,7 +195,7 @@ /*! * \brief Deletes the aji_buddy data structure. - * \param obj is the structure we will delete. + * \param obj aji_buddy The structure we will delete. * \return void. */ static void aji_buddy_destroy(struct aji_buddy *obj) @@ -216,7 +217,7 @@ * our list * \param version the version attribute in the caps element we'll look for or * add to our list - * \param pak the XML stanza we're processing + * \param pak struct The XML stanza we're processing * \return a pointer to the added or found aji_version structure */ static struct aji_version *aji_find_version(char *node, char *version, ikspak *pak) @@ -279,7 +280,12 @@ } return res; } - +/*! + * \brief Find the aji_resource we want + * \param buddy aji_buddy A buddy + * \param name + * \return aji_resource object +*/ static struct aji_resource *aji_find_resource(struct aji_buddy *buddy, char *name) { struct aji_resource *res = NULL; @@ -295,6 +301,11 @@ return res; } +/*! + * \brief Jabber GTalk function + * \param node iks + * \return 1 on success, 0 on failure. +*/ static int gtalk_yuck(iks *node) { if (iks_find_with_attrib(node, "c", "node", "http://www.google.com/xmpp/client/caps")) @@ -304,7 +315,7 @@ /*! * \brief Detects the highest bit in a number. - * \param Number you want to have evaluated. + * \param number Number you want to have evaluated. * \return the highest power of 2 that can go into the number. */ static int aji_highest_bit(int number) @@ -319,6 +330,13 @@ return (1 << x); } +/*! + * \brief Setup the authentication struct + * \param id iksid + * \param pass password + * \param sid + * \return x iks +*/ static iks *jabber_make_auth(iksid * id, const char *pass, const char *sid) { iks *x, *y; @@ -343,8 +361,9 @@ /*! * \brief Dial plan function status(). puts the status of watched user into a channel variable. - * \param channel, and username,watched user, status var - * \return 0. + * \param chan ast_channel + * \param data + * \return 0 on success, -1 on error */ static int aji_status_exec(struct ast_channel *chan, void *data) { @@ -407,8 +426,9 @@ /*! * \brief Dial plan function to send a message. - * \param channel, and data, data is sender, reciever, message. - * \return 0. + * \param chan ast_channel + * \param data Data is sender|reciever|message. + * \return 0 on success,-1 on error. */ static int aji_send_exec(struct ast_channel *chan, void *data) { @@ -444,7 +464,10 @@ /*! * \brief the debug loop. - * \param aji_client structure, xml data as string, size of string, direction of packet, 1 for inbound 0 for outbound. + * \param data void + * \param xmpp xml data as string + * \param size size of string + * \param is_incoming direction of packet 1 for inbound 0 for outbound. */ static void aji_log_hook(void *data, const char *xmpp, size_t size, int is_incoming) { @@ -470,7 +493,9 @@ /*! * \brief The action hook parses the inbound packets, constantly running. - * \param aji client structure, type of packet, the actual packet. + * \param data aji_client + * \param type type of packet. + * \param node iks the actual packet. * \return IKS_OK or IKS_HOOK . */ static int aji_act_hook(void *data, int type, iks *node) @@ -674,7 +699,12 @@ ASTOBJ_UNREF(client, aji_client_destroy); return IKS_OK; } - +/*! + * \brief Uknown + * \param data void + * \param pak ikspak + * \return IKS_FILTER_EAT. +*/ static int aji_register_approve_handler(void *data, ikspak *pak) { struct aji_client *client = ASTOBJ_REF((struct aji_client *) data); @@ -713,7 +743,12 @@ ASTOBJ_UNREF(client, aji_client_destroy); return IKS_FILTER_EAT; } - +/*! + * \brief register query + * \param data incoming aji_client request + * \param pak ikspak + * \return IKS_FILTER_EAT. +*/ static int aji_register_query_handler(void *data, ikspak *pak) { struct aji_client *client = ASTOBJ_REF((struct aji_client *) data); @@ -785,6 +820,12 @@ return IKS_FILTER_EAT; } +/*! + * \brief Handles stuff + * \param data void + * \param pak ikspak + * \return IKS_FILTER_EAT. +*/ static int aji_ditems_handler(void *data, ikspak *pak) { struct aji_client *client = ASTOBJ_REF((struct aji_client *) data); @@ -880,7 +921,12 @@ return IKS_FILTER_EAT; } - +/*! + * \brief Handle add extra info + * \param data void + * \param pak ikspak + * \return IKS_FILTER_EAT +*/ static int aji_client_info_handler(void *data, ikspak *pak) { struct aji_client *client = ASTOBJ_REF((struct aji_client *) data); @@ -939,7 +985,12 @@ ASTOBJ_UNREF(client, aji_client_destroy); return IKS_FILTER_EAT; } - +/*! + * \brief Handler of the return info packet + * \param data aji_client + * \param pak ikspak + * \return IKS_FILTER_EAT +*/ static int aji_dinfo_handler(void *data, ikspak *pak) { struct aji_client *client = ASTOBJ_REF((struct aji_client *) data); @@ -1091,7 +1142,8 @@ /*! * \brief Handles \verbatim \endverbatim tags. - * \param client structure and the iq node. + * \param client aji_client + * \param node iks * \return void. */ static void aji_handle_iq(struct aji_client *client, iks *node) @@ -1101,8 +1153,8 @@ /*! * \brief Handles presence packets. - * \param client structure and the node. - * \return void. + * \param client aji_client + * \param pak ikspak the node */ static void aji_handle_message(struct aji_client *client, ikspak *pak) { @@ -1139,7 +1191,11 @@ AST_LIST_INSERT_HEAD(&client->messages, insert, list); AST_LIST_UNLOCK(&client->messages); } - +/*! + * \brief Check the presence info + * \param client aji_client + * \param pak ikspak +*/ static void aji_handle_presence(struct aji_client *client, ikspak *pak) { int status, priority; @@ -1333,7 +1389,8 @@ /*! * \brief handles subscription requests. - * \param aji_client struct and xml packet. + * \param client aji_client + * \param pak ikspak iksemel packet. * \return void. */ static void aji_handle_subscribe(struct aji_client *client, ikspak *pak) @@ -1383,7 +1440,9 @@ /*! * \brief sends messages. - * \param aji_client struct , reciever, message. + * \param client aji_client + * \param address + * \param message * \return 1. */ int ast_aji_send(struct aji_client *client, const char *address, const char *message) @@ -1407,7 +1466,10 @@ /*! * \brief create a chatroom. - * \param aji_client struct , room, server, topic for the room. + * \param client aji_client + * \param room name of room + * \param server name of server + * \param topic topic for the room. * \return 0. */ int ast_aji_create_chat(struct aji_client *client, char *room, char *server, char *topic) @@ -1428,7 +1490,8 @@ /*! * \brief join a chatroom. - * \param aji_client struct , room. + * \param client aji_client + * \param room room to join * \return res. */ int ast_aji_join_chat(struct aji_client *client, char *room) @@ -1456,7 +1519,10 @@ /*! * \brief invite to a chatroom. - * \param aji_client struct ,user, room, message. + * \param client aji_client + * \param user + * \param room + * \param message * \return res. */ int ast_aji_invite_chat(struct aji_client *client, char *user, char *room, char *message) @@ -1491,7 +1557,7 @@ /*! * \brief receive message loop. - * \param aji_client struct. + * \param data void * \return void. */ static void *aji_recv_loop(void *data) @@ -1529,7 +1595,7 @@ /*! * \brief increments the mid field for messages and other events. - * \param message id. + * \param mid char. * \return void. */ void ast_aji_increment_mid(char *mid) @@ -1636,7 +1702,7 @@ */ /*! * \brief goes through roster and prunes users not needed in list, or adds them accordingly. - * \param aji_client struct. + * \param client aji_client * \return void. */ static void aji_pruneregister(struct aji_client *client) @@ -1689,7 +1755,8 @@ /*! * \brief filters the roster packet we get back from server. - * \param aji_client struct, and xml packet. + * \param data void + * \param pak ikspak iksemel packet. * \return IKS_FILTER_EAT. */ static int aji_filter_roster(void *data, ikspak *pak) @@ -1763,7 +1830,11 @@ ASTOBJ_UNREF(client, aji_client_destroy); return IKS_FILTER_EAT; } - +/*! + * \brief reconnect to jabber server + * \param client aji_client + * \return res. +*/ static int aji_reconnect(struct aji_client *client) { int res = 0; @@ -1783,7 +1854,11 @@ return res; } - +/*! + * \brief Get the roster of jabber users + * \param client aji_client + * \return 1. +*/ static int aji_get_roster(struct aji_client *client) { iks *roster = NULL; @@ -1800,7 +1875,8 @@ /*! * \brief connects as a client to jabber server. - * \param aji_client struct, and xml packet. + * \param data void + * \param pak ikspak iksemel packet * \return res. */ static int aji_client_connect(void *data, ikspak *pak) @@ -1826,7 +1902,7 @@ /*! * \brief prepares client for connect. - * \param aji_client struct. + * \param client aji_client * \return 1. */ static int aji_client_initialize(struct aji_client *client) @@ -1848,7 +1924,7 @@ /*! * \brief prepares component for connect. - * \param aji_client struct. + * \param client aji_client * \return 1. */ static int aji_component_initialize(struct aji_client *client) @@ -1869,7 +1945,7 @@ /*! * \brief disconnect from jabber server. - * \param aji_client struct. + * \param client aji_client * \return 1. */ int ast_aji_disconnect(struct aji_client *client) @@ -1887,7 +1963,11 @@ /*! * \brief set presence of client. - * \param aji_client struct, user to send it to, and from, level, description. + * \param client aji_client + * \param to user send it to + * \param from user it came from + * \param level + * \param desc * \return void. */ static void aji_set_presence(struct aji_client *client, char *to, char *from, int level, char *desc) @@ -1919,7 +1999,9 @@ /*! * \brief turnon console debugging. - * \param fd, number of args, args. + * \param fd + * \param argc Integer. Number of args + * \param argv List of arguements * \return RESULT_SUCCESS. */ static int aji_do_debug(int fd, int argc, char *argv[]) @@ -1935,7 +2017,9 @@ /*! * \brief reload jabber module. - * \param fd, number of args, args. + * \param fd + * \param argc no of args + * \param argv list of arguements * \return RESULT_SUCCESS. */ static int aji_do_reload(int fd, int argc, char *argv[]) @@ -1947,7 +2031,9 @@ /*! * \brief turnoff console debugging. - * \param fd, number of args, args. + * \param fd + * \param argc Integer. number of args + * \param argv list of arguements * \return RESULT_SUCCESS. */ static int aji_no_debug(int fd, int argc, char *argv[]) @@ -1963,7 +2049,9 @@ /*! * \brief show client status. - * \param fd, number of args, args. + * \param fd + * \param argc Integer. number of args + * \param argv list of arguements * \return RESULT_SUCCESS. */ static int aji_show_clients(int fd, int argc, char *argv[]) @@ -1997,8 +2085,10 @@ /*! * \brief send test message for debugging. - * \param fd, number of args, args. - * \return RESULT_SUCCESS. + * \param fd + * \param argc Integer. number of args + * \param argv list of arguements + * \return RESULT_SUCCESS,RESULT_FAILURE. */ static int aji_test(int fd, int argc, char *argv[]) { @@ -2048,7 +2138,9 @@ /*! * \brief creates aji_client structure. - * \param label, ast_variable, debug, pruneregister, component/client, aji_client to dump into. + * \param label + * \param var ast_variable + * \param debug * \return 0. */ static int aji_create_client(char *label, struct ast_variable *var, int debug) @@ -2238,8 +2330,9 @@ /*! * \brief creates buddy. - * \param label, buddy to dump it into. - * \return 0. + * \param label char. + * \param client aji_client buddy to dump it into. + * \return 1 on success, 0 on failure. */ static int aji_create_buddy(char *label, struct aji_client *client) { @@ -2268,11 +2361,7 @@ return 1; } -/*! - * \brief load config file. - * \param void. - * \return 1. - */ +/*!< load config file. \return 1. */ static int aji_load_config(void) { char *cat = NULL; @@ -2311,8 +2400,8 @@ /*! * \brief grab a aji_client structure by label name. - * \param void. - * \return 1. + * \param name label name + * \return aji_client. */ struct aji_client *ast_aji_get_client(const char *name) { @@ -2336,7 +2425,12 @@ " ScreenName: User Name to message.\n" " Message: Message to be sent to the buddy\n"; -/*! \brief Send a Jabber Message via call from the Manager */ +/*! + * \brief Send a Jabber Message via call from the Manager + * \param s mansession Manager session + * \param m message Message to send + * \return 0 +*/ static int manager_jabber_send(struct mansession *s, const struct message *m) { struct aji_client *client = NULL; @@ -2377,7 +2471,7 @@ return 0; } - +/*! \brief Reload the jabber module */ static int aji_reload() { ASTOBJ_CONTAINER_MARKALL(&clients); @@ -2399,6 +2493,7 @@ return 1; } +/*! \brief Unload the jabber module */ static int unload_module(void) { ast_cli_unregister_multiple(aji_cli, sizeof(aji_cli) / sizeof(struct ast_cli_entry)); @@ -2422,6 +2517,7 @@ return 0; } +/*! \brief Unload the jabber module */ static int load_module(void) { ASTOBJ_CONTAINER_INIT(&clients); @@ -2437,6 +2533,7 @@ return 0; } +/*! \brief Wrapper for aji_reload */ static int reload(void) { aji_reload();