[Serusers] Reload Ser configuration and DB in runtime?

sip sip at arcdiv.com
Tue Sep 12 14:33:26 CEST 2006


We initially used a script to add aliases using the serctl command, but moved
to the alias_db method so we wouldn't have the possible security issues that
one gets when one starts allowing a website to run scripts on the server. 

It IS a little slower lookup when under massive use, but not by too much, and
we were happier to sacrifice that speed for security. 

Ideally, the best scheme would be for ser to regularly look for changes in the
aliases table and reload it on its own if there were any, so we could use the
memory-resident speed of ser's normal lookup method combined with the security
and ease of just editing the tables in the DB instead of having to use the
fifo stuff. But alas, we'll make do with what we have available for now. 

Honestly, getting rid of that bloody fifo is the first step toward making SER
more portable to other environments anyway. ;) 

BOTH methods will work. Feel free to choose the one that suits your environment. 

ONE caveat is that there's no guarantee, as SER continues on its path and
OpenSER on its own path, that there will be an alias_db module that works in
newer versions of SER. Unless someone writes one for SER's new architecture
specifically (hint hint), there's the possibility that you'll have to redo how
you add aliases later on (or switch to OpenSER, which might cause even more
headaches). 

Only you can choose the best path for your own architecture. :) 


N.

On Tue, 12 Sep 2006 13:02:01 +0100, Ricardo Carvalho wrote
> Thanx, I thinks I'll give it a try.
> 
> Anyway, I assume that if I add aliases adapting serctl script to a 
> web interface, everything will function well, right? Which option 
> should be better - alias_db module from Openser or adding aliases 
> using serctl script sintax exported to a web interface?
> 
> Regards,
> Ricardo.
> 
> sip wrote:
> > The ONLY information SER doesn't seem to be able to make read straight from
> > the DB is information about aliases (which it stores in memory and which, even
> > if you place into the aliases table manually, it won't read). There's an
> > openser module called alias_db which, if you grab from the openser-0.9.x src
> > tarball, will compile and work quite readily with SER 0.9.x. 
> >
> > ( http://www.openser.org/pub/openser/0.9.5/src/openser-0.9.5_src.tar.gz )
> >
> > Documentation about it can be found here: 
> >
> > http://www.openser.org/docs/modules/0.9.x/alias_db.html
> >
> > Unfortunately, you can't use the same aliases table as you use for the usual
> > lookup("aliases") command, as they use a different structure (although, I have
> > to say I find the alias_db structure to make more sense, but that's a personal
> > thing), but there's a mysql table creation command at the bottom of the docs
> > for creating a table for the alias_db aliases. 
> >
> > Then, in your ser.cfg, load the module and everywhere you have a
> > lookup("aliases"), change that to alias_db_lookup("dbaliases") 
> >
> > Works like a charm. Since it's not memory-resident, it's going to be slower
> > than the normal aliases, but not really any slower than a normal lookup in the
> > DB of any of the other values you're liable to be accessing. 
> >
> > N.
> >
> >
> >
> > On Tue, 12 Sep 2006 10:21:56 +0100, Ricardo Carvalho wrote
> >   
> >> I was expecting that Ser could be able to load some table contents 
> >> in runtime like aliases, grp, subscriber and usr_preferences, so 
> >> that I could use Ser in a production environment where should exist 
> >> some Web interface for user and administrator management capable of 
> >> altering aliases, adding or removing users, adding voicemail 
> >> permissions, altering permissions for each user dialplan, adding 
> >> forwarding contacts in realtime, etc. I guess I'll have to make some 
> >> tests to see which function modules read data from DB in realtime 
> >> and which don't.
> >>
> >> Regards,
> >> Ricardo.
> >>
> >> Andrey Kouprianov wrote:
> >>     
> >>> Hi,
> >>>
> >>> You certainly cannot make ser accept changes made to a configuration
> >>> file during runtime. Take a look for instance at apache http server or
> >>> should i say almost any server on Linux.. None of them allows
> >>> accepting configurations dynamically. :)  Besides, some threads in
> >>> this list already discussed this issue.
> >>>
> >>> As for database, Im not sure.. But what exactly are you expecting to
> >>> be reloaded automatically?
> >>>
> >>>
> >>> Andrey.
> >>> _______________________________________________
> >>> Serusers mailing list
> >>> Serusers at lists.iptel.org
> >>> http://lists.iptel.org/mailman/listinfo/serusers
> >>>
> >>>       
> >> _______________________________________________
> >> Serusers mailing list
> >> Serusers at lists.iptel.org
> >> http://lists.iptel.org/mailman/listinfo/serusers
> >>     
> >
> >




More information about the sr-users mailing list