kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
April 2021
----- 2025 -----
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
14 participants
304 discussions
Start a n
N
ew thread
git:master:0a2450e6: rtpengine: extract call-id/from-tag/to-tag only from sip messages
by Daniel-Constantin Mierla
30 Apr '21
30 Apr '21
Module: kamailio Branch: master Commit: 0a2450e62d77020243530e18d93c9aa8181a5701 URL:
https://github.com/kamailio/kamailio/commit/0a2450e62d77020243530e18d93c9aa…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-30T08:31:34+02:00 rtpengine: extract call-id/from-tag/to-tag only from sip messages - they can be provided via flags in function parameters - fix using functions in non-sip routing blocks (e.g., xhttp processing) --- Modified: src/modules/rtpengine/rtpengine.c --- Diff:
https://github.com/kamailio/kamailio/commit/0a2450e62d77020243530e18d93c9aa…
Patch:
https://github.com/kamailio/kamailio/commit/0a2450e62d77020243530e18d93c9aa…
--- diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c index a60de52a35..6f91c222b2 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -2477,17 +2477,19 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_ memset(&ng_flags, 0, sizeof(ng_flags)); - if (get_callid(msg, &ng_flags.call_id) == -1 || ng_flags.call_id.len == 0) { - LM_ERR("can't get Call-Id field\n"); - return NULL; - } - if (get_to_tag(msg, &ng_flags.to_tag) == -1) { - LM_ERR("can't get To tag\n"); - return NULL; - } - if (get_from_tag(msg, &ng_flags.from_tag) == -1 || ng_flags.from_tag.len == 0) { - LM_ERR("can't get From tag\n"); - return NULL; + if(IS_SIP(msg) || IS_SIP_REPLY(msg)) { + if (get_callid(msg, &ng_flags.call_id) == -1 || ng_flags.call_id.len == 0) { + LM_ERR("can't get Call-Id field\n"); + return NULL; + } + if (get_to_tag(msg, &ng_flags.to_tag) == -1) { + LM_ERR("can't get To tag\n"); + return NULL; + } + if (get_from_tag(msg, &ng_flags.from_tag) == -1 || ng_flags.from_tag.len == 0) { + LM_ERR("can't get From tag\n"); + return NULL; + } } if (bencode_buffer_init(bencbuf)) { LM_ERR("could not initialize bencode_buffer_t\n"); @@ -2535,6 +2537,18 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_ if (parse_flags(&ng_flags, msg, &op, flags_str)) goto error; + if(!IS_SIP(msg) && !IS_SIP_REPLY(msg)) { + /* check required values */ + if (ng_flags.call_id.len == 0) { + LM_ERR("can't get Call-Id field\n"); + return NULL; + } + if (ng_flags.from_tag.len == 0) { + LM_ERR("can't get From tag\n"); + return NULL; + } + } + /* trickle ice sdp fragment? */ if (cont_type == 3) bencode_list_add_string(ng_flags.flags, "fragment");
1
0
0
0
git:master:4695b48b: msrp: destroy str array on error
by Daniel-Constantin Mierla
30 Apr '21
30 Apr '21
Module: kamailio Branch: master Commit: 4695b48b23e22135049f67a6ef362e933a0cf337 URL:
https://github.com/kamailio/kamailio/commit/4695b48b23e22135049f67a6ef362e9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-30T08:03:10+02:00 msrp: destroy str array on error - some code reformatting --- Modified: src/modules/msrp/msrp_parser.c --- Diff:
https://github.com/kamailio/kamailio/commit/4695b48b23e22135049f67a6ef362e9…
Patch:
https://github.com/kamailio/kamailio/commit/4695b48b23e22135049f67a6ef362e9…
--- diff --git a/src/modules/msrp/msrp_parser.c b/src/modules/msrp/msrp_parser.c index 7defaf9353..c701d6a6ca 100644 --- a/src/modules/msrp/msrp_parser.c +++ b/src/modules/msrp/msrp_parser.c @@ -610,7 +610,7 @@ msrp_hdr_t *msrp_get_hdr_by_id(msrp_frame_t *mf, int hdrid) /** * */ -int msrp_explode_str(str **arr, str *in, str *del) +int msrp_explode_str(str_array_t *arr, str *in, str *del) { str *larr; int i; @@ -633,20 +633,20 @@ int msrp_explode_str(str **arr, str *in, str *del) } n++; - larr = pkg_malloc(n * sizeof(str)); + larr = pkg_mallocxz(n * sizeof(str)); if(larr==NULL) { LM_ERR("no more pkg\n"); return -1; } - memset(larr, 0, n * sizeof(str)); k = 0; if(n==1) { larr[k].s = in->s; larr[k].len = in->len; - *arr = larr; + arr->list = larr; + arr->size = n; return n; } @@ -657,19 +657,23 @@ int msrp_explode_str(str **arr, str *in, str *del) { if(in->s[i]==del->s[j]) { - if(k<n) + if(k<n) { larr[k].len = in->s + i - larr[k].s; + } k++; - if(k<n) + if(k<n) { larr[k].s = in->s + i + 1; + } break; } } } - if(k<n) + if(k<n) { larr[k].len = in->s + i - larr[k].s; + } - *arr = larr; + arr->list = larr; + arr->size = n; return n; } @@ -677,7 +681,7 @@ int msrp_explode_str(str **arr, str *in, str *del) /** * */ -int msrp_explode_strz(str **arr, str *in, char *del) +int msrp_explode_strz(str_array_t *arr, str *in, char *del) { str s; @@ -693,7 +697,7 @@ void msrp_str_array_destroy(void *data) return; arr = (str_array_t*)data; if(arr->list!=NULL) - pkg_free(arr->list); + pkg_free(arr->list); pkg_free(arr); } @@ -705,20 +709,19 @@ int msrp_parse_hdr_uri_list(msrp_hdr_t *hdr) str_array_t *arr; str s; - arr = pkg_malloc(sizeof(str_array_t)); + arr = pkg_mallocxz(sizeof(str_array_t)); if(arr==NULL) { LM_ERR("no more pkg\n"); return -1; } - memset(arr, 0, sizeof(str_array_t)); s = hdr->body; trim(&s); - arr->size = msrp_explode_strz(&arr->list, &s, " "); - if(arr->size<0) + if(msrp_explode_strz(arr, &s, " ")<0) { LM_ERR("failed to explode\n"); + msrp_str_array_destroy(arr); return -1; } hdr->parsed.flags |= MSRP_DATA_SET;
1
0
0
0
[kamailio/kamailio] Random crashes on tls_server.c:tls_h_tcpconn_clean_f() (#2638)
by Boris Korzun
29 Apr '21
29 Apr '21
### Description We've random crashes (approx one occurrence per day) on tls_h_tcpconn_clean_f(). ### Troubleshooting #### Reproduction The crash appears **sometimes** on closing TLS session (it doesn't have to be gracefully) initiated by remote edge. #### Debugging Data ``` (lldb) target create "/usr/local/sbin/kamailio" --core "/var/coredump/986/kamailio.51059.core" Core file '/var/coredump/986/kamailio.51059.core' (x86_64) was loaded. (lldb) bt * thread #1, name = 'kamailio', stop reason = signal SIGSEGV * frame #0: 0x0000000800a13cd4 libc.so.7`__je_large_dalloc(tsdn=0x0000000800d1a090, extent=0x0000000000000000) at jemalloc_large.c:346 frame #1: 0x0000000800a3acb7 libc.so.7`__free [inlined] rtree_leaf_elm_lookup(tsdn=0x0000000800d1a090, rtree=<unavailable>, rtree_ctx=<unavailable>, key=<unavailable>, dependent=true, init_missing=false) at rtree.h:337:6 frame #2: 0x0000000800a3acb2 libc.so.7`__free [inlined] rtree_read(tsdn=0x0000000800d1a090, rtree=<unavailable>, rtree_ctx=<unavailable>, key=<unavailable>, dependent=true) at rtree.h:406 frame #3: 0x0000000800a3acb2 libc.so.7`__free [inlined] rtree_extent_read(tsdn=0x0000000800d1a090, rtree=<unavailable>, rtree_ctx=<unavailable>, key=<unavailable>, dependent=true) at rtree.h:418 frame #4: 0x0000000800a3acb2 libc.so.7`__free [inlined] iealloc(tsdn=0x0000000800d1a090, ptr=0x00000008235782f0) at jemalloc_internal_inlines_b.h:82 frame #5: 0x0000000800a3acb2 libc.so.7`__free [inlined] arena_dalloc(tsdn=0x0000000800d1a090, ptr=0x00000008235782f0, tcache=0x0000000800cf4c80, alloc_ctx=<unavailable>, slow_path=false) at arena_inlines_b.h:236 frame #6: 0x0000000800a3ac91 libc.so.7`__free [inlined] idalloctm(tsdn=0x0000000800d1a090, ptr=0x00000008235782f0, tcache=0x0000000800cf4c80, alloc_ctx=<unavailable>, is_internal=false, slow_path=false) at jemalloc_internal_inlines_c.h:118 frame #7: 0x0000000800a3ac91 libc.so.7`__free [inlined] ifree(tsd=<unavailable>, ptr=0x00000008235782f0, tcache=0x0000000800cf4c80, slow_path=false) at jemalloc_jemalloc.c:2226 frame #8: 0x0000000800a3ac91 libc.so.7`__free(ptr=<unavailable>) at jemalloc_jemalloc.c:2382 frame #9: 0x0000000800d9ed0b libthr.so.3`_thr_rwlock_destroy(rwlock=<unavailable>) at thr_rwlock.c:136:3 frame #10: 0x00000008027feba3 libcrypto.so.111`CRYPTO_THREAD_lock_free(lock=0x0000000802e87e20) at threads_pthread.c:107:5 frame #11: 0x00000008027ec676 libcrypto.so.111`BIO_free(a=0x0000000802e88920) at bio_lib.c:136:5 frame #12: 0x00000008027ed572 libcrypto.so.111`BIO_free_all(bio=0x0000000000000000) at bio_lib.c:691:9 frame #13: 0x0000000802540d0b libssl.so.111`SSL_free(s=0x0000000802e799a8) at ssl_lib.c:1160:5 frame #14: 0x0000000802482fdd tls.so`tls_h_tcpconn_clean_f(c=0x0000000802e93270) at tls_server.c:655:3 frame #15: 0x0000000000618bd8 kamailio`_tcpconn_free(c=0x0000000802e93270) at tcp_main.c:1528:58 frame #16: 0x0000000000659534 kamailio`tcpconn_put_destroy(tcpconn=0x0000000802e93270) at tcp_main.c:3269:3 frame #17: 0x0000000000668966 kamailio`handle_tcp_child(tcp_c=0x00000008014dcf68, fd_i=-1) at tcp_main.c:3706:5 frame #18: 0x000000000065b7e9 kamailio`handle_io(fm=0x00000008014e6110, ev=1, idx=-1) at tcp_main.c:4523:8 frame #19: 0x0000000000644502 kamailio`io_wait_loop_kqueue(h=0x00000000008dbf50, t=5, repeat=0) at io_wait.h:1187:9 frame #20: 0x000000000063cb62 kamailio`tcp_main_loop at tcp_main.c:4824:5 frame #21: 0x00000000002e973a kamailio`main_loop at main.c:1779:5 frame #22: 0x00000000002f7650 kamailio`main(argc=7, argv=0x00007fffffffec68) at main.c:2856:6 frame #23: 0x00000000002d1af0 kamailio`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1.c:76:7 ``` All backtraces are differ from other on frames downed SSL_free() (frame #13 on the backtrace). #### Log Messages ``` 17:40:34.305319 51059 - - DEBUG: <core> [core/io_wait.h:600]: io_watch_del(): DBG: io_watch_del (0x8dbf50, 55, -1, 0x0) fd_no=46 called 17:40:34.30536351059 - - DEBUG: <core> [core/tcp_main.c:4457]: handle_tcpconn_ev(): sending to child, events 11 17:40:34.305382 51059 - - DEBUG: <core> [core/tcp_main.c:4130]: send2child(): selected tcp worker idx:5 proc:30 pid:51056 for activity on [tls:91.217.xx.yy:5070], 0x802e93270 17:40:34.305430 51059 - - DEBUG: <core> [core/io_wait.h:600]: io_watch_del(): DBG: io_watch_del (0x8dbf50, 56, -1, 0x0) fd_no=45 called 17:40:34.305446 51059 - - DEBUG: <core> [core/tcp_main.c:4457]: handle_tcpconn_ev(): sending to child, events 11 17:40:34.305461 51059 - - DEBUG: <core> [core/tcp_main.c:4130]: send2child(): selected tcp worker idx:6 proc:31 pid:51057 for activity on [tls:91.217.xx.yy:5070], 0x802ea7430 17:40:34.305678 51059 - - DEBUG: <core> [core/tcp_main.c:3560]: handle_tcp_child(): reader response= 802e93270, -1 from 5 17:40:34.305700 51059 - - DEBUG: tls [tls_server.c:683]: tls_h_tcpconn_close_f(): Closing SSL connection 0x802e9b3a8 17:40:35.024013 51026 - - ALERT: <core> [main.c:777]: handle_sigs(): child process 51059 exited by a signal 11 ``` ### Additional Information * **Kamailio Version** - output of `kamailio -v` ``` kamailio 5.4.3 (x86_64/freebsd) e19ae3 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, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, select, kqueue. id: e19ae3 compiled on 14:45:07 Feb 11 2021 with cc FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2) ``` * **Operating System**: ``` FreeBSD 12.2-STABLE r369029 OpenSSL 1.1.1i-freebsd 8 Dec 2020 ``` -- 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/2638
5
11
0
0
git: new commits in branch 5.5
by Daniel-Constantin Mierla
29 Apr '21
29 Apr '21
- URL:
https://github.com/kamailio/kamailio/commit/5513825a246cff4e5144ed2e83bd010…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:57:07+02:00 topos: use context to load stored branch attributes only for requests (cherry picked from commit 5d661eaa92461f3b43c433ec32653c4f89bb818e) - URL:
https://github.com/kamailio/kamailio/commit/0326fec293da66797fa13ae0a07e3e3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:57:34+02:00 topos: reset context on msg received callback (cherry picked from commit fb777b0e9bf2f87ea8cb1b0134fbfcc625121ad4) - URL:
https://github.com/kamailio/kamailio/commit/314436b2110396a5cb069ea093f8d82…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:57:49+02:00 topos: uniform processing for requests during early dialog - requests that are handled during 1xx state, like PRACK, UPDATE, BYE (cherry picked from commit 72cc3d46c39791d50927508114bdd1faa4a83f4c) - URL:
https://github.com/kamailio/kamailio/commit/b371e7f9be73368d2bb5b9a6deeeb17…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:58:06+02:00 topos: safety handling of onsend data (cherry picked from commit 975a61c89b2440fba737758cce3ab08000811b02) - URL:
https://github.com/kamailio/kamailio/commit/fc90e4c06c5df8c8a9d5cd615923c09…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:58:15+02:00 core/mem: q_malloc - use #else with DBG_QM_MALLOC for debug on freed fragments (cherry picked from commit 764d5be0c44036bb4b86f841588fb0df3b4bb834) - URL:
https://github.com/kamailio/kamailio/commit/1e235b0b5981c309e663cee2ef6f452…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:58:34+02:00 topos: simplified tps_dlg_message_update() (cherry picked from commit 7e5c4c30d2f0bbed2b566d46e5141b6abba315e7) - URL:
https://github.com/kamailio/kamailio/commit/d3575aa72d779e11fd8cfebc7060647…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:58:49+02:00 topos: load associated early dialog transaction using also uuid (cherry picked from commit 94e8988769662a5ae68e30847eef133d50ec5431) - URL:
https://github.com/kamailio/kamailio/commit/f201ea9f86561e9d07fa7ac07b356f5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:59:02+02:00 topos: check if event field exists for NOTIFY (cherry picked from commit 317ddc9efa2f11f0fe3787e9ab462550724954ed) - URL:
https://github.com/kamailio/kamailio/commit/d5e4e026cf6efc19f155f3adddb1429…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:59:13+02:00 topos: restore checks on uri and sip_params for tps_dlg_message_update() - use define for expected min len safety checks (cherry picked from commit 1d6736d16ab3a83b77d6c7be3f9689c7fbfccf28) - URL:
https://github.com/kamailio/kamailio/commit/22e201fa57f7e2be7a9718b97b550a1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:59:26+02:00 topos: increase the number of db keys for query when using uuid for branch - debug message to print a/b uuid (cherry picked from commit fb5ab20123a07afdfaf96197db25d76f8dda0683) - URL:
https://github.com/kamailio/kamailio/commit/8c75a148451b9e2d1c60e67e9b3dfaa…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:59:40+02:00 topos: explicitely set the db match operator and value type for uuid (cherry picked from commit e279f2f464ab05e1a2821d6e2d9e673fe145fbf2) - URL:
https://github.com/kamailio/kamailio/commit/bf57721508c810334c966bab79f2ac3…
Author: Sergey Safarov <s.safarov(a)gmail.com> Date: 2021-04-29T15:00:37+02:00 mohqueue: fixed compiler warning about array initialization (cherry picked from commit c7781edcb37a35193ccdb9414183919aaa614d3a) - URL:
https://github.com/kamailio/kamailio/commit/9dc8f5170a22e4318e1b1ac3f3f0dba…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T15:00:46+02:00 ims_ipsec_pcscf: initialize variable to fix warnings (cherry picked from commit afff18592998cb14561cf4fd95acd1b4866fd994) - URL:
https://github.com/kamailio/kamailio/commit/884dc8babeb285d2c36239d2941dcb6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T15:00:55+02:00 textops: check for msg headers field in case is used for non-sip traffic (cherry picked from commit 48200f3e9ca9f5e5a05de440eefc23f7265b5268) - URL:
https://github.com/kamailio/kamailio/commit/3b2f5081df6450aac425c344e11ce4c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T15:01:05+02:00 core: kemi - parse headers before insert operation (cherry picked from commit 7bf0081102a5755c3282e7f01a0f45e160fdda0f) - URL:
https://github.com/kamailio/kamailio/commit/e55ecc6412997b55569f3b626a681ea…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T15:01:16+02:00 msrp: check return code for str explode (cherry picked from commit addb6a88d0266a0bb0545077fb0b5b8a3fdcca8e) - URL:
https://github.com/kamailio/kamailio/commit/1c7a8459f1a5b0f4d96f3908a301b59…
Author: SPChan <shihping.chan(a)gmail.com> Date: 2021-04-29T15:01:25+02:00 [tls] Don't use OpenSSL<1.0.2 fallback on 1.1+ Address GH #2716. Also see
https://bugs.python.org/issue29697
. (cherry picked from commit 27904530d1f8efd26e2b96fa5f18a3aad887919b) - URL:
https://github.com/kamailio/kamailio/commit/126be686df87f1f89edbdf4e5691636…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T15:06:45+02:00 dispatcher: safety to avoid division by 0 for latency operations (cherry picked from commit cf105d5af78963759825f5eaf9feb767c047a49c) - URL:
https://github.com/kamailio/kamailio/commit/e7d46be2813531b88782004dd6ddbca…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T15:15:32+02:00 Makefile.defs: version set to 5.5.0-rc1
1
0
0
0
git:5.4:9e7c22a2: dispatcher: safety to avoid division by 0 for latency operations
by Daniel-Constantin Mierla
29 Apr '21
29 Apr '21
Module: kamailio Branch: 5.4 Commit: 9e7c22a21d57230180fd7c135128a30f47ea427d URL:
https://github.com/kamailio/kamailio/commit/9e7c22a21d57230180fd7c135128a30…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:50:12+02:00 dispatcher: safety to avoid division by 0 for latency operations - manual backporting of cf105d5af78963759825f5eaf9feb767c047a49c --- Modified: src/modules/dispatcher/dispatch.c --- Diff:
https://github.com/kamailio/kamailio/commit/9e7c22a21d57230180fd7c135128a30…
Patch:
https://github.com/kamailio/kamailio/commit/9e7c22a21d57230180fd7c135128a30…
--- diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c index aee5eb8ea6..8fd28c546c 100644 --- a/src/modules/dispatcher/dispatch.c +++ b/src/modules/dispatcher/dispatch.c @@ -2573,12 +2573,14 @@ int ds_mark_dst(struct sip_msg *msg, int state) return (ret == 0) ? 1 : -1; } +#define _VOR1(v) ((v)?(v):1) + static inline void latency_stats_update(ds_latency_stats_t *latency_stats, int latency) { /* after 2^21 ~24 days at 1s interval, the average becomes a weighted average */ if (latency_stats->count < 2097152) { latency_stats->count++; } else { /* We adjust the sum of squares used by the oneline algorithm proportionally */ - latency_stats->m2 -= latency_stats->m2/latency_stats->count; + latency_stats->m2 -= latency_stats->m2/_VOR1(latency_stats->count); } if (latency_stats->count == 1) { latency_stats->stdev = 0.0f; @@ -2601,10 +2603,10 @@ static inline void latency_stats_update(ds_latency_stats_t *latency_stats, int l float delta; float delta2; delta = latency - latency_stats->average; - latency_stats->average += delta/latency_stats->count; + latency_stats->average += delta/_VOR1(latency_stats->count); delta2 = latency - latency_stats->average; latency_stats->m2 += ((double)delta)*delta2; - latency_stats->stdev = sqrt(latency_stats->m2 / (latency_stats->count-1)); + latency_stats->stdev = sqrt(latency_stats->m2 / _VOR1(latency_stats->count-1)); } /* exponentialy weighted moving average */ if (latency_stats->count < 10) { @@ -2697,7 +2699,7 @@ int ds_update_latency(int group, str *address, int code) ds_latency_stats_t *latency_stats = &ds_dest->latency_stats; congestion_ms = latency_stats->estimate - latency_stats->average; /* We multiply by 2^4 to keep enough precision */ - active_weight = (total_congestion_ms << 4) / congestion_ms; + active_weight = (total_congestion_ms << 4) / _VOR1(congestion_ms); if (ds_dest->attrs.rweight != active_weight) { apply_rweights = 1; ds_dest->attrs.rweight = active_weight;
1
0
0
0
git:master:cf105d5a: dispatcher: safety to avoid division by 0 for latency operations
by Daniel-Constantin Mierla
29 Apr '21
29 Apr '21
Module: kamailio Branch: master Commit: cf105d5af78963759825f5eaf9feb767c047a49c URL:
https://github.com/kamailio/kamailio/commit/cf105d5af78963759825f5eaf9feb76…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T14:47:36+02:00 dispatcher: safety to avoid division by 0 for latency operations --- Modified: src/modules/dispatcher/dispatch.c --- Diff:
https://github.com/kamailio/kamailio/commit/cf105d5af78963759825f5eaf9feb76…
Patch:
https://github.com/kamailio/kamailio/commit/cf105d5af78963759825f5eaf9feb76…
--- diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c index 80944e4b05..78ece3fffe 100644 --- a/src/modules/dispatcher/dispatch.c +++ b/src/modules/dispatcher/dispatch.c @@ -2733,7 +2733,8 @@ int ds_mark_dst(struct sip_msg *msg, int state) return (ret == 0) ? 1 : -1; } -void latency_stats_init(ds_latency_stats_t *latency_stats, int latency, int count) { +void latency_stats_init(ds_latency_stats_t *latency_stats, int latency, int count) +{ latency_stats->stdev = 0.0f; latency_stats->m2 = 0.0f; latency_stats->max = latency; @@ -2743,14 +2744,17 @@ void latency_stats_init(ds_latency_stats_t *latency_stats, int latency, int coun latency_stats->count = count; } -static inline void latency_stats_update(ds_latency_stats_t *latency_stats, int latency) { +#define _VOR1(v) ((v)?(v):1) + +static inline void latency_stats_update(ds_latency_stats_t *latency_stats, int latency) +{ int training_count = 10000; /* after 2^21 ~24 days at 1s interval, the average becomes a weighted average */ if (latency_stats->count < 2097152) { latency_stats->count++; } else { /* We adjust the sum of squares used by the oneline algorithm proportionally */ - latency_stats->m2 -= latency_stats->m2/latency_stats->count; + latency_stats->m2 -= latency_stats->m2/_VOR1(latency_stats->count); } if (latency_stats->count == 1) @@ -2771,10 +2775,10 @@ static inline void latency_stats_update(ds_latency_stats_t *latency_stats, int l float delta; float delta2; delta = latency - latency_stats->average; - latency_stats->average += delta/latency_stats->count; + latency_stats->average += delta/_VOR1(latency_stats->count); delta2 = latency - latency_stats->average; latency_stats->m2 += ((double)delta)*delta2; - latency_stats->stdev = sqrt(latency_stats->m2 / (latency_stats->count-1)); + latency_stats->stdev = sqrt(latency_stats->m2 / _VOR1(latency_stats->count-1)); } /* exponentialy weighted moving average */ if (latency_stats->count < 10) { @@ -2793,7 +2797,8 @@ typedef struct congestion_control_state { int apply_rweights; } congestion_control_state_t; -int ds_update_weighted_congestion_control(congestion_control_state_t *cc, int weight, ds_latency_stats_t *latency_stats) +int ds_update_weighted_congestion_control(congestion_control_state_t *cc, + int weight, ds_latency_stats_t *latency_stats) { int active_weight = 0; int congestion_ms = latency_stats->estimate - latency_stats->average; @@ -2894,7 +2899,7 @@ int ds_update_latency(int group, str *address, int code) ds_latency_stats_t *latency_stats = &ds_dest->latency_stats; congestion_ms = latency_stats->estimate - latency_stats->average; /* We multiply by 2^4 to keep enough precision */ - active_weight = (cc.total_congestion_ms << 4) / congestion_ms; + active_weight = (cc.total_congestion_ms << 4) / _VOR1(congestion_ms); if (ds_dest->attrs.rweight != active_weight) { cc.apply_rweights = 1; ds_dest->attrs.rweight = active_weight;
1
0
0
0
git:master:d139cf26: modules: readme files regenerated - sipdump ... [skip ci]
by Kamailio Dev
29 Apr '21
29 Apr '21
Module: kamailio Branch: master Commit: d139cf261147c96451454b27a4a3dbaa0a226636 URL:
https://github.com/kamailio/kamailio/commit/d139cf261147c96451454b27a4a3dba…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org> Committer: Kamailio Dev <kamailio.dev(a)kamailio.org> Date: 2021-04-29T11:31:19+02:00 modules: readme files regenerated - sipdump ... [skip ci] --- Modified: src/modules/sipdump/README --- Diff:
https://github.com/kamailio/kamailio/commit/d139cf261147c96451454b27a4a3dba…
Patch:
https://github.com/kamailio/kamailio/commit/d139cf261147c96451454b27a4a3dba…
--- diff --git a/src/modules/sipdump/README b/src/modules/sipdump/README index a699336f53..d7da3a8bf7 100644 --- a/src/modules/sipdump/README +++ b/src/modules/sipdump/README @@ -31,7 +31,8 @@ Daniel-Constantin Mierla 3.4. rotate (int) 3.5. folder (str) 3.6. fprefix (str) - 3.7. event_callback (str) + 3.7. fage (int) + 3.8. event_callback (str) 4. Functions @@ -55,9 +56,10 @@ Daniel-Constantin Mierla 1.4. Set rotate parameter 1.5. Set folder parameter 1.6. Set fprefix parameter - 1.7. Set event_callback parameter - 1.8. sipdump_send usage - 1.9. sipdump.enable usage + 1.7. Set fage parameter + 1.8. Set event_callback parameter + 1.9. sipdump_send usage + 1.10. sipdump.enable usage Chapter 1. Admin Guide @@ -77,7 +79,8 @@ Chapter 1. Admin Guide 3.4. rotate (int) 3.5. folder (str) 3.6. fprefix (str) - 3.7. event_callback (str) + 3.7. fage (int) + 3.8. event_callback (str) 4. Functions @@ -138,7 +141,8 @@ Chapter 1. Admin Guide 3.4. rotate (int) 3.5. folder (str) 3.6. fprefix (str) - 3.7. event_callback (str) + 3.7. fage (int) + 3.8. event_callback (str) 3.1. enable (int) @@ -215,13 +219,26 @@ modparam("sipdump", "folder", "/run/kamailio") modparam("sipdump", "fprefix", "ksipdump-") ... -3.7. event_callback (str) +3.7. fage (int) + + Age of created files (in seconds) to be removed if they become older. + Cleanup is done on a timer routine running every 600 seconds. + + Default value is 0 (no cleanup of created files). + + Example 1.7. Set fage parameter +... +# cleanup files older than two days +modparam("sipdump", "fage", 172800) +... + +3.8. event_callback (str) Name of the KEMI function to be executed instead of the event route. Default value is not set. - Example 1.7. Set event_callback parameter + Example 1.8. Set event_callback parameter ... modparam("sipdump", "event_callback", "ksr_sipdump_event") ... @@ -246,7 +263,7 @@ end This function can be used from ANY_ROUTE. - Example 1.8. sipdump_send usage + Example 1.9. sipdump_send usage ... sipdump_send("cfg"); ... @@ -264,7 +281,7 @@ sipdump_send("cfg"); This function can be used from ANY_ROUTE. - Example 1.9. sipdump.enable usage + Example 1.10. sipdump.enable usage ... kamcmd sipdump.enable kamcmd sipdump.enable 1
1
0
0
0
git:master:cf067586: sipdump: docs for fage parameter
by Daniel-Constantin Mierla
29 Apr '21
29 Apr '21
Module: kamailio Branch: master Commit: cf067586bf5c147aa955d3ba7d3a875a2e376329 URL:
https://github.com/kamailio/kamailio/commit/cf067586bf5c147aa955d3ba7d3a875…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T11:23:39+02:00 sipdump: docs for fage parameter --- Modified: src/modules/sipdump/doc/sipdump_admin.xml --- Diff:
https://github.com/kamailio/kamailio/commit/cf067586bf5c147aa955d3ba7d3a875…
Patch:
https://github.com/kamailio/kamailio/commit/cf067586bf5c147aa955d3ba7d3a875…
--- diff --git a/src/modules/sipdump/doc/sipdump_admin.xml b/src/modules/sipdump/doc/sipdump_admin.xml index 7e642f6010..301b667d80 100644 --- a/src/modules/sipdump/doc/sipdump_admin.xml +++ b/src/modules/sipdump/doc/sipdump_admin.xml @@ -195,6 +195,27 @@ modparam("sipdump", "folder", "/run/kamailio") ... modparam("sipdump", "fprefix", "ksipdump-") ... +</programlisting> + </example> + </section> + <section id="sipdump.p.fage"> + <title><varname>fage</varname> (int)</title> + <para> + Age of created files (in seconds) to be removed if they become older. + Cleanup is done on a timer routine running every 600 seconds. + </para> + <para> + <emphasis> + Default value is 0 (no cleanup of created files). + </emphasis> + </para> + <example> + <title>Set <varname>fage</varname> parameter</title> + <programlisting format="linespecific"> +... +# cleanup files older than two days +modparam("sipdump", "fage", 172800) +... </programlisting> </example> </section>
1
0
0
0
git:master:945b6455: sipdump: new param fage - set file age for clean up
by Daniel-Constantin Mierla
29 Apr '21
29 Apr '21
Module: kamailio Branch: master Commit: 945b6455ed8ce9e3de528588cb45aa70728d4430 URL:
https://github.com/kamailio/kamailio/commit/945b6455ed8ce9e3de528588cb45aa7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-04-29T11:17:10+02:00 sipdump: new param fage - set file age for clean up - older files than fage created by sipdump are deleted on a timer routine running every 600 seconds - default value is 0 (no cleanup) - value is in seconds --- Modified: src/modules/sipdump/sipdump_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/945b6455ed8ce9e3de528588cb45aa7…
Patch:
https://github.com/kamailio/kamailio/commit/945b6455ed8ce9e3de528588cb45aa7…
--- diff --git a/src/modules/sipdump/sipdump_mod.c b/src/modules/sipdump/sipdump_mod.c index 54b5c47484..9b733dad66 100644 --- a/src/modules/sipdump/sipdump_mod.c +++ b/src/modules/sipdump/sipdump_mod.c @@ -26,6 +26,10 @@ #include <string.h> #include <time.h> #include <sys/time.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <dirent.h> +#include <errno.h> #include "../../core/sr_module.h" #include "../../core/dprint.h" @@ -49,9 +53,12 @@ static str sipdump_folder = str_init("/tmp"); static str sipdump_fprefix = str_init("kamailio-sipdump-"); int sipdump_mode = SIPDUMP_MODE_WTEXT; static str sipdump_event_callback = STR_NULL; +static int sipdump_fage = 0; static int sipdump_event_route_idx = -1; +static void sipdump_storage_clean(unsigned int ticks, void* param); + static int mod_init(void); static int child_init(int); static void mod_destroy(void); @@ -78,6 +85,7 @@ static param_export_t params[]={ {"rotate", PARAM_INT, &sipdump_rotate}, {"folder", PARAM_STR, &sipdump_folder}, {"fprefix", PARAM_STR, &sipdump_fprefix}, + {"fage", PARAM_INT, &sipdump_fage}, {"mode", PARAM_INT, &sipdump_mode}, {"event_callback", PARAM_STR, &sipdump_event_callback}, @@ -148,6 +156,12 @@ static int mod_init(void) register_basic_timers(1); } + if(sipdump_fage>0) { + if(sr_wtimer_add(sipdump_storage_clean, NULL, 600)<0) { + return -1; + } + } + sr_event_register_cb(SREV_NET_DATA_IN, sipdump_msg_received); sr_event_register_cb(SREV_NET_DATA_OUT, sipdump_msg_sent); @@ -430,6 +444,79 @@ int sipdump_msg_sent(sr_event_param_t *evp) return 0; } +/** + * + */ +static void sipdump_storage_clean(unsigned int ticks, void* param) +{ + DIR *dlist = NULL; + struct stat fstatbuf; + struct dirent *dentry = NULL; + str fname = STR_NULL; + char *cwd = NULL; + time_t tnow; + int fcount = 0; + + if(sipdump_folder.s==NULL || sipdump_folder.len<=0 + || sipdump_fprefix.s==NULL || sipdump_fprefix.len<=0) { + return; + } + cwd = getcwd(NULL, 0); + if(cwd==NULL) { + LM_ERR("getcwd failed\n"); + return; + } + if ((chdir(sipdump_folder.s)==-1)) { + LM_ERR("chdir to [%s] failed\n", sipdump_folder.s); + free(cwd); + return; + } + + dlist = opendir(sipdump_folder.s); + if (dlist==NULL) { + LM_ERR("unable to read directory [%s]\n", sipdump_folder.s); + goto done; + } + + tnow = time(NULL); + while ((dentry = readdir(dlist))) { + fname.s = dentry->d_name; + fname.len = strlen(fname.s); + + /* ignore '.' and '..' */ + if(fname.len==1 && strcmp(fname.s, ".")==0) { continue; } + if(fname.len==2 && strcmp(fname.s, "..")==0) { continue; } + + if(fname.len<=sipdump_fprefix.len + || strncmp(fname.s, sipdump_fprefix.s, sipdump_fprefix.len)!=0) { + continue; + } + if(lstat(fname.s, &fstatbuf) == -1) { + LM_ERR("stat failed on [%s]\n", fname.s); + continue; + } + if (S_ISREG(fstatbuf.st_mode)) { + /* check last modification time */ + if ((tnow - sipdump_fage) > fstatbuf.st_mtime) { + LM_DBG("deleting [%s]\n", fname.s); + unlink (fname.s); + fcount++; + } + } + } + closedir(dlist); + if(fcount>0) { + LM_DBG("deleted %d files\n", fcount); + } + +done: + if((chdir(cwd)==-1)) { + LM_ERR("chdir to [%s] failed\n", cwd); + goto done; + } + free(cwd); +} + /** * */
1
0
0
0
Default config and options for Kamailio 5.5.0
by Daniel-Constantin Mierla
29 Apr '21
29 Apr '21
Hello, I opened a tracker issue to discuss about default kamailio.cfg to be shipped with upcoming new major version 5.5.0: *
https://github.com/kamailio/kamailio/issues/2719
Add your comments on the tracker, to have everyting in a single place -- this message is to notify about on mailing list, not intended to discuss here. Cheers, Daniel -- Daniel-Constantin Mierla --
www.asipto.com
www.twitter.com/miconda
--
www.linkedin.com/in/miconda
Kamailio Advanced Training - Online May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone) *
https://www.asipto.com/sw/kamailio-advanced-training-online/
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
31
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Results per page:
10
25
50
100
200