File: p_usrloc_mod.h

package info (click to toggle)
kamailio 4.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 56,100 kB
  • sloc: ansic: 552,832; xml: 166,484; sh: 8,659; makefile: 7,676; sql: 6,235; perl: 3,487; yacc: 3,428; python: 1,457; cpp: 1,219; php: 1,047; java: 449; pascal: 194; cs: 40; awk: 27
file content (139 lines) | stat: -rw-r--r-- 3,392 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
 * $Id$
 *
 * User location module interface
 *
 * Copyright (C) 2001-2003 FhG Fokus
 *
 * This file is part of Kamailio, a free SIP server.
 *
 * Kamailio is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version
 *
 * Kamailio is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License 
 * along with this program; if not, write to the Free Software 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * History:
 * ---------
 */

/*! \file
 *  \brief P_USRLOC - P-Usrloc module interface
 *  \ingroup usrloc
 */

#ifndef UL_MOD_H
#define UL_MOD_H


#include "../../lib/srdb1/db.h"
#include "../../str.h"
#include "../../lib/kmi/mi.h"
#include "../usrloc/usrloc.h"

/*
 * Module parameters
 */

#define UL_TABLE_VERSION 1004

/*
 * Matching algorithms
 */
#define CONTACT_ONLY            (0)
#define CONTACT_CALLID          (1)
#define CONTACT_PATH		(2)

#define REG_TABLE   "locdb"
#define URL_COL        "url"
#define ID_COL         "id"
#define NUM_COL        "no"
#define STATUS_COL      "status"
#define FAILOVER_T_COL "failover"
#define SPARE_COL      "spare"
#define ERROR_COL      "errors"
#define RISK_GROUP_COL "rg"
#define DEFAULT_EXPIRE 3600
#define DEFAULT_ERR_THRESHOLD 50
#define DB_RETRY 10
#define DB_DEFAULT_POLICY 0
#define DEFAULT_FAILOVER_LEVEL 1
#define DB_DEFAULT_TRANSACTION_LEVEL "READ UNCOMMITED"
#define DB_DEFAULT_CONNECTION_EXPIRES 300
#define DEFAULT_DB_TYPE "single"
#define DEFAULT_DOMAIN_DB "location=cluster,cfa=single"

extern str ruid_col;
extern str user_col;
extern str domain_col;
extern str contact_col;
extern str expires_col;
extern str q_col;
extern str callid_col;
extern str cseq_col;
extern str flags_col;
extern str cflags_col;
extern str user_agent_col;
extern str received_col;
extern str path_col;
extern str sock_col;
extern str methods_col;
extern str instance_col;
extern str reg_id_col;
extern str last_mod_col;

extern int db_mode;
extern int use_domain;
extern int desc_time_order;
extern int cseq_delay;
extern int ul_fetch_rows;
extern int ul_hash_size;



extern str default_db_url;
extern str default_db_type;
extern int default_dbt;
extern str domain_db;
extern int expire;

extern int matching_mode;

struct mi_root* mi_ul_db_refresh(struct mi_root* cmd, void* param);
struct mi_root* mi_loc_nr_refresh(struct mi_root* cmd, void* param);

extern str write_db_url;
extern str read_db_url;
extern str reg_table;
extern str id_col;
extern str url_col;
extern str num_col;
extern str status_col;
extern str failover_time_col;
extern str spare_col;
extern str error_col;
extern str risk_group_col;
extern int expire_time;
extern int db_error_threshold;
extern int failover_level;
extern int retry_interval;
extern int policy;
extern int db_write;
extern int db_master_write;
extern int db_use_transactions;
extern str db_transaction_level;
extern char * isolation_level;
extern int connection_expires;
extern int alg_location;

extern int  max_loc_nr;

#endif /* UL_MOD_H */