# # $Id$ # # simple quick-start config script # # ----------- global configuration parameters ------------------------ debug=7 # debug level (cmd line: -dddddddddd) fork=no log_stderror=yes # (cmd line: -E) check_via=no # (cmd. line: -v) dns=no # (cmd. line: -r) rev_dns=no # (cmd. line: -R) listen=192.168.0.1 port=5010 children=4 # ------------------ module loading ---------------------------------- loadmodule "modules/sl/sl.so" loadmodule "modules/tm/tm.so" loadmodule "modules/rr/rr.so" loadmodule "modules/maxfwd/maxfwd.so" # ----------------- setting module-specific parameters --------------- # ------------------------- 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 (len_gt( 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 record_route_strict(); # loose-route processing loose_route(); # forward to current uri now; use stateful forwarding; that # works reliably even if we forward from TCP to UDP if ( (method == "INVITE") || (method == "ACK") ){ if (!t_relay_to("192.168.0.1","5070")) { sl_reply_error(); }; } else { if(!t_relay()){ sl_reply_error(); }; }; }