|
@@ -67,6 +67,18 @@
|
|
|
# - define WITH_XMLRPC
|
|
|
# - adjust route[XMLRPC] for access policy
|
|
|
#
|
|
|
+# *** To enable the embedded http server:
|
|
|
+# - define WITH_XHTTP
|
|
|
+#
|
|
|
+# *** To enable the RPC web interface execute:
|
|
|
+# - enable xhttp
|
|
|
+# - define WITH_XHTTP_RPC
|
|
|
+#
|
|
|
+# *** To enable the provisioning web interface execute:
|
|
|
+# - enable mysql
|
|
|
+# - enable xhttp
|
|
|
+# - define WITH_XHTTP_PI
|
|
|
+#
|
|
|
# *** To enable anti-flood detection execute:
|
|
|
# - adjust pike and htable=>ipban settings as needed (default is
|
|
|
# block if more than 16 requests in 2 seconds and ban for 300 seconds)
|
|
@@ -174,6 +186,10 @@ enable_tls=yes
|
|
|
# - a bit higher than registration expires to cope with UA behind NAT
|
|
|
tcp_connection_lifetime=3605
|
|
|
|
|
|
+#!ifdef WITH_XHTTP
|
|
|
+tcp_accept_no_cl=yes
|
|
|
+#!endif
|
|
|
+
|
|
|
####### Custom Parameters #########
|
|
|
|
|
|
# These parameters can be modified runtime via RPC interface
|
|
@@ -282,6 +298,18 @@ loadmodule "xmlrpc.so"
|
|
|
loadmodule "debugger.so"
|
|
|
#!endif
|
|
|
|
|
|
+#!ifdef WITH_XHTTP
|
|
|
+loadmodule "xhttp.so"
|
|
|
+#!endif
|
|
|
+
|
|
|
+#!ifdef WITH_XHTTP_RPC
|
|
|
+loadmodule "xhttp_rpc.so"
|
|
|
+#!endif
|
|
|
+
|
|
|
+#!ifdef WITH_XHTTP_PI
|
|
|
+loadmodule "xhttp_pi.so"
|
|
|
+#!endif
|
|
|
+
|
|
|
# ----------------- setting module-specific parameters ---------------
|
|
|
|
|
|
|
|
@@ -445,6 +473,15 @@ modparam("xmlrpc", "url_match", "^/RPC")
|
|
|
modparam("debugger", "cfgtrace", 1)
|
|
|
#!endif
|
|
|
|
|
|
+#!ifdef WITH_XHTTP_RPC
|
|
|
+modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")
|
|
|
+#!endif
|
|
|
+
|
|
|
+#!ifdef WITH_XHTTP_PI
|
|
|
+modparam("xhttp_pi", "xhttp_pi_root", "http_pi")
|
|
|
+modparam("xhttp_pi", "framework", "/usr/local/etc/kamailio/pi_framework.xml")
|
|
|
+#!endif
|
|
|
+
|
|
|
####### Routing Logic ########
|
|
|
|
|
|
|
|
@@ -921,3 +958,23 @@ failure_route[MANAGE_FAILURE] {
|
|
|
}
|
|
|
#!endif
|
|
|
}
|
|
|
+
|
|
|
+#!ifdef WITH_XHTTP
|
|
|
+event_route[xhttp:request] {
|
|
|
+#!ifdef WITH_XHTTP_RPC
|
|
|
+ $var(xhttp_rpc_root) = $(hu{s.substr,0,9});
|
|
|
+ if ($var(xhttp_rpc_root) == "/http_rpc") {
|
|
|
+ dispatch_xhttp_rpc();
|
|
|
+ }
|
|
|
+#!endif
|
|
|
+#!ifdef WITH_XHTTP_PI
|
|
|
+ $var(xhttp_rpc_root) = $(hu{s.substr,0,8});
|
|
|
+ if ($var(xhttp_rpc_root) == "/http_pi") {
|
|
|
+ dispatch_xhttp_pi();
|
|
|
+ }
|
|
|
+#!endif
|
|
|
+ xhttp_reply("200", "OK", "text/html",
|
|
|
+ "<html><body>Wrong URL $hu</body></html>");
|
|
|
+}
|
|
|
+#!endif
|
|
|
+
|