# # $Id: ser.cfg,v 1.21.4.1 2003/11/10 15:35:15 kramarv Exp $ # # 3-rd party registrar config script # # ----------- global configuration parameters ------------------------ debug=7 # 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) server_signature=no sip_warning=no port=5060 # # Change to appropriate IP of ser box # alias="linux" alias="10.50.114.5" alias="10.50.114.69" children=7 fifo="/tmp/ser_fifo" #THIS causes problem with branch when YES => NEVER NEVER NEVER set this "yes"!!!! syn_branch=no # ------------------ module loading ---------------------------------- # Uncomment this if you want to use SQL database loadmodule "/usr/lib64/ser/modules/mysql.so" loadmodule "/usr/lib64/ser/modules/sl.so" loadmodule "/usr/lib64/ser/modules/tm.so" loadmodule "/usr/lib64/ser/modules/rr.so" loadmodule "/usr/lib64/ser/modules/maxfwd.so" loadmodule "/usr/lib64/ser/modules/usrloc.so" loadmodule "/usr/lib64/ser/modules/registrar.so" #loadmodule "/usr/lib64/ser/modules/uri.so loadmodule "/usr/lib64/ser/modules/exec.so" loadmodule "/usr/lib64/ser/modules/textops.so" loadmodule "/usr/lib64/ser/modules/mediaproxy.so" loadmodule "/usr/lib64/ser/modules/domain.so" # Uncomment this if you want digest authentication # mysql.so must be loaded ! loadmodule "/usr/lib64/ser/modules/auth.so" loadmodule "/usr/lib64/ser/modules/auth_db.so" # ----------------- setting module-specific parameters --------------- # -- usrloc params -- #modparam("usrloc", "db_mode", 0) # Uncomment this if you want to use SQL database # for persistent storage and comment the previous line modparam("usrloc", "db_mode", 2) # -- auth params -- # Uncomment if you are using auth module # modparam("auth_db", "calculate_ha1", yes) # # If you set "calculate_ha1" parameter to yes (which true in this config), # uncomment also the following parameter) # modparam("auth_db", "password_column", "password") # -- rr params -- # add value to ;lr param to make some broken UAs happy modparam("rr", "enable_full_lr", 1) #--- tm params --- #modparam("tm", "via1_matching", 0) modparam("mediaproxy", "natping_interval", 60) modparam("registrar", "nat_flag", 2) # ------------------------- 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; }; # loose-route processing - let pass through if (loose_route()) { t_relay(); break; }; if (method=="REGISTER") { route(1); break; }; # Force subsequent messages to pass trough this proxy #if (method == "INVITE") { # record_route(); #}; if (client_nat_test("3") && !search("^Record-Route:")) { # Mark as NAT'ed force_rport(); fix_contact(); }; #PUT CSN IP ADDRESS # check the direction and forward to client if (src_ip == 10.50.114.252) { route(2); break; }; #forwarding to the CSN based on numbering plan route(3); } route[1] { # REGISTER request processing # Mark as NAT'ed if (client_nat_test("3")) { setflag(2); force_rport(); fix_contact(); }; #PUT SER BOX IP ADDRESS if ((!www_authorize("smartconnect.embarq.com", "subscriber")) && (!search("Expires: 0"))) { www_challenge("smartconnect.embarq.com", "0"); break; }; #replace contact if not STAR if (!search("Contact: \*")) { # PROPAGATES 200OK from CSN #save_noreply("location"); # GENERATE 200OK from SER save("location"); if (!search("Expires: 0")) { remove_hf("Contact"); #PUT SER BOX IP ADDRESS append_hf("Contact: \r\n"); } else { remove_hf("Contact"); #PUT SER BOX IP ADDRESS append_hf("Contact: \r\n"); }; #STAR in conact - mark this message } else { setflag(1); }; #PUT CSN IP ADDRESS rewritehostport("10.50.114.252:5060"); t_relay(); if (isflagset(1)) { #erase contacts for REGISTER with STAR save_noreply("location"); }; break; } route[2] { # CSN --> proxy # native SIP destinations are handled using our USRLOC DB if (!lookup("location")) { sl_send_reply("404","Not Found"); break; } else { # forward to current uri now; use stateful forwarding; that # works reliably even if we forward from TCP to UDP t_relay(); #to adsorb retransmissions }; } route[3] { # proxy --> CSN #PUT CSN IP ADDRESS # if (search("sip:660")) { # rewritehostport("10.50.114.252:5060"); # forward(uri:host, uri:port); # }; rewritehostport("10.50.114.252:5060"); t_relay(); } onreply_route[4] { #CSE answers REGISTER #if status not 200 - remove from location break; } route[5] { # proxy --> CSN #PUT CSN IP ADDRESS rewritehostport("10.50.114.252:5060"); forward(uri:host, uri:port); }