kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
January 2011
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
14 participants
227 discussions
Start a n
N
ew thread
git:carstenbock/ims: - Fixed Copy&Paste Bug in Makefile
by Carsten Bock
10 Jan '11
10 Jan '11
Module: sip-router Branch: carstenbock/ims Commit: e41757424397de9bf22aacb480069740ef71a506 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e417574…
Author: Carsten Bock <carsten(a)bock.info> Committer: Carsten Bock <carsten(a)bock.info> Date: Mon Jan 10 17:00:40 2011 +0100 - Fixed Copy&Paste Bug in Makefile --- modules/icscf/Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/modules/icscf/Makefile b/modules/icscf/Makefile index 1798cf9..cb573b4 100644 --- a/modules/icscf/Makefile +++ b/modules/icscf/Makefile @@ -19,7 +19,7 @@ DEFS += -DCDP_FOR_SER DEFS += -I/usr/include/libxml2 LIBS += -L$(LOCALBASE)/lib -lxml2 -MOD_INSTALL_CFGS=CxDataType.dtd CxDataType_Rel6.xsd CxDataType_Rel7.xsd scscf.cfg scscf.xml +MOD_INSTALL_CFGS=icscf.cfg icscf.xml #DEFS+= -DWITH_IMS_PM
1
0
0
0
git:mariuszbihlei/p_usrloc: modules_k/p_usrloc : removed some dead code
by Marius Zbihlei
10 Jan '11
10 Jan '11
Module: sip-router Branch: mariuszbihlei/p_usrloc Commit: b11d463cd6a262d35e32b8bd6a7896c259104259 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b11d463…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro> Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro> Date: Mon Jan 10 16:57:06 2011 +0200 modules_k/p_usrloc : removed some dead code --- modules_k/p_usrloc/ul_db_api.h | 13 ------------- modules_k/p_usrloc/ul_db_layer.c | 2 +- 2 files changed, 1 insertions(+), 14 deletions(-) diff --git a/modules_k/p_usrloc/ul_db_api.h b/modules_k/p_usrloc/ul_db_api.h index 17e66b5..134d2bf 100644 --- a/modules_k/p_usrloc/ul_db_api.h +++ b/modules_k/p_usrloc/ul_db_api.h @@ -59,19 +59,6 @@ typedef struct ul_db_api{ typedef int (*bind_ul_db_t)(ul_db_api_t * api); -/*static inline int load_ul_db_api(ul_db_api_t * api) { - bind_ul_db_t ul_dbf; - - if(!(ul_dbf = (bind_ul_db_t)find_export("sp_ul_db_bind", 1, 0))) { - LM_ERR("can't import sp_ul_db_bind.\n"); - return -1; - } - if(ul_dbf(api) < 0){ - return -1; - } - return 0; -} -*/ int bind_ul_db(ul_db_api_t* api); diff --git a/modules_k/p_usrloc/ul_db_layer.c b/modules_k/p_usrloc/ul_db_layer.c index 2b053a9..feb9d92 100644 --- a/modules_k/p_usrloc/ul_db_layer.c +++ b/modules_k/p_usrloc/ul_db_layer.c @@ -25,7 +25,7 @@ static ul_domain_db_list_t * domain_db_list = NULL; int ul_db_layer_init(void) { if(bind_ul_db(&p_ul_dbf) < 0) { - LM_ERR("could not bind sp_ul_db_api.\n"); + LM_ERR("could not bind ul_db_api.\n"); return -1; } if(db_bind_mod(&default_db_url, &dbf) < 0) {
1
0
0
0
git:mariuszbihlei/p_usrloc: module_k/p_usrloc further interface cleaning
by Marius Zbihlei
10 Jan '11
10 Jan '11
Module: sip-router Branch: mariuszbihlei/p_usrloc Commit: 93329f4579d8213488c9fcf6efd792275b32e894 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=93329f4…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro> Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro> Date: Mon Jan 10 16:25:17 2011 +0200 module_k/p_usrloc further interface cleaning --- modules_k/p_usrloc/ul_mod.c | 8 -------- modules_k/p_usrloc/ul_mod.h | 4 ---- 2 files changed, 0 insertions(+), 12 deletions(-) diff --git a/modules_k/p_usrloc/ul_mod.c b/modules_k/p_usrloc/ul_mod.c index 26a2760..a451e85 100644 --- a/modules_k/p_usrloc/ul_mod.c +++ b/modules_k/p_usrloc/ul_mod.c @@ -106,8 +106,6 @@ extern int ul_locks_no; /** * @var params * defines the parameters which can be set in the openser config file - * @param first_column specifies the column in which the first key is stored - * @param second_column specifies the column in which the second key * is stored. Only used when @see use_second_key is set to 1 * @param write_db_url Url to the database where the key and database information is * stored and where errors are reported to. Only used when @see write_on_db is active. @@ -165,8 +163,6 @@ int desc_time_order = 0; /*!< By default do not enable timestamp ordering */ int ul_fetch_rows = 2000; /*!< number of rows to fetch from result */ int ul_hash_size = 9; -str first_col = {FIRST_COL, sizeof(FIRST_COL) - 1}; -str second_col = {SECOND_COL, sizeof(SECOND_COL) - 1}; 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; @@ -246,8 +242,6 @@ static param_export_t params[] = { {"default_db_url", STR_PARAM, &default_db_url.s }, {"default_db_type", STR_PARAM, &default_db_type.s }, {"domain_db", STR_PARAM, &domain_db.s }, - {"first_column", STR_PARAM, &first_col.s }, - {"second_column", STR_PARAM, &second_col.s }, {"write_db_url", STR_PARAM, &write_db_url.s }, {"read_db_url", STR_PARAM, &read_db_url.s }, {"use_second_key", INT_PARAM, &use_second_key }, @@ -353,8 +347,6 @@ static int mod_init(void) last_mod_col.len = strlen(last_mod_col.s); db_url.len = strlen(db_url.s); - first_col.len = strlen (first_col.s); - second_col.len = strlen (second_col.s); write_db_url.len = strlen (write_db_url.s); read_db_url.len = strlen (read_db_url.s); reg_table.len = strlen(reg_table.s); diff --git a/modules_k/p_usrloc/ul_mod.h b/modules_k/p_usrloc/ul_mod.h index 87954eb..de7c00e 100644 --- a/modules_k/p_usrloc/ul_mod.h +++ b/modules_k/p_usrloc/ul_mod.h @@ -57,8 +57,6 @@ #define CONTACT_CALLID (1) #define CONTACT_PATH (2) -#define FIRST_COL "username" -#define SECOND_COL "domain" #define REG_TABLE "locdb" #define URL_COL "url" #define ID_COL "id" @@ -116,8 +114,6 @@ 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 first_col; -extern str second_col; extern str write_db_url; extern str read_db_url; extern int use_second_key;
1
0
0
0
git:mariuszbihlei/p_usrloc: modules_k:p_usrloc some interface cleaning
by Marius Zbihlei
10 Jan '11
10 Jan '11
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;
1
0
0
0
git:carstenbock/ims: - Add sample configuration files for Kamailio IMS Modules
by Carsten Bock
10 Jan '11
10 Jan '11
Module: sip-router Branch: carstenbock/ims Commit: fa8a4cc51e913349408dc40c2622410fad82d1b9 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fa8a4cc…
Author: Carsten Bock <carsten(a)bock.info> Committer: Carsten Bock <carsten(a)bock.info> Date: Mon Jan 10 16:25:16 2011 +0100 - Add sample configuration files for Kamailio IMS Modules - Before use, change the XML-files --- modules/icscf/Makefile | 2 + modules/icscf/icscf.cfg | 340 +++++++++++++++++ modules/icscf/icscf.xml | 40 ++ modules/pcscf/Makefile | 2 +- modules/pcscf/pcscf.cfg | 971 +++++++++++++++++++++++++++++++++++++++++++++++ modules/pcscf/pcscf.xml | 46 +++ modules/scscf/Makefile | 2 + modules/scscf/scscf.cfg | 752 ++++++++++++++++++++++++++++++++++++ modules/scscf/scscf.xml | 40 ++ 9 files changed, 2194 insertions(+), 1 deletions(-) Diff:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=fa8…
1
0
0
0
git:mariuszbihlei/p_usrloc: New module p_usrloc
by Marius Zbihlei
10 Jan '11
10 Jan '11
Module: sip-router Branch: mariuszbihlei/p_usrloc Commit: cd9df4024eab93e987623e00f2119732a2c8ea49 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cd9df40…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro> Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro> Date: Thu Jan 6 12:36:05 2011 +0200 New module p_usrloc Description: It is based on a usrloc module, but provides partitioned user location. This provides 3 benefits: 1. Redundancy - if a location db is down, there is a spare running 2. Load Balancing - the module balances the entries by hashing the username(or username@domain) 3. Failover- in case of error and recovery, it ensures that no stale contacts are returned More info in the READMEs(soon to come) --- modules_k/p_usrloc/dlist.c | 161 ++++++ modules_k/p_usrloc/dlist.h | 88 ++++ modules_k/p_usrloc/hslot.c | 206 ++++++++ modules_k/p_usrloc/hslot.h | 97 ++++ modules_k/p_usrloc/location.sql | 20 + modules_k/p_usrloc/p_usrloc.sql | 17 + modules_k/p_usrloc/ucontact.c | 828 ++++++++++++++++++++++++++++++ modules_k/p_usrloc/ucontact.h | 219 ++++++++ modules_k/p_usrloc/udomain.c | 717 ++++++++++++++++++++++++++ modules_k/p_usrloc/udomain.h | 194 +++++++ modules_k/p_usrloc/ul_callback.c | 121 +++++ modules_k/p_usrloc/ul_callback.h | 95 ++++ modules_k/p_usrloc/ul_check.c | 196 +++++++ modules_k/p_usrloc/ul_check.h | 61 +++ modules_k/p_usrloc/ul_db.c | 440 ++++++++++++++++ modules_k/p_usrloc/ul_db.h | 100 ++++ modules_k/p_usrloc/ul_db_api.c | 75 +++ modules_k/p_usrloc/ul_db_api.h | 78 +++ modules_k/p_usrloc/ul_db_del.c | 29 + modules_k/p_usrloc/ul_db_del.h | 30 ++ modules_k/p_usrloc/ul_db_failover.c | 351 +++++++++++++ modules_k/p_usrloc/ul_db_failover.h | 41 ++ modules_k/p_usrloc/ul_db_failover_func.c | 239 +++++++++ modules_k/p_usrloc/ul_db_failover_func.h | 40 ++ modules_k/p_usrloc/ul_db_form_query.c | 147 ++++++ modules_k/p_usrloc/ul_db_form_query.h | 48 ++ modules_k/p_usrloc/ul_db_handle.c | 639 +++++++++++++++++++++++ modules_k/p_usrloc/ul_db_handle.h | 86 +++ modules_k/p_usrloc/ul_db_ins.c | 28 + modules_k/p_usrloc/ul_db_ins.h | 30 ++ modules_k/p_usrloc/ul_db_ins_upd.c | 28 + modules_k/p_usrloc/ul_db_ins_upd.h | 30 ++ modules_k/p_usrloc/ul_db_layer.c | 475 +++++++++++++++++ modules_k/p_usrloc/ul_db_layer.h | 59 +++ modules_k/p_usrloc/ul_db_query.c | 112 ++++ modules_k/p_usrloc/ul_db_query.h | 31 ++ modules_k/p_usrloc/ul_db_repl.c | 28 + modules_k/p_usrloc/ul_db_repl.h | 30 ++ modules_k/p_usrloc/ul_db_tran.c | 223 ++++++++ modules_k/p_usrloc/ul_db_tran.h | 36 ++ modules_k/p_usrloc/ul_db_upd.c | 29 + modules_k/p_usrloc/ul_db_upd.h | 31 ++ modules_k/p_usrloc/ul_db_watch.c | 213 ++++++++ modules_k/p_usrloc/ul_db_watch.h | 38 ++ modules_k/p_usrloc/ul_mi.c | 565 ++++++++++++++++++++ modules_k/p_usrloc/ul_mi.h | 101 ++++ modules_k/p_usrloc/ul_mod.c | 541 +++++++++++++++++++ modules_k/p_usrloc/ul_mod.h | 150 ++++++ modules_k/p_usrloc/urecord.c | 629 +++++++++++++++++++++++ modules_k/p_usrloc/urecord.h | 192 +++++++ modules_k/p_usrloc/usrloc.c | 82 +++ modules_k/p_usrloc/usrloc.h | 69 +++ modules_k/p_usrloc/utime.c | 42 ++ modules_k/p_usrloc/utime.h | 45 ++ 54 files changed, 9200 insertions(+), 0 deletions(-) Diff:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=cd9…
1
0
0
0
git:mariuszbihlei/p_usrloc: test:unit : Basic test for partitioned registration (work in progress)
by Marius Zbihlei
10 Jan '11
10 Jan '11
Module: sip-router Branch: mariuszbihlei/p_usrloc Commit: 0f03e95b9b7798946db82e2ef32ef08bddf5e08d URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0f03e95…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro> Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro> Date: Mon Jan 10 12:27:22 2011 +0200 test:unit : Basic test for partitioned registration (work in progress) --- test/unit/50.cfg | 86 +++++++++++++++++++++++++ test/unit/50.sh | 186 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 272 insertions(+), 0 deletions(-) diff --git a/test/unit/50.cfg b/test/unit/50.cfg new file mode 100644 index 0000000..7a414a9 --- /dev/null +++ b/test/unit/50.cfg @@ -0,0 +1,86 @@ +# ----------- global configuration parameters ------------------------ +debug=3 +fork=yes +log_stderror=no +children=1 +disable_tcp=yes + +# ------------------ module loading ---------------------------------- +loadpath "../../modules/:../../modules_k/" +loadmodule "tm" +loadmodule "sl" +loadmodule "rr" +loadmodule "maxfwd" +loadmodule "textops" +loadmodule "xlog" +loadmodule "pv" +loadmodule "../../modules/db_mysql/db_mysql.so" + +loadmodule "mi_fifo" +modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo") + +loadmodule "p_usrloc" +modparam("p_usrloc", "db_mode", 3) +modparam("p_usrloc", "db_url", "mysql://ser:ser@localhost/ser") +modparam("p_usrloc", "read_db_url", "mysql://ser:ser@localhost/ser") +modparam("p_usrloc", "write_db_url", "mysql://ser:ser@localhost/ser") + +modparam("p_usrloc", "write_on_db", 1) +#modparam("p_usrloc", "write_on_master_db", 1) +modparam("p_usrloc", "alg_location", 1) + +modparam("p_usrloc", "reg_db_table", "locdb") + +loadmodule "registrar" +modparam("registrar", "min_expires", 5) +modparam("p_usrloc", "timer_interval", 2) + +#------------------------- request routing logic ------------------- +route{ + + if (!mf_process_maxfwd_header("10")) { + sl_send_reply("483","Too Many Hops"); + exit; + } + + if (msg:len >= 2048 ) { + sl_send_reply("513", "Message Too Large"); + exit; + } + + if (!method=="REGISTER") + record_route(); + + if (loose_route()) { + # mark routing logic in request + append_hf("P-hint: rr-enforced\r\n"); + route(1); + } + + if (!uri==myself) { + append_hf("P-hint: outbound\r\n"); + route(1); + } + + if (uri==myself) { + if (method=="REGISTER") { + save("location"); + exit; + } + if (!lookup("location")) { + sl_send_reply("404", "Not Found"); + exit; + } + append_hf("P-hint: usrloc applied\r\n"); + } + + route(1); +} + +route[1] { + if (!t_relay()) { + sl_reply_error(); + } + exit; +} + diff --git a/test/unit/50.sh b/test/unit/50.sh new file mode 100755 index 0000000..5865794 --- /dev/null +++ b/test/unit/50.sh @@ -0,0 +1,186 @@ +#!/bin/bash +# database access and persistent storage for registrar on mysql + +# Copyright (C) 2010 marius.zbihlei(a)1and1.ro +# +# 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. + +source include/common +source include/require +source include/database + +CFG=50.cfg + +if ! (check_sipsak && check_kamailio && check_module "db_mysql" && check_mysql); then + exit 0 +fi ; + +cp $CFG $CFG.bak + +#$BIN -w . -f $CFG > /dev/null +ret=$? + +sleep 1 + +# register two contacts +echo "adding new contacts" +sipsak -U -C sip:foobar@localhost -s sip:49721123456789@localhost -H localhost &> /dev/null +sipsak -U -C sip:foobar1@localhost -s sip:49721123456789@localhost -H localhost &> /dev/null +ret=$? + +sleep 100 + +if [ "$ret" -eq 0 ]; then + $CTL ul show | grep "AOR:: 49721123456789" &> /dev/null + ret=$? +fi; + +if [ "$ret" -eq 0 ]; then + TMP=`$MYSQL "select COUNT(*) from location where username='49721123456789';" | tail -n 1` + if [ "$TMP" -eq 0 ] ; then + ret=1 + fi; +fi; + +if [ "$ret" -eq 0 ]; then + # check if the contact is registered + sipsak -U -C empty -s sip:49721123456789@127.0.0.1 -H localhost -q "Contact: <sip:foobar@localhost>" &> /dev/null + ret=$? +fi; + +if [ "$ret" -eq 0 ]; then + # update the registration + sipsak -U -C sip:foobar@localhost -s sip:49721123456789@localhost -H localhost &> /dev/null + ret=$? +fi; + +if [ "$ret" -eq 0 ]; then + # check if we get a hint when we try to unregister a non-existent conctact + sipsak -U -C "sip:foobar2@localhost" -s sip:49721123456789@127.0.0.1 -H localhost -x 0 -q "Contact: <sip:foobar@localhost>" &> /dev/null + ret=$? +fi; + +if [ "$ret" -eq 0 ]; then + # unregister the contact + sipsak -U -C "sip:foobar@localhost" -s sip:49721123456789@127.0.0.1 -H localhost -x 0 &> /dev/null + ret=$? +fi; + +if [ "$ret" -eq 0 ]; then + # unregister the user again should not fail + sipsak -U -C "sip:foobar@localhost" -s sip:49721123456789@127.0.0.1 -H localhost -x 0 &> /dev/null + ret=$? +fi; + +if [ "$ret" -eq 0 ]; then + # check if the other contact is still registered + sipsak -U -C empty -s sip:49721123456789@127.0.0.1 -H localhost -q "Contact: <sip:foobar1@localhost>" &> /dev/null + ret=$? +fi; + +if [ "$ret" -eq 0 ]; then + # register the other again + sipsak -U -C sip:foobar@localhost -s sip:49721123456789@localhost -H localhost &> /dev/null + ret=$? +fi; + +if [ "$ret" -eq 0 ]; then + # unregister all contacts + sipsak -U -C "*" -s sip:49721123456789@127.0.0.1 -H localhost -x 0 &> /dev/null + ret=$? +fi; + +if [ "$ret" -eq 0 ]; then + $CTL ul show | grep "AOR:: 49721123456789" > /dev/null + ret=$? + if [ "$ret" -eq 0 ]; then + ret=1 + else + ret=0 + fi; +fi ; + +if [ "$ret" -eq 0 ]; then + ret=`$MYSQL "select COUNT(*) from location where username='49721123456789';" | tail -n 1` +fi; + +if [ "$ret" -eq 0 ]; then + # test min_expires functionality + sipsak -U -C sip:foobar@localhost -s sip:49721123456789@localhost -H localhost -x 2 &> /dev/null + ret=$? +fi; + +if [ "$ret" -eq 0 ]; then + sleep 3 + # check if the contact is still registered + sipsak -U -C empty -s sip:49721123456789@127.0.0.1 -H localhost -q "Contact: <sip:foobar@localhost>" &> /dev/null + ret=$? +fi; + +if [ "$ret" -eq 0 ]; then + # register a few more contacts + sipsak -U -e 9 -s sip:49721123456789@localhost -H localhost &> /dev/null +fi; + +if [ "$ret" -eq 0 ]; then + # let the timer cleanup the previous registrations + sleep 3 + # and check + TMP=`$MYSQL "select COUNT(*) from location where username like '49721123456789%';" | tail -n 1` + if [ "$TMP" -eq 10 ] ; then + ret=0 + else + ret=1 + fi; +fi; + +$MYSQL "delete from location where username like '49721123456789%';" + +if [ "$ret" -eq 0 ]; then + # register again + sipsak -U -C sip:foobar@localhost -s sip:49721123456789@localhost -H localhost &> /dev/null + ret=$? +fi; + +$KILL + +# restart to test preload_udomain functionality +$BIN -w . -f $CFG > /dev/null +ret=$? + +sleep 1 + +if [ "$ret" -eq 0 ]; then + # check if the contact is still registered + sipsak -U -C empty -s sip:49721123456789@127.0.0.1 -H localhost -q "Contact: <sip:foobar@localhost>" &> /dev/null + ret=$? +fi; + +# check if the methods value is correct +if [ "$ret" -eq 0 ]; then + $CTL ul show | grep "Methods:: 4294967295" &> /dev/null + ret=$? +fi; + +# cleanup +$MYSQL "delete from location where username like '49721123456789%';" + +$KILL + +mv $CFG.bak $CFG + +exit $ret \ No newline at end of file
1
0
0
0
git:mariuszbihlei/p_usrloc: Compleated interface of module.
by Marius Zbihlei
10 Jan '11
10 Jan '11
Module: sip-router Branch: mariuszbihlei/p_usrloc Commit: 74d276844561298b67edb9b56fed7e1f52ffe3ad URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=74d2768…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro> Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro> Date: Thu Jan 6 15:18:10 2011 +0200 Compleated interface of module. --- modules_k/p_usrloc/dlist.c | 10 ++++++++-- modules_k/p_usrloc/dlist.h | 3 +++ modules_k/p_usrloc/usrloc.c | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules_k/p_usrloc/dlist.c b/modules_k/p_usrloc/dlist.c index f91a2d6..baecd59 100644 --- a/modules_k/p_usrloc/dlist.c +++ b/modules_k/p_usrloc/dlist.c @@ -142,11 +142,17 @@ int register_udomain(const char *name, udomain_t **domain) { unsigned long get_number_of_users(void) { int numberOfUsers = 0; - LM_INFO("not available with sp-ul_db interface"); + LM_INFO("not available with partitioned interface"); return numberOfUsers; } +int get_all_ucontacts(void *buf, int len, unsigned int flags, + unsigned int part_idx, unsigned int part_max) +{ + LM_INFO("not available with partitioned interface"); + return -1; +} /*! * \brief Run timer handler of all domains * \return 0 if all timer return 0, != 0 otherwise @@ -154,7 +160,7 @@ unsigned long get_number_of_users(void) int synchronize_all_udomains(void) { int res = 0; - LM_INFO("not available with sp-ul_db interface"); + LM_INFO("not available with partitioned interface"); return res; } diff --git a/modules_k/p_usrloc/dlist.h b/modules_k/p_usrloc/dlist.h index 5afa429..bbd3588 100644 --- a/modules_k/p_usrloc/dlist.h +++ b/modules_k/p_usrloc/dlist.h @@ -71,6 +71,9 @@ void free_all_udomains(void); typedef int (*get_all_ucontacts_t) (void* buf, int len, unsigned int flags, unsigned int part_idx, unsigned int part_max); +int get_all_ucontacts(void *, int, unsigned int, + unsigned int part_idx, unsigned int part_max); + /*! * \brief Run timer handler of all domains * \return 0 if all timer return 0, != 0 otherwise diff --git a/modules_k/p_usrloc/usrloc.c b/modules_k/p_usrloc/usrloc.c index e366ede..67e79bc 100644 --- a/modules_k/p_usrloc/usrloc.c +++ b/modules_k/p_usrloc/usrloc.c @@ -54,7 +54,7 @@ int bind_usrloc(usrloc_api_t* api) LM_ERR("invalid parameter value\n"); return -1; } - LM_ERR("BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\n"); + if (init_flag==0) { LM_ERR("configuration error - trying to bind to usrloc module" " before being initialized\n"); @@ -62,6 +62,7 @@ int bind_usrloc(usrloc_api_t* api) } api->register_udomain = register_udomain; + api->get_all_ucontacts = get_all_ucontacts; api->insert_urecord = insert_urecord; api->delete_urecord = delete_urecord; api->get_urecord = get_urecord;
1
0
0
0
git:3.1: modules/enum: fixed access to service parameter in enum_query.
by Juha Heinanen
09 Jan '11
09 Jan '11
Module: sip-router Branch: 3.1 Commit: 2c33979528969e43f7366c7cd6470b4f03e25440 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2c33979…
Author: Juha Heinanen <jh(a)tutpro.com> Committer: Juha Heinanen <jh(a)tutpro.com> Date: Thu Jan 6 11:14:14 2011 +0200 modules/enum: fixed access to service parameter in enum_query. (cherry picked from commit 9f116e23d8b46b5470dc02f5bf731b61c7516fd8) --- modules/enum/enum.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/enum/enum.c b/modules/enum/enum.c index 695beaf..25c4c23 100644 --- a/modules/enum/enum.c +++ b/modules/enum/enum.c @@ -730,19 +730,20 @@ int enum_query_1(struct sip_msg* _msg, char* _suffix, char* _str2) */ int enum_query_2(struct sip_msg* _msg, char* _suffix, char* _service) { - str suffix, service; + str suffix, *service; if (get_str_fparam(&suffix, _msg, (fparam_t*)_suffix) != 0) { LM_ERR("unable to get suffix\n"); return -1; } - - if (get_str_fparam(&service, _msg, (fparam_t*)_service) != 0) { - LM_ERR("unable to get service\n"); + + service = (str*)_service; + if ((service == NULL) || (service->len == 0)) { + LM_ERR("invalid service parameter"); return -1; } - return enum_query(_msg, &suffix, &service); + return enum_query(_msg, &suffix, service); } @@ -756,6 +757,9 @@ int enum_query(struct sip_msg* _msg, str* suffix, str* service) char name[MAX_DOMAIN_SIZE]; char string[17]; + LM_DBG("enum_query on suffix <%.*s> service <%.*s>\n", + suffix->len, suffix->s, service->len, service->s); + if (parse_sip_msg_uri(_msg) < 0) { LM_ERR("Parsing of R-URI failed\n"); return -1;
1
0
0
0
git:3.1: uac_redirect: use the flag for parsing contact header
by Daniel-Constantin Mierla
07 Jan '11
07 Jan '11
Module: sip-router Branch: 3.1 Commit: 5fe41fc280a0cd5680c754867f495d4f193f94c0 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5fe41fc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Fri Jan 7 23:25:10 2011 +0100 uac_redirect: use the flag for parsing contact header - header type was used instead (cherry picked from commit 4fc4ceb5495486ff1313c631d34a3bc04b792895) --- modules_k/uac_redirect/rd_funcs.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules_k/uac_redirect/rd_funcs.c b/modules_k/uac_redirect/rd_funcs.c index ef92fcb..2f85ed1 100644 --- a/modules_k/uac_redirect/rd_funcs.c +++ b/modules_k/uac_redirect/rd_funcs.c @@ -211,7 +211,7 @@ static int shmcontact2dset(struct sip_msg *req, struct sip_msg *sh_rpl, memcpy( &dup_rpl, sh_rpl, sizeof(struct sip_msg) ); dup = 2; /* ok -> force the parsing of contact header */ - if ( parse_headers( &dup_rpl, HDR_CONTACT_T, 0)<0 ) { + if ( parse_headers( &dup_rpl, HDR_CONTACT_F, 0)<0 ) { LM_ERR("dup_rpl parse failed\n"); ret = -1; goto restore; @@ -224,7 +224,7 @@ static int shmcontact2dset(struct sip_msg *req, struct sip_msg *sh_rpl, } else { dup = 3; /* force the parsing of contact header */ - if ( parse_headers( sh_rpl, HDR_CONTACT_T, 0)<0 ) { + if ( parse_headers( sh_rpl, HDR_CONTACT_F, 0)<0 ) { LM_ERR("sh_rpl parse failed\n"); ret = -1; goto restore; @@ -272,8 +272,10 @@ static int shmcontact2dset(struct sip_msg *req, struct sip_msg *sh_rpl, /* add the sortet contacts as branches in dset and log this! */ for ( i=0 ; i<n ; i++ ) { - LM_DBG("adding contact <%.*s>\n", scontacts[i]->uri.len, scontacts[i]->uri.s); - if (km_append_branch( 0, &scontacts[i]->uri, 0, 0, sqvalues[i], bflags, 0)<0) { + LM_DBG("adding contact <%.*s>\n", scontacts[i]->uri.len, + scontacts[i]->uri.s); + if (km_append_branch( 0, &scontacts[i]->uri, 0, 0, sqvalues[i], + bflags, 0)<0) { LM_ERR("failed to add contact to dset\n"); } else { added++;
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
...
23
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Results per page:
10
25
50
100
200