"Fossies" - the Fresh Open Source Software Archive

Member "opensips-3.0.1/test/21.cfg" (16 Apr 2019, 2129 Bytes) of package /linux/misc/opensips-3.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "21.cfg": 2.4.5_vs_3.0.0.

    1 #
    2 # simple quick-start config script
    3 # Please refer to the Core CookBook at http://www.opensips.org/dokuwiki/doku.php
    4 # for a explanation of possible statements, functions and parameters.
    5 #
    6 
    7 # ----------- global configuration parameters ------------------------
    8 
    9 log_level=3      # debug level (cmd line: -dddddddddd)
   10 log_stderror=no    # (cmd line: -E)
   11 children=4
   12 
   13 listen=udp:127.0.0.1:5059
   14 
   15 dns=no
   16 rev_dns=no
   17 
   18 # ------------------ module loading ----------------------------------
   19 
   20 #set module path
   21 mpath="../modules/"
   22 
   23 # Uncomment this if you want to use SQL database
   24 loadmodule "db_mysql/db_mysql.so"
   25 
   26 loadmodule "sl/sl.so"
   27 loadmodule "rr/rr.so"
   28 loadmodule "maxfwd/maxfwd.so"
   29 loadmodule "usrloc/usrloc.so"
   30 loadmodule "registrar/registrar.so"
   31 loadmodule "textops/textops.so"
   32 loadmodule "auth/auth.so"
   33 loadmodule "auth_db/auth_db.so"
   34 
   35 # ----------------- setting module-specific parameters ---------------
   36 # -- usrloc params --
   37 
   38 # Uncomment this if you want to use SQL database 
   39 # for persistent storage and comment the previous line
   40 modparam("usrloc", "db_mode", 3)
   41 modparam("usrloc", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
   42 
   43 # -- auth params --
   44 # Uncomment if you are using auth module
   45 #
   46 modparam("auth_db", "calculate_ha1", 1)
   47 
   48 # If you set "calculate_ha1" parameter to 1 (which true in this config), 
   49 # uncomment also the following parameter)
   50 #
   51 modparam("auth_db", "password_column", "password")
   52 
   53 
   54 # -------------------------  request routing logic -------------------
   55 
   56 # main routing logic
   57 
   58 route{
   59 
   60 	if (!mf_process_maxfwd_header("10")) {
   61 		sl_send_reply("483", "Too Many Hops");
   62 		exit;
   63 	}
   64 
   65 	if (is_method("ACK")) {
   66 		xlog("ACK");
   67 		sl_send_reply("200","OK");
   68 		exit;
   69 	}
   70 
   71 	if (is_myself("$rd")) {
   72 		if($rm==REGISTER) {
   73 			if (!www_authorize("localhost", "subscriber")) {
   74 				www_challenge("localhost", "0");
   75 			} else {
   76 				if($au==$tU && $au==$fU) {
   77 					sl_send_reply("200","OK");
   78 				}
   79 			}
   80 		} else {
   81 			if (!proxy_authorize("localhost", "subscriber")) {
   82 				proxy_challenge("localhost", "0");
   83 			} else {
   84 				if($au==$fU && $au==$tU) {
   85 					sl_send_reply("200","OK");
   86 				}
   87 			}
   88 		}
   89 		exit;
   90 	}
   91 }