Module: kamailio
Branch: master
Commit: 5e701d6a0826611dc980db2f434bee49e0fdcf88
URL:
https://github.com/kamailio/kamailio/commit/5e701d6a0826611dc980db2f434bee4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-01-05T18:50:40+01:00
core: cfg parser - resolve conflict between proto:host and event route name
- there was a conflict on same kind of id:id format
- event route name is expected now only after an event_route
---
Modified: cfg.lex
---
Diff:
https://github.com/kamailio/kamailio/commit/5e701d6a0826611dc980db2f434bee4…
Patch:
https://github.com/kamailio/kamailio/commit/5e701d6a0826611dc980db2f434bee4…
---
diff --git a/cfg.lex b/cfg.lex
index 472dfd0..3eb79dc 100644
--- a/cfg.lex
+++ b/cfg.lex
@@ -117,6 +117,7 @@
#define IFDEF_EOL_S 14
#define IFDEF_SKIP_S 15
#define DEFINE_DATA_S 16
+ #define EVRT_NAME_S 17
#define STR_BUF_ALLOC_UNIT 128
struct str_buf{
@@ -181,7 +182,7 @@
/* start conditions */
%x STRING1 STRING2 STR_BETWEEN COMMENT COMMENT_LN ATTR SELECT AVP_PVAR PVAR_P
-%x PVARID INCLF IMPTF
+%x PVARID INCLF IMPTF EVRTNAME
%x LINECOMMENT DEFINE_ID DEFINE_EOL DEFINE_DATA IFDEF_ID IFDEF_EOL IFDEF_SKIP
/* config script types : #!SER or #!KAMAILIO or #!MAX_COMPAT */
@@ -619,7 +620,19 @@ IMPORTFILE "import_file"
<INITIAL>{ROUTE_SEND} { count(); default_routename="DEFAULT_SEND";
yylval.strval=yytext; return ROUTE_SEND; }
<INITIAL>{ROUTE_EVENT} { count(); default_routename="DEFAULT_EVENT";
- yylval.strval=yytext; return ROUTE_EVENT; }
+ yylval.strval=yytext;
+ state=EVRT_NAME_S; BEGIN(EVRTNAME);
+ return ROUTE_EVENT; }
+<EVRTNAME>{LBRACK} { count(); return LBRACK; }
+<EVRTNAME>{EAT_ABLE}|{CR} { count(); };
+<EVRTNAME>{EVENT_RT_NAME} { count();
+ addstr(&s_buf, yytext, yyleng);
+ yylval.strval=s_buf.s;
+ memset(&s_buf, 0, sizeof(s_buf));
+ return EVENT_RT_NAME; }
+<EVRTNAME>{RBRACK} { count();
+ state=INITIAL_S; BEGIN(INITIAL);
+ return RBRACK; }
<INITIAL>{EXEC} { count(); yylval.strval=yytext; return EXEC; }
<INITIAL>{SET_HOST} { count(); yylval.strval=yytext; return SET_HOST; }
<INITIAL>{SET_HOSTPORT} { count(); yylval.strval=yytext; return SET_HOSTPORT; }
@@ -1150,11 +1163,6 @@ IMPORTFILE "import_file"
<INITIAL>{DOT} { count(); return DOT; }
<INITIAL>\\{CR} {count(); } /* eat the escaped CR */
<INITIAL>{CR} { count();/* return CR;*/ }
-<INITIAL>{EVENT_RT_NAME} { count();
- addstr(&s_buf, yytext, yyleng);
- yylval.strval=s_buf.s;
- memset(&s_buf, 0, sizeof(s_buf));
- return EVENT_RT_NAME; }
<INITIAL,SELECT>{QUOTES} { count(); old_initial = YY_START;