Browse Source

kamailio.cfg: check if uri is still myself after aliases and speed dial

- new uri can point to other voip domains
- set tcp connection lifetime and max expires registrations to cope with
  UA behind NAT using TCP
Daniel-Constantin Mierla 14 years ago
parent
commit
195ab47e1d
1 changed files with 10 additions and 2 deletions
  1. 10 2
      etc/kamailio.cfg

+ 10 - 2
etc/kamailio.cfg

@@ -163,6 +163,10 @@ port=5060
 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
+tcp_connection_lifetime=3605
+
 ####### Custom Parameters #########
 ####### Custom Parameters #########
 
 
 # These parameters can be modified runtime via RPC interface
 # These parameters can be modified runtime via RPC interface
@@ -297,6 +301,8 @@ modparam("registrar", "method_filtering", 1)
 # 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)
 #modparam("registrar", "max_contacts", 10)
+# max value for expires of registrations
+modparam("registrar", "max_expires", 3600)
 
 
 
 
 # ----- acc params -----
 # ----- acc params -----
@@ -613,12 +619,14 @@ route[LOCATION] {
 #!ifdef WITH_SPEEDIAL
 #!ifdef WITH_SPEEDIAL
 	# search for short dialing - 2-digit extension
 	# search for short dialing - 2-digit extension
 	if($rU=~"^[0-9][0-9]$")
 	if($rU=~"^[0-9][0-9]$")
-		sd_lookup("speed_dial");
+		if(sd_lookup("speed_dial"))
+			route(SIPOUT);
 #!endif
 #!endif
 
 
 #!ifdef WITH_ALIASDB
 #!ifdef WITH_ALIASDB
 	# search in DB-based aliases
 	# search in DB-based aliases
-	alias_db_lookup("dbaliases");
+	if(alias_db_lookup("dbaliases"))
+		route(SIPOUT);
 #!endif
 #!endif
 
 
 	$avp(oexten) = $rU;
 	$avp(oexten) = $rU;