[sr-dev] Re: [kamailio/kamailio] SEGV in dialog module (PR #4151)
Den4t left a comment (kamailio/kamailio#4151) > Thanks! I split manually the PR in 2, doing differently the part for dlg > variables to use directly the static kemi global var, the second being about > fixes to the flags. > > If you find any related problems, open a bug on the tracker. Thanks ! Should we expect backports? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4151#issuecomment-2674246564 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] SEGV in dialog module (PR #4151)
Den4t left a comment (kamailio/kamailio#4151) > Thanks for the PR, good point with the additional locks and also the error > related to the DMQ flags. There have been similar reports (e.g. #2923) for > crashes related to the dialog profiles. I do not analyze dialog profile functions, but think it is possible that they can have similar problems. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4151#issuecomment-2669086322 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] SEGV in dialog module (PR #4151)
Den4t left a comment (kamailio/kamailio#4151) > What was the reasoning by changing the string memory to static and also > passing str by value instead of reference? Is this also related to the crash > fix? Hi ! I think you mean this in ki_dlg_get_var_helper: static str val; This is because of natute of function get_dlg_varval, whiсh i reuse it to clone dlg var in private pv buffer, we can't use here stack variable (without static), because no garanty the stack is changed after return from ki_dlg_get_var_helper (if I understood the question correctly), using get_dlg_varref as before is unsafe, because of data under the pointer can be changed in concurrent process. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4151#issuecomment-2669080330 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] [kamailio/kamailio] SEGV in dialog module (PR #4151)
Fixes for SEGV in dialog module. Pre-Submission Checklist - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated) Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality) Checklist: - [ ] PR should be backported to stable branches - [ ] Tested changes locally - [ ] Related to issue # (replace with an open issue number) Description Hi ! The problem - periodically, 2-3 times in а month, kamailio dumps core with SEGV. Different OS versions (Ubuntu 18,20,22), different kamailio versions from 5.7.1 up to 5.8.4, high call load, python kemi, actively used dialog module. Analyzing core files shows more or less the same picture - SEGV happends in dialog mododule around the dialog vars, can be in rpc call (dlg.list), in destroy dlg, in accessing dlg variable. Backtrace can look like: ``` Core was generated by `/usr/sbin/kamailio -P /run/kamailio/kamailio.pid -f /etc/kamailio/kamailio.cfg'. Program terminated with signal SIGSEGV, Segmentation fault. #0 get_dlg_variable_unsafe (dlg=dlg@entry=0x7fa2818849b8, key=key@entry=0x7ffe67990d68) at dlg_var.c:236 236 dlg_var.c: No such file or directory. (gdb) bt full #0 get_dlg_variable_unsafe (dlg=dlg@entry=0x7fa2818849b8, key=key@entry=0x7ffe67990d68) at dlg_var.c:236 var = 0x8 var_list =#1 0x7fa2a2ce0397 in get_dlg_varref (dlg=dlg@entry=0x7fa2818849b8, key=key@entry=0x7ffe67990d68) at dlg_var.c:297 var = 0x0 __func__ = "get_dlg_varref" #2 0x7fa2a2ccd429 in ki_dlg_var_get_mode (msg= , name=0x7ffe67990d68, rmode=0) at dialog.c:2462 dlg = 0x7fa2818849b8 pval = #3 0x55e2d5b87cbb in sr_kemi_exec_func (ket=ket@entry=0x7fa2a2d0c0c0 , msg=msg@entry=0x7fa2a34577c0, pno=pno@entry=1, vps=vps@entry=0x7ffe67990d60) at core/kemiexec.c:82 ret = __func__ = "sr_kemi_exec_func" #4 0x7fa2a2930376 in sr_apy_kemi_exec_func_ex (ket=ket@entry=0x7fa2a2d0c0c0 , self=self@entry=0x7fa280ce2b80, args=args@entry=0x7fa2804ba3a0, idx=idx@entry=485) at apy_kemi.c:327 fname = i = ret = vps = {{vtype = 2, v = {n = -2142122656, l = 140335914274144, s = {s = 0x7fa28051cd60 "rtpe_setid", len = 10}, dict = 0x7fa28051cd60}}, {vtype = 0, v = {n = 0, l = 0, s = {s = 0x0, len = 0}, dict = 0x0}}, {vtype = 0, v = { n = 0, l = 0, s = {s = 0x0, len = 0}, dict = 0x0}}, {vtype = 0, v = {n = 0, l = 0, s = {s = 0x0, len = 0}, dict = 0x0}}, {vtype = 0, v = {n = 0, l = 0, s = {s = 0x0, len = 0}, dict = 0x0}}, {vtype = 0, v = {n = 0, l = 0, s = {s = 0x0, len = 0}, dict = 0x0}}} env_P = lmsg = 0x7fa2a34577c0 xret = slen = 10 alen = 1 pobj = __func__ = "sr_apy_kemi_exec_func_ex" #5 0x7fa2a2931f45 in sr_apy_kemi_exec_func (self=0x7fa280ce2b80, args=0x7fa2804ba3a0, idx=485) at apy_kemi.c:356 ket = 0x7fa2a2d0c0c0 ret = 0x0 pstate = 0x0 pframe = 0x0 tvb = {tv_sec = 0, tv_usec = 0} tve = {tv_sec = 0, tv_usec = 0} tz = {tz_minuteswest = 2, tz_dsttime = 0} tdiff = __func__ = "sr_apy_kemi_exec_func" #6 0x7fa2a266f697 in ?? () from /lib/x86_64-linux-gnu/libpython3.8.so.1.0 ``` Inspecting dl
[sr-dev] [kamailio/kamailio] tcpops: fix memory leak in $tcp(conid) (PR #3924)
Pre-Submission Checklist - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated) Type Of Change - [x] Small bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality) Checklist: - [ ] PR should be backported to stable branches - [ ] Tested changes locally - [ ] Related to issue # (replace with an open issue number) Description Reference counter to tcp session not decremented after use $tcp(conid), so shm for session never free. Can be releated to: https://www.mail-archive.com/sr-users@lists.kamailio.org/msg21294.html You can view, comment on, or merge this pull request online at: https://github.com/kamailio/kamailio/pull/3924 -- Commit Summary -- * tcpops: fix memory leak in $tcp(conid) -- File Changes -- M src/modules/tcpops/tcpops_mod.c (3) -- Patch Links -- https://github.com/kamailio/kamailio/pull/3924.patch https://github.com/kamailio/kamailio/pull/3924.diff -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3924 You are receiving this because you are subscribed to this thread. Message ID:___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] [kamailio/kamailio] Siptrace: setting send_sock_name/send_sock_address is ineffective for tcp based transports (PR #3837)
For tcp based transports it is need to set SND_F_FORCE_SOCKET flag before msg_send_buffer call, or duplicate will send from wrong addr/port. Pre-Submission Checklist - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated) Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality) Checklist: - [ ] PR should be backported to stable branches - [ ] Tested changes locally - [ ] Related to issue # (replace with an open issue number) Description You can view, comment on, or merge this pull request online at: https://github.com/kamailio/kamailio/pull/3837 -- Commit Summary -- * siptrace: add SND_F_FORCE_SOCKET flag if send_sock_name/send_sock_address config parameters are used -- File Changes -- M src/modules/siptrace/siptrace_send.c (2) -- Patch Links -- https://github.com/kamailio/kamailio/pull/3837.patch https://github.com/kamailio/kamailio/pull/3837.diff -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3837 You are receiving this because you are subscribed to this thread. Message ID:___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] [kamailio/kamailio] dispatcher: refine documentation (PR #3783)
- more clear documentation for the new ds_is_from_list flags Pre-Submission Checklist - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated) Type Of Change - [x] Small bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality) Checklist: - [ ] PR should be backported to stable branches - [ ] Tested changes locally - [ ] Related to issue # (replace with an open issue number) Description You can view, comment on, or merge this pull request online at: https://github.com/kamailio/kamailio/pull/3783 -- Commit Summary -- * dispatcher: refine documentation -- File Changes -- M src/modules/dispatcher/doc/dispatcher_admin.xml (9) -- Patch Links -- https://github.com/kamailio/kamailio/pull/3783.patch https://github.com/kamailio/kamailio/pull/3783.diff -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3783 You are receiving this because you are subscribed to this thread. Message ID:___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
Hi, @miconda ! About the docs changes above, do i need to make a new PR, this one is closed ? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3699#issuecomment-1988089752 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
Thansk for merging @miconda ! I wanted to offer a version of the documentation for flag 16 to make it more clear: If bit five is set, then try to find the most closest target from all dispatcher targets with the mandatory ip and combination of local socket, protocol, port. The weighted search result is combined from bit flags of matched components: ip - 1, port - 2, protocol - 4, local socket - 8, the target with the maximum value of flags combination will be selected. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3699#issuecomment-1963943052 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
Hi ! Yes, i need to refine the docs, will try to do at this weekends. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3699#issuecomment-1957261250 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
> Your last comment does not clarify if a destination record matching (ip, > socket) has to be selected over one that matches (ip, port, proto). Can you > present the order of selection based on matching the values for ip, port, > proto or socket? The strictness are defined by the flags combination: #define DS_MATCHED_ADDR 1 #define DS_MATCHED_PORT (1 << 1) #define DS_MATCHED_PROTO (1 << 2) #define DS_MATCHED_SOCK (1 << 3) in each iteration global variable ds_strictness are "OR-ed" with corresponding flag by criteria of matching, the winner is that which have the greatest value, for example if we have: ##ip, port, protocol 70 sip:192.168.1.1:5060;transport=udp 0 1 route=route1 #ip and socket 90 sip:192.168.1.1 0 1 route=route2;sockname=udp_5060 in first case we have flags: DS_MATCHED_ADDR | DS_MATCHED_PORT | DS_MATCHED_PROTO (7) in second: MATCHED_ADDR | DS_MATCHED_SOCK (9) The winner will be second, in this case 90. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3699#issuecomment-1919401498 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
Hi! Sorry, I was sick last week... > because of the flag for socket matching, record matching (ip, socket) is > selected. Is this the desired behavior. Yes, this is the desired behavior, because we can only have a target with an ip and socket like this (it seems to be a valid configuration): 70 sip:192.168.1.1 0 1 route=route 1;sockname=udp_5060 >Somehow, it should be clear in the documents how the destination record is >selected. I understood, I will supplement the documentation more fully on this occasion. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3699#issuecomment-1911841712 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
> I meant for the case/flag DS_MATCH_FULLADDRSOCK: a destination record that > matches **only** the socket is selected against one that matches > address+port+proto. Using DS_MATCH_TRY_FULL ADDR SOCK, at least an ip must also be matched, and in this mode we do not interrupt the serach cycle, trying to find a more complete match, so the ip+socket combination will be valid, but not only the socket match. If i am right understand the question. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3699#issuecomment-119042 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
> If I understand the code correctly, a destination record that matches only > the socket is selected against one that matches address/port/proto? Is it > like that and if yes, is it the expected result? Yes, it is a separate flag - DS_MATCH_SOCKET (8), it work like ds_is_from_list(-1,0), but socket is take in account also (if specified in the configuration). -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3699#issuecomment-1888650488 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
I have changed the flag name and added docs to xml. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3699#issuecomment-1884558285 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
@Den4t pushed 1 commit. 53ae14294f021ae615c0fae6ec9b48758d9a051e dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3699/files/9ef53dd70fb412a8c0754b523253be9478951a06..53ae14294f021ae615c0fae6ec9b48758d9a051e You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
> I've not done any testing myself, but by my understanding the > DS_MATCH_STRICTEST flag is basically a flag to indicate it should not return > on the first match but scan through all. Then sort and return the one that is > matching one most criterias? Right, but not exactly, there is no sorting as separate entity, during the traverse of tree the gobal variable filled with strictess flags (which are the bitmask of sip uri components - addr/proto/port and local socket) and more strictess node is saved in process global variable, if full set of possible flags is found, the cycle is stopped (we found full match and no more iterations needed), when traverse pocess finished (resursive method in original code) and we are not found full match, the global vars will contains more strictness node (if found at least address match), from this global vars then making out the final result of ds_is_from_list. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3699#issuecomment-1879215548 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
> Maybe DS_MATCH_FULLADDRSOCK. OK, i will change the flag name, need some time to think about adequate name, writing docs hope can help with this. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3699#issuecomment-1879191053 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] [kamailio/kamailio] Dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching (PR #3699)
Pre-Submission Checklist - [ ] Commit message has the format required by CONTRIBUTING guide - [ ] Commits are split per component (core, individual modules, libs, utils, ...) - [ ] Each component has a single commit (if not, squash them into one commit) - [ ] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated) Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality) Checklist: - [ ] PR should be backported to stable branches - [ ] Tested changes locally - [ ] Related to issue # (replace with an open issue number) Description This PR adds 2 new flags to the mode parameter of the ds_is_from_list function. Some times the dispatcher configuration can look like this (route attribute is just for exampe, sockname is important here): 70 sip:192.168.1.1:5060;transport=udp 0 1 route=route1;sockname=udp_5060 71 sip:192.168.1.1:5060;transport=udp 0 1 route=route2;sockname=udp_5061 72 sip:192.168.1.1:5060;transport=udp 0 1 route=route3;sockname=udp_5062 73 sip:192.168.1.1:5060;transport=udp 0 1 route=route4;sockname=udp_5063 Here we have one host/port/protocol on the remote side and different ports that we are listening on, In stock dispatcher version ds_is_from_list(-1,0) will always match first available - 70, but this is not right for dst ports 5061-5063 (sockets in realality, because we can have different local ip on same port also). The new mode flag DS_MATCH_SOCKET (8) allow match for dispatcher socket also. Second flag is DS_MATCH_STRICTEST (16), it allow to match more strictness target in "address/protocol/port/socket" key, for example: 70 sip:192.168.1.1;transport=udp 0 1 route=route1 71 sip:192.168.1.1:5061;transport=udp 0 1 route=route2 72 sip:192.168.1.1:5062;transport=udp 0 1 route=route3 73 sip:192.168.1.1;transport=udp 0 1 route=route4;socket=udp:192.168.10.10:5063 if packet come from from any port of sip:192.168.1.1;transport=udp except 5061-5062 ds_is_from list will return 70, if received port also is 5063 the result will be 73, packets from ports 5061-5062 will be matched at 71-72 respectively. In stock version of ds_is_from_list the result will always be 70. Note, the DS_MATCH_STRICTEST method can be more compute intensive, because we can potentially traverse all the dispatcher tree. The behavior of existing flags are not changed. You can view, comment on, or merge this pull request online at: https://github.com/kamailio/kamailio/pull/3699 -- Commit Summary -- * dispatcher: added two new flags to mode parameter of ds_is_from_list function for more strictly matching -- File Changes -- M src/modules/dispatcher/dispatch.c (112) M src/modules/dispatcher/dispatch.h (2) -- Patch Links -- https://github.com/kamailio/kamailio/pull/3699.patch https://github.com/kamailio/kamailio/pull/3699.diff -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3699 You are receiving this because you are subscribed to this thread. Message ID:___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Fixed saving dialogs on shutdown that are already loaded at startup in db_mode 3 (PR #3688)
Done -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3688#issuecomment-1869732914 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Fixed saving dialogs on shutdown that are already loaded at startup in db_mode 3 (PR #3688)
Some incorrect identation was found after initial commit, fixed in additional commits. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3688#issuecomment-1867912566 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Fixed saving dialogs on shutdown that are already loaded at startup in db_mode 3 (PR #3688)
@Den4t pushed 1 commit. 0c36a852d0b2300040ea32c32888d354a54dddec Update dlg_db_handler.c -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3688/files/78e270b3a8db48705d349771b7d155f237a04ca5..0c36a852d0b2300040ea32c32888d354a54dddec You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Fixed saving dialogs on shutdown that are already loaded at startup in db_mode 3 (PR #3688)
@Den4t pushed 1 commit. 78e270b3a8db48705d349771b7d155f237a04ca5 Update dlg_db_handler.c -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3688/files/d1699ab62ebc0aa62c4acb87bf496e64b16f67e4..78e270b3a8db48705d349771b7d155f237a04ca5 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] [kamailio/kamailio] Fixed saving dialogs on shutdown that are already loaded at startup in db_mode 3 (PR #3688)
…tartup when using db_mode 3 - The dialogs that loaded at startup are not saved in DB on shutdown, and so not loaded at restart, fixes issue #3669 Pre-Submission Checklist - [ ] Commit message has the format required by CONTRIBUTING guide - [ ] Commits are split per component (core, individual modules, libs, utils, ...) - [ ] Each component has a single commit (if not, squash them into one commit) - [ ] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated) Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality) Checklist: - [ ] PR should be backported to stable branches - [ ] Tested changes locally - [ ] Related to issue # (replace with an open issue number) Description You can view, comment on, or merge this pull request online at: https://github.com/kamailio/kamailio/pull/3688 -- Commit Summary -- * dialog: fixed saving dialogs on shutdown that are already loaded at startup when using db_mode 3 -- File Changes -- M src/modules/dialog/dlg_db_handler.c (3) -- Patch Links -- https://github.com/kamailio/kamailio/pull/3688.patch https://github.com/kamailio/kamailio/pull/3688.diff -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3688 You are receiving this because you are subscribed to this thread. Message ID:___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dialogs loaded from the DB are no longer saved. (Issue #3669)
I have tested all 3 DB modes with my latest modifications, the results look correct: ``` === Test mode 1 === modparam("dialog", "db_url", "sqlite:///etc/kamailio/sqlite.db") modparam("dialog", "db_mode", 1) # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 >> make 2 calls # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 1536 dflags: 1536 # systemctl stop kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such file or directory [2] # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 0 dflags: 0 # systemctl restart kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 0 dflags: 0 # systemctl restart kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 0 dflags: 0 >> terminate calls # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 === Mode 1 looks good. === Test mode 2 === modparam("dialog", "db_url", "sqlite:///etc/kamailio/sqlite.db") modparam("dialog", "db_mode", 2) modparam("dialog", "db_update_period", 5) # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 >> make 2 calls # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 1 dflags: 1538 dflags: 1667 # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 1536 dflags: 1536 # systemctl stop kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such file or directory [2] # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 0 dflags: 0 # systemctl restart kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 0 dflags: 0 >> terminate calls ... after 5 seconds # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 === Mode 2 looks good === Test mode 3 === modparam("dialog", "db_url", "sqlite:///etc/kamailio/sqlite.db") modparam("dialog", "db_mode", 3) # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 >> make 2 calls # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 dflags: 1667 dflags: 1667 # systemctl stop kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such file or directory [2] # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 dflags: 1 dflags: 1 # systemctl restart kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 dflags: 1 dflags: 1 # systemctl stop kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such file or directory [2] # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 dflags: 1 dflags: 1 >>terminate calls # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 # systemctl stop kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such file or directory [2] # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 === Mode 3 loos good also. ``` -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3669#issuecomment-1866618262 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.o
[sr-dev] Re: [kamailio/kamailio] Dialogs loaded from the DB are no longer saved. (Issue #3669)
I have tested all 3 DB modes with my latest modifications, the results look correct: ``` === Test mode 1 === modparam("dialog", "db_url", "sqlite:///etc/kamailio/sqlite.db") modparam("dialog", "db_mode", 1) # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 >> make 2 calls # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 1536 dflags: 1536 # systemctl stop kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such file or directory [2] # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 0 dflags: 0 # systemctl restart kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 0 dflags: 0 # systemctl restart kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 0 dflags: 0 >> terminate calls # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 === Mode 1 looks good. === Test mode 2 === modparam("dialog", "db_url", "sqlite:///etc/kamailio/sqlite.db") modparam("dialog", "db_mode", 2) modparam("dialog", "db_update_period", 5) # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 >> make 2 calls # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 1 dflags: 1538 dflags: 1667 # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 1536 dflags: 1536 # systemctl stop kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such file or directory [2] # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 0 dflags: 0 # systemctl restart kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 dflags: 0 dflags: 0 >> terminate calls ... after 5 seconds # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 === Mode 2 looks good === Test mode 3 === modparam("dialog", "db_url", "sqlite:///etc/kamailio/sqlite.db") modparam("dialog", "db_mode", 3) # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 >> make 2 calls # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 dflags: 1667 dflags: 1667 # systemctl stop kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such file or directory [2] # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 dflags: 1 dflags: 1 # systemctl restart kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 dflags: 1 dflags: 1 # systemctl stop kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 2 ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such file or directory [2] # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 dflags: 1 dflags: 1 >>terminate calls # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 # systemctl stop kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 ERROR: connect_unix_sock: connect(/var/run/kamailio//kamailio_ctl): No such file or directory [2] # systemctl start kamailio # echo 'select "dlgs: "||count(*) from dialog'|sqlite3 sqlite.db ; kamcmd dlg.list|grep dflags dlgs: 0 === Mode 3 looks good also. ``` -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3669#issuecomment-1866616202 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamail
[sr-dev] Re: [kamailio/kamailio] Dialogs loaded from the DB are no longer saved. (Issue #3669)
> You should probably only do this if: > if(dlg_db_mode == DB_MODE_SHUTDOWN) { Yes, i missed it, will test all the db modes. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3669#issuecomment-1866163424 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dialogs loaded from the DB are no longer saved. (Issue #3669)
I have fixed dialog saving with folowing change: https://github.com/Den4t/kamailio/commit/0ff12a0a0ab62123c7a37acb1c8f2f81d63751b5 Look like work as expected. I haven't tested DMQ, but having studied the code in detail, i don't think this change will affect it in any way. So, if the authors have no objections, I will do a PR. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3669#issuecomment-1864510351 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dialogs loaded from the DB are no longer saved. (Issue #3669)
>>I did not investigate myself, but based on his descriptions dialogs that are >>created before the first restart is not kept >>during the second restart >>since they're no longer marked as "changed" or "new". Exactly ! -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3669#issuecomment-1859074046 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] Dialogs loaded from the DB are no longer saved. (Issue #3669)
Hi ! Yes, you are right, not modified, but as i said above - "when in some resonable short time kamailio shutdowned again with active dialogs loaded at startup", this can happend for example if i whant to modify scenario when do some mistake, or pod in cloud is migrated for some reason (stop in one location snd start in enother), all this can happend during long life dialog sessios. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3669#issuecomment-1850654380 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] [kamailio/kamailio] Dialogs loaded from the DB are no longer saved. (Issue #3669)
Hi ! ### Description I have а scenario where dialogs are saved at kamailio shutdown and loaded at startup, the dialog module related configuration: modparam("dialog", "db_url", DBURL) modparam("dialog", "db_mode", 3) When kamailio shut down first time all dialogs a saved in DB, upon startup they loaded as expected, but when in some resonable short time kamailio shutdowned again with active dialogs loaded at startup, they not saved in DB. I think this happens because the dialog dflags in load_dialog_info_from_db function set to zero after dialog loaded, so in update_dialog_dbinfo_unsafe such dialogs are ignored (no DLG_FLAG_NEW, no DLG_FLAG_CHANGED set). Debugging Data Before shutdown: kamcmd> dlg.list { h_entry: 521 h_id: 11463 ref: 2 call-id: 7z32YR9BCg from_uri: sip:X@[::b081:1320::1:2c] to_uri: sip:Y@[::0:201d::a1] state: 4 start_ts: 1702137597 init_ts: 1702137595 end_ts: 0 duration: 18 timeout: 1702144797 lifetime: 7200 **dflags: 643** sflags: 0 iflags: 0 . After startup: kamcmd> dlg.list { h_entry: 521 h_id: 11463 ref: 2 call-id: 7z32YR9BCg from_uri: sip:X@[::b081:1320::1:2c] to_uri: sip:Y@[::0:201d::a1] state: 4 start_ts: 1702137597 init_ts: 1702137636 end_ts: 0 duration: 46 timeout: 1702144798 lifetime: 7201 **dflags: 0** sflags: 0 iflags: 0 ### Possible Solutions At first glance, it's easy to set dlg->flags = DLG_FLAG_CHANGED (or may be to DLG_FLAG_NEW|DLG_FLAG_CHANGED) after loading from the database in load_dialog_info_from_db function, but I'm not sure if this could break anything else (e.g. DMQ). ### Additional Information * **Kamailio Version** - kamailio 5.7.2 (x86_64/linux) * **Operating System**: Ubuntu 18.04.6 LTS -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3669 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] Re: [kamailio/kamailio] TOPOS callid masking (Issue #3606)
Hi ! Thanks for the fix. Can't check this right now. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3606#issuecomment-1780921759 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
[sr-dev] [kamailio/kamailio] TOPOS callid masking (Issue #3606)
### Description PKG memory errors when configured mask_callid in TOPOS. ### Troubleshooting The poblem in detail desribed in mailing lists: https://www.mail-archive.com/sr-users@lists.kamailio.org/msg19997.html ### Possible Solutions Right way to configure topos for callid masking is: modparam("topoh", "use_mode", 1) modparam("topos", "mask_callid", 1) modparam("topoh", "mask_callid", 1) We need to set mask_callid module parameter for topoh also. There is not a word about this in the documentation, so docs correction needed. ### Additional Information * **Kamailio Version** - 5.7.X -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/3606 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-le...@lists.kamailio.org