i tried to give xlog an expression param and got segfault at startup:
Apr 22 14:29:41 sip kernel: [53028.559446] sip-proxy[8339]: segfault at f30cbd8b ip 080c7616 sp bfa74da0 error 5 in sip-proxy[8048000+18e000]
Not starting sip-proxy: invalid configuration file!
0(8339) INFO: pv [pv_shv.c:61]: locks array size 16
0(8339) : <core> [cfg.y:3437]: parse error in config file /etc/sip-proxy/sip-proxy.cfg, line 1531, column 24-58: function xlog: parameter 2 is not constant
it would be better to just to give the error message without
segfaulting. this was with master branch.
-- juha
Module: sip-router
Branch: master
Commit: b56094a42d010e1ead64195e3db0c855e49f1cde
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b56094a…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Fri Apr 22 12:25:26 2011 +0300
modules_k/siputils: allow tel2sip call also in failure route.
---
modules_k/siputils/README | 3 ++-
modules_k/siputils/doc/siputils_admin.xml | 3 ++-
modules_k/siputils/siputils.c | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules_k/siputils/README b/modules_k/siputils/README
index 5fae3c7..73c760c 100644
--- a/modules_k/siputils/README
+++ b/modules_k/siputils/README
@@ -508,7 +508,8 @@ add_uri_param("nat=yes");
The SIP URI hostpart is taken from second param (pseudo variable or
string).
- This function can be used from REQUEST_ROUTE or ONREPLY_ROUTE.
+ This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, or
+ ONREPLY_ROUTE.
Example 1.17. tel2sip usage
...
diff --git a/modules_k/siputils/doc/siputils_admin.xml b/modules_k/siputils/doc/siputils_admin.xml
index f2135d5..8ae86c2 100644
--- a/modules_k/siputils/doc/siputils_admin.xml
+++ b/modules_k/siputils/doc/siputils_admin.xml
@@ -502,7 +502,8 @@ add_uri_param("nat=yes");
(pseudo variable or string).
</para>
<para>
- This function can be used from REQUEST_ROUTE or ONREPLY_ROUTE.
+ This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
+ or ONREPLY_ROUTE.
</para>
<example>
<title><function>tel2sip</function> usage</title>
diff --git a/modules_k/siputils/siputils.c b/modules_k/siputils/siputils.c
index 5427fb2..391907e 100644
--- a/modules_k/siputils/siputils.c
+++ b/modules_k/siputils/siputils.c
@@ -139,7 +139,7 @@ static cmd_export_t cmds[]={
{"decode_contact", (cmd_function)decode_contact, 0, 0,
0, REQUEST_ROUTE},
{"decode_contact_header", (cmd_function)decode_contact_header, 0, 0,
- 0,REQUEST_ROUTE|ONREPLY_ROUTE},
+ 0,REQUEST_ROUTE|FAILURE_ROUTE|ONREPLY_ROUTE},
{"cmp_uri", (cmd_function)w_cmp_uri, 2, fixup_spve_spve,
0, ANY_ROUTE},
{"cmp_aor", (cmd_function)w_cmp_aor, 2, fixup_spve_spve,
i understood that module functions can now have an arbitrary number of
string, int and pseudo var arguments, where string arguments can
possibly also contain pseudo variables.
some time ago i asked an example on how this is done, but didn't get any
reply. so i'll try again. for example, allow_trusted function is
now defined like this:
{"allow_trusted", (cmd_function)allow_trusted_2, 2, fixup_pvar_pvar,
fixup_free_pvar_pvar, REQUEST_ROUTE | FAILURE_ROUTE},
how can i add a third argument to the function without needing to define
yet another fixup_pvar_pvar_something?
-- juha