[sr-dev] git:master:97f8c975: core: new core parameter xavp_via_params
Daniel-Constantin Mierla
miconda at gmail.com
Thu Apr 19 18:51:04 CEST 2018
Module: kamailio
Branch: master
Commit: 97f8c975b006fed3ea817a62654d2957c8077d12
URL: https://github.com/kamailio/kamailio/commit/97f8c975b006fed3ea817a62654d2957c8077d12
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-04-19T17:50:48+02:00
core: new core parameter xavp_via_params
- set the name of the xavp whose subfields will be added as via params
---
Modified: src/core/cfg.lex
Modified: src/core/cfg.y
Modified: src/core/globals.h
Modified: src/core/msg_translator.c
---
Diff: https://github.com/kamailio/kamailio/commit/97f8c975b006fed3ea817a62654d2957c8077d12.diff
Patch: https://github.com/kamailio/kamailio/commit/97f8c975b006fed3ea817a62654d2957c8077d12.patch
---
diff --git a/src/core/cfg.lex b/src/core/cfg.lex
index 67803e9b58..033f87e3df 100644
--- a/src/core/cfg.lex
+++ b/src/core/cfg.lex
@@ -293,6 +293,7 @@ LOGPREFIX log_prefix
LOGPREFIXMODE log_prefix_mode
LOGENGINETYPE log_engine_type
LOGENGINEDATA log_engine_data
+XAVPVIAPARAMS xavp_via_params
LISTEN listen
ADVERTISE advertise|ADVERTISE
ALIAS alias
@@ -694,6 +695,7 @@ IMPORTFILE "import_file"
<INITIAL>{LOGPREFIXMODE} { yylval.strval=yytext; return LOGPREFIXMODE; }
<INITIAL>{LOGENGINETYPE} { yylval.strval=yytext; return LOGENGINETYPE; }
<INITIAL>{LOGENGINEDATA} { yylval.strval=yytext; return LOGENGINEDATA; }
+<INITIAL>{XAVPVIAPARAMS} { yylval.strval=yytext; return XAVPVIAPARAMS; }
<INITIAL>{LISTEN} { count(); yylval.strval=yytext; return LISTEN; }
<INITIAL>{ADVERTISE} { count(); yylval.strval=yytext; return ADVERTISE; }
<INITIAL>{ALIAS} { count(); yylval.strval=yytext; return ALIAS; }
diff --git a/src/core/cfg.y b/src/core/cfg.y
index ff94b604b2..25be814025 100644
--- a/src/core/cfg.y
+++ b/src/core/cfg.y
@@ -324,6 +324,7 @@ extern char *default_routename;
%token LOGPREFIXMODE
%token LOGENGINETYPE
%token LOGENGINEDATA
+%token XAVPVIAPARAMS
%token LISTEN
%token ADVERTISE
%token ALIAS
@@ -797,6 +798,10 @@ assign_stm:
| LOGENGINETYPE EQUAL error { yyerror("string value expected"); }
| LOGENGINEDATA EQUAL STRING { _km_log_engine_data=$3; }
| LOGENGINEDATA EQUAL error { yyerror("string value expected"); }
+ | XAVPVIAPARAMS EQUAL STRING { _ksr_xavp_via_params.s=$3;
+ _ksr_xavp_via_params.len=strlen($3);
+ }
+ | XAVPVIAPARAMS 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; }
diff --git a/src/core/globals.h b/src/core/globals.h
index 786e8f2578..d335a99caf 100644
--- a/src/core/globals.h
+++ b/src/core/globals.h
@@ -205,6 +205,7 @@ extern int http_reply_parse;
extern int _sr_ip_free_bind;
extern int ksr_verbose_startup;
extern int ksr_route_locks_size;
+extern str _ksr_xavp_via_params;
#ifdef USE_DNS_CACHE
extern int dns_cache_init; /* if 0, the DNS cache is not initialized at startup */
diff --git a/src/core/msg_translator.c b/src/core/msg_translator.c
index 414648d6af..5d7c1866e5 100644
--- a/src/core/msg_translator.c
+++ b/src/core/msg_translator.c
@@ -111,7 +111,7 @@
extern char version[];
extern int version_len;
-
+str _ksr_xavp_via_params = STR_NULL;
/** per process fixup function for global_req_flags.
* It should be called from the configuration framework.
More information about the sr-dev
mailing list