[Serusers] 'dbtext' database tables problems

Daniel-Constantin Mierla Daniel-Constantin.Mierla at fokus.fraunhofer.de
Mon Nov 29 21:47:29 CET 2004


Hello Michael,

thanks for your feedback. I will add the definition of the tables and
the config file in the documentation of dbtext, hoping that will help
other people.

Daniel


On 11/29/04 19:11, msg wrote:

> Daniel, thanks for your reply.
>
> I had used the definitions found in ser_mysql.sh (omitting some fields
> I'll admit) and comparing those with the fields in the various examples;
> one problem turned out to be white space in (type,null) definitions
> in the examples.  There also were extra fields not included in the
> ser_mysql.sh script but requested in the diagnostics.
>
> Anyway, it works now and for those who want a quick start I'm posting
> the contents of 'ser.cfg' and the database files 'version', 
> 'subscriber', 'aliases' and 'location' (stripped of actual entries).
>
> Regards,
>
> Michael Grigoni
> Cybertheque Museum
>
> ---ser.cfg---
> #
> # $Id: ser.cfg,v 1.24 2003/11/11 15:32:36 andrei Exp $
> #
> # simple quick-start config script
> #
>
> # ----------- global configuration parameters ------------------------
>
> mhomed=1
> alias=cybertheque.org
> debug=9         # debug level (cmd line: -dddddddddd)
> fork=yes
> #log_stderror=no        # (cmd line: -E)
>
> check_via=no    # (cmd. line: -v)
> dns=no           # (cmd. line: -r)
> rev_dns=no      # (cmd. line: -R)
> #port=5060
> children=2
> fifo="<absolute path to fifo>" #why tell the world
>
> # ------------------ module loading ----------------------------------
>
> # Uncomment this if you want to use dbtext database
> loadmodule "/usr/local/lib/ser/modules/dbtext.so"
>
> loadmodule "/usr/local/lib/ser/modules/sl.so"
> loadmodule "/usr/local/lib/ser/modules/tm.so"
> loadmodule "/usr/local/lib/ser/modules/rr.so"
> loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
> loadmodule "/usr/local/lib/ser/modules/usrloc.so"
> loadmodule "/usr/local/lib/ser/modules/registrar.so"
> loadmodule "/usr/local/lib/ser/modules/textops.so"
>
> # Uncomment this if you want digest authentication
> # dbtext.so must be loaded !
> loadmodule "/usr/local/lib/ser/modules/auth.so"
> loadmodule "/usr/local/lib/ser/modules/auth_db.so"
>
> # ----------------- setting module-specific parameters ---------------
>
> # -- usrloc params --
>
> #modparam("usrloc", "db_mode",   0)
>
> # Uncomment this if you want to use dbtext database
> # for persistent storage and comment the previous line
> modparam("usrloc", "db_mode", 2)
> modparam("usrloc", "db_url", "dbtext://</absolute/path/to/url_dir>")
> modparam("auth_db", "db_url", "dbtext://</absolute/path/to/url_dir>")
>
> # -- auth params --
> # Uncomment if you are using auth module
> #
> modparam("auth_db", "calculate_ha1", 1)
> #
> # If you set "calculate_ha1" parameter to 1 (which true in this config),
> # uncomment also the following parameter)
> #
> modparam("auth_db", "password_column", "password")
> modparam("auth_db", "user_column", "username")
> modparam("auth_db", "domain_column", "domain")
>
> # -- rr params --
> # add value to ;lr param to make some broken UAs happy
> modparam("rr", "enable_full_lr", 1)
>
> # -------------------------  request routing logic -------------------
>
> # main routing logic
>
> route{
>
>         # initial sanity checks -- messages with
>         # max_forwards==0, or excessively long requests
>         if (!mf_process_maxfwd_header("10")) {
>                 sl_send_reply("483","Too Many Hops");
>                 break;
>         };
>         if (msg:len >=  max_len ) {
>                 sl_send_reply("513", "Message too big");
>                 break;
>         };
>
>         # we record-route all messages -- to make sure that
>         # subsequent messages will go through our proxy; that's
>         # particularly good if upstream and downstream entities
>         # use different transport protocol
>         if (!method=="REGISTER") record_route();
>
>         # subsequent messages withing a dialog should take the
>         # path determined by record-routing
>         if (loose_route()) {
>                 # mark routing logic in request
>                 append_hf("P-hint: rr-enforced\r\n");
>                 route(1);
>                 break;
>         };
>
>         if (!uri==myself) {
>                 # mark routing logic in request
>                 append_hf("P-hint: outbound\r\n");
>                 route(1);
>                 break;
>         };
>
>         # if the request is for other domain use UsrLoc
>         # (in case, it does not work, use the following command
>         # with proper names and addresses in it)
>         if (uri==myself) {
>
>                 if (method=="REGISTER") {
>
> # Uncomment this if you want to use digest authentication
>        if (!www_authorize("<your_sip_domain>", "subscriber")) {
>                       www_challenge("<your_sip_domain>", "0");
>                       break;
>            };
>
>                         save("location");
>                         break;
>                 };
>
>                 lookup("aliases");
>                 if (!uri==myself) {
>                         append_hf("P-hint: outbound alias\r\n");
>                         route(1);
>                         break;
>                 };
>
>                 # native SIP destinations are handled using our USRLOC DB
>                 if (!lookup("location")) {
>                         sl_send_reply("404", "Not Found");
>                         break;
>                 };
>         };
>         append_hf("P-hint: usrloc applied\r\n");
>         route(1);
> }
>
> route[1]
> {
>         # send it out now; use stateful forwarding as it works reliably
>         # even for UDP2TCP
>         if (!t_relay()) {
>                 sl_reply_error();
>         };
> }
>
>
> ---version---
> table_name(str) table_version(int)
> subscriber:3
> location:6
> aliases:6
>
> ---location--- (note that this is all one line):
> username(str) domain(str,null) contact(str,null) expires(int,null) 
> q(double,null) callid(str,null) cseq(int,null) last_modified(str) 
> replicate(int,null) state(int,null) flags(int) user_agent(str) 
> received(str)
>
> ---aliases---  (note that this is all one line):
> username(str) domn(str,null) contact(str,null) expires(int,null) 
> q(double,null) callid(str,null) cseq(int,null) last_modified(str) 
> replicate(int,null) state(int,null) flags(int) user_agent(str) 
> received(str)
>
> ---subscriber--- (note that this is all one line):
> username(str) domn(str) password(str) first_name(str) last_name(str) 
> phone(str) email_address(str) datetime_created(int) 
> datetime_modified(int) confirmation(str) flag(str) 
> sendnotification(str) greeting(str) ha1(str) ha1b(str) perms(str) 
> allow_find(str) timezone(str,null) rpid(str,null) uuid(str,null)
>
>




More information about the sr-users mailing list