Hi Martin,
as it is on cvs, the DB connection is mandatory for the uri module - it
is not a requirement, but a design choice.
I attached a small patch (for 0.8.14) which will allow you to set the
module parameter "db_url" to an empty value/string and to disable the DB
support. Use:
modparam("uri", "db_url", "" )
NOTE that the functions "does_uri_exist()" and "is_user()" (in
combination with "use_uri_table" parameter) will not work in this case.
Please let me know if it works for you.
Best regards,
Marian Dumitru
Martin Koenig wrote:
Hi list,
I need to setup a radius-only ser. Is it possible to make use of the
check_to and check_from functions from the uri.so module without loading a
mysql or other database module?
Thank you,
regards,
Martin
_______________________________________________
Serusers mailing list
serusers(a)lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serusers
--
Voice Sistem
http://www.voice-sistem.ro
Index: modules/uri/checks.c
===================================================================
RCS file: /cvsroot/ser/sip_router/modules/uri/checks.c,v
retrieving revision 1.10.6.2
diff -u -r1.10.6.2 checks.c
--- modules/uri/checks.c 20 Feb 2004 00:39:55 -0000 1.10.6.2
+++ modules/uri/checks.c 13 Oct 2004 15:43:55 -0000
@@ -265,6 +265,11 @@
db_key_t cols[1];
db_res_t* res;
+ if (db_handle == 0) {
+ LOG(L_ERR, "does_uri_exist(): database support not enabled\n");
+ return -1;
+ }
+
if (parse_sip_msg_uri(_msg) < 0) {
LOG(L_ERR, "does_uri_exist(): Error while parsing URI\n");
return -1;
Index: modules/uri/uri_mod.c
===================================================================
RCS file: /cvsroot/ser/sip_router/modules/uri/uri_mod.c,v
retrieving revision 1.12.6.2
diff -u -r1.12.6.2 uri_mod.c
--- modules/uri/uri_mod.c 20 Feb 2004 00:39:55 -0000 1.12.6.2
+++ modules/uri/uri_mod.c 13 Oct 2004 15:43:55 -0000
@@ -124,6 +124,10 @@
*/
static int child_init(int rank)
{
+ if (db_url==0) {
+ DBG("uri:init_child(%d): not using database\n", rank);
+ return 0;
+ }
db_handle = db_init(db_url);
if (!db_handle) {
LOG(L_ERR, "uri:init_child(%d): Unable to connect database\n", rank);
@@ -141,7 +145,15 @@
{
DBG("uri - initializing\n");
- if (bind_dbmod()) {
+ if (strlen(db_url)==0) {
+ if (use_uri_table) {
+ LOG(L_ERR, "uri:mod_init(): database disabled, "
+ "\"use_uri_table\" set -> conflict\n");
+ return -1;
+ }
+ DBG("uri:mod_init(): not binding to database module\n");
+ db_url = 0;
+ } else if (bind_dbmod()) {
LOG(L_ERR, "uri:mod_init(): No database module found\n");
return -1;
}