Browse code

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

Daniel-Constantin Mierla authored on 28/10/2009 21:07:00
Showing 1 changed files
... ...
@@ -266,7 +266,7 @@ route{
266 266
 	}
267 267
 
268 268
 	# NAT detection
269
-	route(4);
269
+	route(NAT);
270 270
 
271 271
 	if (has_totag()) {
272 272
 		# sequential request withing a dialog should
... ...
@@ -280,7 +280,7 @@ route{
280 280
 		} else {
281 281
 			if (is_method("SUBSCRIBE") && uri == myself) {
282 282
 				# in-dialog subscribe requests
283
-				route(2);
283
+				route(PRESENCE);
284 284
 				exit;
285 285
 			}
286 286
 			if ( is_method("ACK") ) {
... ...
@@ -311,7 +311,7 @@ route{
311 311
 	t_check_trans();
312 312
 
313 313
 	# authentication
314
-	route(3);
314
+	route(AUTH);
315 315
 
316 316
 	# record routing for dialog forming requests (in case they are routed)
317 317
 	if (is_method("INVITE|SUBSCRIBE"))
... ...
@@ -334,13 +334,13 @@ route{
334 334
 		##	t_relay("tls:domain2.net");
335 335
 		##	exit;
336 336
 		##}
337
-		route(1);
337
+		route(RELAY);
338 338
 	}
339 339
 
340 340
 	# requests for my domain
341 341
 
342 342
 	if( is_method("PUBLISH|SUBSCRIBE"))
343
-		route(2);
343
+		route(PRESENCE);
344 344
 
345 345
 	if (is_method("REGISTER"))
346 346
 	{
... ...
@@ -375,23 +375,23 @@ route{
375 375
 	# when routing via usrloc, log the missed calls also
376 376
 	setflag(2);
377 377
 
378
-	route(1);
378
+	route(RELAY);
379 379
 }
380 380
 
381 381
 
382
-route[1] {
382
+route[RELAY] {
383 383
 #n#	if (check_route_param("nat=yes")) {
384 384
 #n#		setbflag(6);
385 385
 #n#	}
386 386
 #n#	if (isflagset(5) || isbflagset(6)) {
387
-#n#		route(5);
387
+#n#		route(RTPPROXY);
388 388
 #n#	}
389 389
 
390 390
 	/* example how to enable some additional event routes */
391 391
 	if (is_method("INVITE")) {
392
-		#t_on_branch("1");
393
-		t_on_reply("1");
394
-		t_on_failure("1");
392
+		#t_on_branch("BRANCH_ONE");
393
+		t_on_reply("REPLY_ONE");
394
+		t_on_failure("FAIL_ONE");
395 395
 	}
396 396
 
397 397
 	if (!t_relay()) {
... ...
@@ -403,7 +403,7 @@ route[1] {
403 403
 
404 404
 # Presence route
405 405
 /* uncomment the whole following route for enabling presence server */
406
-route[2]
406
+route[PRESENCE]
407 407
 {
408 408
 #p#	if (!t_newtran())
409 409
 #p#	{
... ...
@@ -435,7 +435,7 @@ route[2]
435 435
 
436 436
 # Authentication route
437 437
 /* uncomment the whole following route for enabling authentication */
438
-route[3] {
438
+route[AUTH] {
439 439
 #a#	if (is_method("REGISTER"))
440 440
 #a#	{
441 441
 #a#		# authenticate the REGISTER requests (uncomment to enable auth)
... ...
@@ -480,7 +480,7 @@ route[3] {
480 480
 
481 481
 # Caller NAT detection route
482 482
 /* uncomment the whole following route for enabling Caller NAT Detection */
483
-route[4]{
483
+route[NAT]{
484 484
 #n#	force_rport();
485 485
 #n#	if (nat_uac_test("19")) {
486 486
 #n#		if (method=="REGISTER") {
... ...
@@ -495,7 +495,7 @@ route[4]{
495 495
 
496 496
 # RTPProxy control
497 497
 /* uncomment the whole following route for enabling RTPProxy Control */
498
-route[5] {
498
+route[RTPPROXY] {
499 499
 #n#	if (is_method("BYE")) {
500 500
 #n#		unforce_rtp_proxy();
501 501
 #n#	} else if (is_method("INVITE")){
... ...
@@ -505,12 +505,12 @@ route[5] {
505 505
 	return;
506 506
 }
507 507
 
508
-branch_route[1] {
508
+branch_route[BRANCH_ONE] {
509 509
 	xdbg("new branch at $ru\n");
510 510
 }
511 511
 
512 512
 
513
-onreply_route[1] {
513
+onreply_route[REPLY_ONE] {
514 514
 	xdbg("incoming reply\n");
515 515
 
516 516
 #n#	if ((isflagset(5) || isbflagset(6)) && status=~"(183)|(2[0-9][0-9])") {
... ...
@@ -522,7 +522,7 @@ onreply_route[1] {
522 522
 }
523 523
 
524 524
 
525
-failure_route[1] {
525
+failure_route[FAIL_ONE] {
526 526
 #n#	if (is_method("INVITE")
527 527
 #n#			&& (isbflagset(6) || isflagset(5))) {
528 528
 #n#		unforce_rtp_proxy();