### Description
kemi python3: exception occur when import logging module
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Reproduction
very simple to reproduce is add this line to python kemi file
```
import logging
```
#### Debugging Data
```
(paste your debugging data here)
```
#### Log Messages
```
0(49) INFO: <core> [core/tcp_main.c:4983]: init_tcp(): using epoll_lt as the io watch method (auto detected)
0(49) WARNING: outbound [outbound_mod.c:121]: mod_init(): "stun" module is not loaded. STUN is required to use outbound with UDP.
0(49) INFO: <core> [core/kemi.c:105]: sr_kemi_core_info(): KAMAILIO PYTHON3 APPLICATION INSTANTIATE CLASS OBJECT
0(49) INFO: <core> [core/kemi.c:105]: sr_kemi_core_info(): KAMAILIO INITIATION
0(49) INFO: <core> [main.c:3030]: main(): processes (at least): 25 - shm size: 268435456 - pkg size: 16777216
0(49) INFO: <core> [core/udp_server.c:154]: probe_max_receive_buffer(): SO_RCVBUF is initially 212992
0(49) INFO: <core> [core/udp_server.c:206]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984
Exception ignored in: <function _releaseLock at 0x7fb7ed1d3f28>
Traceback (most recent call last):
File "/usr/lib/python3.7/logging/__init__.py", line 226, in _releaseLock
_lock.release()
RuntimeError: cannot release un-acquired lock
Ignoring exception from logging atfork <_StderrHandler <stderr> (WARNING)> release method: cannot release un-acquired lock
1(50) INFO: <core> [core/kemi.c:105]: sr_kemi_core_info(): KAMAILIO CHILD PROCESS INITIALIZED 1
Exception ignored in: <function _releaseLock at 0x7fb7ed1d3f28>
Traceback (most recent call last):
File "/usr/lib/python3.7/logging/__init__.py", line 226, in _releaseLock
Exception ignored in: <function _releaseLock at 0x7fb7ed1d3f28>
Traceback (most recent call last):
File "/usr/lib/python3.7/logging/__init__.py", line 226, in _releaseLock
Exception ignored in: <function _releaseLock at 0x7fb7ed1d3f28>
Traceback (most recent call last):
File "/usr/lib/python3.7/logging/__init__.py", line 226, in _releaseLock
_lock.release()
Exception ignored in: <function _releaseLock at 0x7fb7ed1d3f28>
Traceback (most recent call last):
File "/usr/lib/python3.7/logging/__init__.py", line 226, in _releaseLock
_lock.release()
_lock.release()
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your sip traffic here)
```
### 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`
Test on `5.5.2` and `5.4.7` both occur the issue
```
root@c011e17b1e00:/opt/siproxy# kamailio -v
version: kamailio 5.5.2 (x86_64/linux) 55e232
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, 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_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 55e232
compiled on 11:54:55 Oct 14 2021 with gcc 8.3.0
```
```
root@sgcoordinator1:/opt# kamailio -v
version: kamailio 5.4.5 (x86_64/linux) c46342
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, 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_BLACKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_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: c46342
compiled on 07:26:04 Jul 23 2021 with gcc 8.3.0
```
* **Operating System**:
occur on debian or docker as well
```
Linux c011e17b1e00 5.10.47-linuxkit #1 SMP Sat Jul 3 21:51:47 UTC 2021 x86_64 GNU/Linux
Linux machine 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2885
Hello everyone
I’m new in siremis as web interface of kamailio and I immediately need your help,I installed kamailio and siremis and login in siremis web interface,I can work with it but now I have a problem.
I want to change menu language there is an option in(setting->translate->manage languages) add my desired language and click save and i see this error:
Error message: #2, count(): Parameter must be an array or an object that implements Countable
Script name and line number of error: /var/www/siremis-5.3.x/siremis/modules/translation/lib/LangPackCreator.php
github.com>
Module: kamailio
Branch: master
Commit: 99a9f27c8d24a06f201b4713f7a2bfeb37092482
URL: https://github.com/kamailio/kamailio/commit/99a9f27c8d24a06f201b4713f7a2bfe…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-12-19T17:55:55+01:00
misc/examples: kemi - update lua sample config
---
Modified: misc/examples/kemi/kamailio-basic-kemi-lua.lua
---
Diff: https://github.com/kamailio/kamailio/commit/99a9f27c8d24a06f201b4713f7a2bfe…
Patch: https://github.com/kamailio/kamailio/commit/99a9f27c8d24a06f201b4713f7a2bfe…
---
diff --git a/misc/examples/kemi/kamailio-basic-kemi-lua.lua b/misc/examples/kemi/kamailio-basic-kemi-lua.lua
index a406b6429c..7b1476efb1 100644
--- a/misc/examples/kemi/kamailio-basic-kemi-lua.lua
+++ b/misc/examples/kemi/kamailio-basic-kemi-lua.lua
@@ -80,18 +80,20 @@ function ksr_request_route()
return 1;
end
+ -- handle retransmissions
+ if not KSR.is_ACK() then
+ if KSR.tmx.t_precheck_trans()>0 then
+ KSR.tm.t_check_trans();
+ return 1;
+ end
+ if KSR.tm.t_check_trans()==0 then return 1 end
+ end
+
-- handle requests within SIP dialogs
ksr_route_withindlg();
-- -- only initial requests (no To tag)
- -- handle retransmissions
- if KSR.tmx.t_precheck_trans()>0 then
- KSR.tm.t_check_trans();
- return 1;
- end
- if KSR.tm.t_check_trans()==0 then return 1 end
-
-- authentication
ksr_route_auth();
@@ -158,6 +160,11 @@ end
-- Per SIP request initial checks
function ksr_route_reqinit()
+ -- no connect for sending replies
+ KSR.set_reply_no_connect();
+ -- enforce symmetric signaling
+ -- send back replies to the source address of request
+ KSR.force_rport();
if not KSR.is_myself_srcip() then
local srcip = KSR.kx.get_srcip();
if KSR.htable.sht_match_name("ipban", "eq", srcip) > 0 then
@@ -194,7 +201,7 @@ function ksr_route_reqinit()
KSR.x.exit();
end
- if KSR.sanity.sanity_check(1511, 7)<0 then
+ if KSR.sanity.sanity_check(17895, 7)<0 then
KSR.err("malformed SIP message from "
.. KSR.kx.get_srcip() .. ":" .. KSR.kx.get_srcport() .."\n");
KSR.x.exit();
@@ -319,7 +326,6 @@ function ksr_route_natdetect()
if not KSR.nathelper then
return 1;
end
- KSR.force_rport();
if KSR.nathelper.nat_uac_test(19)>0 then
if KSR.is_REGISTER() then
KSR.nathelper.fix_nated_register();
Module: kamailio
Branch: master
Commit: 03acf834a19689d6c3efcea93e48985d3e7ffc37
URL: https://github.com/kamailio/kamailio/commit/03acf834a19689d6c3efcea93e48985…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-12-16T09:44:54+01:00
core: parser - clang format parser_f.c
---
Modified: src/core/parser/parser_f.c
---
Diff: https://github.com/kamailio/kamailio/commit/03acf834a19689d6c3efcea93e48985…
Patch: https://github.com/kamailio/kamailio/commit/03acf834a19689d6c3efcea93e48985…
---
diff --git a/src/core/parser/parser_f.c b/src/core/parser/parser_f.c
index f1a532fd6f..c124f68cc5 100644
--- a/src/core/parser/parser_f.c
+++ b/src/core/parser/parser_f.c
@@ -15,8 +15,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
@@ -28,22 +28,27 @@
*/
-#include "parser_f.h"
+#include "parser_f.h"
#include "../ut.h"
/** @brief returns pointer to next line or after the end of buffer */
-char* eat_line(char* buffer, unsigned int len)
+char *eat_line(char *buffer, unsigned int len)
{
- char* nl;
+ char *nl;
/* jku .. replace for search with a library function; not conforming
as I do not care about CR
*/
- nl=(char *)q_memchr( buffer, '\n', len );
- if ( nl ) {
- if ( nl + 1 < buffer+len) nl++;
- if (( nl+1<buffer+len) && * nl=='\r') nl++;
- } else nl=buffer+len;
+ nl = (char *)q_memchr(buffer, '\n', len);
+ if(nl) {
+ if(nl + 1 < buffer + len) {
+ nl++;
+ }
+ if((nl + 1 < buffer + len) && *nl == '\r') {
+ nl++;
+ }
+ } else {
+ nl = buffer + len;
+ }
return nl;
}
-