|
@@ -1,6 +1,6 @@
|
|
#!KAMAILIO
|
|
#!KAMAILIO
|
|
#
|
|
#
|
|
-# Kamailio (OpenSER) SIP Server v4.4 - default configuration script
|
|
|
|
|
|
+# Kamailio (OpenSER) SIP Server v5.0 - default configuration script
|
|
# - web: http://www.kamailio.org
|
|
# - web: http://www.kamailio.org
|
|
# - git: http://sip-router.org
|
|
# - git: http://sip-router.org
|
|
#
|
|
#
|
|
@@ -9,6 +9,13 @@
|
|
# Refer to the Core CookBook at http://www.kamailio.org/wiki/
|
|
# Refer to the Core CookBook at http://www.kamailio.org/wiki/
|
|
# for an explanation of possible statements, functions and parameters.
|
|
# for an explanation of possible statements, functions and parameters.
|
|
#
|
|
#
|
|
|
|
+# Note: the comments can be:
|
|
|
|
+# - lines starting with #, but not the pre-processor directives,
|
|
|
|
+# which start with #!, like #!define, #!ifdef, #!endif, #!else, #!trydef,
|
|
|
|
+# #!subst, #!substdef, ...
|
|
|
|
+# - lines starting with //
|
|
|
|
+# - blocks enclosed in between /* */
|
|
|
|
+#
|
|
# Several features can be enabled using '#!define WITH_FEATURE' directives:
|
|
# Several features can be enabled using '#!define WITH_FEATURE' directives:
|
|
#
|
|
#
|
|
# *** To run in debug mode:
|
|
# *** To run in debug mode:
|
|
@@ -76,6 +83,9 @@
|
|
# *** To block 3XX redirect replies execute:
|
|
# *** To block 3XX redirect replies execute:
|
|
# - define WITH_BLOCK3XX
|
|
# - define WITH_BLOCK3XX
|
|
#
|
|
#
|
|
|
|
+# *** To block 401 and 407 authentication replies execute:
|
|
|
|
+# - define WITH_BLOCK401407
|
|
|
|
+#
|
|
# *** To enable VoiceMail routing execute:
|
|
# *** To enable VoiceMail routing execute:
|
|
# - define WITH_VOICEMAIL
|
|
# - define WITH_VOICEMAIL
|
|
# - set the value of voicemail.srv_ip
|
|
# - set the value of voicemail.srv_ip
|
|
@@ -147,70 +157,65 @@ memlog=5
|
|
|
|
|
|
log_facility=LOG_LOCAL0
|
|
log_facility=LOG_LOCAL0
|
|
|
|
|
|
-# number of SIP routing processes
|
|
|
|
|
|
+/* number of SIP routing processes */
|
|
children=8
|
|
children=8
|
|
|
|
|
|
/* uncomment the next line to disable TCP (default on) */
|
|
/* uncomment the next line to disable TCP (default on) */
|
|
-#disable_tcp=yes
|
|
|
|
|
|
+# disable_tcp=yes
|
|
|
|
|
|
/* uncomment the next line to disable the auto discovery of local aliases
|
|
/* uncomment the next line to disable the auto discovery of local aliases
|
|
- based on reverse DNS on IPs (default on) */
|
|
|
|
-#auto_aliases=no
|
|
|
|
|
|
+ * based on reverse DNS on IPs (default on) */
|
|
|
|
+# auto_aliases=no
|
|
|
|
|
|
/* add local domain aliases */
|
|
/* add local domain aliases */
|
|
#alias="sip.mydomain.com"
|
|
#alias="sip.mydomain.com"
|
|
|
|
|
|
/* uncomment and configure the following line if you want Kamailio to
|
|
/* uncomment and configure the following line if you want Kamailio to
|
|
- bind on a specific interface/port/proto (default bind on all available) */
|
|
|
|
-#listen=udp:10.0.0.10:5060
|
|
|
|
|
|
+ * bind on a specific interface/port/proto (default bind on all available) */
|
|
|
|
+# listen=udp:10.0.0.10:5060
|
|
|
|
|
|
-/* port to listen to */
|
|
|
|
-#port=5060
|
|
|
|
|
|
+/* port to listen to (default 5060 for udp, tcp, scrtp, or 5061 for tls)*/
|
|
|
|
+# port=5060
|
|
|
|
|
|
#!ifdef WITH_TLS
|
|
#!ifdef WITH_TLS
|
|
enable_tls=yes
|
|
enable_tls=yes
|
|
#!endif
|
|
#!endif
|
|
|
|
|
|
-# life time of TCP connection when there is no traffic
|
|
|
|
-# - a bit higher than registration expires to cope with UA behind NAT
|
|
|
|
|
|
+/* life time of TCP connection when there is no traffic
|
|
|
|
+ * - a bit higher than registration expires to cope with UA behind NAT */
|
|
tcp_connection_lifetime=3605
|
|
tcp_connection_lifetime=3605
|
|
|
|
|
|
####### Custom Parameters #########
|
|
####### Custom Parameters #########
|
|
|
|
|
|
-# These parameters can be modified runtime via RPC interface
|
|
|
|
-# - see the documentation of 'cfg_rpc' module.
|
|
|
|
-#
|
|
|
|
-# Format: group.id = value 'desc' description
|
|
|
|
-# Access: $sel(cfg_get.group.id) or @cfg_get.group.id
|
|
|
|
-#
|
|
|
|
|
|
+/* These parameters can be modified runtime via RPC interface
|
|
|
|
+ * - see the documentation of 'cfg_rpc' module.
|
|
|
|
+ *
|
|
|
|
+ * Format: group.id = value 'desc' description
|
|
|
|
+ * Access: $sel(cfg_get.group.id) or @cfg_get.group.id */
|
|
|
|
|
|
#!ifdef WITH_PSTN
|
|
#!ifdef WITH_PSTN
|
|
-# PSTN GW Routing
|
|
|
|
-#
|
|
|
|
-# - pstn.gw_ip: valid IP or hostname as string value, example:
|
|
|
|
-# pstn.gw_ip = "10.0.0.101" desc "My PSTN GW Address"
|
|
|
|
-#
|
|
|
|
-# - by default is empty to avoid misrouting
|
|
|
|
|
|
+/* PSTN GW Routing
|
|
|
|
+ *
|
|
|
|
+ * - pstn.gw_ip: valid IP or hostname as string value, example:
|
|
|
|
+ * pstn.gw_ip = "10.0.0.101" desc "My PSTN GW Address"
|
|
|
|
+ *
|
|
|
|
+ * - by default is empty to avoid misrouting */
|
|
pstn.gw_ip = "" desc "PSTN GW Address"
|
|
pstn.gw_ip = "" desc "PSTN GW Address"
|
|
pstn.gw_port = "" desc "PSTN GW Port"
|
|
pstn.gw_port = "" desc "PSTN GW Port"
|
|
#!endif
|
|
#!endif
|
|
|
|
|
|
#!ifdef WITH_VOICEMAIL
|
|
#!ifdef WITH_VOICEMAIL
|
|
-# VoiceMail Routing on offline, busy or no answer
|
|
|
|
-#
|
|
|
|
-# - by default Voicemail server IP is empty to avoid misrouting
|
|
|
|
|
|
+/* VoiceMail Routing on offline, busy or no answer
|
|
|
|
+ *
|
|
|
|
+ * - by default Voicemail server IP is empty to avoid misrouting */
|
|
voicemail.srv_ip = "" desc "VoiceMail IP Address"
|
|
voicemail.srv_ip = "" desc "VoiceMail IP Address"
|
|
voicemail.srv_port = "5060" desc "VoiceMail Port"
|
|
voicemail.srv_port = "5060" desc "VoiceMail Port"
|
|
#!endif
|
|
#!endif
|
|
|
|
|
|
####### Modules Section ########
|
|
####### Modules Section ########
|
|
|
|
|
|
-# set paths to location of modules (to sources or installation folders)
|
|
|
|
-#!ifdef WITH_SRCPATH
|
|
|
|
-mpath="modules/"
|
|
|
|
-#!else
|
|
|
|
-mpath="/usr/local/lib/kamailio/modules/"
|
|
|
|
-#!endif
|
|
|
|
|
|
+/* set paths to location of modules */
|
|
|
|
+# mpath="/usr/local/lib/kamailio/modules/"
|
|
|
|
|
|
#!ifdef WITH_MYSQL
|
|
#!ifdef WITH_MYSQL
|
|
loadmodule "db_mysql.so"
|
|
loadmodule "db_mysql.so"
|
|
@@ -287,10 +292,12 @@ loadmodule "debugger.so"
|
|
|
|
|
|
|
|
|
|
# ----- mi_fifo params -----
|
|
# ----- mi_fifo params -----
|
|
-#modparam("mi_fifo", "fifo_name", "/var/run/kamailio/kamailio_fifo")
|
|
|
|
|
|
+/* set the path to MI fifo control file */
|
|
|
|
+# modparam("mi_fifo", "fifo_name", "/var/run/kamailio/kamailio_fifo")
|
|
|
|
|
|
# ----- ctl params -----
|
|
# ----- ctl params -----
|
|
-#modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
|
|
|
|
|
|
+/* set the path to RPC unix socket control file */
|
|
|
|
+# modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
|
|
|
|
|
|
# ----- tm params -----
|
|
# ----- tm params -----
|
|
# auto-discard branches from previous serial forking leg
|
|
# auto-discard branches from previous serial forking leg
|
|
@@ -313,10 +320,10 @@ modparam("registrar", "method_filtering", 1)
|
|
/* uncomment the next line to disable parallel forking via location */
|
|
/* uncomment the next line to disable parallel forking via location */
|
|
# modparam("registrar", "append_branches", 0)
|
|
# modparam("registrar", "append_branches", 0)
|
|
/* uncomment the next line not to allow more than 10 contacts per AOR */
|
|
/* uncomment the next line not to allow more than 10 contacts per AOR */
|
|
-#modparam("registrar", "max_contacts", 10)
|
|
|
|
-# max value for expires of registrations
|
|
|
|
|
|
+# modparam("registrar", "max_contacts", 10)
|
|
|
|
+/* max value for expires of registrations */
|
|
modparam("registrar", "max_expires", 3600)
|
|
modparam("registrar", "max_expires", 3600)
|
|
-# set it to 1 to enable GRUU
|
|
|
|
|
|
+/* set it to 1 to enable GRUU */
|
|
modparam("registrar", "gruu_enabled", 0)
|
|
modparam("registrar", "gruu_enabled", 0)
|
|
|
|
|
|
|
|
|
|
@@ -326,8 +333,8 @@ modparam("acc", "early_media", 0)
|
|
modparam("acc", "report_ack", 0)
|
|
modparam("acc", "report_ack", 0)
|
|
modparam("acc", "report_cancels", 0)
|
|
modparam("acc", "report_cancels", 0)
|
|
/* by default ww do not adjust the direct of the sequential requests.
|
|
/* by default ww do not adjust the direct of the sequential requests.
|
|
- if you enable this parameter, be sure the enable "append_fromtag"
|
|
|
|
- in "rr" module */
|
|
|
|
|
|
+ * if you enable this parameter, be sure the enable "append_fromtag"
|
|
|
|
+ * in "rr" module */
|
|
modparam("acc", "detect_direction", 0)
|
|
modparam("acc", "detect_direction", 0)
|
|
/* account triggers (flags) */
|
|
/* account triggers (flags) */
|
|
modparam("acc", "log_flag", FLT_ACC)
|
|
modparam("acc", "log_flag", FLT_ACC)
|
|
@@ -390,7 +397,7 @@ modparam("speeddial", "use_domain", MULTIDOMAIN)
|
|
# ----- domain params -----
|
|
# ----- domain params -----
|
|
#!ifdef WITH_MULTIDOMAIN
|
|
#!ifdef WITH_MULTIDOMAIN
|
|
modparam("domain", "db_url", DBURL)
|
|
modparam("domain", "db_url", DBURL)
|
|
-# register callback to match myself condition with domains list
|
|
|
|
|
|
+/* register callback to match myself condition with domains list */
|
|
modparam("domain", "register_myself", 1)
|
|
modparam("domain", "register_myself", 1)
|
|
#!endif
|
|
#!endif
|
|
|
|
|
|
@@ -433,7 +440,7 @@ modparam("pike", "reqs_density_per_unit", 16)
|
|
modparam("pike", "remove_latency", 4)
|
|
modparam("pike", "remove_latency", 4)
|
|
|
|
|
|
# ----- htable params -----
|
|
# ----- htable params -----
|
|
-# ip ban htable with autoexpire after 5 minutes
|
|
|
|
|
|
+/* ip ban htable with autoexpire after 5 minutes */
|
|
modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")
|
|
modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")
|
|
#!endif
|
|
#!endif
|
|
|
|
|
|
@@ -452,9 +459,9 @@ modparam("debugger", "log_level_name", "exec")
|
|
####### Routing Logic ########
|
|
####### Routing Logic ########
|
|
|
|
|
|
|
|
|
|
-# Main SIP request routing logic
|
|
|
|
-# - processing of any incoming SIP request starts with this route
|
|
|
|
-# - note: this is the same as route { ... }
|
|
|
|
|
|
+/* Main SIP request routing logic
|
|
|
|
+ * - processing of any incoming SIP request starts with this route
|
|
|
|
+ * - note: this is the same as route { ... } */
|
|
request_route {
|
|
request_route {
|
|
|
|
|
|
# per request initial checks
|
|
# per request initial checks
|
|
@@ -936,6 +943,14 @@ failure_route[MANAGE_FAILURE] {
|
|
}
|
|
}
|
|
#!endif
|
|
#!endif
|
|
|
|
|
|
|
|
+#!ifdef WITH_BLOCK401407
|
|
|
|
+ # block call redirect based on 401, 407 replies.
|
|
|
|
+ if (t_check_status("401|407")) {
|
|
|
|
+ t_reply("404","Not found");
|
|
|
|
+ exit;
|
|
|
|
+ }
|
|
|
|
+#!endif
|
|
|
|
+
|
|
#!ifdef WITH_VOICEMAIL
|
|
#!ifdef WITH_VOICEMAIL
|
|
# serial forking
|
|
# serial forking
|
|
# - route to voicemail on busy or no answer (timeout)
|
|
# - route to voicemail on busy or no answer (timeout)
|