소스 검색

dispatcher: updates to sameple config file

Daniel-Constantin Mierla 8 년 전
부모
커밋
0b3d6ad323
1개의 변경된 파일32개의 추가작업 그리고 32개의 파일을 삭제
  1. 32 32
      modules/dispatcher/doc/dispatcher.cfg

+ 32 - 32
modules/dispatcher/doc/dispatcher.cfg

@@ -5,9 +5,9 @@
 # - no TPC listening
 # - no TPC listening
 # - don't dispatch REGISTER and presence requests
 # - don't dispatch REGISTER and presence requests
 #
 #
-# Kamailio (OpenSER) SIP Server v3.2
+# Kamailio SIP Server
 #     - web: http://www.kamailio.org
 #     - web: http://www.kamailio.org
-#     - git: http://sip-router.org
+#     - git: http://github.com/kamailio/
 #
 #
 # Direct your questions about this file to: [email protected]
 # Direct your questions about this file to: [email protected]
 #
 #
@@ -16,7 +16,7 @@
 #
 #
 # 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:
 #     - define WITH_DEBUG
 #     - define WITH_DEBUG
 #
 #
 
 
@@ -24,6 +24,13 @@
 #!define DBURL "mysql://kamailio:kamailiorw@localhost/kamailio"
 #!define DBURL "mysql://kamailio:kamailiorw@localhost/kamailio"
 #!endif
 #!endif
 
 
+# - flags
+#   FLT_ - per transaction (message) flags
+#	FLB_ - per branch flags
+#!define FLT_ACC 1
+#!define FLT_ACCMISSED 2
+#!define FLT_ACCFAILED 3
+
 ####### Global Parameters #########
 ####### Global Parameters #########
 
 
 #!ifdef WITH_DEBUG
 #!ifdef WITH_DEBUG
@@ -54,7 +61,7 @@ auto_aliases=no
 
 
 port=5060
 port=5060
 
 
-/* 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) */
    bind on a specific interface/port/proto (default bind on all available) */
 # listen=udp:127.0.0.1:5060
 # listen=udp:127.0.0.1:5060
 
 
@@ -62,8 +69,8 @@ sip_warning=no
 
 
 ####### Modules Section ########
 ####### Modules Section ########
 
 
-#set module path
-mpath="/usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/"
+# set module path
+mpath="/usr/local/lib/kamailio/modules/"
 
 
 loadmodule "db_mysql.so"
 loadmodule "db_mysql.so"
 loadmodule "mi_fifo.so"
 loadmodule "mi_fifo.so"
@@ -87,10 +94,6 @@ loadmodule "dispatcher.so"
 # ----------------- setting module-specific parameters ---------------
 # ----------------- setting module-specific parameters ---------------
 
 
 
 
-# ----- mi_fifo params -----
-modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
-
-
 # ----- rr params -----
 # ----- rr params -----
 # add value to ;lr param to cope with most of the UAs
 # add value to ;lr param to cope with most of the UAs
 modparam("rr", "enable_full_lr", 1)
 modparam("rr", "enable_full_lr", 1)
@@ -99,9 +102,9 @@ modparam("rr", "append_fromtag", 0)
 
 
 
 
 # ----- acc params -----
 # ----- acc params -----
-modparam("acc", "log_flag", 1)
-modparam("acc", "failed_transaction_flag", 3)
-modparam("acc", "log_extra", 
+modparam("acc", "log_flag", FLT_ACC)
+modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
+modparam("acc", "log_extra",
 	"src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;src_ip=$si")
 	"src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;src_ip=$si")
 
 
 # ----- tm params -----
 # ----- tm params -----
@@ -122,7 +125,7 @@ modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)")
 
 
 # main request routing logic
 # main request routing logic
 
 
-route {
+request_route {
 
 
 	# per request initial checks
 	# per request initial checks
 	route(REQINIT);
 	route(REQINIT);
@@ -140,6 +143,11 @@ route {
 		exit;
 		exit;
 	}
 	}
 
 
+	# handle retransmissions
+	if(t_precheck_trans()) {
+		t_check_trans();
+		exit;
+	}
 	t_check_trans();
 	t_check_trans();
 
 
 	# record routing for dialog forming requests (in case they are routed)
 	# record routing for dialog forming requests (in case they are routed)
@@ -149,9 +157,8 @@ route {
 		record_route();
 		record_route();
 
 
 	# account only INVITEs
 	# account only INVITEs
-	if (is_method("INVITE"))
-	{
-		setflag(1); # do accounting
+	if (is_method("INVITE")) {
+		setflag(FLT_ACC); # do accounting
 	}
 	}
 
 
 	# handle presence related requests
 	# handle presence related requests
@@ -160,8 +167,7 @@ route {
 	# handle registrations
 	# handle registrations
 	route(REGISTRAR);
 	route(REGISTRAR);
 
 
-	if ($rU==$null)
-	{
+	if ($rU==$null) {
 		# request with no Username in RURI
 		# request with no Username in RURI
 		sl_send_reply("484","Address Incomplete");
 		sl_send_reply("484","Address Incomplete");
 		exit;
 		exit;
@@ -186,8 +192,7 @@ route[REQINIT] {
 		exit;
 		exit;
 	}
 	}
 
 
-	if(!sanity_check("1511", "7"))
-	{
+	if(!sanity_check("1511", "7")) {
 		xlog("Malformed SIP message from $si:$sp\n");
 		xlog("Malformed SIP message from $si:$sp\n");
 		exit;
 		exit;
 	}
 	}
@@ -200,8 +205,8 @@ route[WITHINDLG] {
 		# take the path determined by record-routing
 		# take the path determined by record-routing
 		if (loose_route()) {
 		if (loose_route()) {
 			if (is_method("BYE")) {
 			if (is_method("BYE")) {
-				setflag(1); # do accounting ...
-				setflag(3); # ... even if the transaction fails
+				setflag(FLT_ACC); # do accounting ...
+				setflag(FLT_ACCFAILED); # ... even if the transaction fails
 			}
 			}
 			route(RELAY);
 			route(RELAY);
 		} else {
 		} else {
@@ -247,8 +252,7 @@ route[PRESENCE] {
 # Dispatch requests
 # Dispatch requests
 route[DISPATCH] {
 route[DISPATCH] {
 	# round robin dispatching on gateways group '1'
 	# round robin dispatching on gateways group '1'
-	if(!ds_select_dst("1", "4"))
-	{
+	if(!ds_select_dst("1", "4")) {
 		send_reply("404", "No destination");
 		send_reply("404", "No destination");
 		exit;
 		exit;
 	}
 	}
@@ -258,22 +262,18 @@ route[DISPATCH] {
 	exit;
 	exit;
 }
 }
 
 
-# Sample failure route
+# Try next destionations in failure route
 failure_route[RTF_DISPATCH] {
 failure_route[RTF_DISPATCH] {
 	if (t_is_canceled()) {
 	if (t_is_canceled()) {
 		exit;
 		exit;
 	}
 	}
 	# next DST - only for 500 or local timeout
 	# next DST - only for 500 or local timeout
 	if (t_check_status("500")
 	if (t_check_status("500")
-			or (t_branch_timeout() and !t_branch_replied()))
-	{
-		if(ds_next_dst())
-		{
+			or (t_branch_timeout() and !t_branch_replied())) {
+		if(ds_next_dst()) {
 			t_on_failure("RTF_DISPATCH");
 			t_on_failure("RTF_DISPATCH");
 			route(RELAY);
 			route(RELAY);
 			exit;
 			exit;
 		}
 		}
 	}
 	}
 }
 }
-
-