# # $Id: ser.cfg,v 1.25.2.1 2005/02/18 14:30:44 andrei Exp $ # # simple quick-start config script # # ----------- global configuration parameters ------------------------ debug=7 # debug level (cmd line: -dddddddddd) fork=yes log_stderror=yes # (cmd line: -E) listen=192.168.87.252 # hostname matching an alias will satisfy the condition uri==myself". alias=ser.mydomain.pri alias=ser.mydomain.net /* Uncomment these lines to enter debugging mode log_stderror=yes */ check_via=yes # (cmd. line: -v) dns=no # (cmd. line: -r) rev_dns=no # (cmd. line: -R) port=5060 children=7 # fifo - FIFO special file pathname fifo="/tmp/ser_fifo" fifo_db_url="mysql://ser:heslo@127.0.0.1/ser" # syn_branch - Shall the server use stateful synonym branches? It is # faster but not reboot-safe. Default is yes. syn_branch=yes # memlog - Debugging level for final memory statistics report. Default # is L_DBG -- memory statistics are dumped only if debug is set high. memlog=3 # sip_warning - Should replies include extensive warnings? By default # yes, it is good for trouble-shooting. sip_warning=yes # reply_to_via - A hint to reply modules whether they should send reply # to IP advertised in Via. Turned off by default, which means that # replies are sent to IP address from which requests came. reply_to_via=no # ------------------ module loading ---------------------------------- # Uncomment this if you want to use SQL database loadmodule "/opt/ser/lib/ser/modules/sl.so" loadmodule "/opt/ser/lib/ser/modules/tm.so" loadmodule "/opt/ser/lib/ser/modules/mysql.so" loadmodule "/opt/ser/lib/ser/modules/domain.so" loadmodule "/opt/ser/lib/ser/modules/uri_db.so" loadmodule "/opt/ser/lib/ser/modules/rr.so" loadmodule "/opt/ser/lib/ser/modules/maxfwd.so" loadmodule "/opt/ser/lib/ser/modules/usrloc.so" loadmodule "/opt/ser/lib/ser/modules/registrar.so" loadmodule "/opt/ser/lib/ser/modules/textops.so" loadmodule "/opt/ser/lib/ser/modules/mediaproxy.so" loadmodule "/opt/ser/lib/ser/modules/nathelper.so" loadmodule "/opt/ser/lib/ser/modules/pa.so" # Uncomment this if you want digest authentication # mysql.so must be loaded ! loadmodule "/opt/ser/lib/ser/modules/auth.so" loadmodule "/opt/ser/lib/ser/modules/auth_db.so" # ----------------- setting module-specific parameters --------------- # param settings modparam("pa", "use_db",1) modparam("pa","db_url", "mysql://ser:heslo@127.0.0.1/ser") modparam("pa", "default_expires", 3) modparam("pa","pa_domain", "ser.mydomain.pri") #modparam("domain", "db_mode", 1) modparam("domain", "db_url", "mysql://ser:heslo@127.0.0.1/ser") #modparam("domain", "domain_table", "new_name") #modparam("domain", "domain_col", "domain_col") modparam("uri_db", "uri_table", "uri") modparam("uri_db", "uri_user_column", "username") modparam("uri_db", "uri_domain_column", "domain") modparam("uri_db", "uri_uriuser_column", "uri_user") modparam("uri_db", "subscriber_table", "subscriber") modparam("uri_db", "subscriber_user_column", "username") modparam("uri_db", "subscriber_domain_column", "domain") modparam("nathelper", "rtpproxy_disable", 1) modparam("nathelper", "natping_interval", 0) modparam("mediaproxy", "natping_interval", 40) modparam("mediaproxy", "mediaproxy_socket", "/var/run/mediaproxy.sock") modparam("mediaproxy", "sip_asymmetrics", "/etc/ser/sip-clients") modparam("mediaproxy", "rtp_asymmetrics", "/etc/ser/rtp-clients") modparam("registrar", "nat_flag", 6) # -- usrloc params -- #modparam("usrloc", "db_mode", 0) # 2 enables write-back to persistent mysql storage for speed # disable=0, write-through=1 # Uncomment this if you want to use SQL database # for persistent storage and comment the previous line modparam("usrloc", "db_mode", 2) # database location modparam("usrloc", "db_url", "mysql://ser:heslo@127.0.0.1/ser") # minimize write back window - default is 60 seconds modparam("usrloc", "timer_interval", 10) # -- auth params -- # Uncomment if you are using auth module # modparam("auth", "secret", "johndoessecretphrase") modparam("auth", "nonce_expire", 600) 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", "db_url", "mysql://ser:heslo@127.0.0.1/ser") modparam("auth_db", "user_column", "user") modparam("auth_db", "domain_column", "domain") 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) # ------------------------- 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 >= 2048 ) { 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"); setflag(6); use_media_proxy(); route(1); break; }; if (!uri==myself) { # mark routing logic in request append_hf("P-hint: outbound\r\n"); route(1); break; }; if (method=="BYE" || method=="CANCEL" ) { end_media_session(); }; # 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("ser.mydomain.net", "subscriber")) { # www_challenge("ser.mydomain.net", "0"); # break; # }; save("location"); # pa_handle_registration("ser.mydomain.pri"); break; }; if (uri==myself) { if (method=="SUBSCRIBE") { if (!t_newtran()) { sl_reply_error(); break; }; handle_subscription("registrar"); 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); break; } route[1] { # send it out now; use stateful forwarding as it works reliably # even for UDP2TCP if (isflagset(6) || isflagset(7)) { use_media_proxy(); }; if (!t_relay()) { sl_reply_error(); }; }