#include <stdio.h>#include <string.h>#include <stdlib.h>#include <sys/types.h>#include <sys/ipc.h>#include <unistd.h>#include <fcntl.h>#include <time.h>#include <curl/curl.h>#include "../../pt.h"#include "../../db/db.h"#include "../../sr_module.h"#include "../../dprint.h"#include "../../error.h"#include "../../ut.h"#include "../../mem/mem.h"#include "../../mem/shm_mem.h"#include "../presence/utils_func.h"#include "xcap_functions.h"#include "xcap_client.h"

Go to the source code of this file.
Defines | |
| #define | STR_MATCH(s1, s2) ((s1).len==(s2).len && memcmp((s1).s, (s2).s, (s1).len)==0) |
| #define | XCAP_TABLE_VERSION 3 |
Functions | |
| void | destroy (void) |
| int | get_auid_flag (str auid) |
| static int | mod_init (void) |
| int | parse_doc_url (str doc_url, char **serv_addr, xcap_doc_sel_t *doc_sel) |
| void | query_xcap_update (unsigned int ticks, void *param) |
| struct mi_root * | refreshXcapDoc (struct mi_root *cmd, void *param) |
Variables | |
| static cmd_export_t | cmds [] |
| struct module_exports | exports |
| static mi_export_t | mi_cmds [] |
| static param_export_t | params [] |
| int | periodical_query = 1 |
| unsigned int | query_period = 100 |
| str | str_doc_col = str_init("doc") |
| str | str_doc_type_col = str_init("doc_type") |
| str | str_doc_uri_col = str_init("doc_uri") |
| str | str_domain_col = str_init("domain") |
| str | str_etag_col = str_init("etag") |
| str | str_path_col = str_init("path") |
| str | str_port_col = str_init("port") |
| str | str_source_col = str_init("source") |
| str | str_username_col = str_init("username") |
| db_con_t * | xcap_db = NULL |
| str | xcap_db_table = str_init("xcap") |
| str | xcap_db_url = str_init(DEFAULT_DB_URL) |
| db_func_t | xcap_dbf |
| xcap_callback_t * | xcapcb_list = NULL |
Definition at line 399 of file xcap_client.c.
| #define XCAP_TABLE_VERSION 3 |
| void destroy | ( | void | ) |
| int get_auid_flag | ( | str | auid | ) |
Definition at line 401 of file xcap_client.c.
References PRES_RULES, RESOURCE_LIST, str_init, and STR_MATCH.
Referenced by refreshXcapDoc().
| static int mod_init | ( | void | ) | [static] |
init module function
Definition at line 121 of file xcap_client.c.
References db_bind_mod(), DB_CAP_ALL, DB_CAPABILITY, db_check_table_version(), db_func::init, _str::len, LM_ERR, periodical_query, query_period, query_xcap_update(), register_timer(), _str::s, and XCAP_TABLE_VERSION.
| int parse_doc_url | ( | str | doc_url, | |
| char ** | serv_addr, | |||
| xcap_doc_sel_t * | doc_sel | |||
| ) |
Definition at line 293 of file xcap_client.c.
References xcap_doc_sel::auid, GLOBAL_TYPE, _str::len, _str::s, xcap_doc_sel::type, and USERS_TYPE.
Referenced by refreshXcapDoc().
| void query_xcap_update | ( | unsigned int | ticks, | |
| void * | param | |||
| ) |
Definition at line 165 of file xcap_client.c.
References DB_INT, DB_STR, DB_STRING, domain, domain_col, db_func::free_result, IF_NONE_MATCH, db_val_t::int_val, _str::len, LM_DBG, LM_ERR, db_res::n, db_val_t::nul, NULL, pkg_free, port, port_col, db_func::query, ROW_VALUES, db_res::rows, run_xcap_update_cb(), _str::s, send_http_get(), db_val_t::string_val, db_val_t::type, uandd_to_uri(), db_func::update, db_func::use_table, user, user_col, db_val_t::val, and XCAP_CL_MOD.
Referenced by mod_init().
Definition at line 328 of file xcap_client.c.
References xcap_doc_sel::auid, get_auid_flag(), init_mi_tree(), mi_node::kids, _str::len, LM_ERR, mi_node::next, mi_root::node, NULL, parse_doc_url(), pkg_free, run_xcap_update_cb(), _str::s, send_http_get(), str2int(), mi_node::value, xcap_port, and xcap_doc_sel::xid.
cmd_export_t cmds[] [static] |
Initial value:
{
{"bind_xcap", (cmd_function)bind_xcap, 1, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0}
}
Definition at line 91 of file xcap_client.c.
| struct module_exports exports |
module exports
Definition at line 103 of file xcap_client.c.
mi_export_t mi_cmds[] [static] |
Initial value:
{
{ "refreshXcapDoc", refreshXcapDoc, 0, 0, 0},
{ 0, 0, 0, 0, 0}
}
Definition at line 97 of file xcap_client.c.
param_export_t params[] [static] |
Definition at line 82 of file xcap_client.c.
| int periodical_query = 1 |
| unsigned int query_period = 100 |
| str str_doc_col = str_init("doc") |
Definition at line 67 of file xcap_client.c.
| str str_doc_type_col = str_init("doc_type") |
Definition at line 71 of file xcap_client.c.
| str str_doc_uri_col = str_init("doc_uri") |
| str str_domain_col = str_init("domain") |
Definition at line 70 of file xcap_client.c.
| str str_etag_col = str_init("etag") |
Definition at line 68 of file xcap_client.c.
| str str_path_col = str_init("path") |
Definition at line 66 of file xcap_client.c.
| str str_port_col = str_init("port") |
| str str_source_col = str_init("source") |
| str str_username_col = str_init("username") |
Definition at line 69 of file xcap_client.c.
| str xcap_db_table = str_init("xcap") |
| str xcap_db_url = str_init(DEFAULT_DB_URL) |
Definition at line 60 of file xcap_client.c.
| xcap_callback_t* xcapcb_list = NULL |
Definition at line 61 of file xcap_client.c.
Referenced by destroy_xcapcb_list(), register_xcapcb(), and run_xcap_update_cb().
1.5.6