[sr-dev] git:master: core: reply_route aliased to main onreply_route block

Daniel-Constantin Mierla miconda at gmail.com
Sun May 22 17:25:30 CEST 2011


Module: sip-router
Branch: master
Commit: 1d2246f48bb7bd26f7026abda1e45e7235a53da6
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1d2246f48bb7bd26f7026abda1e45e7235a53da6

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Sun May 22 15:02:09 2011 +0200

core: reply_route aliased to main onreply_route block

- reply_route { ... } can be used instead of main onreply_route { ... }
- easier to refer to core reply routing actions, avoiding naming
  confusion with tm reply routing blocks

---

 cfg.lex |    2 ++
 cfg.y   |   10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/cfg.lex b/cfg.lex
index 02439ae..5b863ac 100644
--- a/cfg.lex
+++ b/cfg.lex
@@ -202,6 +202,7 @@ ERROR	error
 ROUTE	route
 ROUTE_REQUEST request_route
 ROUTE_FAILURE failure_route
+ROUTE_REPLY reply_route
 ROUTE_ONREPLY onreply_route
 ROUTE_BRANCH branch_route
 ROUTE_SEND onsend_route
@@ -589,6 +590,7 @@ SUBST       subst
 <INITIAL>{ROUTE_REQUEST}	{ count(); yylval.strval=yytext; return ROUTE_REQUEST; }
 <INITIAL>{ROUTE_ONREPLY}	{ count(); yylval.strval=yytext;
 								return ROUTE_ONREPLY; }
+<INITIAL>{ROUTE_REPLY}	{ count(); yylval.strval=yytext; return ROUTE_REPLY; }
 <INITIAL>{ROUTE_FAILURE}	{ count(); yylval.strval=yytext;
 								return ROUTE_FAILURE; }
 <INITIAL>{ROUTE_BRANCH} { count(); yylval.strval=yytext; return ROUTE_BRANCH; }
diff --git a/cfg.y b/cfg.y
index f67ce7c..bd44b13 100644
--- a/cfg.y
+++ b/cfg.y
@@ -310,6 +310,7 @@ extern char *finame;
 %token ROUTE_REQUEST
 %token ROUTE_FAILURE
 %token ROUTE_ONREPLY
+%token ROUTE_REPLY
 %token ROUTE_BRANCH
 %token ROUTE_SEND
 %token ROUTE_EVENT
@@ -1837,8 +1838,14 @@ failure_route_stm:
 	| ROUTE_FAILURE error { yyerror("invalid failure_route statement"); }
 	;
 
+
+route_reply_main:	ROUTE_ONREPLY { ; }
+		  | ROUTE_REPLY { ; }
+;
+
+
 onreply_route_stm:
-	ROUTE_ONREPLY LBRACE {rt=CORE_ONREPLY_ROUTE;} actions RBRACE {
+	route_reply_main LBRACE {rt=CORE_ONREPLY_ROUTE;} actions RBRACE {
 	#ifdef SHM_MEM
 		if (!shm_initialized() && init_shm()<0) {
 			yyerror("Can't initialize shared memory");
@@ -1848,6 +1855,7 @@ onreply_route_stm:
 		push($4, &onreply_rt.rlist[DEFAULT_RT]);
 	}
 	| ROUTE_ONREPLY error { yyerror("invalid onreply_route statement"); }
+	| ROUTE_REPLY error { yyerror("invalid onreply_route statement"); }
 	| ROUTE_ONREPLY LBRACK route_name RBRACK 
 		{rt=(*$3=='0' && $3[1]==0)?CORE_ONREPLY_ROUTE:TM_ONREPLY_ROUTE;}
 		LBRACE actions RBRACE {




More information about the sr-dev mailing list