[sr-dev] git:master:df73f600: dispatcher: cfg - more simple nesing for route[WITHINDLG]

Sergey Safarov s.safarov at gmail.com
Mon Jun 29 07:48:29 CEST 2020


Module: kamailio
Branch: master
Commit: df73f60011497a7346c122cd4328e9564862a448
URL: https://github.com/kamailio/kamailio/commit/df73f60011497a7346c122cd4328e9564862a448

Author: Sergey Safarov <s.safarov at gmail.com>
Committer: Sergey Safarov <s.safarov at gmail.com>
Date: 2020-06-25T22:39:14+03:00

dispatcher: cfg - more simple nesing for route[WITHINDLG]

---

Modified: src/modules/dispatcher/doc/dispatcher.cfg

---

Diff:  https://github.com/kamailio/kamailio/commit/df73f60011497a7346c122cd4328e9564862a448.diff
Patch: https://github.com/kamailio/kamailio/commit/df73f60011497a7346c122cd4328e9564862a448.patch

---

diff --git a/src/modules/dispatcher/doc/dispatcher.cfg b/src/modules/dispatcher/doc/dispatcher.cfg
index 98492ec5c2..f79e9c762d 100644
--- a/src/modules/dispatcher/doc/dispatcher.cfg
+++ b/src/modules/dispatcher/doc/dispatcher.cfg
@@ -209,36 +209,38 @@ route[REQINIT] {
 
 # Handle requests within SIP dialogs
 route[WITHINDLG] {
-	if (has_totag()) {
-		# sequential request withing a dialog should
-		# take the path determined by record-routing
-		if (loose_route()) {
-			if (is_method("BYE")) {
-				setflag(FLT_ACC); # do accounting ...
-				setflag(FLT_ACCFAILED); # ... even if the transaction fails
-			}
-			route(RELAY);
-		} else {
-			if (is_method("SUBSCRIBE") && uri == myself) {
-				# in-dialog subscribe requests
-				route(PRESENCE);
+	if (!has_totag()) {
+		return;
+	}
+
+	# sequential request withing a dialog should
+	# take the path determined by record-routing
+	if (loose_route()) {
+		if (is_method("BYE")) {
+			setflag(FLT_ACC); # do accounting ...
+			setflag(FLT_ACCFAILED); # ... even if the transaction fails
+		}
+		route(RELAY);
+	} else {
+		if (is_method("SUBSCRIBE") && uri == myself) {
+			# in-dialog subscribe requests
+			route(PRESENCE);
+			exit;
+		}
+		if ( is_method("ACK") ) {
+			if ( t_check_trans() ) {
+				# non loose-route, but stateful ACK;
+				# must be ACK after a 487 or e.g. 404 from upstream server
+				t_relay();
+				exit;
+			} else {
+				# ACK without matching transaction ... ignore and discard.
 				exit;
 			}
-			if ( is_method("ACK") ) {
-				if ( t_check_trans() ) {
-					# non loose-route, but stateful ACK;
-					# must be ACK after a 487 or e.g. 404 from upstream server
-					t_relay();
-					exit;
-				} else {
-					# ACK without matching transaction ... ignore and discard.
-					exit;
-				}
-			}
-			sl_send_reply("404","Not here");
 		}
-		exit;
+		sl_send_reply("404","Not here");
 	}
+	exit;
 }
 
 # Handle SIP registrations




More information about the sr-dev mailing list