From e00cce62b91fa89c8be9a551eb4b0b70b21e7ff6 Mon Sep 17 00:00:00 2001 From: paulc Date: Thu, 6 Oct 2011 11:41:25 +0000 Subject: [PATCH] Addded capability to read parameters from main engine config file. git-svn-id: http://voip.null.ro/svn/yate@4640 acf43c95-373e-0410-b603-e72c3f656dc1 --- conf.d/regexroute.conf.sample | 1 + modules/regexroute.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/conf.d/regexroute.conf.sample b/conf.d/regexroute.conf.sample index edb163c7..7f2e17f4 100644 --- a/conf.d/regexroute.conf.sample +++ b/conf.d/regexroute.conf.sample @@ -47,6 +47,7 @@ ; $(random,STRING) = STRING with each ? character replaced with a random digit ; $(index,N,ITEM1,ITEM2,...) = N-th (modulo length of list) item in list ; $(rotate,N,ITEM1,ITEM2,...) = list rotated N (modulo length of list) times +; $(config,SECTION,KEY) = value of KEY= in [SECTION] of main config file (yate.conf, yate-qt4.conf) ; $(engine,NAME) = value of Engine's runtime parameter NAME ; $(runid) = the current Engine run identifier ; $(nodename) = the node name the Engine runs as, may be empty diff --git a/modules/regexroute.cpp b/modules/regexroute.cpp index 7d4db2ca..4beca2e3 100644 --- a/modules/regexroute.cpp +++ b/modules/regexroute.cpp @@ -287,6 +287,11 @@ static void evalFunc(String& str) } lst->destruct(); } + else if ((sep >= 0) && (str == "config")) { + str = par.substr(0,sep).trimBlanks(); + par = par.substr(sep+1).trimBlanks(); + str = Engine::config().getValue(str,par); + } else if (str == "engine") str = Engine::runParams().getValue(vars(par)); else if (str == "runid") {