#include <stdio.h>
#include "ul_mod.h"
#include "../../sr_module.h"
#include "../../dprint.h"
#include "../../timer.h"
#include "../../globals.h"
#include "../../ut.h"
#include "dlist.h"
#include "udomain.h"
#include "urecord.h"
#include "ucontact.h"
#include "ul_mi.h"
#include "ul_callback.h"
#include "usrloc.h"

Go to the source code of this file.
Defines | |
| #define | CALLID_COL "callid" |
| #define | CFLAGS_COL "cflags" |
| #define | CONTACT_COL "contact" |
| #define | CSEQ_COL "cseq" |
| #define | DOMAIN_COL "domain" |
| #define | EXPIRES_COL "expires" |
| #define | FLAGS_COL "flags" |
| #define | LAST_MOD_COL "last_modified" |
| #define | METHODS_COL "methods" |
| #define | PATH_COL "path" |
| #define | Q_COL "q" |
| #define | RECEIVED_COL "received" |
| #define | SOCK_COL "socket" |
| #define | USER_AGENT_COL "user_agent" |
| #define | USER_COL "username" |
Functions | |
| int | bind_usrloc (usrloc_api_t *api) |
| usrloc module API export bind function | |
| static int | child_init (int rank) |
| static void | destroy (void) |
| Module destroy function. | |
| static int | mi_child_init (void) |
| static int | mod_init (void) |
| Module initialization function. | |
| static void | timer (unsigned int ticks, void *param) |
| Timer handler. | |
Variables | |
| str | callid_col = str_init(CALLID_COL) |
| str | cflags_col = str_init(CFLAGS_COL) |
| static cmd_export_t | cmds [] |
| Exported functions. | |
| str | contact_col = str_init(CONTACT_COL) |
| str | cseq_col = str_init(CSEQ_COL) |
| int | db_mode = 0 |
| str | db_url = str_init(DEFAULT_DB_URL) |
| int | desc_time_order = 0 |
| str | domain_col = str_init(DOMAIN_COL) |
| str | expires_col = str_init(EXPIRES_COL) |
| struct module_exports | exports |
| str | flags_col = str_init(FLAGS_COL) |
| unsigned int | init_flag = 0 |
| str | last_mod_col = str_init(LAST_MOD_COL) |
| str | methods_col = str_init(METHODS_COL) |
| static mi_export_t | mi_cmds [] |
| stat_export_t | mod_stats [] |
| unsigned int | nat_bflag = (unsigned int)-1 |
| static param_export_t | params [] |
| Exported parameters. | |
| str | path_col = str_init(PATH_COL) |
| str | q_col = str_init(Q_COL) |
| str | received_col = str_init(RECEIVED_COL) |
| str | sock_col = str_init(SOCK_COL) |
| int | timer_interval = 60 |
| db_func_t | ul_dbf |
| db_con_t * | ul_dbh = 0 |
| int | ul_fetch_rows = 2000 |
| int | ul_hash_size = 9 |
| int | ul_locks_no |
| int | use_domain = 0 |
| str | user_agent_col = str_init(USER_AGENT_COL) |
| str | user_col = str_init(USER_COL) |
Definition in file ul_mod.c.
| int bind_usrloc | ( | usrloc_api_t * | api | ) |
usrloc module API export bind function
| api | usrloc API |
Definition at line 51 of file usrloc.c.
References db_mode, usrloc_api::db_mode, delete_ucontact(), usrloc_api::delete_ucontact, delete_urecord(), usrloc_api::delete_urecord, get_all_ucontacts(), usrloc_api::get_all_ucontacts, get_ucontact(), usrloc_api::get_ucontact, get_urecord(), usrloc_api::get_urecord, init_flag, insert_ucontact(), usrloc_api::insert_ucontact, insert_urecord(), usrloc_api::insert_urecord, LM_ERR, lock_udomain(), usrloc_api::lock_udomain, nat_bflag, usrloc_api::nat_flag, register_udomain(), usrloc_api::register_udomain, register_ulcb(), usrloc_api::register_ulcb, release_urecord(), usrloc_api::release_urecord, unlock_udomain(), usrloc_api::unlock_udomain, update_ucontact(), usrloc_api::update_ucontact, use_domain, and usrloc_api::use_domain.
Referenced by cpl_init(), mod_init(), and registerForUSRLOCCallbacks().
| static int child_init | ( | int | rank | ) | [static] |
Per-child init function
Definition at line 297 of file ul_mod.c.
References dlist::d, db_mode, DB_ONLY, db_func::init, _str::len, LM_ERR, dlist::name, dlist::next, NO_DB, preload_udomain(), PROC_MAIN, PROC_TIMER, root, _str::s, WRITE_BACK, WRITE_THROUGH, and ZSW.
| static void destroy | ( | void | ) | [static] |
Module destroy function.
Module destroy function
| static int mi_child_init | ( | void | ) | [static] |
| static int mod_init | ( | void | ) | [static] |
Module initialization function.
Module initialization function
Definition at line 215 of file ul_mod.c.
References CONTACT_CALLID, CONTACT_ONLY, db_bind_mod(), DB_CAP_ALL, DB_CAPABILITY, db_mode, init_flag, init_ulcb_list(), _str::len, LM_ERR, matching_mode, nat_bflag, NO_DB, register_timer(), _str::s, timer_interval, ul_fetch_rows, ul_hash_size, ul_init_locks(), and ul_locks_no.
| static void timer | ( | unsigned int | ticks, | |
| void * | param | |||
| ) | [static] |
Timer handler.
Timer handler
| str callid_col = str_init(CALLID_COL) |
Name of column containing callid string
Definition at line 104 of file ul_mod.c.
Referenced by db_delete_ucontact(), db_insert_ucontact(), db_load_urecord(), db_restore(), db_update(), db_update_ucontact(), get_subs_db(), get_wi_subs_db(), preload_udomain(), restore_db_subs(), rls_restore_db_subs(), and update_db_subs().
| str cflags_col = str_init(CFLAGS_COL) |
Name of column containing contact flags
Definition at line 107 of file ul_mod.c.
Referenced by db_insert_ucontact(), db_load_urecord(), db_update_ucontact(), get_all_db_ucontacts(), and preload_udomain().
cmd_export_t cmds[] [static] |
Initial value:
{
{"ul_bind_usrloc", (cmd_function)bind_usrloc, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 0}
}
| str contact_col = str_init(CONTACT_COL) |
Name of column containing contact addresses
Definition at line 101 of file ul_mod.c.
Referenced by db_delete_ucontact(), db_insert_ucontact(), db_load_urecord(), db_restore(), db_update(), db_update_ucontact(), get_all_db_ucontacts(), get_subs_db(), preload_udomain(), restore_db_subs(), rls_restore_db_subs(), and update_db_subs().
Name of column containing cseq values
Definition at line 105 of file ul_mod.c.
Referenced by db_insert_ucontact(), db_load_urecord(), db_restore(), db_update(), db_update_ucontact(), get_subs_db(), and preload_udomain().
| int db_mode = 0 |
Database sync scheme: 0-no db, 1-write through, 2-write back, 3-only db
Definition at line 116 of file ul_mod.c.
Referenced by allow_trusted(), bind_usrloc(), child_init(), dbt_db_get_table(), delete_ucontact(), delete_urecord(), free_urecord(), get_all_ucontacts(), get_urecord(), init_child_trusted(), init_trusted(), insert_ucontact(), insert_urecord(), is_domain_local(), lock_udomain(), lock_ulslot(), mi_child_init(), mi_domain_dump(), mi_domain_reload(), mod_init(), register_udomain(), release_urecord(), st_delete_ucontact(), st_update_ucontact(), synchronize_all_udomains(), timer_urecord(), unlock_udomain(), unlock_ulslot(), and update_ucontact().
| int desc_time_order = 0 |
By default do not enable timestamp ordering
Definition at line 118 of file ul_mod.c.
Referenced by db_load_urecord(), mem_insert_ucontact(), and update_contact_pos().
| str domain_col = str_init(DOMAIN_COL) |
| str expires_col = str_init(EXPIRES_COL) |
Name of column containing expires values
Definition at line 102 of file ul_mod.c.
Referenced by db_insert_ucontact(), db_load_urecord(), db_restore(), db_timer_udomain(), db_update(), db_update_ucontact(), get_all_db_ucontacts(), get_p_notify_body(), get_subs_db(), get_wi_subs_db(), preload_udomain(), pres_htable_restore(), restore_db_subs(), rls_restore_db_subs(), and update_db_subs().
| struct module_exports exports |
| unsigned int init_flag = 0 |
flag to protect against wrong initialization
Definition at line 125 of file ul_mod.c.
Referenced by bind_usrloc(), and mod_init().
| str last_mod_col = str_init(LAST_MOD_COL) |
Name of column containing the last modified date
Definition at line 113 of file ul_mod.c.
Referenced by db_insert_ucontact(), db_load_urecord(), db_update_ucontact(), and preload_udomain().
| str methods_col = str_init(METHODS_COL) |
Name of column containing the supported methods
Definition at line 112 of file ul_mod.c.
Referenced by db_insert_ucontact(), db_load_urecord(), db_update_ucontact(), and preload_udomain().
mi_export_t mi_cmds[] [static] |
Initial value:
{
{"registered_users" , STAT_IS_FUNC, (stat_var**)get_number_of_users },
{0,0,0}
}
| unsigned int nat_bflag = (unsigned int)-1 |
nat branch flag
Definition at line 124 of file ul_mod.c.
Referenced by bind_usrloc(), and mod_init().
param_export_t params[] [static] |
Name of column containing the Path header
Definition at line 110 of file ul_mod.c.
Referenced by db_insert_ucontact(), db_load_urecord(), db_update_ucontact(), get_all_db_ucontacts(), and preload_udomain().
Name of column containing q values
Definition at line 103 of file ul_mod.c.
Referenced by db_insert_ucontact(), db_load_urecord(), db_update_ucontact(), and preload_udomain().
| str received_col = str_init(RECEIVED_COL) |
Name of column containing transport info of REGISTER
Definition at line 109 of file ul_mod.c.
Referenced by db_insert_ucontact(), db_load_urecord(), db_update_ucontact(), get_all_db_ucontacts(), and preload_udomain().
Name of column containing the received socket
Definition at line 111 of file ul_mod.c.
Referenced by db_insert_ucontact(), db_load_urecord(), db_update_ucontact(), get_all_db_ucontacts(), and preload_udomain().
| int timer_interval = 60 |
Definition at line 128 of file ul_mod.c.
Referenced by db_delete_ucontact(), db_delete_urecord(), db_insert_ucontact(), db_load_urecord(), db_timer_udomain(), db_update_ucontact(), get_all_db_ucontacts(), preload_udomain(), register_udomain(), and testdb_udomain().
Definition at line 127 of file ul_mod.c.
Referenced by db_delete_ucontact(), db_delete_urecord(), db_insert_ucontact(), db_timer_udomain(), db_update_ucontact(), get_all_db_ucontacts(), and get_urecord().
| int ul_fetch_rows = 2000 |
number of rows to fetch from result
Definition at line 120 of file ul_mod.c.
Referenced by mod_init(), and preload_udomain().
| int ul_hash_size = 9 |
| int ul_locks_no |
number of locks
Definition at line 35 of file hslot.c.
Referenced by init_slot(), mod_init(), ul_init_locks(), and ul_unlock_locks().
| int use_domain = 0 |
| str user_agent_col = str_init(USER_AGENT_COL) |
Name of column containing user agent string
Definition at line 108 of file ul_mod.c.
Referenced by db_insert_ucontact(), db_load_urecord(), db_update_ucontact(), and preload_udomain().
Name of column containing usernames
Definition at line 99 of file ul_mod.c.
Referenced by db_delete_ucontact(), db_delete_urecord(), db_insert_ucontact(), db_load_urecord(), db_update_ucontact(), msg_presentity_clean(), preload_udomain(), pres_htable_restore(), query_xcap_update(), and testdb_udomain().
1.5.6