[Serusers] periodically read back from db

Chris St Denis chris at aebc.com
Fri Aug 19 03:05:27 CEST 2005


preload_all_udomains was used to load data from the database.

The dlist.c patch loads the contents of the database if its in readback mode
(this code is added within the timer code)

Ucontact.c patch just makes readback act the same as writeback

ul_mod.c patch is just a comment addition

ul_mod.h patch adds the constant for the new mode

urecord.c patch calls the timer in readback mode. 

udomain.c patch purges the old records before the new ones are loaded



at quick glance, it looks like preload_all_udomains has been murged into
register_udomain. Again, at quick glance, it looks like this is the block of
revelant code. I don’t have time to study this in more depth tho.


        if (db_mode != NO_DB) {
                con = ul_dbf.init(db_url.s);
                if (!con) {
                        LOG(L_ERR, "register_udomain(): Can not open
database connection\n");
                        goto err;
                }

                ver = table_version(&ul_dbf, con, &s);

                if (ver < 0) {
                        LOG(L_ERR, "register_udomain(): Error while querying
table version\n");
                        goto err;
                } else if (ver < TABLE_VERSION) {
                        LOG(L_ERR, "register_udomain(): Invalid table
version (use ser_mysql.sh reinstall)\n");
                        goto err;
                }

                if (preload_udomain(con, d->d) < 0) {
                        LOG(L_ERR, "register_udomain(): Error while
preloading domain '%.*s'\n",
                            s.len, ZSW(s.s));
                        goto err;
                }

                ul_dbf.close(con);
        }

________________________________________
From: serusers-bounces at iptel.org [mailto:serusers-bounces at lists.iptel.org] On
Behalf Of Chia Huey Lim
Sent: Thursday, August 18, 2005 3:17 AM
To: serusers at lists.iptel.org
Subject: [Serusers] periodically read back from db

Hi all,

I am using ser-0.9.3. I wish to have multiple SER in synchronization at
database level. 
Therefore, I have to patch SER so that it will also periodically read back
the location table from db to the cache as well. 
I’ve followed the patch at 
http://bugs.sip-router.org/browse/SER-46

however, I can’t use preload_all_udomains();  for dlist.c

Anyone has any clue what’s that for? 
Anyone has successfully patch the version 0.9.3 so that SER can write and
read back from the location table?
Thanks in advance.

Regards,
Chia




More information about the sr-users mailing list