ul_mod.c File Reference

USRLOC - Usrloc module interface

More...

#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"

Include dependency graph for ul_mod.c:

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_tul_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)


Detailed Description

USRLOC - Usrloc module interface

Definition in file ul_mod.c.


Define Documentation

#define CALLID_COL   "callid"

Definition at line 76 of file ul_mod.c.

#define CFLAGS_COL   "cflags"

Definition at line 79 of file ul_mod.c.

#define CONTACT_COL   "contact"

Definition at line 73 of file ul_mod.c.

#define CSEQ_COL   "cseq"

Definition at line 77 of file ul_mod.c.

#define DOMAIN_COL   "domain"

Definition at line 72 of file ul_mod.c.

#define EXPIRES_COL   "expires"

Definition at line 74 of file ul_mod.c.

#define FLAGS_COL   "flags"

Definition at line 78 of file ul_mod.c.

#define LAST_MOD_COL   "last_modified"

Definition at line 85 of file ul_mod.c.

#define METHODS_COL   "methods"

Definition at line 84 of file ul_mod.c.

#define PATH_COL   "path"

Definition at line 82 of file ul_mod.c.

#define Q_COL   "q"

Definition at line 75 of file ul_mod.c.

#define RECEIVED_COL   "received"

Definition at line 81 of file ul_mod.c.

#define SOCK_COL   "socket"

Definition at line 83 of file ul_mod.c.

#define USER_AGENT_COL   "user_agent"

Definition at line 80 of file ul_mod.c.

#define USER_COL   "username"

Definition at line 71 of file ul_mod.c.


Function Documentation

int bind_usrloc ( usrloc_api_t api  ) 

static int child_init ( int  rank  )  [static]

static void destroy ( void   )  [static]

Module destroy function.

Module destroy function

static int mi_child_init ( void   )  [static]

Definition at line 342 of file ul_mod.c.

References db_mode, db_func::init, LM_ERR, and NO_DB.

static int mod_init ( void   )  [static]

static void timer ( unsigned int  ticks,
void *  param 
) [static]

Timer handler.

Timer handler


Variable Documentation

str callid_col = str_init(CALLID_COL)

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}
}
Exported functions.

Definition at line 135 of file ul_mod.c.

str contact_col = str_init(CONTACT_COL)

str cseq_col = str_init(CSEQ_COL)

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

str db_url = str_init(DEFAULT_DB_URL)

Database URL

Definition at line 114 of file ul_mod.c.

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)

Name of column containing domains

Definition at line 100 of file ul_mod.c.

str expires_col = str_init(EXPIRES_COL)

Definition at line 196 of file ul_mod.c.

str flags_col = str_init(FLAGS_COL)

Name of column containing internal flags

Definition at line 106 of file ul_mod.c.

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]

Definition at line 179 of file ul_mod.c.

Initial value:

 {
   {"registered_users" ,  STAT_IS_FUNC, (stat_var**)get_number_of_users  },
   {0,0,0}
}

Definition at line 173 of file ul_mod.c.

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]

Exported parameters.

Definition at line 144 of file ul_mod.c.

str path_col = str_init(PATH_COL)

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().

str q_col = str_init(Q_COL)

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().

str sock_col = str_init(SOCK_COL)

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

Timer interval in seconds

Definition at line 115 of file ul_mod.c.

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

Definition at line 121 of file ul_mod.c.

Referenced by mod_init(), and new_dlist().

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

Whether usrloc should use domain part of aor

Definition at line 117 of file ul_mod.c.

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().

str user_col = str_init(USER_COL)


Generated on Thu May 24 22:00:45 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6