[sr-dev] git:kamailio_3.0: kamailio.cfg: use name for routes

Daniel-Constantin Mierla miconda at gmail.com
Wed Oct 28 22:09:17 CET 2009


Module: sip-router
Branch: kamailio_3.0
Commit: 489ddd1336d3bd703ea0b393226631469883b4f3
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=489ddd1336d3bd703ea0b393226631469883b4f3

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Wed Oct 28 22:07:00 2009 +0100

kamailio.cfg: use name for routes

- switched from index to names for routes
	- 1 => RELAY
	- 2 => PRESENCE
	- 3 => AUTH
	- 4 => NAT
	- 5 => RTPPROXY
- failure route: 1 = > FAIL_ONE
- onreply route: 1 = > REPLY_ONE
- branch route:  1 = > BRANCH_ONE

---

 etc/kamailio.cfg |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/etc/kamailio.cfg b/etc/kamailio.cfg
index 256645c..bfadc3a 100644
--- a/etc/kamailio.cfg
+++ b/etc/kamailio.cfg
@@ -266,7 +266,7 @@ route{
 	}
 
 	# NAT detection
-	route(4);
+	route(NAT);
 
 	if (has_totag()) {
 		# sequential request withing a dialog should
@@ -280,7 +280,7 @@ route{
 		} else {
 			if (is_method("SUBSCRIBE") && uri == myself) {
 				# in-dialog subscribe requests
-				route(2);
+				route(PRESENCE);
 				exit;
 			}
 			if ( is_method("ACK") ) {
@@ -311,7 +311,7 @@ route{
 	t_check_trans();
 
 	# authentication
-	route(3);
+	route(AUTH);
 
 	# record routing for dialog forming requests (in case they are routed)
 	if (is_method("INVITE|SUBSCRIBE"))
@@ -334,13 +334,13 @@ route{
 		##	t_relay("tls:domain2.net");
 		##	exit;
 		##}
-		route(1);
+		route(RELAY);
 	}
 
 	# requests for my domain
 
 	if( is_method("PUBLISH|SUBSCRIBE"))
-		route(2);
+		route(PRESENCE);
 
 	if (is_method("REGISTER"))
 	{
@@ -375,23 +375,23 @@ route{
 	# when routing via usrloc, log the missed calls also
 	setflag(2);
 
-	route(1);
+	route(RELAY);
 }
 
 
-route[1] {
+route[RELAY] {
 #n#	if (check_route_param("nat=yes")) {
 #n#		setbflag(6);
 #n#	}
 #n#	if (isflagset(5) || isbflagset(6)) {
-#n#		route(5);
+#n#		route(RTPPROXY);
 #n#	}
 
 	/* example how to enable some additional event routes */
 	if (is_method("INVITE")) {
-		#t_on_branch("1");
-		t_on_reply("1");
-		t_on_failure("1");
+		#t_on_branch("BRANCH_ONE");
+		t_on_reply("REPLY_ONE");
+		t_on_failure("FAIL_ONE");
 	}
 
 	if (!t_relay()) {
@@ -403,7 +403,7 @@ route[1] {
 
 # Presence route
 /* uncomment the whole following route for enabling presence server */
-route[2]
+route[PRESENCE]
 {
 #p#	if (!t_newtran())
 #p#	{
@@ -435,7 +435,7 @@ route[2]
 
 # Authentication route
 /* uncomment the whole following route for enabling authentication */
-route[3] {
+route[AUTH] {
 #a#	if (is_method("REGISTER"))
 #a#	{
 #a#		# authenticate the REGISTER requests (uncomment to enable auth)
@@ -480,7 +480,7 @@ route[3] {
 
 # Caller NAT detection route
 /* uncomment the whole following route for enabling Caller NAT Detection */
-route[4]{
+route[NAT]{
 #n#	force_rport();
 #n#	if (nat_uac_test("19")) {
 #n#		if (method=="REGISTER") {
@@ -495,7 +495,7 @@ route[4]{
 
 # RTPProxy control
 /* uncomment the whole following route for enabling RTPProxy Control */
-route[5] {
+route[RTPPROXY] {
 #n#	if (is_method("BYE")) {
 #n#		unforce_rtp_proxy();
 #n#	} else if (is_method("INVITE")){
@@ -505,12 +505,12 @@ route[5] {
 	return;
 }
 
-branch_route[1] {
+branch_route[BRANCH_ONE] {
 	xdbg("new branch at $ru\n");
 }
 
 
-onreply_route[1] {
+onreply_route[REPLY_ONE] {
 	xdbg("incoming reply\n");
 
 #n#	if ((isflagset(5) || isbflagset(6)) && status=~"(183)|(2[0-9][0-9])") {
@@ -522,7 +522,7 @@ onreply_route[1] {
 }
 
 
-failure_route[1] {
+failure_route[FAIL_ONE] {
 #n#	if (is_method("INVITE")
 #n#			&& (isbflagset(6) || isflagset(5))) {
 #n#		unforce_rtp_proxy();




More information about the sr-dev mailing list