Re: [sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

2018-05-23 Thread Lucian Balaceanu
Merged #1529. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/1529#event-1641923369___ Kamailio (SER) - Development Mailing List sr-dev@lis

Re: [sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

2018-05-23 Thread Lucian Balaceanu
Thank you @hdikme. Closing the pull request. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/1529#issuecomment-391364442___ Kamailio (SER)

Re: [sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

2018-05-23 Thread hdikme
hdikme commented on this pull request. > @@ -102,13 +102,16 @@ int ul_db_child_init(void) { if(ul_db_child_locnr_init() == -1) return -1; LM_INFO("location number is %d\n", max_loc_nr); - if(db_master_write){ +lock_get(&write_on_master_db_shared->lock); p_

Re: [sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

2018-05-23 Thread hdikme
hdikme commented on this pull request. > @@ -677,6 +677,26 @@ modparam("usrloc", "db_update_as_insert", 1) ... modparam("p_usrloc", "default_db_url", "mysql://ser:ser@localhost/ser") ... + Done! -- You are receiving this because you are subscribed to this thread. Reply to this email direct

Re: [sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

2018-05-23 Thread hdikme
hdikme commented on this pull request. > @@ -307,6 +309,13 @@ static int mod_init(void) } #endif + if((write_on_master_db_shared = shm_malloc(sizeof(dbm_write_t))) == NULL) { The parameter will be created once at the beginning of mod_init and used so long as the process runs,

Re: [sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

2018-05-23 Thread hdikme
hdikme commented on this pull request. > @@ -123,5 +123,11 @@ extern int connection_expires; extern int alg_location; extern int max_loc_nr; +typedef struct dbm_write { has been changed with "db_shared_param". -- You are receiving this because you are subscribed to this thread. Reply to

Re: [sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

2018-05-22 Thread hdikme
hdikme commented on this pull request. > @@ -96,7 +96,10 @@ void check_dbs(unsigned int ticks, void *param){ ul_db_handle_list_t * tmp2, * new_element; int found; int i; - + + if(mdb_availability_control) { correct, i m removing the one inside the check_mast

Re: [sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

2018-05-22 Thread hdikme
hdikme commented on this pull request. > @@ -149,6 +152,25 @@ void check_dbs(unsigned int ticks, void *param){ lock_release(list_lock); } +void check_master_db(int dbm_write_default) { + if(mdb_availability_control) { + if(mdb.write.dbh){ There is unfortunately no

Re: [sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

2018-05-22 Thread Lucian Balaceanu
lbalaceanu commented on this pull request. > @@ -149,6 +152,25 @@ void check_dbs(unsigned int ticks, void *param){ lock_release(list_lock); } +void check_master_db(int dbm_write_default) { + if(mdb_availability_control) { + if(mdb.write.dbh){ Is it necessary to cl

Re: [sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

2018-05-21 Thread Lucian Balaceanu
lbalaceanu commented on this pull request. I will continue the review tomorrow. > @@ -307,6 +309,13 @@ static int mod_init(void) } #endif + if((write_on_master_db_shared = shm_malloc(sizeof(dbm_write_t))) == NULL) { Make sure to shm_free this allocated memory. > @@ -123,5 +123

Re: [sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

2018-05-18 Thread Henning Westerholt
@lbalaceanu - any comments on this patch? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/1529#issuecomment-390303154___ Kamailio (SER) - D

[sr-dev] [kamailio/kamailio] p_usrloc: new parameter "mdb_availability_control" has been created. (#1529)

2018-05-14 Thread hdikme
- The new parameter "mdb_availability_control" overwrites the "write_on_master_db" parameter based on the availability of master database. Pre-Submission Checklist - [ ] Commit message has the format required by CONTRIBUTING guide - [ ] Commits are split per component (core, individua