i think i asked this once before, but i'm not sure what the conclusion
was:
it is somehow currently possible to evaluate an runtime an expression
stored in variable, for example,
$var(exp) = ";param=$avp(value)";
append_hf("P-Foo: " + $var(uri) + eval($var(exp)) + "\r\n");
in practice, the expression to be evaluated could come from database,
htable, etc., which would in my opinion greatly enhance flexibility of
sr.
if that cannot be done in sr 3.1, would it be difficult to implement it
for the next version?
-- juha
Module: sip-router
Branch: master
Commit: b5cc26d622f1711f6c26f50d6562c7f93d7e1ea7
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b5cc26d…
Author: Miklos Tirpak <miklos(a)iptel.org>
Committer: Miklos Tirpak <miklos(a)iptel.org>
Date: Wed Oct 27 13:03:59 2010 +0200
Merge remote branch 'origin/tirpi/cfg_framework_multivalue'
* origin/tirpi/cfg_framework_multivalue: (33 commits)
cfg framework: fix uninitialized group_inst pointers
xmlrpc: scan resets the error code
cfg_rpc: group can be specified for cfg.list
cfg_rpc: cfg.set and cfg.set_delayed commands added
ctl: rpc->scan does not immediately send out errors
cfg_rpc: documentation update - group instances
cfg framework: multiple group instances is documented
cfg framework: timer must reset the handles more frequently
cfg framework: cfg_select() and cfg_reset() added
cfg framework: group handle can be moved runtime
cfg framework: group instance support in the script
cfg framework: apply the values in the order they are set
cfg framework: translate_pointer bugfix
cfg framework: apply additional var list bugfix
cfg framework: apply the additional variable list
cfg framework: group instance support before forking
cfg framework: CFG_GROUP_UNKNOWN group type
cfg framework: cfg_commit() log message fixes
cfg_db: updated to the cfg framework changes
cfg_db: updated to the cfg framework changes
...
---
Module: sip-router
Branch: tirpi/cfg_framework_multivalue
Commit: f6f6e6c8134d5c995d1818890b6107790363410f
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f6f6e6c…
Author: Miklos Tirpak <miklos(a)iptel.org>
Committer: Miklos Tirpak <miklos(a)iptel.org>
Date: Tue Oct 5 16:50:51 2010 +0200
cfg_rpc: group can be specified for cfg.list
- cfg.list without any parameter lists all the cfg variables.
- cfg.list <group name> lists only the variables of the specific group.
---
modules/cfg_rpc/README | 4 ++--
modules/cfg_rpc/cfg_rpc.c | 14 ++++++++++++--
modules/cfg_rpc/doc/rpc.xml | 3 ++-
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/modules/cfg_rpc/README b/modules/cfg_rpc/README
index 385ee8d..3bec8f0 100644
--- a/modules/cfg_rpc/README
+++ b/modules/cfg_rpc/README
@@ -60,8 +60,8 @@ Miklos Tirpak
can optionally contain the group instance id, for example foo[5].
* cfg.help - Print the description of a configuration variable. The
function accepts two parameters: group name, variable name.
- * cfg.list - List the configuration variables. The function does not
- have any parameters.
+ * cfg.list - List the configuration variables. The function has one
+ optional parameter: group name.
* cfg.diff - List the pending configuration changes that have not
been committed yet. The function does not have any parameters.
* cfg.add_group_inst - Add a new instance to an existing
diff --git a/modules/cfg_rpc/cfg_rpc.c b/modules/cfg_rpc/cfg_rpc.c
index 0ec588f..23cba03 100644
--- a/modules/cfg_rpc/cfg_rpc.c
+++ b/modules/cfg_rpc/cfg_rpc.c
@@ -353,11 +353,21 @@ static void rpc_list(rpc_t* rpc, void* c)
str gname;
cfg_def_t *def;
int i;
+ str group;
+
+ if (rpc->scan(c, "*S", &group) < 1) {
+ group.s = NULL;
+ group.len = 0;
+ }
cfg_get_group_init(&h);
while(cfg_get_group_next(&h, &gname, &def))
- for (i=0; def[i].name; i++)
- rpc->printf(c, "%.*s: %s", gname.len, gname.s, def[i].name);
+ if (!group.len
+ || ((gname.len == group.len)
+ && (memcmp(gname.s, group.s, group.len) == 0))
+ )
+ for (i=0; def[i].name; i++)
+ rpc->printf(c, "%.*s: %s", gname.len, gname.s, def[i].name);
}
static const char* rpc_diff_doc[2] = {
diff --git a/modules/cfg_rpc/doc/rpc.xml b/modules/cfg_rpc/doc/rpc.xml
index 24c5769..4491184 100644
--- a/modules/cfg_rpc/doc/rpc.xml
+++ b/modules/cfg_rpc/doc/rpc.xml
@@ -100,7 +100,8 @@
<listitem>
<para>
<emphasis>cfg.list</emphasis> - List the configuration
- variables. The function does not have any parameters.
+ variables. The function has one optional parameter:
+ group name.
</para>
</listitem>
<listitem>
Module: sip-router
Branch: 3.1
Commit: 14a2f7d1560a3462df850084f25a758ca704a473
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=14a2f7d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Oct 26 21:15:11 2010 +0200
db_text(k): fixed db_url driver name
- it has to be 'text' instead of 'dbtext'
- db_text should work as well, according to db driver names and module
names
- reported by Jeremya
(cherry picked from commit e82be561d2e7f98cb2cbd7e574873134f70b2f8a)
---
modules_k/db_text/README | 247 +++++++++++++++++--------------
modules_k/db_text/doc/db_text_admin.xml | 18 +-
2 files changed, 142 insertions(+), 123 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=14a…
Module: sip-router
Branch: master
Commit: e82be561d2e7f98cb2cbd7e574873134f70b2f8a
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e82be56…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Oct 26 21:15:11 2010 +0200
db_text(k): fixed db_url driver name
- it has to be 'text' instead of 'dbtext'
- db_text should work as well, according to db driver names and module
names
- reported by Jeremya
---
modules_k/db_text/README | 247 +++++++++++++++++--------------
modules_k/db_text/doc/db_text_admin.xml | 18 +-
2 files changed, 142 insertions(+), 123 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=e82…
Hi,
there seems to be a bug when using multi_leg_info (version: kamailio 3.1.0
(i386/linux) bf8b8d):
modparam("acc", "multi_leg_info", "Src-Leg=$avp(i:901);Dst-Leg=$avp(i:902)")
When the call ends, kamailio suddenly segfaults:
WARNING: no fork mode
Segmentation fault (core dumped)
If you do not know to reproduce the error, please provide a howto that can
lead me to retrieve another useful information (gdb..). Thank you very much.