# ----------- global configuration parameters ------------------------ #debug=9 fork=yes check_via=no dns=no rev_dns=no port=5060 children=4 sip_warning=0 # ------------------ module loading ---------------------------------- loadmodule "/usr/lib/openser/modules/mysql.so" loadmodule "/usr/lib/openser/modules/nathelper.so" loadmodule "/usr/lib/openser/modules/sl.so" loadmodule "/usr/lib/openser/modules/tm.so" loadmodule "/usr/lib/openser/modules/rr.so" loadmodule "/usr/lib/openser/modules/maxfwd.so" loadmodule "/usr/lib/openser/modules/lcr.so" loadmodule "/usr/lib/openser/modules/acc.so" loadmodule "/usr/lib/openser/modules/xlog.so" loadmodule "/usr/lib/openser/modules/textops.so" loadmodule "/usr/lib/openser/modules/permissions.so" # ----------------- setting module-specific parameters --------------- modparam("lcr", "db_url", "mysql://???") modparam("lcr", "db_mode", 0) modparam("rr","enable_full_lr",1) modparam("acc", "db_url", "mysql://???") modparam("acc", "db_flag", 1) modparam("acc", "db_localtime", 1) modparam("acc", "log_level", 1) modparam("acc", "log_flag", 1 ) modparam("permissions", "db_url", "mysql://???") route { if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); return; }; if (msg:len >= max_len ) { sl_send_reply("513", "Message too big"); return; }; if (!is_method("REGISTER")) { record_route(); }; if (is_method("BYE") || is_method("CANCEL")) { xlog("L_NOTICE", "End call($ci | $Ri): $fU -> $tU"); if (is_method("BYE")) setflag(1); unforce_rtp_proxy(); }; if (loose_route()) { route(1); return; }; if (!allow_trusted()) { xlog("L_WARN", "Host not trusted ($fu/$si/$rP)"); sl_send_reply("403", "Forbidden"); exit; }; if (!load_gws()) { sl_send_reply("500", "Internal server error, unable to load gateways"); return; } if (!next_gw()) { xlog("L_ERR", "No gw found ($ru/$fu)"); sl_send_reply("503", "Service not available, no gateways found"); return; }; t_on_failure("2"); route(1); } route[1] { setflag(1); if (is_method("INVITE") || is_method("ACK")){ if (is_method("INVITE")) xlog("L_NOTICE", "Incoming call($ci | $Ri): $fU -> $tU"); if (!search("^Content-Length:[ ]*0")) force_rtp_proxy("foc"); # if(src_ip == 217.15.85.178) { # subst('/^From:.* $tU 400 Bad Request"); } else if (t_check_status("401")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 401 Unauthorized"); } else if (t_check_status("403")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 403 Forbidden"); } else if (t_check_status("404")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 404 Not Found"); } else if (t_check_status("405")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 405 Method Not Allowed"); } else if (t_check_status("406")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 406 Not Acceptable"); } else if (t_check_status("407")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 407 Proxy Authentication Required"); } else if (t_check_status("408")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 408 Request Timeout"); } else if (t_check_status("410")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 410 Gone"); } else if (t_check_status("413")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 413 Request Entity Too Large"); } else if (t_check_status("414")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 414 Request-URI Too Long"); } else if (t_check_status("415")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 415 Unsupported Media Type"); } else if (t_check_status("416")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 416 Unsupported URI Scheme"); } else if (t_check_status("420")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 420 Bad Extension"); } else if (t_check_status("421")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 421 Extension Required"); } else if (t_check_status("423")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 423 Interval Too Brief"); } else if (t_check_status("480")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 480 Temporarily Unavailable"); } else if (t_check_status("481")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 481 Call/Transaction Does Not Exist"); } else if (t_check_status("482")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 482 Loop Detected"); } else if (t_check_status("483")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 483 Too Many Hops"); } else if (t_check_status("484")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 484 Address Incomplete"); } else if (t_check_status("485")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 485 Ambiguous"); } else if (t_check_status("486")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 486 Busy Here"); } else if (t_check_status("487")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 487 Request Terminated"); } else if (t_check_status("488")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 488 Not Acceptable Here"); } else if (t_check_status("491")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 491 Request Pending"); } else if (t_check_status("493")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 493 Undecipherable"); } else if (t_check_status("500")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 500 Server Internal Error"); } else if (t_check_status("501")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 501 Not Implemented"); } else if (t_check_status("502")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 502 Bad Gateway"); } else if (t_check_status("503")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 503 Service Unavailable"); } else if (t_check_status("504")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 504 Server Time-out"); } else if (t_check_status("505")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 505 Version Not Supported"); } else if (t_check_status("513")) { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU 513 Message Too Large"); } else { xlog("L_NOTICE", "Failure call($ci | $Ri): $fU -> $tU Unknown code"); } setflag(1); if (is_method("INVITE") && t_check_status("408|500|503")) { if (!next_gw()) { xlog("L_ERR", "No more gw ($ru/$fu)"); t_reply("486", "Busy"); # t_reply("503", "Service not available"); exit; } t_on_failure("2"); force_rtp_proxy("foc"); t_relay(); } }