p_usrloc_mod.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * User location module interface
00005  *
00006  * Copyright (C) 2001-2003 FhG Fokus
00007  *
00008  * This file is part of Kamailio, a free SIP server.
00009  *
00010  * Kamailio is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version
00014  *
00015  * Kamailio is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License 
00021  * along with this program; if not, write to the Free Software 
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  * History:
00025  * ---------
00026  */
00027 
00033 #ifndef UL_MOD_H
00034 #define UL_MOD_H
00035 
00036 
00037 #include "../../lib/srdb1/db.h"
00038 #include "../../str.h"
00039 #include "../../lib/kmi/mi.h"
00040 #include "../usrloc/usrloc.h"
00041 
00042 /*
00043  * Module parameters
00044  */
00045 
00046 #define UL_TABLE_VERSION 1004
00047 
00048 /*
00049  * Matching algorithms
00050  */
00051 #define CONTACT_ONLY            (0)
00052 #define CONTACT_CALLID          (1)
00053 #define CONTACT_PATH            (2)
00054 
00055 #define REG_TABLE   "locdb"
00056 #define URL_COL        "url"
00057 #define ID_COL         "id"
00058 #define NUM_COL        "no"
00059 #define STATUS_COL      "status"
00060 #define FAILOVER_T_COL "failover"
00061 #define SPARE_COL      "spare"
00062 #define ERROR_COL      "errors"
00063 #define RISK_GROUP_COL "rg"
00064 #define DEFAULT_EXPIRE 3600
00065 #define DEFAULT_ERR_THRESHOLD 50
00066 #define DB_RETRY 10
00067 #define DB_DEFAULT_POLICY 0
00068 #define DEFAULT_FAILOVER_LEVEL 1
00069 #define DB_DEFAULT_TRANSACTION_LEVEL "READ UNCOMMITED"
00070 #define DB_DEFAULT_CONNECTION_EXPIRES 300
00071 #define DEFAULT_DB_TYPE "single"
00072 #define DEFAULT_DOMAIN_DB "location=cluster,cfa=single"
00073 
00074 extern str user_col;
00075 extern str domain_col;
00076 extern str contact_col;
00077 extern str expires_col;
00078 extern str q_col;
00079 extern str callid_col;
00080 extern str cseq_col;
00081 extern str flags_col;
00082 extern str cflags_col;
00083 extern str user_agent_col;
00084 extern str received_col;
00085 extern str path_col;
00086 extern str sock_col;
00087 extern str methods_col;
00088 extern str last_mod_col;
00089 
00090 extern int db_mode;
00091 extern int use_domain;
00092 extern int desc_time_order;
00093 extern int cseq_delay;
00094 extern int ul_fetch_rows;
00095 extern int ul_hash_size;
00096 
00097 
00098 
00099 extern str default_db_url;
00100 extern str default_db_type;
00101 extern int default_dbt;
00102 extern str domain_db;
00103 extern int expire;
00104 
00105 extern int matching_mode;
00106 
00107 struct mi_root* mi_ul_db_refresh(struct mi_root* cmd, void* param);
00108 struct mi_root* mi_loc_nr_refresh(struct mi_root* cmd, void* param);
00109 
00110 extern str write_db_url;
00111 extern str read_db_url;
00112 extern str reg_table;
00113 extern str id_col;
00114 extern str url_col;
00115 extern str num_col;
00116 extern str status_col;
00117 extern str failover_time_col;
00118 extern str spare_col;
00119 extern str error_col;
00120 extern str risk_group_col;
00121 extern int expire_time;
00122 extern int db_error_threshold;
00123 extern int failover_level;
00124 extern int retry_interval;
00125 extern int policy;
00126 extern int db_write;
00127 extern int db_master_write;
00128 extern int db_use_transactions;
00129 extern str db_transaction_level;
00130 extern char * isolation_level;
00131 extern int connection_expires;
00132 extern int alg_location;
00133 
00134 extern int  max_loc_nr;
00135 
00136 #endif /* UL_MOD_H */