[sr-dev] Re: [kamailio/kamailio] db_mongodb: build warning on CentOS 10 (Issue #4037)

2024-11-30 Thread Daniel-Constantin Mierla via sr-dev
Pushed a new commit to address the last one, but had no option to test it. 
Reopen if it fails.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4037#issuecomment-2508905330
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] Re: [kamailio/kamailio] db_mongodb: build warning on CentOS 10 (Issue #4037)

2024-11-30 Thread Daniel-Constantin Mierla via sr-dev
Closed #4037 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4037#event-15480684679
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] Re: [kamailio/kamailio] Python exception handling (Issue #4045)

2024-11-30 Thread Daniel-Constantin Mierla via sr-dev
The second parameter for KSR.pv.sets(...)  must be a valid string. If you want 
to unset a pv, use KSR.ov.unset(...). For discussing further about using or 
configuring kamailio, use sr-us...@lists.kamailio.org mailing list.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4045#issuecomment-2508903978
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] Re: [kamailio/kamailio] Python exception handling (Issue #4045)

2024-11-30 Thread Daniel-Constantin Mierla via sr-dev
Closed #4045 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4045#event-15480676516
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] Re: [kamailio/kamailio] Python exception handling (Issue #4045)

2024-11-30 Thread Matthias Urlichs via sr-dev
Yes. I *know* that it must be a valid string. The problem is what happens if it 
is not. The Python exception that's raised in this case is accomoanied by your 
C code not returning NULL, and that's simply wrong according to the Python C 
interface documentation.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4045#issuecomment-2508912589
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] Re: [kamailio/kamailio] Python exception handling fixes (PR #4044)

2024-11-30 Thread Matthias Urlichs via sr-dev
You seem to have misunderstood me here. I am **not** trying to suppress the 
exception. I am trying to make sure that the programmer gets the **correct** 
exception (`TypeError`) handed to them.

The Python C interface documentation is pretty clear on this point. You MUST 
return NULL instead of a `PyObject*` when your C code has set an exception. The 
resulting `SystemError`, on top of the `TypeError` the calling Python code 
*should* be getting, is a pretty clear and unequivocal demonstration of this, 
and it even says what's wrong ("SystemError:  returned 
a result with an exception set"). See my bug report for the example stack trace.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4044#issuecomment-2508915041
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] Re: [kamailio/kamailio] Python exception handling fixes (PR #4044)

2024-11-30 Thread Matthias Urlichs via sr-dev
NB: Two years ago I found another example of this problem which was fixed in 
b7911b6.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4044#issuecomment-2508916716
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] Re: [kamailio/kamailio] race condition in load distribution Use call load distribution (Issue #4047)

2024-11-30 Thread Daniel-Constantin Mierla via sr-dev
Closed #4047 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4047#event-15480672474
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] Re: [kamailio/kamailio] race condition in load distribution Use call load distribution (Issue #4047)

2024-11-30 Thread Daniel-Constantin Mierla via sr-dev
Use sr-us...@lists.kamailio.org mailing list to discuss about using kamailio 
and its configuration file.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4047#issuecomment-2508903368
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] git:master:3991350b: ndb_mongodb: mongoc_collection_command_with_opts() for mongodb_cmd()

2024-11-30 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 3991350b1acdcd8b3cd575cdbc8932b4f8540e13
URL: 
https://github.com/kamailio/kamailio/commit/3991350b1acdcd8b3cd575cdbc8932b4f8540e13

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-11-30T10:39:20+01:00

ndb_mongodb: mongoc_collection_command_with_opts() for mongodb_cmd()

- mongoc_collection_command() is deprecated with lib v1.29.0
- GH #4037

---

Modified: src/modules/ndb_mongodb/mongodb_client.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/3991350b1acdcd8b3cd575cdbc8932b4f8540e13.diff
Patch: 
https://github.com/kamailio/kamailio/commit/3991350b1acdcd8b3cd575cdbc8932b4f8540e13.patch

---

diff --git a/src/modules/ndb_mongodb/mongodb_client.c 
b/src/modules/ndb_mongodb/mongodb_client.c
index dd48e5d471e..94d1b87500b 100644
--- a/src/modules/ndb_mongodb/mongodb_client.c
+++ b/src/modules/ndb_mongodb/mongodb_client.c
@@ -274,8 +274,24 @@ int mongodbc_exec_cmd(
bson_destroy(&reply);
} else {
if(emode == 1) {
+#if MONGOC_CHECK_VERSION(1, 29, 0)
+   opts = bson_new();
+   ret = mongoc_collection_command_with_opts(
+   rpl->collection, &command, NULL, opts, 
&reply, &error);
+   bson_free(opts);
+   if(!ret) {
+   LM_ERR("Failed to run command: %s\n", 
error.message);
+   bson_destroy(&command);
+   goto error_exec;
+   }
+   rpl->jsonrpl.s = _ksr_bson_as_json(&reply, NULL);
+   rpl->jsonrpl.len = (rpl->jsonrpl.s) ? 
strlen(rpl->jsonrpl.s) : 0;
+   bson_destroy(&reply);
+   goto done;
+#else
rpl->cursor = mongoc_collection_command(rpl->collection,
MONGOC_QUERY_NONE, 0, 0, 0, &command, 
NULL, 0);
+#endif
} else {
 #if MONGOC_CHECK_VERSION(1, 5, 0)
if(emode == 3)
@@ -313,6 +329,10 @@ int mongodbc_exec_cmd(
rpl->jsonrpl.len = (rpl->jsonrpl.s) ? strlen(rpl->jsonrpl.s) : 
0;
}
 
+#if MONGOC_CHECK_VERSION(1, 29, 0)
+done:
+#endif
+
LM_DBG("command result: [[%s]]\n",
(rpl->jsonrpl.s) ? rpl->jsonrpl.s : "");
 

___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] Re: [kamailio/kamailio] Python exception handling fixes (PR #4044)

2024-11-30 Thread Daniel-Constantin Mierla via sr-dev
I think the code is better how it is because the second parameter of the 
function you gave as example in the issue has to be a valid string. In the 
current form, it indicates there is a problem with the parameter, rather than 
having it silently not doing anything when it was expected to be a change of 
the value. As commented in the issue, use sr-users mailing list if you want to 
discuss further.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4044#issuecomment-2508904860
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!


[sr-dev] Re: [kamailio/kamailio] Python exception handling fixes (PR #4044)

2024-11-30 Thread Daniel-Constantin Mierla via sr-dev
Closed #4044.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4044#event-15480681866
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!