Module: kamailio
Branch: master
Commit: d394724ee79e168786abb9ac94ef1e965f169a7c
URL:
https://github.com/kamailio/kamailio/commit/d394724ee79e168786abb9ac94ef1e9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-09-06T21:02:42+02:00
core: config parser extended with xavp_via_reply_params parameter
- allows to specify xavp name that is going to hold parameters to be
added to the top via of replies
---
Modified: src/core/cfg.lex
Modified: src/core/cfg.y
---
Diff:
https://github.com/kamailio/kamailio/commit/d394724ee79e168786abb9ac94ef1e9…
Patch:
https://github.com/kamailio/kamailio/commit/d394724ee79e168786abb9ac94ef1e9…
---
diff --git a/src/core/cfg.lex b/src/core/cfg.lex
index e0500769bb5..6ec71fcf6d1 100644
--- a/src/core/cfg.lex
+++ b/src/core/cfg.lex
@@ -304,6 +304,7 @@ LOGENGINETYPE log_engine_type
LOGENGINEDATA log_engine_data
XAVPVIAPARAMS xavp_via_params
XAVPVIAFIELDS xavp_via_fields
+XAVPVIAREPLYPARAMS xavp_via_reply_params
LISTEN listen
ADVERTISE advertise|ADVERTISE
VIRTUAL virtual
@@ -753,6 +754,7 @@ IMPORTFILE "import_file"
<INITIAL>{LOGENGINEDATA} { yylval.strval=yytext; return LOGENGINEDATA; }
<INITIAL>{XAVPVIAPARAMS} { yylval.strval=yytext; return XAVPVIAPARAMS; }
<INITIAL>{XAVPVIAFIELDS} { yylval.strval=yytext; return XAVPVIAFIELDS; }
+<INITIAL>{XAVPVIAREPLYPARAMS} { yylval.strval=yytext; return XAVPVIAREPLYPARAMS; }
<INITIAL>{LISTEN} { count(); yylval.strval=yytext; return LISTEN; }
<INITIAL>{ADVERTISE} { count(); yylval.strval=yytext; return ADVERTISE; }
<INITIAL>{VIRTUAL} { count(); yylval.strval=yytext; return VIRTUAL; }
diff --git a/src/core/cfg.y b/src/core/cfg.y
index eef8e6acd28..19d0ee6949e 100644
--- a/src/core/cfg.y
+++ b/src/core/cfg.y
@@ -328,6 +328,7 @@ extern char *default_routename;
%token LOGENGINEDATA
%token XAVPVIAPARAMS
%token XAVPVIAFIELDS
+%token XAVPVIAREPLYPARAMS
%token LISTEN
%token ADVERTISE
%token VIRTUAL
@@ -890,6 +891,10 @@ assign_stm:
_ksr_xavp_via_fields.len=strlen($3);
}
| XAVPVIAFIELDS EQUAL error { yyerror("string value expected"); }
+ | XAVPVIAREPLYPARAMS EQUAL STRING { _ksr_xavp_via_reply_params.s=$3;
+ _ksr_xavp_via_reply_params.len=strlen($3);
+ }
+ | XAVPVIAREPLYPARAMS EQUAL error { yyerror("string value expected"); }
| DNS EQUAL NUMBER { received_dns|= ($3)?DO_DNS:0; }
| DNS EQUAL error { yyerror("boolean value expected"); }
| REV_DNS EQUAL NUMBER { received_dns|= ($3)?DO_REV_DNS:0; }