this call caused sr from master branch to crash at startup:
t_set_fr("@cfg_get.local.invite_timeout", "@cfg_get.local.gw_timeout");
i had misspelled the name of the configuration variable when i set it at
the top of the script.
-- juha
Oct 19 18:16:37 squeeze /usr/sbin/trunk-proxy[1738]: ERROR: <core> [cfg/cfg_select.c:117]: ERROR: cfg_parse_selects(): unknown variable: local.gw_timeout
Oct 19 18:16:37 squeeze /usr/sbin/trunk-proxy[1738]: : <core> [main.c:1519]: could not initialize shared configuration
Oct 19 18:16:37 squeeze kernel: [ 338.729036] trunk-proxy[1738]: segfault at 10 ip 081638ad sp bf984d70 error 4 in trunk-proxy[8048000+184000]
Module: sip-router
Branch: 3.1
Commit: a10d3c62d4eb5e18e54564ed6ae354dc0ce9dfd0
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a10d3c6…
Author: Miklos Tirpak <miklos(a)iptel.org>
Committer: Miklos Tirpak <miklos(a)iptel.org>
Date: Wed Oct 20 15:32:18 2010 +0200
cfg framework: segfault during exit is fixed
Verify that *cfg_global is not NULL when destroying the
configuration.
t_set_fr("@cfg_get.local.invite_timeout", "@cfg_get.local.gw_timeout");
caused a segfault during startup when the variable was not defined.
Reported by Juha Heinanen
(cherry picked from commit d85ff11cf0db4aad859f6dcfd18dfb2011e3d78a)
---
cfg/cfg_struct.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cfg/cfg_struct.c b/cfg/cfg_struct.c
index f2f5bfe..11a825d 100644
--- a/cfg/cfg_struct.c
+++ b/cfg/cfg_struct.c
@@ -333,7 +333,7 @@ void cfg_destroy(void)
cfg_ctx_destroy();
/* free the list of groups */
- cfg_destory_groups(cfg_global ? (*cfg_global)->vars : NULL);
+ cfg_destory_groups((cfg_global && (*cfg_global)) ? (*cfg_global)->vars : NULL);
/* free the select list */
cfg_free_selects();
Module: sip-router
Branch: master
Commit: d85ff11cf0db4aad859f6dcfd18dfb2011e3d78a
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d85ff11…
Author: Miklos Tirpak <miklos(a)iptel.org>
Committer: Miklos Tirpak <miklos(a)iptel.org>
Date: Wed Oct 20 15:32:18 2010 +0200
cfg framework: segfault during exit is fixed
Verify that *cfg_global is not NULL when destroying the
configuration.
t_set_fr("@cfg_get.local.invite_timeout", "@cfg_get.local.gw_timeout");
caused a segfault during startup when the variable was not defined.
Reported by Juha Heinanen
---
cfg/cfg_struct.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cfg/cfg_struct.c b/cfg/cfg_struct.c
index f2f5bfe..11a825d 100644
--- a/cfg/cfg_struct.c
+++ b/cfg/cfg_struct.c
@@ -333,7 +333,7 @@ void cfg_destroy(void)
cfg_ctx_destroy();
/* free the list of groups */
- cfg_destory_groups(cfg_global ? (*cfg_global)->vars : NULL);
+ cfg_destory_groups((cfg_global && (*cfg_global)) ? (*cfg_global)->vars : NULL);
/* free the select list */
cfg_free_selects();
On Monday 18 October 2010, Nicolas Rüger wrote:
> [..]
> I'd like to add some functionality to the userblacklist module and
> therefore I'd like to modify the function
>
> check_blacklist ([string table])
>
> because I need a check for the CALLER's URI _instead_ of the CALLEE's URI.
Hello Nicolas,
i understand. At the moment this function does not support parameters, but
patches are of course welcome. :-)
> I want to change that for me, as I do deal with SPIT-prevention and I need
> a global_list to be able to block or delay some caller's URIs globally and
> whitelist others (like hospitals and stuff) for incoming calls.
> [..]
> I had a look at "userblacklist.c" and I guess that's the one to patch. My
> idea is to implement the changes and name the method "check_blacklist1()".
>
> Here it seems the the URI that's checked is stored in "req_number".
>
> [...]
>
> if ((parse_sip_msg_uri(msg) < 0) || (!msg->parsed_uri.user.s) ||
> (msg->parsed_uri.user.len > MAXNUMBERLEN)) { LM_ERR("cannot parse msg
> URI\n");
> return -1;
> }
> strncpy(req_number, msg->parsed_uri.user.s, msg->parsed_uri.user.len);
>
> [...]
>
>
> I guess I have to change "msg->parsed_uri.user.s" to something that returns
> the CALLER instead of the CALLEE!?
You could indeed change the c-code like this.
> I had a look at the struct "sip_uri" (in msg_parser.h) because that's the
> type of variable "parsed_uri" and found the following...
> [..]
> So user is just a string (pointer to first char + length) and so it seems I
> have even to replace "parsed_uri" by something else.
>
> Then I had a look to struct "sip_msg" (in msg_parser.h) as it's the type of
> "msg" and next level of abstraction. There I found...
> [..]
> Another idea is to extend the parameter array of "check_blacklist()" so
> that one can pass the URI which has to be checked as an extra parameter.
>
> What do you think is the better way???
I'd think that adding functionality to parse arbitrary parameter is the better
and more flexible way instead of the req_number change you proposed above.
Take a look to the check_userblacklist functions to get some ideas for the
implementation.
> Furthermore I need a function that checks the global list for whitelisted
> entries.
>
> The flag "whitelist" is already present but there's no method to query it,
> as "check_blacklist()" returns true, when the prefix is whitelisted and
> the same when it's not on the list (so there's no way to distinguish
> between both possibilities yet)
Maybe you would like to add some functionality like the check_userwhitelist
functionality, for the check_blacklist function?
Regards,
Henning
Hi,
avpops module documentation still mentions onreply_avp_mode which is
obsolete now:
http://kamailio.org/docs/modules/3.1.x/modules/avpops.html
<<AVPs are persistent per SIP transaction, being available in "route",
"branch_route" and "failure_route". To make them available in
"onreply_route" armed via TM module, set "onreply_avp_mode" parameter of
TM module (note that in the default "onreply_route", the AVPs of the
transaction are not available).>>
Please remove the references. Thank you.
--
Sincerely,
Andrew Pogrebennyk
i added Docbook documentation line for 3.1 branch on page
http://sip-router.org/wiki/start#cookbooks
i was not able to do the same regarding Cookbooks, where only master
version seems to be available. perhaps 3.0 and 3.1 versions are
somewhere, but i didn't find them.
-- juha