diff --git a/MANIFEST.in b/MANIFEST.in index 7695180..0b06c2d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,10 +1,9 @@ recursive-include debian changelog compat control copyright docs rules recursive-include debian format lintian-overrides openxcap.service -recursive-include opensips *.cfg recursive-include scripts *.py *.sql recursive-include tls README recursive-include test * prune debian/.debhelper prune debian/openxcap prune debian/tmp include INSTALL LICENSE MANIFEST.in TODO diff --git a/opensips/opensips.cfg b/opensips/opensips.cfg deleted file mode 100644 index 96a5f7b..0000000 --- a/opensips/opensips.cfg +++ /dev/null @@ -1,205 +0,0 @@ - -# --- module loading --- - -mpath = "/usr/lib/opensips/modules" -loadmodule "mi_fifo.so" -loadmodule "mi_datagram.so" -loadmodule "mysql.so" -loadmodule "sl.so" -loadmodule "maxfwd.so" -loadmodule "tm.so" -loadmodule "rr.so" -loadmodule "xlog.so" - -loadmodule "presence.so" -loadmodule "presence_xml.so" -loadmodule "presence_mwi.so" -loadmodule "presence_xcapdiff.so" -loadmodule "pua.so" -loadmodule "pua_mi.so" -loadmodule "rls.so" - - -# ----------------- setting module-specific parameters --------------- - -# -- rr params -- -# add value to ;lr param to make some broken UAs happy -modparam("rr", "enable_full_lr", 1) - -modparam("mi_datagram", "socket_name", "/var/run/opensips/socket") -modparam("mi_datagram", "unix_socket_user", "opensips") -modparam("mi_datagram", "unix_socket_group", "opensips") - -modparam("mi_fifo", "fifo_name", "/var/run/opensips/fifo") -modparam("mi_fifo", "fifo_user", "opensips") -modparam("mi_fifo", "fifo_group", "opensips") - -# -- presence params -- -modparam("presence", "db_url", "mysql://opensips:password@db/opensips") -modparam("presence", "server_address", "sip:presence@10.0.0.1") -modparam("presence", "fallback2db", 1) -modparam("presence", "clean_period", 30) - -# -- xcap params -- -modparam("presence_xml", "db_url", "mysql://opensips:password@db/opensips") -modparam("presence_xml", "force_active", 0) -modparam("presence_xml", "pidf_manipulation", 1) -modparam("presence_xml", "integrated_xcap_server", 1) - -# -- rls params -- - -modparam("rls", "db_url", "mysql://opensips:password@db/opensips") -modparam("rls", "server_address", "sip:rls@10.0.0.1") -modparam("rls", "to_presence_code", 5) -modparam("rls", "integrated_xcap_server", 1) - - -# ------------------------- request routing logic ------------------- - -# main routing logic - -route { - xlog("L_INFO", "----- Start routing"); - - if ((method=="PUBLISH" || method=="SUBSCRIBE" || method=="NOTIFY")) { - xlog("L_INFO", "Presence event: $hdr(Event)\n"); - } - - if(is_method("PUBLISH")) { - if ((src_ip==10.0.0.1 && src_port==5060)) { - sl_send_reply("404", "Domain not served here"); - return; - } - if (is_from_local()) { - if (avp_check("$hdr(Event)", "fm/presence*/i") && ($au != $rU || $ar != $rd)) { - xlog("L_WARN", "Account $au@$ar tried to publish $hdr(Event) event for $ru\n"); - sl_send_reply("403", "Publishing $hdr(Event) events for others is forbidden"); - return; - } - } else { - sl_send_reply("403", "PUBLISH forbidden for outside domains"); - return; - } - - if (t_newtran()) { - handle_publish(); - t_release(); - } else { - sl_reply_error(); - } - exit; - } else if( is_method("NOTIFY")) - if (has_totag()) { - if (!loose_route()) { - if (!t_newtran()) { - sl_reply_error(); - exit; - } - rls_handle_notify(); - switch ($retcode) { - case 1: - # Notify processed by rls - xlog("L_INFO", "$rm processed by RLS\n"); - t_release(); - exit; - break; - case -1: - # Error - xlog("L_INFO", "$rm processed by RLS but has error\n"); - t_reply("500", "Server error while processing RLS NOTIFY"); - exit; - break; - default: - if (uri == "sip:rls@10.0.0.1") { - xlog("L_ERR", "$rm should be processed by RLS but was not recognized\n"); - xlog("L_INFO", "Dropping $rm because it will loop\n"); - t_reply("500", "Server error while processing RLS NOTIFY"); - exit; - } else { - xlog("L_INFO", "$rm handled by presence\n"); - t_release(); - } - } - } - } else { - # Out-of-dialog NOTIFY - sl_send_reply("405", "Method Not Allowed"); - exit; - } - - } else if( is_method("SUBSCRIBE")) { - if (!has_totag()) { - if (loose_route()) { - xlog("L_ERR", "Incorrectly formatted $rm request. Rejected.\n"); - sl_send_reply("400", "Incorrectly formatted request"); - return; - } - - if ((src_ip==10.0.0.1 && src_port==5060) && is_present_hf("Record-Route")) { - sl_send_reply("404", "Domain not served here"); - return; - } - - if (is_from_local()) { - if (!(src_ip==10.0.0.1 && src_port==5060)) { - xlog("L_INFO", "Request came directly from the subscriber\n"); - setflag(18); - } - - if ((avp_check("$hdr(Event)", "fm/*.winfo/i") || avp_check("$hdr(Event)", "eq/message-summary/i")) && - ($au != $rU || $ar != $rd)) { - xlog("L_WARN", "Account $au@$ar tried to subscribe to $ru for $hdr(Event)\n"); - sl_send_reply("403", "Subscription to others $hdr(Event) is forbidden"); - return; - } - } - } - - # Internal presence handling - if (!t_newtran()) { - sl_reply_error(); - exit; - } - - rls_handle_subscribe(); - - switch ($retcode) { - case 5: - # RLS indicated that message should be processed by presence - - if (is_uri_host_local()) { - if (does_uri_exist()) { - handle_subscribe(); - t_release(); - } else { - t_reply("404", "User not found"); - } - exit; - } - break; - default: - t_release(); - exit; - } - } else { - # In-dialog SUBSCRIBE - if (uri=="sip:presence@10.0.0.1" || uri=="sip:rls@10.0.0.1" || !loose_route()) { - # Internal presence handling - if (t_newtran()) { - rls_handle_subscribe(); - if ($retcode==5) { - handle_subscribe(); - } - t_release(); - } else { - sl_reply_error(); - } - exit; - } - } - } else { - xlog("L_INFO", "Method $rm Not Acceptable Here"); - sl_send_reply("488", "Not Acceptable Here"); - exit; - }; -}