Module: kamailio
Branch: master
Commit: fcedbd7099a15e09d1dd21c933f3ebfe3c55f5c5
URL: https://github.com/kamailio/kamailio/commit/fcedbd7099a15e09d1dd21c933f3ebf…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2025-04-22T07:34:29+08:00
app_python3s: update docs for threads_mode parameter
---
Modified: src/modules/app_python3s/doc/app_python3s_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/fcedbd7099a15e09d1dd21c933f3ebf…
Patch: https://github.com/kamailio/kamailio/commit/fcedbd7099a15e09d1dd21c933f3ebf…
---
diff --git a/src/modules/app_python3s/doc/app_python3s_admin.xml b/src/modules/app_python3s/doc/app_python3s_admin.xml
index 8381dda274f..bb9e86c8c5c 100644
--- a/src/modules/app_python3s/doc/app_python3s_admin.xml
+++ b/src/modules/app_python3s/doc/app_python3s_admin.xml
@@ -160,6 +160,10 @@ def ksr_script_child_init():
v6.0.x). If set to 0, use PyGILState_Ensure()/PyGILState_Release()
(the mode implemented initially).
</para>
+ <para>
+ If set to 1, Python threading Thread objects created in the KEMI script will be scheduled. Otherwise,
+ additional Python threads will not be scheduled (no release of GIL).
+ </para>
<para>
<emphasis>
Default value is <quote>0</quote>.
Module: kamailio
Branch: master
Commit: 168d289ebd6daadf58199f4461ef7cd30dc7442a
URL: https://github.com/kamailio/kamailio/commit/168d289ebd6daadf58199f4461ef7cd…
Author: S-P Chan <shihping.chan(a)gmail.com>
Committer: S-P Chan <shihping.chan(a)gmail.com>
Date: 2025-04-22T07:34:29+08:00
app_python3: update docs for threads_mode parameter
---
Modified: src/modules/app_python3/doc/app_python3_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/168d289ebd6daadf58199f4461ef7cd…
Patch: https://github.com/kamailio/kamailio/commit/168d289ebd6daadf58199f4461ef7cd…
---
diff --git a/src/modules/app_python3/doc/app_python3_admin.xml b/src/modules/app_python3/doc/app_python3_admin.xml
index 87b97f0824d..20eeae6ffce 100644
--- a/src/modules/app_python3/doc/app_python3_admin.xml
+++ b/src/modules/app_python3/doc/app_python3_admin.xml
@@ -168,6 +168,10 @@ modparam("app_python3", "child_init_method", "my_child_init")
v6.0.x). If set to 0, use PyGILState_Ensure()/PyGILState_Release()
(the mode implemented initially).
</para>
+ <para>
+ If set to 1, Python threading Thread objects created in the KEMI script will be scheduled. Otherwise,
+ additional Python threads will not be scheduled (no release of GIL).
+ </para>
<para>
<emphasis>
Default value is <quote>0</quote>.
### Description
if multiple sip websocket clients are subscribed to some UA and one of the watchers suddenly disappears (e.g. the web page is reloaded), then no NOTIFY is ever sent after issuing a `pres_refresh_watchers()`.
The following error is logged:
```
WARNING: <core> [core/msg_translator.c:3007]: via_builder(): TCP/TLS connection (id: 0) for WebSocket could not be found
ERROR: tm [t_msgbuilder.c:1423]: assemble_via(): via building failed
ERROR: tm [t_msgbuilder.c:1614]: build_uac_req(): error while assembling Via
ERROR: tm [uac.c:552]: t_uac_prepare(): Error while building message
ERROR: presence [notify.c:1734]: send_notify_request(): in function tm t_request_within()
ERROR: presence [notify.c:1829]: notify(): sending Notify not successful
ERROR: presence [notify.c:1585]: query_db_notify(): Could not send notify for [event]=dialog
ERROR: presence [presence.c:739]: pres_refresh_watchers(): sending Notify requests
```
### Troubleshooting
when the client disconnects, the old watcher is not removed from the active_watchers table, instead it coexists with the new one, but the stale connection causes the error above when sending the notify, and then all of the following watchers (even the valid ones) are skipped too.
Looking at the logs, the valid watchers are not notified because the while loop [here](https://github.com/kamailio/kamailio/blob/b96bc11a54f11ec688429c057bf… is skipped because of the `goto done` line in case of errors, which happens because it fails to build the via header for the message relevant to the stale websocket connection.
By breaking out of the while loop, the remaining subs in the `subs_array` are skipped.
#### Reproduction
Just subscribe to a sip client using a websocket-based phone, then abruptly disconnect it (e.g. by reloading the web page) and then issue a `pres_refresh_watchers()` to make it generate a notify.
#### Debugging Data
#### Log Messages
#### SIP Traffic
### Possible Solutions
I tried to use the "websocket:closed" route to purge stale connections, but to my knowledge there are no APIs to clean invalid watchers.
A possible solution could be to automatically remove the watchers on disconnection and maybe skip the invalid ones without exiting from the refresh loop
### Additional Information
kamailio 5.8.2
* **Operating System**:
Rocky Linux 9
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4118
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4118(a)github.com>
Documentation https://www.kamailio.org/docs/modules/devel/modules/tm.html#tm.p.fr_timer says:
>Timer which hits if no **final reply** for a request or ACK for a negative INVITE reply arrives (in milliseconds).
Looks like it is not correct description - fr_timer value works until 1xx(not **final**) response received and then timer restarted with fr_inv_timer value there:
https://github.com/kamailio/kamailio/blob/master/src/modules/tm/t_reply.c#L…
Looks like old doc from sip router https://sip-router.org/wiki/ref_manual/timers explains it correctly:
> fr_timer
This timer is used for all SIP requests. It hits if no reply for an INVITE request or other request has been received (F in milliseconds). If a provisional reply is received for an INVITE (any 1xx), then the fr_inv_timer will be used instead. And if no replies (at all) for an INVITE are received before `fr_timer` hits, the transaction is terminated with a 408 in failure route.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3939
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3939(a)github.com>
space88man created an issue (kamailio/kamailio#4216)
### Description
Use cfgengine python and KSR.cfgutils.unlock
### Troubleshooting
#### Reproduction
In cfgengine python call
```
KSR.cfgutils.lock("something")
# do some work
KSR.cfgutils.unlock("something")
```
#### Debugging Data
n/a
#### Log Messages
```ERROR: app_python3 [apy_kemi.c:278]: sr_apy_kemi_exec_func_ex(): invalid number of parameters - idx: 1 argc: 1
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 6.0.1 (x86_64/linux) fce50d
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: fce50d
compiled on 17:27:30 Mar 29 2025 with gcc 8.5.0
```
* **Operating System**:
```
AlmaLinux 9.5 x86_64
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4216
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4216(a)github.com>