|
@@ -0,0 +1,76 @@
|
|
|
+#!KAMAILIO
|
|
|
+#
|
|
|
+# Kamailio (OpenSER) SIP Server v5.3 - default configuration script
|
|
|
+# - web: https://www.kamailio.org
|
|
|
+# - git: https://github.com/kamailio/kamailio
|
|
|
+#
|
|
|
+debug=3
|
|
|
+log_stderror=yes
|
|
|
+
|
|
|
+memdbg=5
|
|
|
+memlog=5
|
|
|
+
|
|
|
+log_facility=LOG_LOCAL0
|
|
|
+log_prefix="{$mt $hdr(CSeq) $ci} "
|
|
|
+
|
|
|
+/* number of SIP routing processes */
|
|
|
+children=2
|
|
|
+
|
|
|
+loadmodule "jsonrpcs.so"
|
|
|
+loadmodule "kex.so"
|
|
|
+loadmodule "corex.so"
|
|
|
+loadmodule "tm.so"
|
|
|
+loadmodule "tmx.so"
|
|
|
+loadmodule "sl.so"
|
|
|
+loadmodule "rr.so"
|
|
|
+loadmodule "pv.so"
|
|
|
+loadmodule "maxfwd.so"
|
|
|
+loadmodule "textops.so"
|
|
|
+loadmodule "xlog.so"
|
|
|
+
|
|
|
+loadmodule "auth.so"
|
|
|
+loadmodule "uac.so"
|
|
|
+
|
|
|
+# ----- tm params -----
|
|
|
+# auto-discard branches from previous serial forking leg
|
|
|
+modparam("tm", "failure_reply_mode", 3)
|
|
|
+# default retransmission timeout: 30sec
|
|
|
+modparam("tm", "fr_timer", 30000)
|
|
|
+# default invite retransmission timeout after 1xx: 120sec
|
|
|
+modparam("tm", "fr_inv_timer", 120000)
|
|
|
+
|
|
|
+# ----- rr params -----
|
|
|
+# set next param to 1 to add value to ;lr param (helps with some UAs)
|
|
|
+modparam("rr", "enable_full_lr", 0)
|
|
|
+# do not append from tag to the RR (no need for this script)
|
|
|
+modparam("rr", "append_fromtag", 1)
|
|
|
+
|
|
|
+
|
|
|
+####### Routing Logic ########
|
|
|
+
|
|
|
+
|
|
|
+/* Main SIP request routing logic
|
|
|
+ * - processing of any incoming SIP request starts with this route
|
|
|
+ * - note: this is the same as route { ... } */
|
|
|
+request_route {
|
|
|
+
|
|
|
+ if(is_method("OPTIONS")) {
|
|
|
+ sl_send_reply("200", "ok");
|
|
|
+ $uac_req(method)="INFO";
|
|
|
+ $uac_req(ruri)="sip:test@" + $Ri;
|
|
|
+ $uac_req(furi)="sip:test@" + $Ri;
|
|
|
+ $uac_req(turi)="sip:test@" + $Ri;
|
|
|
+ $uac_req(auser)="test";
|
|
|
+ $uac_req(apasswd)="test123";
|
|
|
+ uac_req_send();
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+ if(is_method("INFO")) {
|
|
|
+ if (!pv_auth_check("$fd", "test123", "0", "1")) {
|
|
|
+ auth_challenge("$fd", "0");
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+ xlog("info request authenticated\n");
|
|
|
+ }
|
|
|
+ sl_send_reply("200", "ok");
|
|
|
+}
|