Hi to all, It's mentioned in the Permissions module doc, we can set DB driver:https://kamailio.org/docs/modules/3.1.x/modules_k/permissions.html#id2511783
So we can use MongoDB as a DB backend? All the modules that use DB, support Mongo? Thanks. Regards,Hossein
Hello,
This should work, yes. With a few exceptions you can use all existing modules that needs a database with the mongodb backend. (Some special module functions might need certain capabilities that not all database drivers are able to provide. Usually, you will get a message during Kamailio startup with an error message if something is not supported).
Cheers,
Henning
-- Henning Westerholt – https://skalatan.de/blog/ Kamailio services – https://gilawa.comhttps://gilawa.com/
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of H Yavari Sent: Saturday, February 6, 2021 6:25 AM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: [SR-Users] Permissions module with Mongodb
Hi to all,
It's mentioned in the Permissions module doc, we can set DB driver: https://kamailio.org/docs/modules/3.1.x/modules_k/permissions.html#id2511783
So we can use MongoDB as a DB backend? All the modules that use DB, support Mongo?
Thanks.
Regards, Hossein
Thanks Henning. The problem is "version" checking.I created a collection "version" in Mongo for address, trusted, and permissions with value=6 but Kamailio doesn't start:Feb 6 19:41:36 kamailio-sip kamailio[12400]: 0(12402) ERROR: <core> [db.c:466]: db_check_table_version(): invalid version 0 for table address found, expected 6 (check table structure and table "version")Feb 6 19:41:36 kamailio-sip kamailio[12400]: 0(12402) ERROR: permissions [address.c:484]: init_addresses(): Error during version check for db table: address, check database structure.Feb 6 19:41:36 kamailio-sip kamailio[12400]: 0(12402) ERROR: permissions [permissions.c:645]: mod_init(): failed to initialize the allow_address functionFeb 6 19:41:36 kamailio-sip kamailio[12400]: 0(12402) ERROR: <core> [core/sr_module.c:849]: init_mod(): Error while initializing module permissions (/opt/kamailio/lib64/kamailio/modules/permissions.so) and this is cfg file: ..modparam("permissions", "db_url", "mongodb://X.Y.W.Z/kamailio") .. Any idea what is wrong in configs?
BR,Hossein
---- On Saturday, February 6, 2021, 02:28:27 AM PST, Henning Westerholt hw@skalatan.de wrote: Hello,
This should work, yes. With a few exceptions you can use all existing modules that needs a database with the mongodb backend. (Some special module functions might need certain capabilities that not all database drivers are able to provide. Usually, you will get a message during Kamailio startup with an error message if something is not supported).
Cheers,
Henning
Hi - This may not be a correct solution, but it might help you move forward.
modparam("permissions", "version_table", 0)
Thanks Jeremy, But as I see in logs, it can't set this parameter! Anybody did it before? using Mongo for these modules. BR,Hossein
On Saturday, February 6, 2021, 01:39:09 PM PST, Jeremy McNamara mcnamara.jeremy@gmail.com wrote:
Hi - This may not be a correct solution, but it might help you move forward. modparam("permissions", "version_table", 0) _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hmm... I know I used that trick for usrloc about a decade ago :)
Have you discovered the mongo schema files located here: https://github.com/kamailio/kamailio/tree/master/utils/kamctl/mongodb/kamail... I did a quick scan through and it seems everything should be there. (Do you see a version table in your mongodb?)
-J
On Sat, Feb 6, 2021 at 6:14 PM H Yavari hyavari@rocketmail.com wrote:
Thanks Jeremy,
But as I see in logs, it can't set this parameter!
Anybody did it before? using Mongo for these modules.
BR, Hossein
On Saturday, February 6, 2021, 01:39:09 PM PST, Jeremy McNamara < mcnamara.jeremy@gmail.com> wrote:
Hi - This may not be a correct solution, but it might help you move forward.
modparam("permissions", "version_table", 0)
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Thanks for the reply.But I have the version now like this, and get the error!
Any idea? Regards,Hossein ---- On Sunday, February 7, 2021, 09:25:12 AM PST, Jeremy McNamara mcnamara.jeremy@gmail.com wrote:
Hmm... I know I used that trick for usrloc about a decade ago :) Have you discovered the mongo schema files located here: https://github.com/kamailio/kamailio/tree/master/utils/kamctl/mongodb/kamail... did a quick scan through and it seems everything should be there. (Do you see a version table in your mongodb?)
-J
On Sat, Feb 6, 2021 at 6:14 PM H Yavari hyavari@rocketmail.com wrote:
Thanks Jeremy, But as I see in logs, it can't set this parameter! Anybody did it before? using Mongo for these modules. BR,Hossein
On Saturday, February 6, 2021, 01:39:09 PM PST, Jeremy McNamara mcnamara.jeremy@gmail.com wrote:
Hi - This may not be a correct solution, but it might help you move forward. modparam("permissions", "version_table", 0) _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello,
can you see on the mongoDB level (e.g. with query debugging) what query is actually done on the server? This might help to debug the problem.
Cheers,
Henning
-- Henning Westerholt – https://skalatan.de/blog/ Kamailio services – https://gilawa.comhttps://gilawa.com/
From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of H Yavari Sent: Sunday, February 7, 2021 10:10 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] Permissions module with Mongodb
Thanks for the reply. But I have the version now like this, and get the error!
[Inline image]
Any idea?
Regards, Hossein
----
On Sunday, February 7, 2021, 09:25:12 AM PST, Jeremy McNamara <mcnamara.jeremy@gmail.commailto:mcnamara.jeremy@gmail.com> wrote:
Hmm... I know I used that trick for usrloc about a decade ago :)
Have you discovered the mongo schema files located here: https://github.com/kamailio/kamailio/tree/master/utils/kamctl/mongodb/kamail... I did a quick scan through and it seems everything should be there. (Do you see a version table in your mongodb?)
-J
On Sat, Feb 6, 2021 at 6:14 PM H Yavari <hyavari@rocketmail.commailto:hyavari@rocketmail.com> wrote: Thanks Jeremy,
But as I see in logs, it can't set this parameter!
Anybody did it before? using Mongo for these modules.
BR, Hossein
On Saturday, February 6, 2021, 01:39:09 PM PST, Jeremy McNamara <mcnamara.jeremy@gmail.commailto:mcnamara.jeremy@gmail.com> wrote:
Hi - This may not be a correct solution, but it might help you move forward.
modparam("permissions", "version_table", 0)
_______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.orgmailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hello,
jumping in to add another hint: run kamailio with debug=3 in kamailio.cfg and look at the syslog file, iirc, the db_mongodb should print many details when doing queries and then you may get a clue of what happens. If not, send over here all the log messages printed by kamailio in such case and we can take a look.
Cheers, Daniel
On 08.02.21 11:56, Henning Westerholt wrote:
Hello,
can you see on the mongoDB level (e.g. with query debugging) what query is actually done on the server? This might help to debug the problem.
Cheers,
Henning
--
Henning Westerholt – https://skalatan.de/blog/ https://skalatan.de/blog/
Kamailio services – https://gilawa.com https://gilawa.com/
*From:* sr-users sr-users-bounces@lists.kamailio.org *On Behalf Of *H Yavari *Sent:* Sunday, February 7, 2021 10:10 PM *To:* Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org *Subject:* Re: [SR-Users] Permissions module with Mongodb
Thanks for the reply.
But I have the version now like this, and get the error!
Inline image
Any idea?
Regards,
Hossein
On Sunday, February 7, 2021, 09:25:12 AM PST, Jeremy McNamara <mcnamara.jeremy@gmail.com mailto:mcnamara.jeremy@gmail.com> wrote:
Hmm... I know I used that trick for usrloc about a decade ago :)
Have you discovered the mongo schema files located here: https://github.com/kamailio/kamailio/tree/master/utils/kamctl/mongodb/kamail... https://github.com/kamailio/kamailio/tree/master/utils/kamctl/mongodb/kamailio
I did a quick scan through and it seems everything should be there. (Do you see a version table in your mongodb?)
-J
On Sat, Feb 6, 2021 at 6:14 PM H Yavari <hyavari@rocketmail.com mailto:hyavari@rocketmail.com> wrote:
Thanks Jeremy, But as I see in logs, it can't set this parameter! Anybody did it before? using Mongo for these modules. BR, Hossein On Saturday, February 6, 2021, 01:39:09 PM PST, Jeremy McNamara <mcnamara.jeremy@gmail.com <mailto:mcnamara.jeremy@gmail.com>> wrote: Hi - This may not be a correct solution, but it might help you move forward. modparam("permissions", "version_table", 0) _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users> _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Dear Daniel, Thanks for reply. Obviously, there is a problem in my collection, is there any how-to for it? kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:973]: db_mongodb_query(): query to collection [version]kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:1007]: db_mongodb_query(): query filter: { "table_name" : "address" }kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:1043]: db_mongodb_query(): columns filter: { "projection" : { "table_version" : 1 } }kamailio[1206]: 0(1208) DEBUG: <core> [db_res.c:119]: db_new_result(): allocate 56 bytes for result set at 0x7ff37023bce0kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:851]: db_mongodb_store_result(): no result from mongodbkamailio[1206]: 0(1208) DEBUG: <core> [db.c:407]: db_table_version(): no row for table address foundkamailio[1206]: 0(1208) ERROR: <core> [db.c:466]: db_check_table_version(): invalid version 0 for table address found, expected 6 (check table structure and table "version") What I miss? Regards,Hossein
On Monday, February 8, 2021, 10:12:51 AM PST, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
jumping in to add another hint: run kamailio with debug=3 in kamailio.cfg and look at the syslog file, iirc, the db_mongodb should print many details when doing queries and then you may get a clue of what happens. If not, send over here all the log messages printed by kamailio in such case and we can take a look.
Cheers, Daniel
On 08.02.21 11:56, Henning Westerholt wrote:
Hello,
can you see on the mongoDB level (e.g. with query debugging) what query is actually done on the server? This might help to debug the problem.
Cheers,
Henning
Hello,
maybe the version collection was not created properly -- have you read the guidelines from next link?
* https://www.kamailio.org/wiki/tutorials/kamailio-and-mongodb
Cheers, Daniel
On 09.02.21 08:00, H Yavari wrote:
Dear Daniel,
Thanks for reply.
Obviously, there is a problem in my collection, is there any how-to for it?
kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:973]: db_mongodb_query(): query to collection [version] kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:1007]: db_mongodb_query(): query filter: { "table_name" : "address" } kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:1043]: db_mongodb_query(): columns filter: { "projection" : { "table_version" : 1 } } kamailio[1206]: 0(1208) DEBUG: <core> [db_res.c:119]: db_new_result(): allocate 56 bytes for result set at 0x7ff37023bce0 kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:851]: db_mongodb_store_result(): no result from mongodb kamailio[1206]: 0(1208) DEBUG: <core> [db.c:407]: db_table_version(): no row for table address found kamailio[1206]: 0(1208) ERROR: <core> [db.c:466]: db_check_table_version(): invalid version 0 for table address found, expected 6 (check table structure and table "version")
What I miss?
Regards, Hossein
On Monday, February 8, 2021, 10:12:51 AM PST, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
jumping in to add another hint: run kamailio with debug=3 in kamailio.cfg and look at the syslog file, iirc, the db_mongodb should print many details when doing queries and then you may get a clue of what happens. If not, send over here all the log messages printed by kamailio in such case and we can take a look.
Cheers, Daniel
On 08.02.21 11:56, Henning Westerholt wrote:
Hello,
can you see on the mongoDB level (e.g. with query debugging) what query is actually done on the server? This might help to debug the problem.
Cheers,
Henning
--
Henning Westerholt – https://skalatan.de/blog/ https://skalatan.de/blog/
Kamailio services – https://gilawa.com https://gilawa.com/
*From:* sr-users sr-users-bounces@lists.kamailio.org mailto:sr-users-bounces@lists.kamailio.org *On Behalf Of *H Yavari *Sent:* Sunday, February 7, 2021 10:10 PM *To:* Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org *Subject:* Re: [SR-Users] Permissions module with Mongodb
Thanks for the reply.
But I have the version now like this, and get the error!
Any idea?
Regards,
Hossein
On Sunday, February 7, 2021, 09:25:12 AM PST, Jeremy McNamara <mcnamara.jeremy@gmail.com mailto:mcnamara.jeremy@gmail.com> wrote:
Hmm... I know I used that trick for usrloc about a decade ago :)
Have you discovered the mongo schema files located here: https://github.com/kamailio/kamailio/tree/master/utils/kamctl/mongodb/kamail... https://github.com/kamailio/kamailio/tree/master/utils/kamctl/mongodb/kamailio
I did a quick scan through and it seems everything should be there. (Do you see a version table in your mongodb?)
-J
On Sat, Feb 6, 2021 at 6:14 PM H Yavari <hyavari@rocketmail.com mailto:hyavari@rocketmail.com> wrote:
Thanks Jeremy, But as I see in logs, it can't set this parameter! Anybody did it before? using Mongo for these modules. BR, Hossein On Saturday, February 6, 2021, 01:39:09 PM PST, Jeremy McNamara <mcnamara.jeremy@gmail.com <mailto:mcnamara.jeremy@gmail.com>> wrote: Hi - This may not be a correct solution, but it might help you move forward. modparam("permissions", "version_table", 0) _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users> _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla -- www.asipto.com http://www.asipto.com www.twitter.com/miconda http://www.twitter.com/miconda -- www.linkedin.com/in/miconda http://www.linkedin.com/in/miconda Funding: https://www.paypal.me/dcmierla https://www.paypal.me/dcmierla _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi Daniel, I investigated a little and find something: db.version.find() doesn't run. It seems Mongo has a problem with the name of "version" and it says: 2021-02-09T00:16:57.333-0800 E QUERY [js] TypeError: db.version.find is not a function :
I am using: The server version:4.2.12Mongo-C version:1.17.4 Do you have any idea? is there any hint about versions?
BR,Hossein
-- On Monday, February 8, 2021, 11:32:57 PM PST, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
maybe the version collection was not created properly -- have you read the guidelines from next link?
* https://www.kamailio.org/wiki/tutorials/kamailio-and-mongodb
Cheers, Daniel
On 09.02.21 08:00, H Yavari wrote:
Dear Daniel, Thanks for reply. Obviously, there is a problem in my collection, is there any how-to for it? kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:973]: db_mongodb_query(): query to collection [version] kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:1007]: db_mongodb_query(): query filter: { "table_name" : "address" } kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:1043]: db_mongodb_query(): columns filter: { "projection" : { "table_version" : 1 } } kamailio[1206]: 0(1208) DEBUG: <core> [db_res.c:119]: db_new_result(): allocate 56 bytes for result set at 0x7ff37023bce0 kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:851]: db_mongodb_store_result(): no result from mongodb kamailio[1206]: 0(1208) DEBUG: <core> [db.c:407]: db_table_version(): no row for table address found kamailio[1206]: 0(1208) ERROR: <core> [db.c:466]: db_check_table_version(): invalid version 0 for table address found, expected 6 (check table structure and table "version") What I miss? Regards, Hossein
On Monday, February 8, 2021, 10:12:51 AM PST, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
jumping in to add another hint: run kamailio with debug=3 in kamailio.cfg and look at the syslog file, iirc, the db_mongodb should print many details when doing queries and then you may get a clue of what happens. If not, send over here all the log messages printed by kamailio in such case and we can take a look.
Cheers, Daniel
On 08.02.21 11:56, Henning Westerholt wrote:
Hello,
can you see on the mongoDB level (e.g. with query debugging) what query is actually done on the server? This might help to debug the problem.
Cheers,
Henning
Hello,
hmm, that's interesting, used to be no problem with name "version", afaik, might be something specific to newer versions of mongodb. I think there is a function to retrieve the collection by name, but that requires changes in the c code, not sure when I will get time for it, maybe others can also take a look.
Meanwhile, the solution is to use a different name for the version table, you can set it via the core parameter:
- https://www.kamailio.org/wiki/cookbooks/5.4.x/core#version_table
Cheers, Daniel
On 09.02.21 09:17, H Yavari wrote:
Hi Daniel,
I investigated a little and find something: db.version.find() doesn't run. It seems Mongo has a problem with the name of "version" and it says:
2021-02-09T00:16:57.333-0800 E QUERY [js] TypeError: db.version.find is not a function :
I am using:
The server version: 4.2.12 Mongo-C version: 1.17.4
Do you have any idea? is there any hint about versions?
BR, Hossein
-- On Monday, February 8, 2021, 11:32:57 PM PST, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
maybe the version collection was not created properly -- have you read the guidelines from next link?
* https://www.kamailio.org/wiki/tutorials/kamailio-and-mongodb https://www.kamailio.org/wiki/tutorials/kamailio-and-mongodb
Cheers, Daniel
On 09.02.21 08:00, H Yavari wrote: Dear Daniel,
Thanks for reply.
Obviously, there is a problem in my collection, is there any how-to for it?
kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:973]: db_mongodb_query(): query to collection [version] kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:1007]: db_mongodb_query(): query filter: { "table_name" : "address" } kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:1043]: db_mongodb_query(): columns filter: { "projection" : { "table_version" : 1 } } kamailio[1206]: 0(1208) DEBUG: <core> [db_res.c:119]: db_new_result(): allocate 56 bytes for result set at 0x7ff37023bce0 kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:851]: db_mongodb_store_result(): no result from mongodb kamailio[1206]: 0(1208) DEBUG: <core> [db.c:407]: db_table_version(): no row for table address found kamailio[1206]: 0(1208) ERROR: <core> [db.c:466]: db_check_table_version(): invalid version 0 for table address found, expected 6 (check table structure and table "version")
What I miss?
Regards, Hossein
On Monday, February 8, 2021, 10:12:51 AM PST, Daniel-Constantin Mierla miconda@gmail.com mailto:miconda@gmail.com wrote:
Hello,
jumping in to add another hint: run kamailio with debug=3 in kamailio.cfg and look at the syslog file, iirc, the db_mongodb should print many details when doing queries and then you may get a clue of what happens. If not, send over here all the log messages printed by kamailio in such case and we can take a look.
Cheers, Daniel
On 08.02.21 11:56, Henning Westerholt wrote:
Hello,
can you see on the mongoDB level (e.g. with query debugging) what query is actually done on the server? This might help to debug the problem.
Cheers,
Henning
--
Henning Westerholt – https://skalatan.de/blog/ https://skalatan.de/blog/
Kamailio services – https://gilawa.com https://gilawa.com/
*From:* sr-users sr-users-bounces@lists.kamailio.org mailto:sr-users-bounces@lists.kamailio.org *On Behalf Of *H Yavari *Sent:* Sunday, February 7, 2021 10:10 PM *To:* Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org *Subject:* Re: [SR-Users] Permissions module with Mongodb
Thanks for the reply.
But I have the version now like this, and get the error!
Any idea?
Regards,
Hossein
On Sunday, February 7, 2021, 09:25:12 AM PST, Jeremy McNamara <mcnamara.jeremy@gmail.com mailto:mcnamara.jeremy@gmail.com> wrote:
Hmm... I know I used that trick for usrloc about a decade ago :)
Have you discovered the mongo schema files located here: https://github.com/kamailio/kamailio/tree/master/utils/kamctl/mongodb/kamail... https://github.com/kamailio/kamailio/tree/master/utils/kamctl/mongodb/kamailio
I did a quick scan through and it seems everything should be there. (Do you see a version table in your mongodb?)
-J
On Sat, Feb 6, 2021 at 6:14 PM H Yavari <hyavari@rocketmail.com mailto:hyavari@rocketmail.com> wrote:
Thanks Jeremy, But as I see in logs, it can't set this parameter! Anybody did it before? using Mongo for these modules. BR, Hossein On Saturday, February 6, 2021, 01:39:09 PM PST, Jeremy McNamara <mcnamara.jeremy@gmail.com <mailto:mcnamara.jeremy@gmail.com>> wrote: Hi - This may not be a correct solution, but it might help you move forward. modparam("permissions", "version_table", 0) _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users> _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla -- www.asipto.com http://www.asipto.com www.twitter.com/miconda http://www.twitter.com/miconda -- www.linkedin.com/in/miconda http://www.linkedin.com/in/miconda Funding: https://www.paypal.me/dcmierla https://www.paypal.me/dcmierla _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org mailto:sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Daniel-Constantin Mierla -- www.asipto.com http://www.asipto.com www.twitter.com/miconda http://www.twitter.com/miconda -- www.linkedin.com/in/miconda http://www.linkedin.com/in/miconda Funding: https://www.paypal.me/dcmierla https://www.paypal.me/dcmierla
Hi Daniel, It worked with different names like "versions".Please put it in your issue list for future release. Thank you. Regards,Hossein -- On Tuesday, February 9, 2021, 12:34:06 AM PST, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
hmm, that's interesting, used to be no problem with name "version", afaik, might be something specific to newer versions of mongodb. I think there is a function to retrieve the collection by name, but that requires changes in the c code, not sure when I will get time for it, maybe others can also take a look.
Meanwhile, the solution is to use a different name for the version table, you can set it via the core parameter:
- https://www.kamailio.org/wiki/cookbooks/5.4.x/core#version_table
Cheers, Daniel
On 09.02.21 09:17, H Yavari wrote:
Hi Daniel, I investigated a little and find something: db.version.find() doesn't run. It seems Mongo has a problem with the name of "version" and it says: 2021-02-09T00:16:57.333-0800 E QUERY [js] TypeError: db.version.find is not a function :
I am using: The server version: 4.2.12 Mongo-C version: 1.17.4 Do you have any idea? is there any hint about versions?
BR, Hossein
-- On Monday, February 8, 2021, 11:32:57 PM PST, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
maybe the version collection was not created properly -- have you read the guidelines from next link?
* https://www.kamailio.org/wiki/tutorials/kamailio-and-mongodb
Cheers, Daniel
On 09.02.21 08:00, H Yavari wrote:
Dear Daniel, Thanks for reply. Obviously, there is a problem in my collection, is there any how-to for it? kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:973]: db_mongodb_query(): query to collection [version] kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:1007]: db_mongodb_query(): query filter: { "table_name" : "address" } kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:1043]: db_mongodb_query(): columns filter: { "projection" : { "table_version" : 1 } } kamailio[1206]: 0(1208) DEBUG: <core> [db_res.c:119]: db_new_result(): allocate 56 bytes for result set at 0x7ff37023bce0 kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:851]: db_mongodb_store_result(): no result from mongodb kamailio[1206]: 0(1208) DEBUG: <core> [db.c:407]: db_table_version(): no row for table address found kamailio[1206]: 0(1208) ERROR: <core> [db.c:466]: db_check_table_version(): invalid version 0 for table address found, expected 6 (check table structure and table "version") What I miss? Regards, Hossein
On Monday, February 8, 2021, 10:12:51 AM PST, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
jumping in to add another hint: run kamailio with debug=3 in kamailio.cfg and look at the syslog file, iirc, the db_mongodb should print many details when doing queries and then you may get a clue of what happens. If not, send over here all the log messages printed by kamailio in such case and we can take a look.
Cheers, Daniel
On 08.02.21 11:56, Henning Westerholt wrote:
Hello,
can you see on the mongoDB level (e.g. with query debugging) what query is actually done on the server? This might help to debug the problem.
Cheers,
Henning