# # $Id: ser.cfg,v 1.20 2003/05/31 21:12:19 jiri 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=9 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" # ------------------ module loading ---------------------------------- # Uncomment this if you want to use SQL database loadmodule "/var/ser/lib/ser/modules/mysql.so" loadmodule "/var/ser/lib/ser/modules/sl.so" loadmodule "/var/ser/lib/ser/modules/tm.so" loadmodule "/var/ser/lib/ser/modules/rr.so" loadmodule "/var/ser/lib/ser/modules/maxfwd.so" loadmodule "/var/ser/lib/ser/modules/usrloc.so" loadmodule "/var/ser/lib/ser/modules/registrar.so" # Uncomment this if you want digest authentication # mysql.so must be loaded ! loadmodule "/var/ser/lib/ser/modules/auth.so" loadmodule "/var/ser/lib/ser/modules/auth_db.so" ######## JABBER <-> SIMPLE loadmodule "/var/ser/lib/ser/modules/print.so" loadmodule "/var/ser/lib/ser/modules/textops.so" loadmodule "/var/ser/lib/ser/modules/jabber.so" loadmodule "/var/ser/lib/ser/modules/pa.so" modparam("jabber","db_url","sql://ser:heslo@127.0.0.1/sip_jab") modparam("jabber","jaddress","sait661") modparam("jabber","jport",5222) modparam("jabber","workers",2) modparam("jabber","max_jobs",10) modparam("jabber","aliases","0;") modparam("jabber","jdomain","sait661") modparam("jabber","delay_time",2) modparam("jabber","cache_time",200) modparam("jabber","sleep_time",600) modparam("jabber","check_time",60) ################ # ----------------- 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") # ------------------------- request routing logic ------------------- alias="ms.com" alias="piias12.ms.com" # 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(); # loose-route processing if (loose_route()) { t_relay(); break; }; # 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 (uri=~"[@:]piias12\.ms\.com([;:].*)*") { if (method=="REGISTER") { if (t_newtran()) { if (!www_authorize("piias12.ms.com", "subscriber")) { www_challenge("piias12.ms.com", "0"); break; }; save("location"); }; if(search("egistration")) { log (1, "XJAB: Going Online in Jabber network!\n"); if (jab_go_online()) { sl_send_reply("200", "Accepted"); } else { sl_send_reply("404","Not found"); }; } else { log (1, "XJAB: Going Offline in Jabber network!!!\n"); if (jab_go_offline()) { sl_send_reply("200", "Accepted"); } else { sl_send_reply("404","Not found"); }; }; break; }; # native SIP destinations are handled using our USRLOC DB if (!lookup("location")) { sl_send_reply("404", "Not Found"); break; }; }; if (search("To:.*@sait661.*")) { log (1, "Sinking the event here...\n"); if (! t_newtran()) { sl_reply_error(); break; }; if (method=="SUBSCRIBE") { log (1, "Subscribing to jabber presence!\n"); handle_subscription ("jabber"); break; }; if (method == "MESSAGE") { log (1, "MESSAGE to Jabber\n"); if (jab_send_message()) { sl_send_reply("200","Accepted"); } else{ sl_send_reply("503","Service Unavailable"); }; break; }; break; }; # forward to current uri now; use stateful forwarding; that # works reliably even if we forward from TCP to UDP if (!t_relay()) { sl_reply_error(); }; }