[Serusers] nat_uac_test

Klaus Darilion klaus.mailinglists at pernau.at
Tue Jun 29 09:46:55 CEST 2004


probably you use an old ser version (rpm?). Get the latest stable from 
cvs and build ser yourself. Then you have the nathelper module with all 
features which were introduced after the first 0.8.12 release.

klaus

Bill wrote:
>     Shown below is my ser.cfg file. For some reason the nat_uac_test 
> routine doesn't work. The debugging says it doesn't know the command and 
> believes I left out a module. I can't find much documentation on this 
> command. Did I leave out a module or something required to use this?
>  
>     Bill
> 
>  
>  
> #
> # $Id: ser.cfg,v 1.21.4.1 2003/11/10 15:35:15 andrei Exp $
> #
> # simple quick-start config script
> #
>  
> # ----------- global configuration parameters ------------------------
>  
> #debug=3         # debug level (cmd line: -dddddddddd)
> #fork=yes
> #log_stderror=no        # (cmd line: -E)
>  
> /* Uncomment these lines to enter debugging mode
> debug=7
> fork=no
> log_stderror=yes
> */
>  
> check_via=no    # (cmd. line: -v)
> dns=no           # (cmd. line: -r)
> rev_dns=no      # (cmd. line: -R)
> #port=5060
> #children=4
> fifo="/tmp/ser_fifo"
> fifo_mode=0666
>  
> # ------------------ module loading ----------------------------------
>  
> # Uncomment this if you want to use SQL database
> loadmodule "/lib/ser/modules/mysql.so"
>  
> loadmodule "/lib/ser/modules/sl.so"
> loadmodule "/lib/ser/modules/tm.so"
> loadmodule "/lib/ser/modules/maxfwd.so"
> loadmodule "/lib/ser/modules/registrar.so"
> loadmodule "/lib/ser/modules/auth.so"
> # loadmodule "/lib/ser/modules/textops.so"
> # loadmodule "/lib/ser/modules/enum.so"
> loadmodule "/lib/ser/modules/group.so"
>  
> loadmodule "/lib/ser/modules/nathelper.so"
> modparam("nathelper", "natping_interval", 10)
>  
> # loadmodule "/lib/ser/modules/vm.so"
> # modparam("vm", "db_url", "sql://root:@127.0.0.1/ser")
> # modparam("vm", "email_column", "sip at xxx.xxx.net <mailto:sip at xxx.xxx.net>")
> # modparam("vm", "domain_column", "ser.vci.net")
>  
> loadmodule "/lib/ser/modules/acc.so"
> modparam("acc", "db_url", "sql://root:@127.0.0.1/ser")
> modparam("acc", "log_missed_flag", 2)
> modparam("acc", "log_level", 1)
> modparam("acc", "log_flag", 1)
> modparam("acc", "db_flag", 2)
> modparam("acc", "db_missed_flag", 2)
>  
> loadmodule "/lib/ser/modules/usrloc.so"
> modparam("usrloc", "db_mode",   0)
> modparam("usrloc", "db_mode", 2)
>  
> loadmodule "/lib/ser/modules/auth_db.so"
> modparam("auth_db", "calculate_ha1", yes)
> modparam("auth_db", "password_column", "password")
>  
> loadmodule "/lib/ser/modules/rr.so"
> 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;
>         };
>  
>         if (nat_uac_test("3")) {
>                 log("1,Connection from someone behind a NAT");
>         };
>  
>         if (uri =~ "^sip:admin" ) {
>               log(1, "Connection from admin at xxx.xxx.net 
> <mailto:admin at xxx.xxx.net>");
>         };
>  
>         if (method=="CANCEL") {
>                 log(1,"Sent CANCEL request");
>         }
>  
>         if (method=="INVITE") {
>                 log(1,"Sent INVITE request");
>         }
>  
>         # 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
>         record_route();
>         # loose-route processing
>         if (loose_route()) {
>                 t_relay();
>                 break;
>         };
>  
>         setflag(2);
>  
>         # 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) {
>                 log(1,"processing request for ser.vci.net domain");
>  
>                 if (method=="REGISTER") {
>                         log(1,"register request for xxx.xxx.net domain");
>                         if (!www_authorize("xxx.xxx.net", "subscriber")) {
>                                 www_challenge("ser.vci.net", "0");
>                                 break;
>                         };
>  
>                         save("location");
>                         break;
>                 };
>  
>                 # native SIP destinations are handled using our USRLOC DB
>                 if (!lookup("location")) {
>                         log(1,"404 - Not Found");
>                         acc_db_request("404 Not Found", "acc");
>                         sl_send_reply("404", "Not Found");
>                         break;
>                 };
>         };
>         # forward to current uri now; use stateful forwarding; that
>         # works reliably even if we forward from TCP to UDP
>         if (!t_relay()) {
>                 log(1,"not sure what this does");
>                 sl_reply_error();
>         };
>  
> }
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers




More information about the sr-users mailing list