Module: kamailio
Branch: 5.0
Commit: f127d59318e0d277b5f0ab05bc6e885aa002c018
URL:
https://github.com/kamailio/kamailio/commit/f127d59318e0d277b5f0ab05bc6e885…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2018-10-17T15:55:31+02:00
core: [cfg] reset routename properly
solution for #1536 was not working
fix #1668
(cherry picked from commit 6d1bf58d468e8ee62da2b1a2e50a57feb7c576c6)
---
Modified: src/core/cfg.lex
Modified: src/core/cfg.y
---
Diff:
https://github.com/kamailio/kamailio/commit/f127d59318e0d277b5f0ab05bc6e885…
Patch:
https://github.com/kamailio/kamailio/commit/f127d59318e0d277b5f0ab05bc6e885…
---
diff --git a/src/core/cfg.lex b/src/core/cfg.lex
index f7a3f145f1..53fefd34c8 100644
--- a/src/core/cfg.lex
+++ b/src/core/cfg.lex
@@ -556,23 +556,23 @@ IMPORTFILE "import_file"
<INITIAL>{ISAVPFLAGSET} { count(); yylval.strval=yytext; return ISAVPFLAGSET; }
<INITIAL>{AVPFLAGS_DECL} { count(); yylval.strval=yytext; return AVPFLAGS_DECL; }
<INITIAL>{MSGLEN} { count(); yylval.strval=yytext; return MSGLEN; }
-<INITIAL>{ROUTE} { count(); routename=0;
default_routename="DEFAULT_ROUTE";
+<INITIAL>{ROUTE} { count(); default_routename="DEFAULT_ROUTE";
yylval.strval=yytext; return ROUTE; }
-<INITIAL>{ROUTE_REQUEST} { count(); routename=0;
default_routename="DEFAULT_ROUTE";
+<INITIAL>{ROUTE_REQUEST} { count(); default_routename="DEFAULT_ROUTE";
yylval.strval=yytext; return ROUTE_REQUEST; }
-<INITIAL>{ROUTE_ONREPLY} { count(); routename=0;
default_routename="DEFAULT_ONREPLY";
+<INITIAL>{ROUTE_ONREPLY} { count(); default_routename="DEFAULT_ONREPLY";
yylval.strval=yytext;
return ROUTE_ONREPLY; }
-<INITIAL>{ROUTE_REPLY} { count(); routename=0;
default_routename="DEFAULT_ONREPLY";
+<INITIAL>{ROUTE_REPLY} { count(); default_routename="DEFAULT_ONREPLY";
yylval.strval=yytext; return ROUTE_REPLY; }
-<INITIAL>{ROUTE_FAILURE} { count(); routename=0;
default_routename="DEFAULT_FAILURE";
+<INITIAL>{ROUTE_FAILURE} { count(); default_routename="DEFAULT_FAILURE";
yylval.strval=yytext;
return ROUTE_FAILURE; }
-<INITIAL>{ROUTE_BRANCH} { count(); routename=0;
default_routename="DEFAULT_BRANCH";
+<INITIAL>{ROUTE_BRANCH} { count(); default_routename="DEFAULT_BRANCH";
yylval.strval=yytext; return ROUTE_BRANCH; }
-<INITIAL>{ROUTE_SEND} { count(); routename=0;
default_routename="DEFAULT_SEND";
+<INITIAL>{ROUTE_SEND} { count(); default_routename="DEFAULT_SEND";
yylval.strval=yytext; return ROUTE_SEND; }
-<INITIAL>{ROUTE_EVENT} { count(); routename=0;
default_routename="DEFAULT_EVENT";
+<INITIAL>{ROUTE_EVENT} { count(); default_routename="DEFAULT_EVENT";
yylval.strval=yytext;
state=EVRT_NAME_S; BEGIN(EVRTNAME);
return ROUTE_EVENT; }
diff --git a/src/core/cfg.y b/src/core/cfg.y
index 0bd017005b..8282751d49 100644
--- a/src/core/cfg.y
+++ b/src/core/cfg.y
@@ -1792,8 +1792,11 @@ route_stm:
| ROUTE error { yyerror("invalid route statement"); }
| ROUTE_REQUEST error { yyerror("invalid request_route statement"); }
;
+
+failure_route_main: ROUTE_FAILURE { routename=NULL; }
+;
failure_route_stm:
- ROUTE_FAILURE LBRACE actions RBRACE {
+ failure_route_main LBRACE actions RBRACE {
#ifdef SHM_MEM
if (!shm_initialized() && init_shm()<0) {
yyerror("Can't initialize shared memory");
@@ -1870,8 +1873,11 @@ onreply_route_stm:
yyerror("invalid onreply_route statement");
}
;
+
+branch_route_main: ROUTE_BRANCH { routename=NULL; }
+;
branch_route_stm:
- ROUTE_BRANCH LBRACE actions RBRACE {
+ branch_route_main LBRACE actions RBRACE {
#ifdef SHM_MEM
if (!shm_initialized() && init_shm()<0) {
yyerror("Can't initialize shared memory");
@@ -1900,7 +1906,11 @@ branch_route_stm:
}
| ROUTE_BRANCH error { yyerror("invalid branch_route statement"); }
;
-send_route_stm: ROUTE_SEND LBRACE actions RBRACE {
+
+send_route_main: ROUTE_SEND { routename=NULL; }
+;
+send_route_stm:
+ send_route_main LBRACE actions RBRACE {
#ifdef SHM_MEM
if (!shm_initialized() && init_shm()<0) {
yyerror("Can't initialize shared memory");
@@ -1929,7 +1939,11 @@ send_route_stm: ROUTE_SEND LBRACE actions RBRACE {
}
| ROUTE_SEND error { yyerror("invalid onsend_route statement"); }
;
-event_route_stm: ROUTE_EVENT LBRACK EVENT_RT_NAME RBRACK LBRACE actions RBRACE {
+
+event_route_main: ROUTE_EVENT { routename=NULL; }
+;
+event_route_stm:
+ event_route_main LBRACK EVENT_RT_NAME RBRACK LBRACE actions RBRACE {
#ifdef SHM_MEM
if (!shm_initialized() && init_shm()<0) {
yyerror("Can't initialize shared memory");