Module: sip-router
Branch: mariuszbihlei/p_usrloc
Commit: 6293171f60dda717cc25c1d299687cb24f671f55
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6293171…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Date: Mon Jan 10 16:06:30 2011 +0200
modules_k:p_usrloc some interface cleaning
---
modules_k/p_usrloc/ul_db_handle.c | 14 +++++---------
modules_k/p_usrloc/ul_mod.c | 1 -
modules_k/p_usrloc/ul_mod.h | 2 --
3 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/modules_k/p_usrloc/ul_db_handle.c b/modules_k/p_usrloc/ul_db_handle.c
index be6765e..3df4b2b 100644
--- a/modules_k/p_usrloc/ul_db_handle.c
+++ b/modules_k/p_usrloc/ul_db_handle.c
@@ -38,7 +38,7 @@ static void free_handle(ul_db_handle_list_t * element);
static int check_status(ul_db_handle_t * a, ul_db_handle_t * b);
static int compute_id(str* first, str* second);
-static int load_id(db_func_t * dbf, db1_con_t * dbh, str * first, str * second);
+
static int release_handle(ul_db_handle_t * handle);
@@ -51,13 +51,8 @@ ul_db_handle_t * get_handle(db_func_t * dbf, db1_con_t * dbh, str *
first, str *
int id;
switch(alg_location){
- case 0:{
- if((id = load_id(dbf, dbh, first, second)) < 0){
- return NULL;
- }
- break;
- }
- case 1:{
+ case 1:default:{
+ /* atm this is the only matching mode */
if( max_loc_nr == 0){
LM_WARN("max_loc_nr is 0 . Try to recompute value\n");
if( load_location_number(dbf, dbh, &max_loc_nr) != 0 ){
@@ -70,10 +65,11 @@ ul_db_handle_t * get_handle(db_func_t * dbf, db1_con_t * dbh, str *
first, str *
}
break;
}
- default:{
+/* default:{
LM_ERR("No suitable selection for location\n");
return NULL;
}
+*/
}
if(load_data(dbf, dbh, &tmp, id) < 0){
diff --git a/modules_k/p_usrloc/ul_mod.c b/modules_k/p_usrloc/ul_mod.c
index ea554ef..26a2760 100644
--- a/modules_k/p_usrloc/ul_mod.c
+++ b/modules_k/p_usrloc/ul_mod.c
@@ -171,7 +171,6 @@ str write_db_url = {DEFAULT_DB_URL, DEFAULT_DB_URL_LEN};
str read_db_url = {DEFAULT_DB_URL, DEFAULT_DB_URL_LEN};
int use_second_key = 0;
str reg_table = {REG_TABLE, sizeof(REG_TABLE) -1};
-str subscr_table = {SUBSCR_TABLE, sizeof(SUBSCR_TABLE) -1};
str id_col = {ID_COL, sizeof(ID_COL) - 1};
str url_col = {URL_COL, sizeof(URL_COL) - 1};
str num_col = {NUM_COL, sizeof(NUM_COL) - 1};
diff --git a/modules_k/p_usrloc/ul_mod.h b/modules_k/p_usrloc/ul_mod.h
index 2439421..87954eb 100644
--- a/modules_k/p_usrloc/ul_mod.h
+++ b/modules_k/p_usrloc/ul_mod.h
@@ -60,7 +60,6 @@
#define FIRST_COL "username"
#define SECOND_COL "domain"
#define REG_TABLE "locdb"
-#define SUBSCR_TABLE "subscriber"
#define URL_COL "url"
#define ID_COL "id"
#define NUM_COL "no"
@@ -123,7 +122,6 @@ extern str write_db_url;
extern str read_db_url;
extern int use_second_key;
extern str reg_table;
-extern str subscr_table;
extern str id_col;
extern str url_col;
extern str num_col;