=========================== Release 3.2.15 ============================== 2023-10-17 Razvan Crainea * [31be1058f] : dialog: only publish cseq mappings for INVITEs (cherry picked from commit 8a6e78ddeb720f3cdbdd69d0ad696eb25a97e729) 2023-10-14 OpenSIPS * [705615b3c] : Rebuild documentation 2023-10-13 Razvan Crainea * [0bd0264de] : b2b_entities: proper handling of overlapping BYE Although in normal circumstances we should reply with a 500 reply code, in case a BYE is received, we should process it accordingly, and as soon as the overlapping transaction completes, we should terminate the other leg as well. Completes c4032f94f3993d1b62a0483eaae3ac0bd6c7c358 (cherry picked from commit 761e8800ad45eb2a674b1d167e02d2904011a414) (cherry picked from commit a9704bba9a88c1965ac3954850a51832f1d0a5ca) 2023-10-12 Bogdan-Andrei Iancu * [53ddfa24b] : [parser] parse_min_expires() returns FALSE if hdr no found Alternative to #3165 (cherry picked from commit b3990ad41c348c6a34e1e0e13033c54427453d79) 2023-10-11 Bogdan Andrei IANCU * [b1bce7059] : Merge pull request #3223 from purecloudlabs/hotfix/wolfssl-client-cert-verify `tls_wolfssl`: Fix certificate verification in client mode (cherry picked from commit a1b2c3c1ca041a3474d432c4ece8f7cdad493c08) 2023-10-11 zhengsh * [b5f166e53] : cachedb_redis_dbase: Fix the type of port with unsigned short. (cherry picked from commit 59b076048b106a4d9c9d8246746fa229526e21e8) 2023-10-10 Bogdan-Andrei Iancu * [0f75f92fe] : [load_balancer & dispatcher] FS stats do not depend on probing Enabling the stats collection (via timer) from FS boxes must not be conditioned by the activation of probing - there is not relation / dependency between the two. Closes #3216 Reported by @spacetourist (cherry picked from commit 14df28478f902826cf9e36b32a6b0da4ddbf3c06) 2023-10-09 Bogdan-Andrei Iancu * [b40bced93] : Fix persistency of the globally set log_level The globally set log_level (via MI cmd) must impact the future forked processes (due to auto scalling). Closes #3146 (cherry picked from commit 942509835adfe59ee841f16f12a876d828be269f) 2023-10-07 OpenSIPS * [f71fe6971] : Rebuild documentation 2023-10-06 Razvan Crainea * [05cbad4f2] : dialog: proper update contact of callee on seq fixes bug introduced in a76af3f Close #3218 (cherry picked from commit fc144da23d806ab691c0b8479f333f599ebfd73f) 2023-10-06 Razvan Crainea * [d25d094dd] : tls_wolfssl: amend patch with Fix RNG with writedup Amend patch with wolfSSL/wolfssl#6843 (cherry picked from commit e393d4cd20957909f34572910b28f1ec7897c2fa) 2023-10-05 Bogdan-Andrei Iancu * [2e3a46a87] : [b2b_entities] proper handling of B2B requests without active dialogs If we have a requests that is 100% looking as a B2B related request, but it's not matching any active/ongoing b2b dialog, better reject with 481 and drop instead of pushing it into the script (where may be proxyed). Closes #3205 (cherry picked from commit caa78d9676017ae93c35862de90974f407ab25e7) (cherry picked from commit 40b54f36efc44adf451161e204cc689a950ad591) 2023-10-04 Razvan Crainea * [e1641a775] : statistics: do not allow duplicate stats in different groups The statistic's name should be unique, whether it is located in a different group or not. Completes 4640465, Fixes #3136 (cherry picked from commit e7f887d354d8d98d9fe00f2ca9edf3b8d4401cba) 2023-10-02 Razvan Crainea * [a3a57d498] : drouting: allow usage of goes_to_gw in LOCAL_ROUTE (cherry picked from commit 483ee0be161fbfd374cc3e631e354b312a05baa5) 2023-09-30 OpenSIPS * [0162dc5f1] : Rebuild documentation 2023-09-27 Liviu Chircu * [b37734b1c] : stir_shaken: Add the `e164_max_length` parameter (interop fix) This parameter allows the 15-digit number length restriction of the E.164 format to be bypassed. Especially useful in scenarios where various telephony number prefixes are in use, causing some numbers to exceed the standard maximum length. Credits to @Integration-IT for watching over the core issue and helping work towards the current solution! Fixes #3202 Fixes #3182 Fixes #3181 (cherry picked from commit 2e662357307a387020b9c16e465a9d093fd29a23) 2023-09-27 Liviu Chircu * [24d8179f3] : stir_shaken VS: Improve several return codes * on bad client-side signature length, return "438 Invalid Identity Header (bad signature)" vs. "500 Internal Server Error" (??) * on encountering expired certificates advertised by clients, return "438 Invalid Identity Header (cert validity)" vs. "403 Stale Date" (?!) * fix abs() related compiler warnings introduced earlier (cherry picked from commit e2977a4f49f1a164369c515bb7a79b5b436aeb31) 2023-09-27 Liviu Chircu * [4a1cf80dd] : stir_shaken: Fix detection for invalid "future Date/iat" This patch fixes a bug where both the Date hf and the "iat" PASSporT claim could be filled in with a random timestamp value "in the future" and still bypass the OpenSIPS "freshness" integrity checks. Issue discovered during OpenSIPIt'03, thanks to Pavel Bussel & Maksym Sobolyev (Sippy Software) (cherry picked from commit 75a168a9f4315e59ba92bdcc2920639176e7f415) 2023-09-27 Razvan Crainea * [54e7edb15] : [WIP] statistics: fix crash when creating a series stat Under normal circumstances, when a statistic is updated, we first search whether it exists, and if not, we add it to the statistics hash. However, due to the way it is implemented, searching and adding a statistic is not atomic, hence, with high concurrency, when adding a new statistic, we might already find an existing one there. In this case, the code tries to return that statistic in the `pvar` parameter - however, that parameter might be a (r/o) function, hence a crash happens. This commit fixes the crash. Close #3136 However, it returns 0, as if the statistic was properly added - the problem with this approach is that from the caller's perspective, we do not know whether the statistic was already there or not, to free the existing structure - hence this might result into a leak. We are still working on a solution for this. (cherry picked from commit 4640465215f131592326363bd0748d9f0e79f04d) 2023-09-26 Bogdan Andrei IANCU * [0e518ba69] : Merge pull request #3189 from Keyyo-Private/fix_ldap_memleak ldap: Fix memory leak (cherry picked from commit d82ddd85d97fcf0b5c3f01e686c9018b9f00e89c) 2023-09-26 Razvan Crainea * [588af72a8] : dialog: increment last_gen_cseq only if initialized Many thanks to Denys Pozniak (@denyspozniak on GitHub) for reporting and providing troubleshooting information. Close #3206 (cherry picked from commit 7bafee1f91327f91c0372318cf0cd8e6dc4bceaa) 2023-09-24 OpenSIPS * [ca6434fae] : Rebuild documentation 2023-09-21 Razvan Crainea * [fe276b430] : build: add patch as requirement (cherry picked from commit 9e87934732a195e8cea262ebac42bfb626633a66) 2023-09-21 Razvan Crainea * [133c6cf30] : tls_wolfssl: adapt patch with upstream Grabbed from wolfSSL/wolfssl/#6785 As soon as the patch gets in a released version, we shall bump our version as well. (cherry picked from commit 2548f475528bb6b31b769be83091bc944ec01f06) 2023-09-21 Razvan Crainea * [4accd444c] : tls_wolfssl: patch wolfssl lib to fix memory leak More information about the leak can be found on the wolfssl issue tracker: wolfSSL/wolfssl#6760 (cherry picked from commit 716f1d633d19e08165917423cb141c29c0f2b2df) 2023-09-21 Razvan Crainea * [427d1fc69] : tls_wolfssl: refactor makefile to use dependencies (cherry picked from commit 3e6a0fcb0f72a56ad066af97f0fabafe8ded2c83) 2023-09-21 Razvan Crainea * [6d4de4983] : digest_auth: fix Makefile detection of SHA256 and SHA512t256 (cherry picked from commit 3c11d3c0f50adcc3a92dc893a11866cd6aafbe13) (cherry picked from commit d92607f2d7825a9d000b14e6f3d9aa037b273b23) (cherry picked from commit d1c8a475186f94e6a8aae74e0ad884663039b0ac) (cherry picked from commit 8fccc49c7c8c0fb3ae4cf500fffebd00914c3db5) 2023-09-21 Razvan Crainea * [f567e7aea] : proto_ws: enclose IPv6 Host IPs with square brackets Many thanks to @alekseiZh on GitHub for reporting it Close #3198 (cherry picked from commit 3b4beb2c4fa7be27032dbc82f0a0be03677db893) 2023-09-18 Razvan Crainea * [a5d0a901f] : b2b_entities: fix Notify buffer timeout build Complete 312cdd4 Related to bug in #3195 (cherry picked from commit 9d61465fe82c1abeb3795915bfc805944abf068b) 2023-09-16 OpenSIPS * [30b3b86ae] : Rebuild documentation 2023-09-15 Razvan Crainea * [850bd1279] : Revert "b2b_logic: properly initialize socket for topo hiding" This reverts commit 3eb9b5bd59a143005013d274f6ee0bd4cc3ce374. 2023-09-15 Razvan Crainea * [3eb9b5bd5] : b2b_logic: properly initialize socket for topo hiding Fix possible crash when no socket is forced in topology hiding scenario (cherry picked from commit 01a3568eff57f56179f3e3b82647eaf489482d11) 2023-09-15 Razvan Crainea * [9274a17ff] : b2b_entities: prevent hop-by-hop ACK to change the status of dialog (cherry picked from commit 4fe2fb6f5cf16dd069c803e3d4542ae8a756a1d3) 2023-09-15 Razvan Crainea * [b9f87017a] : tm: simplify API interface for t_relay and t_check_trans (cherry picked from commit 1bf83d61b6a9607c903bf26ac76ac50a4aca10b9) 2023-09-14 Bogdan-Andrei Iancu * [bb88aee15] : [b2b_entities] Proper handling of overlaping transactions As per RFC3261, Section 14.2 : A UAS that receives a second INVITE before it sends the final response to a first INVITE with a lower CSeq sequence number on the same dialog MUST return a 500 (Server Internal Error) response to the second INVITE and MUST include a Retry-After header field with a randomly chosen value of between 0 and 10 seconds. A UAS that receives an INVITE on a dialog while an INVITE it had sent on that dialog is in progress MUST return a 491 (Request Pending) response to the received INVITE. Changes: * 491 is now generated when receiving a request while already having an outbound one - the old code was generating 491 upon receiving a request while having another INCOMING one :-/ * generate the 500 reply when receiving a new request while handing another incoming one. (cherry picked from commit c4032f94f3993d1b62a0483eaae3ac0bd6c7c358) (cherry picked from commit 59a0af2723be2fcb7da41f753e40e73a66805479) 2023-09-12 Razvan Crainea * [a2ed8cf8d] : rtp_relay: fix removal of context crash Fix bug introduced in 16188f9 due to bad backporting 2023-09-12 Razvan Crainea * [761bb069b] : rtp_relay: remove context from the list on repicated deletes (cherry picked from commit 1af376b71ee235ce723ccda2716ee507c575b8d8) 2023-09-10 OpenSIPS * [58f2d038c] : Rebuild documentation 2023-09-05 Razvan Crainea * [ae413ff72] : rtp_relay: fix invalid contexts leaked in list When a session would have been established on a provisional reply with body (i.e. 183), the rtp contexts would have been stored in the list. However, if the call would not establish (with a 200 OK), there would be no one removing it from the list, even though the context was released - this resulted in unexpected and almost impossible to track down invalid memory usage. The current patch makes sure that the context is removed from the list if the call does not establish. Many thanks to Rob Moore, Daniel Bryars and Steven Ayre from Dubber for pushing an enormous amount of time into troubleshooting and debugging this, as well as to Liviu Chircu for guiding the troubleshooting! (cherry picked from commit d6ef279f63aa0682bf0fb7ef1d30a6abdfb8b942) 2023-09-02 OpenSIPS * [636d8d476] : Rebuild documentation =========================== Release 3.2.14 ============================== 2023-08-31 Liviu Chircu * [b69d8c52c] : siprec: Fix invalid READ operation on freed memory Also tidy up the cleanup phase Thanks to Rob Moore, Daniel Bryars and Steven Ayre from Dubber for reporting it and providing valuable information for troubleshooting! (cherry picked from commit 9996f9fd13adfae5e4cbbad9de5265e43b5a75b3) 2023-08-20 OpenSIPS * [6e9f821bf] : Rebuild documentation 2023-08-16 Razvan Crainea * [532e4c460] : db_sqlite: fix possible crash when the values is relocated When the query does not manage to count the rows in a first shot, the values buffer might be reallocated, which can result in a relocation of the buffer - if that's the case, we should repoint all the old values to the new location, otherwise they will point to an invalid value. Many thanks to Rob Moore and Steven Ayre from Dubber for reporting and helping us testing and troubleshooting this corner case. (cherry picked from commit 45aa9a947c6306f5723132f9c38903988be6cf8b) 2023-08-16 Razvan Crainea * [2bc3a7af5] : db_perlvdb: fix valdata inline Thanks go to @varghesepaul for reporting it Close #3152 (cherry picked from commit 8b2ac92794d1fe2d2e5a2cc6f1b08396a0322407) 2023-08-16 Razvan Crainea * [c733d4793] : rtpproxy/rtpengine: document socket type if protocol is missing Close #3154 (cherry picked from commit 90018c21a1a4a80afb46f83c4f31ba236b85527a) 2023-08-12 OpenSIPS * [d2a8d5b90] : Rebuild documentation 2023-08-09 Razvan Crainea * [8a7d8d039] : prometheus: properly initiate local stats val (cherry picked from commit bc1a9ceab57e9f6a40b35cb2f0fca7e8711e5782) 2023-08-09 Razvan Crainea * [b6232fcd5] : ipc: initialize job structure before dispatching it (cherry picked from commit 243e0e3abe5bbea5ee1384a0964e7c2af7cbe587) 2023-08-07 Razvan Crainea * [ac068b607] : action/params: do not run route if params were not properly built Thanks go to Nick Altmann for reporting it Close #3141 (cherry picked from commit 3cdc8f1ebdbe49f920298ba60d409b6011ea84c6) 2023-08-05 OpenSIPS * [14cd99987] : Rebuild documentation 2023-08-05 Razvan Crainea * [3eda445bf] : dialog: fix warning without proper variables provided (cherry picked from commit 11f613622b74b148f59b2073ff06e234372007b5) 2023-08-05 Razvan Crainea * [c13ee4575] : dialog: complete cseq maps implementation Do not limit the number of maps, update existing in case the same cseq is incremented multiple times (due to authentication), optimize the number of maps and remove them when the transction is deleted. Complete and close #1071 (cherry picked from commit a76af3f49ccc8bf62fbdbf29d240e652e86050c8) 2023-08-05 Ovidiu Sas * [eded1a4c0] : dialog/uac: fix in-dialog authentication - closes #3041 (cherry picked from commit 155995b2bae4e4947c07c4df1cb0901da4a72a82) 2023-08-05 Razvan Crainea * [ef3990871] : dialog: keep a mapping between INVITE&ACK This prevents concurrency bugs that would generate an ACK with a higher CSeq than the INVITE. Addresses #1071 (cherry picked from commit 80ff319d5f9f688369df689418a1d06a4945fbb4) 2023-07-31 Razvan Crainea * [02187e44f] : context: return 0 if pushing context fails 1 otherwise (cherry picked from commit 7c93e59cb07e0e9357d768f64f92aeca1280d002) 2023-07-29 OpenSIPS * [b78df872b] : Rebuild documentation 2023-07-26 Razvan Crainea * [36eb3627d] : b2b_entities: make sure we don't "leak" transaction when canceling it (cherry picked from commit 0a0a0d65a8732231c41f0519dbd737072433e42b) 2023-07-26 Razvan Crainea * [98df1b8c2] : tm: add set_t in API (cherry picked from commit 5339179b011f20b002429649fc30fe95ff26e7d7) 2023-07-25 Razvan Crainea * [ba34ff5a0] : rtp_relay: mark session as successful if we have callee's SDP (cherry picked from commit 9d77b6def960c1dffab7013eb2bab4a2837e3eaf) 2023-07-24 Bogdan-Andrei Iancu * [de98f816c] : [tm] avoid incoming request matching against UAC transactions (cherry picked from commit e6c733595eeeaa74fec18a5911fc45592f45e737) 2023-07-24 Razvan Crainea * [f7fd5b1d8] : siprec: do not require SDP for a 200 OK This should be OK if the SDP was completed on the 183. (cherry picked from commit 2a0990d0886108bb09987bd69be2efd15fe4ac05) 2023-07-22 OpenSIPS * [794f37921] : Rebuild documentation 2023-07-17 Vlad Paiu * [49750d3c4] : set async ctx to 0 prevent crash in timeout_f not being set but reactor still somehow timing out fds (cherry picked from commit cfcd9a65eb6eb41f6c8c5b69a55d0f930c383efc) 2023-07-15 OpenSIPS * [69512abf2] : Rebuild documentation 2023-07-11 Vlad Paiu * [6b8ec335b] : Generate correct OPTIONS pings for NATed devices (cherry picked from commit c4c376484cdbefa9eb8da84dfb0a011a07ddb27d) 2023-07-08 OpenSIPS * [a0bfbe6f7] : Rebuild documentation 2023-07-06 Razvan Crainea * [cbfb959a1] : tm: proper cleanup for anycast CANCEL transactions Thanks go to Rizwan Syed and Jonathan Hulme from ConnexCS for reporting, providing testing environment and support the troubleshooting and fix! Close #3111 (cherry picked from commit 24ec4ebd901c18feba418b7c995faa9778357fc7) 2023-07-04 Vlad Patrascu * [ff1d906b5] : clusterer: fix deadlock when receiving clusterer_reload via cluster Running cluster_send_mi or cluster_broadcast_mi with clusterer_reload as the command to dispatch would cause a deadlock on the receiving nodes. (cherry picked from commit aa8e5ff0a020c1569880fe51a4af54cb9866cded) 2023-07-04 Bogdan-Andrei Iancu * [112694525] : Small code beautification Related to 1d83a0c (cherry picked from commit e455d009436b8ac5f3c879c410d0901a77769820) 2023-07-04 Bogdan-Andrei Iancu * [4f1c5a947] : Merge branch 'warning_delay_timer' (cherry picked from commit daaef52c1375d05e66318d2ae375a304d15f15f4) 2023-07-04 Bogdan-Andrei Iancu * [a038d3abc] : [tracer] properly do per-request traceing in local route As in local route we have only outbound (callee) leg, we cannot the typical incoming request tracing here. We need to "fake" it a bit to look as an outbound tracing. Funny enough, this problem poped only when doing per-request/message tracing in local route; otherwise the per-transaction tracing was doing the correct job. Credits for reporting go to @ovidiusas Closes #3066 (cherry picked from commit 9eb13bf2ca6d8dae84fc84c4c2c113217d36aea5) 2023-07-04 Vlad Patrascu * [3597f5d1b] : b2b_logic: properly reset the current tuple in all cases The global variable used to identify the current tuple in the local_route was not properly reset in all cases (when retrying a birdge action for example). This could lead to a failure to identify the current tuple when acessing the $b2b_logic variables, the b2b logic context etc., even when we're not in the context of a local_route. (cherry picked from commit 92772e69f36dcc70b2418374d83bf3274b13f104) 2023-07-04 Bogdan-Andrei Iancu * [4238e8e22] : [ratelimit] Fix accuracy on the ratelimit timer The computation perform by the ratelimit module is very time sensitive - any deviation of the interval between the runs of the timer handler may lead to false positive detection of CPS thresholds. So, let's move the timer handler from regular timer (1s sensitivity) to utimer (100ms sensitivity) -> 10 times more accurate. Still, the number of triggerings is the same, only the precision is 10 times better. Credits go to @ovidiusas Closes #2797 (cherry picked from commit 03788691a145bd1597ab6c5ec43544718143aad3) 2023-07-04 Bogdan-Andrei Iancu * [39cb0a173] : Fix advertising IPv6 IP addresses Enclose the IPv6 advertised address when using it as string Fixes #2774 (cherry picked from commit 4c16207a5be0bdb12a303e4c932b8bc3345a24f2) 2023-07-03 Vlad Patrascu * [b6b4eb0eb] : clusterer: fix crash after MI reload The crash was caused by accessing a dangling pointer to the capability structure after it was freed. Thanks to Suchi Sahoo from Five9 for reporting! (cherry picked from commit cb8d63193b84909e1c238418dc3e80825ebb746e) 2023-07-01 OpenSIPS * [3fe0f4a55] : Rebuild documentation 2023-06-30 Maksym Sobolyev * [e5a1a69f8] : Remove packages that are auto-installed by GitHub and create a version conflict later when we install our version. This is the reason the build were failing in the past few days. 2023-06-30 Maksym Sobolyev * [e48eb184d] : Move list of required packages into plain text file and GC .travis.yml which "serves no purpose anymore". 2023-06-30 Vlad Patrascu * [715d3c62c] : b2b_entities: fix crashes due to races when deleting entity An entity might have been deleted and freed while the lock has been released when running the entity storage callbacks. Related to #3110 (cherry picked from commit 22bd8184e6c1cbd52ce3be79fbe0c52306226f37) 2023-06-30 Bogdan-Andrei Iancu * [297fc767d] : [uac_registrant] avoid code duplicate Use common/shared functions for pushing / poping new processing context A follow up on 3705209d524b7f61b193df8b56310fe9600e14b1 (cherry picked from commit 44c25dba422671497fda672762acdf4dd27b5a6e) 2023-06-30 Bogdan-Andrei Iancu * [b97e7e030] : [b2b_logic] fix crash on tracing expired b2b tuples When a tuple expires via timer, be sure to provide a processing context, otherwise the tracer (if enabled) will simply crash. As part of the fix, two new helper functions were added for pushing and poping new processing contexts - these are to be reused by some prev similar fix on uac_registrant. Related to #3110 Many thanks to @vtzan for helping with the troubleshooting and testing (cherry picked from commit 2a3eb1e2a8e609b6b7b37074c1d1fd4dffc76f5e) 2023-06-27 Bogdan-Andrei Iancu * [a042588e3] : Fix computing the size to clone for a body part Take the optional header len into account also when cloning a body part struct. This particular bug occured when using add_body_part() with extra hdr parameter in conjunction with an async() operation (or failure route) Credits for reporting and helping with repoducing this go to @thuroc Fixes #3067 2023-06-27 Bogdan-Andrei Iancu * [1c582af8f] : [dialog] fix dropping empty string dlg vals Upon DB recovery (after an OpenSIPS restart) do not drop emtpy string dlg vals - as we do allow creation of such vals via cfg and api and have them saved to DB, it makes all the sense to also restore them This triggers some startup warnings when using in-dialog re-INVITE probing. Closes #3108 (cherry picked from commit e24668131bcd828214c4fb9bccb208e9483a2a4e) (cherry picked from commit dfb9b4f8a5846d55302563bacfbd988d000d8a3d) 2023-06-24 OpenSIPS * [113eda829] : Rebuild documentation 2023-06-23 Vlad Patrascu * [4a5ac1c48] : Also register a custom event from subscribe_event() fixup This will permit raising an event from MI with an event subscribtion done in startup_route without the need to define an event_route for this event or using a raise() in the script. (cherry picked from commit f69b150c8090adb86f2fcaadd56873f61cdb7097) 2023-06-22 Vlad Patrascu * [ecc6e225e] : lua: fix duplicate logs to syslog (cherry picked from commit 949422a938ed12c5b5a820dc4af6de1c437b3798) 2023-06-22 Vlad Patrascu * [7c84bfc8e] : lua: don't register functions under a name This fixes issues with running the "opensips" table functions on Lua library version 5.1. This essentially reverts commit ab964d9. (cherry picked from commit 5e4d10cff40fed34cc419d81d5791b207cfb6a96) 2023-06-22 Bogdan-Andrei Iancu * [3cd6344f6] : Fix reload of timer routes Use a separate, dynamic list of timer tasks that can be update by other proc than the timer itself (which has no info on the script). The proc doing the reload, upon success, re-generates the list of timer tasks corresponding to the new set of timer routes. NOTE: a more complex logic is needed when purging the old set of timer tasks, as they may still be under execution - we use here a pending list where we wait their completion. (cherry picked from commit fce0eaeb241866d0c42db41160ed454be59fd7ed) (cherry picked from commit 0950670879d586439448c4e62be7c065c724cde0) =========================== Release 3.2.13 ============================== 2023-06-21 Liviu Chircu * [d4edccc62] : F_MALLOC: Optimize the free() operation Commit bdaaf60b2c introduced a side-effect of gradually moving the fragment "action" towards the exponential, non-optimized hash table buckets (i.e. buckets 2049 ... 2100). Here, the fragments were inserted in a sorted fashion, with the sorted-insert algorithm costing a O(N) iteration on each free operation instead of a simple O(1). Consequently, the user experience of this effect is that "dr_reload" operations were stalling for 12 minutes (coming up from 24 seconds!), when working with large rule sets (millions of rules). Interestingly enough, the stalling was not due to the caching phase -- malloc() -- rather due to the cleanup phase, when clearing the old rules -- free()! To address this issue: * we drop the sorted insertion completely for buckets 2049 ... 2100, and simply do a list prepend operation: O(1), as with the others * we make all allocation requests from these buckets return the next bucket (!!), thus guarantee'ing our requested fragment. Examples: malloc(18K) -> now you always get a 32K+ frag, but instantly! malloc(37K) -> now you always get a 64K+ frag, but instantly! * this does not make F_MALLOC more wasteful, since the extra frag space gets split anyway into a new fragment, with the two eventually coalescing together again thanks to commit bdaaf60b2c (cherry picked from commit e6b4de51298eb78aef097cbfd1c34ada17b9b78f) 2023-06-21 Vlad Patrascu * [a53ba3d0d] : lua: fix opensips lua API docs 2023-06-20 Vlad Patrascu * [0c4c5abed] : cachedb_mongodb: fix regression in commit 69ed4f7 Loading the cachedb_mongodb module alongside the tls_openssl module, but before tls_mgm would cause a crash. This is a result of the OpenSIPS versus mongoc library openssl initialization issues (initially fixed in commit 298bf6b). Commit 69ed4f7 split all the openssl related code from the tls_mgm module into a new tls_openssl module but some openssl initialization bypasses from the cachedb_mongodb module were left to depend on loading the tls_mgm module (instead of the new tls_openssl module). Fixes #3072 (cherry picked from commit ce177c133724ca913d9e4b0ab12fe30eb44e4561) 2023-06-20 Bogdan-Andrei Iancu * [6a2567ee9] : [tracer] fix bogus multiple tracing When calling the trace() function multiple times from script (to do tracing via different backends), be sure and install all the tracing callbacks (in TM, dialog) only first time. Reported by @gmaruzz Closes #3082 (cherry picked from commit 18ccdbe0efbf327c88026dd9006513a06dd4a348) 2023-06-19 Bogdan-Andrei Iancu * [43acad25e] : [uac_registrant] fix passing wrong context to authenticated REGISTER When sending the authenticating REGISTER, be sure a new context is provided. This will avoid the usage of the context belonging to the first (challenged) REGISTER. This mixup of the context was breaking the tracing of these REGISTER requests via local route. (cherry picked from commit c64766a8526c3953bd5adf45030a29a9aacb4550) 2023-06-17 OpenSIPS * [ff72f5788] : Rebuild documentation 2023-06-16 Vlad Patrascu * [de35e0b13] : b2b_logic: prevent initializing B2B session on non-INVITEs This prevents crashes when the b2b_init_request() function is used on methods other than INVITE or from other routes than request routes where the INVITE SIP message is visible. Related to #3102 (cherry picked from commit 8c0a9e0ae48841e27d4b1e803b584f5de0c3419b) 2023-06-14 Bogdan-Andrei Iancu * [703712eb5] : [dialog] fix too strict restrictions for get_profile_size() The function does not require any existing dialog context, so it can be used from any route (cherry picked from commit a5f85013ea9156410a48614079105a7c5b41fe8e) 2023-06-10 OpenSIPS * [ba30686ff] : Rebuild documentation 2023-06-09 Vlad Patrascu * [312056a33] : b2b_logic: fix issues when new entities are unused New entities created with b2b_server_new() or b2b_client_new() functions would leak if they were not eventually used by a b2b_init_request() call. This would lead to pkg memory leaks and bogus errors from successive calls to b2b_init_request(). (cherry picked from commit c84fe372c50becc177f57732ff087da53b71be0f) (cherry picked from commit d914720b0bbf620a30e5c16ff9548733783295ec) 2023-06-09 Răzvan Crainea * [ed0f04c35] : Merge pull request #3104 from purecloudlabs/hotfix/sipmsgops-allowed-routes sipmsgops: fix allowed routes for exported functions (cherry picked from commit 14e1eab55b67992e4493602248628777d7d6d9a9) 2023-06-04 OpenSIPS * [98f613694] : Rebuild documentation 2023-06-02 Razvan Crainea * [881fdeff1] : topology_hiding: properly quote contact hdr params Thanks go to @manojmth for reporting this on GitHub Close #3090 (cherry picked from commit e767b87123191b9f44db004e3a33b25982724672) 2023-05-29 Razvan Crainea * [9b5890be5] : rtpengine: add docs for via-branch-param (cherry picked from commit 96eac0be302228cc59a0dce8d463e2b3972417c0) 2023-05-20 OpenSIPS * [ad8aea25c] : Rebuild documentation 2023-05-17 Bogdan-Andrei Iancu * [a4e6b551b] : Merge remote-tracking branch 'origin/regex_max_groups_segfault' (cherry picked from commit e09eb58ac63c63da7e00c918de0e132649f01b6a) 2023-05-07 OpenSIPS * [6da0e2d48] : Rebuild documentation 2023-05-05 Bogdan-Andrei Iancu * [8c56c6b9e] : [call_center] fix skill overflow on refreshing agents via MI Completes 6617ecc805520961642c16ac1e6c5a49787af2ab (cherry picked from commit d4db20087ce162e9ea5cb6c4662c2f4c1ac4d31f) 2023-05-04 Bogdan-Andrei Iancu * [d38c9dfe3] : [call_center] fix overflowing the per-agent array of skills As the array of skills is pre-allocated inside the agent struct, be sure you do not overflow it when populating the agent's skills (from DB). Also, the logstate/logged_in value for an agent is read from DB or MI and it must be forced to 0/1 values, as it is later used as index. Yet another overflow fixed here. (cherry picked from commit 6617ecc805520961642c16ac1e6c5a49787af2ab) 2023-05-03 Bogdan-Andrei Iancu * [c07ee02f2] : [acc] removed old workaround multiple int2str() in acc_extra Since 2.3 we actually do not need this, as each acc_extra is individually set into its own buffer. Related to 6c0b37f907d30749266e2deca3c9ccc475dd32e4 (cherry picked from commit 54b03a17276439a24a81d7f55e6d43c92f22637e) 2023-05-03 Bogdan-Andrei Iancu * [eba29c0da] : [acc] workaround for compiling issue Related to 0ff82562bd74a177184b1e179c3a607446c47b78 We need to review this logic (of static_detector) as it looks to be broken as it is now. (cherry picked from commit 6c0b37f907d30749266e2deca3c9ccc475dd32e4) 2023-05-03 Bogdan-Andrei Iancu * [f2e63bd94] : Fix logging multiple IPs in the same time Use a multiple static rotating buffers for convering the IPs to str, so that we can print multiple IPs in the same time. Closes #3062 Reported by @jes (cherry picked from commit 0ff82562bd74a177184b1e179c3a607446c47b78) 2023-05-02 Razvan Crainea * [b45f3ae79] : rtp_relay: do not force flags for `delete` command Before this commit, flags from offer and answer were put together, resulting in bogus flags, since delete does not need any of the initial flags. Instead, we just force one of the participants's flags, that can be overwritten in the config if something else is needed. 2023-04-26 Vlad Pătrașcu * [96914a05c] : Merge pull request #3065 from Ellipsis753/patch-1 Fix buffer overflow in b2b_logic (cherry picked from commit cdb5d49865d6e1c70f330b6519ff8c500bfcef8e) 2023-04-26 Vlad Pătrașcu * [cdf252f63] : Merge pull request #3063 from jes/master Fix 'NO_SSL_GLOBAL_LOCK' typos (cherry picked from commit 895a5344030d57aed55405aa294c567bba6c899a) 2023-04-26 Razvan Crainea * [3acb01c7f] : uac: specify in-dialog auth without dialog limitations in docs (cherry picked from commit c44566adb7b3d63bc3340fed66cac7d3a821d26d) 2023-04-20 Bogdan-Andrei Iancu * [1fbdd048c] : [uac] update and improve docs for uac_auth() (cherry picked from commit 422f815f5e8432f4855398e1cd65bce6c2dcc093) =========================== Release 3.2.12 ============================== 2023-04-19 Liviu Chircu * [f91a4aa0c] : F_MALLOC: Add LHS coalescing on free() operations This is a continuation/rework of commit fb9a3777, which intended to address the de-fragmentation issues where performance would drop. Unfortunately, there were still memory allocation / releasing patterns which still lead to heavy fragmentation. For example, an MI "dlg_list" command, which allocates fragments from Left -> Right as the dialog list is walked: Chunk-1 Chunk-2 Chunk-3 ... Chunk-N After building the MI output, the chunks were also freed Left -> Right. Due to the former allocator logic of RHS-only coalescing, the coalescing would never happen! In some cases, this could lead to fragmentation of an indefinite amount of memory, given enough time (e.g., even 8 GB PKG). This patch adds LHS coalescing to F_MALLOC, such that when "Chunk-2" is freed, in the above example, the allocator tries to merge it with both "Chunk-1" and "Chunk-3" before exiting the free() function (depending on the state of chunks 1 and 3, this could mean 0, 1 or 2 coalescings). This F_MALLOC patch was stress-tested using the mem/test/ testing suite. Many thanks to @fedkis and @ankogan for helping troubleshoot the issue and also test the current version of this patch! Fixes #2726 (cherry picked from commit bdaaf60b2c42681da70f095468c2df1b8dfa8c3e) 2023-04-19 Bogdan-Andrei Iancu * [ddaf6ea35] : [acc] fix leaking of AAA request for CDRs Closes #3019 Credits go to @medeanwz (cherry picked from commit 8be536447664c34548df7b5ab154d45c19a1c126) 2023-04-18 Razvan Crainea * [444cd6b3d] : tm: proper matching of transaction for auto-CANCEL handling (cherry picked from commit c8458a3c166679ef56c6af2017256216d3d4ad8b) 2023-04-18 Bogdan-Andrei Iancu * [0db4e2596] : [callops] Fix bad MI array termination Closes #3057 (cherry picked from commit 2d6dbf7ecbb9f1ad14ff68b15aa650a497b04c9b) 2023-04-18 Bogdan Andrei IANCU * [7af4b673d] : Merge pull request #3060 from purecloudlabs/hotfix/fix-qop-value-for-md5-hashing uac_auth: fix qop-value for MD5 hashing (cherry picked from commit 24ba63a411d46aaf060feda33593785ff9233f2e) 2023-04-10 Bogdan-Andrei Iancu * [d59d43370] : Fix strange `"error":null` JSON node An `error` node with NULL value does not make much of a sense, but let's try to handle it. Closes #3047 (cherry picked from commit 1a8f8e47bf3badc68927fbb573b1e78c596d2055) 2023-04-10 Liviu Chircu * [a1903b1c1] : auth: Avoid abort() if len(secret) is not 32 bytes Before OpenSIPS 3.2, the "secret" modparam supported random-length strings, to be hashed into an MD5 computation when generating the nonce. Starting with 3.2 and the new AES-CBC based nonce generation algorithm, the "secret" has been restricted to 32-bytes only, however OpenSIPS would assert() -> abort() on startup without displaying any helper error if the user supplied a different-length secret. Many thanks to @thuroc for an accurate report on the assert() issue! Fixes #3043 (cherry picked from commit 00a19ede805577c29ae8b65af8a0cb81fc583209) 2023-04-10 Liviu Chircu * [e386c10fd] : event_route: Fix off-by-one error in some $param warning log (cherry picked from commit d4b03b7d0b828c0f7ecd6061cda882a560d6a216) 2023-04-10 Bogdan-Andrei Iancu * [0680e263c] : Fix doc typo Closes #3048 (cherry picked from commit d8b28e4cd00b4678feed491929bd1df42a70e096) 2023-04-06 Razvan Crainea * [e89e5fc9b] : rtp_relay: proper check remaining sessions for failed branches 2023-03-31 Razvan Crainea * [409c22a2e] : b2b_entities: fix cherry-pick merge in previous commit (cherry picked from commit 789893166e2bf1020f23eaf29d01fde2ab4224d6) 2023-03-31 Razvan Crainea * [0e4197ee5] : b2b_entities: match e2e ACK according to dlg, not transaction This change presumes that uas_tran is no longer reset on 200 OK, but kept in memory until the ACK comes in. (cherry picked from commit 11f685ffae7f651004d349ada32579f260fa63ca) 2023-03-31 Razvan Crainea * [1205184eb] : tm: expose t_release_transaction in API (cherry picked from commit 66bc6fd8f3e82f02919e27a8d728c09b0aa3615e) 2023-03-30 Vlad Patrascu * [39724fd71] : b2b_logic: ignore replies to NOTIFYs sent while bridging This will get rid of the races between the processing of the replies for the NOTIFY and the subsequent BYE sent to the bridge initiator. The entity might be already deleted as a result of handling the 200 OK for the BYE before we try to do a lookup again for handling the NOTIFY reply. These races would not produce any significant negative effects but OpenSIPS would log unnecessary 'No b2b_key match found' errors. (cherry picked from commit a72cfbeda919eca0020d34e33c844cc3b49a3b71) 2023-03-30 Vlad Patrascu * [d47503c52] : b2b_logic: fix a bridging issue when using the 'peer' identifier Don't fail the bridging action when using the 'peer' identifier for the b2b_bridge() function and the current entity is already deleted. (cherry picked from commit 266e5524ad11732912d6e990d499aedf25ea1eed) 2023-03-30 Vlad Patrascu * [53b0a53ea] : b2b_logic: fix crash when sending NOTIFY for local timeout This commit fixes a crash when using the 'n' flag of the b2b_bridge() function, and a local timeout occurs. The crash was caused by improperly setting the first line of the the dummy SIP message built by the b2b_entities module. (cherry picked from commit 312cdd4da1a1a23429b7e2a47c0889795c50c8a3) 2023-03-29 Razvan Crainea * [688365067] : params: duplicate INT value as string This prevents errors raised when comparing the INT with STR (cherry picked from commit 89b7c8d5c84bcf131da3554480ed2573e28c5825) 2023-03-28 Razvan Crainea * [5392ea0d1] : params: initialize expanded parameters Also, do not indicate that an INT also has a STR value if it doesn't, because other functions might try to evaluate it; and combined with the lack of initialization, it might end up reading whatever leftovers are in the `.rs` field, posibly leading to a crash. Many thanks to Nick Altmann for reporting this and Liviu Chircu for testing and support :) (cherry picked from commit 16f5212d865fd75ca6f519381358e031ca9a10e2) 2023-03-23 Maksym Sobolyev * [435561e67] : Get rid of the ubuntu-18.04, add clang-14 and clang-15. 2023-03-23 Maksym Sobolyev * [a23bae73a] : GC unused variable. 2023-03-23 Maksym Sobolyev * [f9f9abcb6] : clang-15 fix: make child_init() prototype match actual function. 2023-03-23 Maksym Sobolyev * [e57592664] : clang15 fix: define function prototype properly. 2023-03-23 Maksym Sobolyev * [69737a8e4] : clang 15 fix: get rid of variable that is set but not used. 2023-03-23 Maksym Sobolyev * [fdd4f76ae] : Fix prototype for lcache_htable_destroy() to match implementation. 2023-03-23 Maksym Sobolyev * [a07ae74c4] : Fix build with clang 15: get rid of the 30-year old PROTO_LIST hack to deal with some prehistoric compilers. Switch public API to use char *, not unsigned char *, which is kinda pointless. Also make arguments const where appropriate. 2023-03-23 Maksym Sobolyev * [b6f00e89f] : Set POLLRDHUP on Linux when polling rtpproxy's socket to drain any unclaimed data. This seems to be necessary on TCP sockets otherwise poll() appears to hang indefinitely if rtpproxy has been terminated despite timeout being set to 0 (i.e. don't block). With this flag set the disconnect is properly detected and socket is re-connected after configured timeout. 2023-03-23 Bogdan Andrei IANCU * [1e9c49250] : Merge pull request #3038 from okhowang/tracer-leak tracer: Don't modify shm msg in trace_onreply_out (cherry picked from commit 9c2d99de6c40c53dc1419fe237b23d8b956bd647) 2023-03-23 Bogdan Andrei IANCU * [c312b5a7c] : Merge pull request #3012 from purecloudlabs/bug/rport_param_corrupts_via_header add_local_rport script function corrupts VIA header params (cherry picked from commit 8f41fccfa19a0a8070b48b4cd8caeb0a4a78e3fd) 2023-03-22 Bogdan-Andrei Iancu * [108ac960a] : [dialog] fix bad examples with invalid profile name The name of a dialog profile is an alphanumerical string. Make this clear in the doc and also fix the broken examples. (cherry picked from commit a6ef1968887696da8932a8350e532af8f7f9be44) 2023-03-20 Maksym Sobolyev * [3b0cb05cb] : Fix skip_name() to not generate strings with bogus length. Discovered by OSS-Fuzz. 2023-03-20 Maksym Sobolyev * [df9fb6324] : Fix a pkg memory leak: when parsing of the Contact fails, free all associated parameters that have been parsed so far, not just the contact structure itself. Reported by OSS-Fuzz. 2023-03-20 Maksym Sobolyev * [f75381b4a] : Expect that protos[proto].name can be NULL. 2023-03-20 Maksym Sobolyev * [60491604a] : Fix off-by-one error allocating space for protos[]. Reported by OSS-Fuzz. 2023-03-20 Maksym Sobolyev * [d7db1eadd] : If we did not request qop to start with when challenging then no additional work needs to be done after receiving authentication with no qop. Reported by: efes99999@gmail.com, callum.guy@x-on.co.uk, gshepard@sangoma.com 2023-03-19 OpenSIPS * [c0f4acc6f] : Rebuild documentation 2023-03-17 Bogdan-Andrei Iancu * [444f0264f] : [async] fix setting restoring type route after running report route for launch() Fixes #3034 (cherry picked from commit c0af4fe6a4cd3c1119d765320f8a1b2e5d4dc9b5) 2023-03-16 Vlad Pătrașcu * [89d03ea9a] : Merge pull request #3018 from doopage/3.2-fix-b2b-null-to_uri Fix NULL to_uri due to b2b_msg_get_to is called after accessing to_uri 2023-03-16 Bogdan Andrei IANCU * [8c1f10c7e] : Merge pull request #3020 from nexbridge/temp Fix bug in weight-based sort (cherry picked from commit 48c051fc16f4d83bf176d1eefe1df642882b6b88) 2023-03-16 Bogdan-Andrei Iancu * [a162879b7] : Revert "Update drouting.c" This reverts commit bf4c8a9426a6211993acf342136a87bc0847c890. 2023-03-16 nexbridge <13848887+nexbridge@users.noreply.github.com> * [bf4c8a942] : Update drouting.c In weight_based_sort() function: - Changed RAND_MAX to RAND_MAX + 1 to make sure that quotient is always less than 1 - Changed float to double to avoid rounding errors, particularly when the value of rand() nears RAND_MAX and thus the quotient could round to 1 (cherry picked from commit 6ef8168a8de88d04512b3aa6bb888ac3794fb142) 2023-03-14 Razvan Crainea * [3d107a0a8] : event_route: fix crash when raising with no params When raising an event using `raise_event` with AVP values that are not correctly populated, it triggers a corner case in the event_route module: the module "serializes" the parameters just after the event, hence, if there is no expanded parameter, the first parameter ends up pointing to a bogus value, resulting in a crash. This commit fixes this corner case by treating it (0 expanded parameters) just as if there no parameters passed at all. Many thanks to David Escartin from Sonoc for the help in troubleshooting this issue! (cherry picked from commit 7f845994b1ba43f8ffc0c0bdc6c9b8065a935955) 2023-03-12 OpenSIPS * [377c67df0] : Rebuild documentation 2023-03-10 Bogdan-Andrei Iancu * [b1f580e41] : Fix race in TCP Main <> TCP Worker communication As a TCP worker has 2 comm channels (one TCP worker specific and one worker generic) to TCP Main, be sure we have a consistent communication (over the 2 channels) between the TCP worker and TCP main. The actual fixed race: the TCP workers creates a new TCP conn (and sends this event as TCP worker to Main) and when trying to write to the conn it fails (and sends back a bad-conn event to Main, but as generic worker) - the 2 events are delivered via different comm channels, so their order may be lost, reasulting to bogus behavior (cherry picked from commit bfb62212ea4b4895b3174653b11d33e7ecb92751) 2023-03-08 Vlad Patrascu * [e9cc77282] : clusterer docs: fix module parameter name (cherry picked from commit 3b577388089f405dc633bfc3184ce0fcab3f21a5) 2023-03-07 Maksym Sobolyev * [ee0467ef6] : Fix what seems to be a typo, calling sockaddru_len() on unitialized local structure is likely to produce bogus result causing getsockname() to fail silently and produce no useable address. This error has been masked on Linux, since Linux has no sa_len structure and the sockaddru_len() in that case defaults to sizeof(struct sockaddr_in) unless local_su happens to have s.sa_family==AF_INET6. This however means that IPv6 has been somewhat broken for TCP & TLS. 2023-03-07 Vlad Patrascu * [3f61bbe09] : tls_wolfssl: fix regression in commit 77f5f5a The wolfSSL_CTX_load_verify_locations_ex() function would still return an error when no valid CA certificate was found in the directory. Since before commit 77f5f5a, opensips startup would not fail when wolfSSL_CTX_load_verify_locations_ex() would return an error, the change in the above commit would constitute a regression for cases where no valid certificate is found in the directory. This commit brings the wolfssl behavior further in line with openssl. (cherry picked from commit 9999d313733d0731941374526e8a2db030819c38) 2023-03-07 Razvan Crainea * [912530b5a] : avpops: document the returned value in case of NULL Due to the fact that an AVP cannot contain `NULL` values, we cannot store `NULL` database values in AVPs. Hence, we store the `` value This commit simply documents the behavior, as reported in #3027 (cherry picked from commit fc35f7308efd6d2623e36adf048911be86b7b749) 2023-03-06 Liviu Chircu * [89080a3ea] : rest_client: Improve async() handling in "delayed 200 OK" scenarios In case the 200 OK reply or its body take several seconds to arrive, do not break the loop prematurely due to a 500ms hardcoded loop timeout and re-use the configurable "curl_timeout" modparam as loop timeout instead. (cherry picked from commit 532d8e83726f96f8e8d2c493a1e7cb0f54615869) 2023-03-05 OpenSIPS * [adc5c85c7] : Rebuild documentation 2023-02-28 Razvan Crainea * [e8170abbd] : media_exchange: properly handle internally generated timeouts (cherry picked from commit de5347c29071bbb91e3c1509333c6e8cc9e981e4) 2023-02-27 truong.hua * [33bf27722] : Fix NULL to_uri due to b2b_msg_get_to is called after accessing to_uri in case of adv_ct is not set, so contact uri can not be parsed if advertise_contact is not provided 2023-02-26 OpenSIPS * [0726e126c] : Rebuild documentation =========================== Release 3.2.11 ============================== 2023-02-21 Vlad Patrascu * [974d34b2d] : b2b_entities: remove no-op and improve code clarity Related to #3011 (cherry picked from commit 4b3ff72b7fd76afb884fdd6488802d1ffe2bc4fa) 2023-02-21 Ovidiu Sas * [e4341ab28] : b2b_entities: don't try to get the lock if the l;ock was alredy taken - closes #3011 - this part of the code should be reviewed and cleaned up or clarity (cherry picked from commit a7eb936241b6187a94416aae4f05314cecd915cd) 2023-02-21 Razvan Crainea * [85cc2aff3] : b2b_entities: avoid deadlock for certain scenarios When a call was terminted with a BYE from the handler of the 200 OK reply, the entities lock would remain locked, generating a deadlock. This commit fixes this (and possible other) situations by generically keeping a track when the lock is taken and unlock it before exiting. Thanks to Vlad Patrascu for helping with debugging and solution for this (cherry picked from commit 87661e1f14f9be6d957cd25c9f7dbe58d6ce0c82) 2023-02-20 Liviu Chircu * [e201d69d3] : xlog_level: Do not abort startup on a negative value (cherry picked from commit 16472ab84d4f35f408bde121e033e9664d992124) 2023-02-20 Liviu Chircu * [52f45813c] : usrloc: Remove bogus "unsused" parameter to MI 'ul_add'; Improve docs (cherry picked from commit 227f2c82d9f2d43f632e9a865f54fd8b0605659c) (cherry picked from commit af4d6a0365e7ce14ea5100bb880b1dff01257765) 2023-02-19 OpenSIPS * [1ec8c054c] : Rebuild documentation 2023-02-17 Maksym Sobolyev * [18edae8f8] : Revert "ci: add cifuzz integration" This reverts commit 60e1d3a76e249a81e4a9810cf5b7550a86cda9e5. As discussed with Liviu, the decision to keep CiFuzz in master branch was an intentional one, so stil with it. 2023-02-17 Liviu Chircu * [1d83b8c07] : statistics docs: Fix quoted integers in function call example Credits to Fabien Aunay for the report! (cherry picked from commit 31f526555ee9ba22ba1ee702a3c5994a133e6d38) 2023-02-16 Ovidiu Sas * [a6e60a929] : cachedb_sql: fix warning: this `if` clause does not guard... [-Wmisleading-indentation] msilo: fix warning: this `else` clause does not guard... [-Wmisleading-indentation] 2023-02-16 Maksym Sobolyev * [0d438d00a] : Make b2bl_bridge_extern() & internal_init_scenario() implementations match prototype. 2023-02-16 Maksym Sobolyev * [c4a9d9f9b] : Don't pass unsigned short * into a function that expects unsigned int *. This fixes the following error building with gcc on ubuntu-22: sipmemcache.c: In function `l_sipmemcache_server_add`: ../../ut.h:685:13: error: array subscript `unsigned int[0]` is partly outside array bounds of `in_port_t[1]` {aka `short unsigned int[1]`} [-Werror=array-bounds] 685 | *_r = 0; | ~~~~^~~ sipmemcache.c:72:13: note: while referencing `iport` 72 | in_port_t iport = 0; | ^~~~~ 2023-02-16 Maksym Sobolyev * [2127b4b54] : Remove comparison that is always "true". Reported by: gcc-12 2023-02-16 Maksym Sobolyev * [6d39836a7] : Fix logical condition that would otherwise always be "false". Reported by: gcc-12 2023-02-16 Maksym Sobolyev * [e47c51257] : Add missing {} as reported by the gcc-11. 2023-02-16 Maksym Sobolyev * [87087fba4] : o Set -Wno-compound-token-split-by-macro needed to get things building up with clang > 11. o Unify common code in the perl modules to fix db_perlvdb as well with clang > 11. 2023-02-16 Maksym Sobolyev * [ac4b102bb] : Make identation match compiler behaviour. This fixes build with gcc-11. 2023-02-16 Maksym Sobolyev * [76ea3ab1c] : Make geoip2_get_field() function declaration match prototype. 2023-02-16 Maksym Sobolyev * [4dc31db2d] : Cast void * to int first before we can it to enum. This is to fix the build on clang-11. 2023-02-16 Maksym Sobolyev * [1ad15d097] : GC variables that is set but never used. This breaks builds with latest clang. 2023-02-16 David Korczynski * [60e1d3a76] : ci: add cifuzz integration Add cifuzz integration so oss-fuzz fuzzers are run 600 secs each PR Signed-off-by: David Korczynski 2023-02-16 Maksym Sobolyev * [90587bdbe] : o Add ubuntu-22.04 builds. o Add gcc-11, gcc-12, clang-11, clang-12 and clang-13. o actions/checkout@v2 -> actions/checkout@v3. 2023-02-16 Maksym Sobolyev * [41fcfcbe9] : Fix unixodbc & friends to 2.3.7 to fix recent build issues on GH Actions. 2023-02-16 Liviu Chircu * [cf793390f] : route params: Fix regression in 8761ce6d20 The patch assumed that variables with PV_VAL_INT|PV_TYPE_INT have symmetric values (e.g. 5 and "5"), whereas this is not always the case (e.g. 1 and "INVITE", returned by $rm) and would proceed to duplicate the output buffer as a int2str() buffer, for safety purposes. The fix is to avoid the duplication completely (i.e. do not overwrite "INVITE" with "1"), thanks to the route params array string buffers having a sufficiently large lifetime in order to be safely returned to the calling code asking for the route parameter. (cherry picked from commit 6b9e140f6576ba66be6f74e686a5fd33c0a16603) 2023-02-12 OpenSIPS * [2ac8b1684] : Rebuild documentation 2023-02-08 Liviu Chircu * [e447586f3] : parse_content_length(): Fix out-of-bounds read edge-case (OSS-Fuzz) This patch fixes several off-by-one read overflows while parsing a bad Content-Length header. Similar to a008e7c23, the error was mostly harmless, as the supplied buffer is typically much larger in the runtime usage of parse_msg(). Severity: Low Fixes OSS-Fuzz#53397 (cherry picked from commit e060fe93429b6da665a4d4210a49876b43223a17) 2023-02-08 Liviu Chircu * [2af46768f] : struct hist: Also record the history for "NULL" objects While the history of a "NULL" object isn't much of a rich/useful piece of information, allowing it may help prevent errors in some cases, due to "sh_push()" returning an unexpected NULL value => crash. (cherry picked from commit cad9bd0b6c210f303f42d6687643b3c0e48aa87c) 2023-02-07 Liviu Chircu * [3c6473821] : Fix ARM-32 compile warning (cherry picked from commit ecd5676867443f63c6d568281807cf71dae40c61) 2023-02-07 Vlad Patrascu * [2f28803eb] : mem: fix compilation if HP_MALLOC is defined and Q_MALLOC is not (cherry picked from commit f602982156b6ff6b83cd7e57e5e42e02f0b37dc4) 2023-02-07 Liviu Chircu * [74d93c43b] : parse_content_length(): Fix out-of-bounds read edge-case (OSS-Fuzz) This patch fixes a possible off-by-one read overflow while parsing a bad Content-Length header. The error was mostly harmless, as the supplied buffer is typically much larger and is stored in PKG memory. Severity: Low Fixes OSS-Fuzz#53199 (cherry picked from commit a008e7c2385bcd83de2f9ab155ed8a9452bf3c5c) 2023-02-07 Bogdan-Andrei Iancu * [f040056ba] : Avoid publishing pkg and load stats for procs with no IPC If IPC is not supported by a process, the pkg stats cannot be collected from it. Also such process is not able to compute internal load. (cherry picked from commit cd191d4b2ce9ab65764c14031b1faa5ae7272df3) 2023-02-06 Vlad Patrascu * [1225b0191] : b2b_logic: fix crashes due to dangling tuple pointer Make sure to not access a tuple that might have been freed while not holding the lock. Many thanks to David Escartin from Sonoc for the help in troubleshooting this issue! 2023-02-06 Vlad Patrascu * [65a8da41f] : b2b_entities: fix crashes after running the script request route After releasing the lock and running the script request route, check if the dialog has not been deleted in the meantime. Credits to David Escartin from Sonoc for reporting. 2023-02-06 Vlad Patrascu * [da6975f06] : b2b_entities: properly handle BYE while another request is pending Instead of rejecting the BYE with 491, first complete the transactions on the UAS side with 200 OK for the BYE and 487 for the other pending transaction. Also, mark the tuple for deletion at b2b_logic level and send a BYE to the peer entity after completing any UAC transcations on this side. Credits to David Escartin from Sonoc for reporting. 2023-02-06 Ryan Bullock * [551a6d82c] : Use msg_flags instead of script level flags. Prevents unintentional collision with script flags which could cause calls to mc_compact and mc_compress to fail. (cherry picked from commit 0cfb7c3b4dcb71fe26ed788bc7c94c56476b720d) 2023-02-05 OpenSIPS * [c6f145b15] : Rebuild documentation 2023-02-02 Bogdan-Andrei Iancu * [e13fa97b4] : [tcp layer] avoid locking and events while shutdown Upon shutdown, when all the TCP conns are destroyed, do not use any locking (we are in single process mode any how) and do not raise any disconnect events (false events here) (cherry picked from commit f953b30c42f84f5709bbc125ddf016d499f55485) 2023-02-02 Razvan Crainea * [7f6d9016d] : lua: proper include for timegm Thanks go to Jonathan Wakely (@jwakely on GitHub) for reporting it. Close #3005 (cherry picked from commit acf0c149503b034955557020ea1ad89713cded12) 2023-01-31 Vlad Patrascu * [1768c8dc6] : tls_wolfssl: complete fix in commit 77f5f5a This also ignores errors due to bad path, same as openssl does by default. (cherry picked from commit d919285009aae706539b9874ed551fe4ceecd9c3) 2023-01-31 Vlad Patrascu * [9b925275c] : tls_wolfssl: ignore invalid CAs when setting ca_dir This will align the behavior of opensips when using wolfssl or openssl. Credits to @benceszigeti for suggesting the solution. Closes #2955 (cherry picked from commit 77f5f5a0a248575a26ffc8052dc44f509aa2e6e1) 2023-01-31 Vlad Patrascu * [0f30bd74b] : tls_wolfssl: update wolfssl library to version 5.4.0 (cherry picked from commit f0c34ddbbac497f336fa5f8d769117abd2239ec5) 2023-01-31 Bogdan-Andrei Iancu * [341266419] : [pua] Fix silly mixing of bits versus bytes in sizeof() Related to ed8bf4d47a5302b74006ce0312797928fc843e98 (cherry picked from commit 5610c03fb14ada7e28f4a05b3928020883bf0773) 2023-01-31 Bogdan-Andrei Iancu * [60370c33f] : [pua] force pres_id a unsigned_int during calculation To avoid any issues due to "singed" overflowing (cherry picked from commit ac99224ef22ece40e3dcd11417712db84d910bb7) 2023-01-31 Bogdan-Andrei Iancu * [524c62fb4] : [pua] fix the computing of presentity ID (pres_id) - be sure the hash size does not overflow (on user setting), as it has to fit on half long size - when computing pres_id, be sure to cast to long to avoid premature overflow - when incrementing local_index, be sure it does no overflow half long size (cherry picked from commit ed8bf4d47a5302b74006ce0312797928fc843e98) 2023-01-31 Bogdan-Andrei Iancu * [fff1381a1] : [dispatcher] Fix hackish extraction of TO URI upon pinging Better use the URI stored in callback params, rather then using the hackish way of extracting the URI from the T-stored To hdr. This is a side effect of 9af1926 Reported by @denyspozniak Closes #3000 (cherry picked from commit e7aeb9723c70e57b472293027135fd2e80d461d9) (cherry picked from commit 596755f0ec3ae1de27f74c9cb644b491ed86467b) 2023-01-31 Bogdan-Andrei Iancu * [da15ab3ae] : [dispatcher] fix chaining and freeing of probing packs Some probing packs may be freed before ending circulating the list (if the prob sending fails), so we need to take care of the linking. (cherry picked from commit c6bcd8435c5b3a648efc28a7173a43653257eb40) (cherry picked from commit 9705834ab26619a1712cbe6f1fed6988c150804a) 2023-01-31 Bogdan-Andrei Iancu * [322e9b962] : [dispatcher] Improve probing by sending the probs outside locking Collect the data under locking, move the OPTIONs probing outside the locking, to be sure that any potential blocking on SIP level sending is not leading to lock starvation. Simialar to 4c7a7a83f93b18eefe4de1fe13c67f9d7561e6a3 (drouting) Related to #2438 (cherry picked from commit 8139e2799ee8d39e9cc99a189f2b2baa2eb0c39d) (cherry picked from commit d65f37ed01a8cc0ef4aa42ea64e3263755ea8925) 2023-01-29 OpenSIPS * [af671fd20] : Rebuild documentation 2023-01-27 Maksym Sobolyev * [72610573a] : Relax qop validation: according to the RFC8760 if the qop is not provided, the qop=auth should be assumed. Issue: #2995 (cherry picked from commit 6f8af86728f278d72d472a85cef7079cd0b54aed) 2023-01-26 Liviu Chircu * [11dc11ef5] : mi_script: Add support for array parameters (cherry picked from commit fb686b8ca22baadd23dff5672c2df43e73e2e2d5) 2023-01-25 Razvan Crainea * [5e4c0b907] : route: pass parameters as values When calling route(NAME, $pv, ...), expand the `$pv` before running the route - this way the parameter is passed as value, rather than reference, which could lead to some unexpected behavior. (cherry picked from commit 8761ce6d2089915f18db6ae21677a690a6958bac) 2023-01-23 Razvan Crainea * [e4c11d992] : tm: remove cluster received '\0' from buffer len When sending a message through cluster, the tm module adds a '\0' terminator to the message - that is because receive_msg expects it. However, this character should not be part of the message lenght. Reported by Denys Pozniak on mailing lists. (cherry picked from commit 81e9b14a16acd284469d8958c57dcece69699a85) 2023-01-23 Razvan Crainea * [34c432510] : dialog: do not remove SDP if no SDP is provided (cherry picked from commit d92f870ca34c551aa01a7a5531d0cca4e304ce27) 2023-01-22 OpenSIPS * [44b369399] : Rebuild documentation 2023-01-19 Bogdan-Andrei Iancu * [88bae8421] : Fix building TO / FROM hdr via t_uac() t_uac() gets URIs as values for TO / FROM, so these URIs may contain URI params. If those URIs are placed into headers without <> enclosing, their params will become header params :( So, to be sure, let's enclose the URIs all the time. Closes 2843 (cherry picked from commit 9af192693f419751ff3fc704d5286274752171b1) 2023-01-18 Liviu Chircu * [f1208da7a] : Merge pull request #2991 from doopage/3.2-fix-b2b-crash Fix crash when restore b2b with tracer enabled due to NULL msg 2023-01-18 truong.hua * [abec071cf] : Fix crash when restore b2b with tracer enabled due to NULL msg 2023-01-16 Bogdan-Andrei Iancu * [38e693291] : [tm] fixed double freeing on t_uac() callback param If the t_uac() fails after the transaction was created (like it fails while trying to send the buffer out on the network), a double free will be done on the eventual callback func params: (1) via the released function attached to the completion callback (this will be automatically done upon free_cell() and (2) when t_uac() returns failure to the upper layer. The fix is NOT to free the param if the t_uac() returns error. So even if the transaction was created, remove the release function on the callback func params, to prevent the free (1), and to allow the upper layer to do its own cleanup. (cherry picked from commit 8448551cc4c1b6d4069790e54a149f4ffd0b4c47) 2023-01-15 OpenSIPS * [7cd9e5b4b] : Rebuild documentation 2023-01-13 Vlad Patrascu * [e9cb286a5] : tests: properly support malloc tests for any available allocator (cherry picked from commit 23eb399abc901e45180ef712d86eb10b8d9291e8) 2023-01-12 Vlad Patrascu * [af074989b] : mem: align all prototypes for realloc functions (cherry picked from commit 379dadab58f5c3c77707259710625cd3558168f9) 2023-01-10 Liviu Chircu * [ff5fc7e0b] : Makefile.test: Fix linking with multiple -DUNIT_TESTS Credits to Vlad Pătrașcu for the report! (cherry picked from commit 1f13945b746bb448c9a5eb8a9a086944d3b12538) 2023-01-10 Liviu Chircu * [23ba044f2] : freeswitch_scripting docs: Fix rc checks in examples (cherry picked from commit 76c18ce1ad9edf70ea12dd1b3fb26b43a6b12ffc) 2023-01-09 Razvan Crainea * [2edcae949] : rtpengine: add the cookie len to the iovec buffers This fixes rtpengine from sending the appropriate dictionary end 'e' in the buffer sent over the network. Thanks go to @ankogan on GitHub for reporting it. Close #2985 (cherry picked from commit 99d14dad58554a39adf1b75167aeae8fd3863884) 2023-01-08 OpenSIPS * [26af95e19] : Rebuild documentation 2023-01-06 Liviu Chircu * [e2b698a7c] : acc: Fix drop_accounting() (do not be a NOOP!) The bug here was that `drop_accounting()` was building its bitmask as: flag_mask = types * flags; ... whereas it should have done the same as in `do_accounting()`: flag_mask = types + types * flags; ------- ^ the actual acc types to reset were missing! (cherry picked from commit 211a63c9b2ccac346dfc57bca2ede71d286e9989) 2023-01-04 Liviu Chircu * [c976f5584] : dialog: Fix a race condition on mid-dlg Contact updates The "contact update on mid-dialog 2xx reply" logic may be invoked in parallel, in case two simultaneous UPDATE transactions are being processed, for example. This patch adds locking, to prevent a possible abort due to "double free" while updating the Contact. Also fix a small bug where the dialog is still flagged with DLG_FLAG_CHANGED, despite the malloc() failing during Contact update. (cherry picked from commit 7dfe2857eef8e109e2c984867eb5e80193f220e1) =========================== Release 3.2.10 ============================== 2022-12-18 OpenSIPS * [9fef177b6] : Rebuild documentation 2022-12-14 Vlad Patrascu * [ed783c473] : b2b_logic: add ability to retry the initial bridge via API This allows the call_center module to properly move the call to the next agent or the queue, when the first agent rejects the call and a welcome message is not used. 2022-12-11 OpenSIPS * [a738a11cc] : Rebuild documentation 2022-12-07 Liviu Chircu * [2fc091b4b] : db_mysql: Do not read freed PKG memory after 1st failed reconnect During db_mysql_connect(), make sure to reset the "init" status after free'ing ptr->con. Per MySQL 5.7 docs on mysql_close(): "Closes a previously opened connection. ... Do not use the handler after it has been closed." (cherry picked from commit d616ed3f979100639ed43e45fd3123ccba787535) 2022-12-05 Razvan Crainea * [3861f458d] : b2b_entities: add more entropy to from_tag generation The initial from-tag generation cosisted of an md5 hash over the From URI. Thus, if you would have generating client requests to the same entity (such as a media server), you would always get the same from-tag for all those requests. The current patch adds more entropy when generating the from_tag, such as the current timestamp (expressed in milliseconds) along with the process pid. (cherry picked from commit b003891b468d5730fd68b445331735a92c770bce) 2022-12-04 OpenSIPS * [bd00ee233] : Rebuild documentation 2022-11-28 Callum * [889e9bbbb] : rate_cacher: :bug: fix parameter types (cherry picked from commit c8219a87024ef864f22a368dd84516cc617abb06) 2022-11-28 Callum * [a7a138a8f] : rate_cacher: :bug: fix parameter typo (cherry picked from commit 0ec0936bac2dbf6ca6c930b5e76ae147a0ad4245) 2022-11-27 OpenSIPS * [864299f5c] : Rebuild documentation 2022-11-25 Liviu Chircu * [5abdfb6f6] : rtpengine: Fix possible startup crash in notification process When the "notification_sock" modparam was set, the process responsible for notifications would start by scanning a non-NULL terminated string past the end boundary, sometimes leading to a crash on startup. Fixes #2947 (cherry picked from commit cb59a84fcccc4ee34a1c1ddbd4fd09cc0c5834a0) 2022-11-24 Liviu Chircu * [7ba55a8dd] : rabbitmq: Fix bogus debug log Credits to Nick Altmann for the report! (cherry picked from commit aaeaf245733cedea540912442a6782325926db11) 2022-11-24 Liviu Chircu * [7f04e91ad] : compression: Fix math bug leading to bad Content-Length Fix an edge-case in mc_ndigits() causing Content-Length values starting with "10..." to be incorrectly counted. (e.g. "107" produced 2, not 3). This bug affected both mc_compact() and mc_compress(). (cherry picked from commit 37213d245c63e426a16004ab161823bd5c2cc1ec) 2022-11-23 Razvan Crainea * [745a7cb7a] : siprec: unref failed dialogs Close #2674 (cherry picked from commit e3c74a39df0fd5f5b58679183ade8eee2e0749f6) 2022-11-20 OpenSIPS * [fd78962d4] : Rebuild documentation 2022-11-18 Liviu Chircu * [e05a30109] : mid_registrar: Fix occasional undesired De-REGISTER forwarding in mode 2 If the timings were aligned in a specific way, the mid-registrar (in AoR throttling mode) would actually forward a De-REGISTER downstream even though it had at least 1+ healthy remaining contacts after having applied the De-REGISTER locally. This would cause some degree of service loss, as the remaining UAs were registered on the mid-reg, but not on the backend. Many thanks to Carlos Cruz Luengo (@cruzccl) and @ryan-netizen for an accurate report, as well as helping come up with the fix! Fixes #2615 (cherry picked from commit 502f1ab66257628f06bee7bf8ea4564ab5e8a160) 2022-11-18 Liviu Chircu * [0bd0c1ef4] : sipcapture: Fix missing lock release on "buffer too small" errors Many thanks to Ryan Caicse (@ryancaicse) for reporting this bug! (cherry picked from commit 9f0fe53744ebf16467b61e9b59da5396bb356896) 2022-11-18 Liviu Chircu * [10740892e] : b2b_entities: Fix missing lock release on OOM error case Many thanks to Ryan Caicse (@ryancaicse) for reporting this bug! (cherry picked from commit 43ffc3d445afc9842afda9caf23e90a0564ffff3) 2022-11-18 Liviu Chircu * [bd50c8c9c] : b2b_logic: Fix missing lock release on OOM error case Many thanks to Ryan Caicse (@ryancaicse) for reporting this bug! (cherry picked from commit b5646bdcf8d1681d894b73af63257c2f0257d4fe) 2022-11-18 Liviu Chircu * [13e515427] : b2b_entities: Fix missing macro in previous commit (cherry picked from commit 2b807ad0cf08c15b1947d38674eb001fd64fd1f4) 2022-11-18 Liviu Chircu * [ade0328cc] : b2b_entities: Fix missing lock release on SIP parsing errors Many thanks to Ryan Caicse (@ryancaicse) for reporting this bug! (cherry picked from commit a379e9367989e6f731c3c4ab1a3ed97d3c53e287) 2022-11-18 Liviu Chircu * [f7e857666] : b2b_sca: Fix double lock release on error case Many thanks to Ryan Caicse (@ryancaicse) for reporting this bug! (cherry picked from commit 4bdbaf222761a74a8fff03bce7afe758742ec3e0) 2022-11-17 Vlad Patrascu * [b73c2d182] : tls_wolfssl: properly enforce the configured ec_curve TLS outgoing connections would not properly use the configured curve but instead any curve selected by the server. (cherry picked from commit d089b9c5ecc84cc81a8b0663a3f75883825ed8a6) 2022-11-17 Bogdan-Andrei Iancu * [8c9ec545d] : [dialog] fix missing locking in get_dlg_vals() Iterating the list of dlg vals must be done under lock (cherry picked from commit 728eff0a551c4eac3bc90d0cfac08de5a1280058) 2022-11-17 Liviu Chircu * [5f27da33f] : next_branches(): Fix infinite looping during error handling If someone has actually taken the time to corrupt the internal "$avp(serial_branch)" AVP, do not perform the "infinite while loop dance" and correctly progress to the next AVP. (cherry picked from commit 244cc92919c1cd6b3bf6a52bd4325b0268c88c76) 2022-11-17 Liviu Chircu * [92650481b] : next_branches(): Fix bugs leading to READ on freed shared memory This patch fixes two code paths leading to the @avp pointer being freed, after which the dangling pointer is read afterwards by the search_next_avp() function at the "done" goto label. This will work 99% of the time, until the 1% where it won't (crash and burn!). Many thanks to Richard Revels (@rrevels-bw) and Sebastien Couture for an accurate report, as well as their involvement in troubleshooting! Fixes #2446 Fixes #2950 (cherry picked from commit 578fc2907374477449313c36e4fc3287701de800) 2022-11-16 Liviu Chircu * [d3df2e2b6] : CacheDB: Allow "," in URL passwords Many thanks to @xuxin010033 for the report! Fixes #2786 (cherry picked from commit f904694120ae6bea23bd12c14becd353a8071962) 2022-11-16 Liviu Chircu * [2ebd84e5f] : CacheDB: Fix URL parser bugs with multiple hosts Although support for CACHEDB_ID_MULTIPLE_HOSTS has been in there for a long time, URLs such as "redis:ha://h1,h2,h3:6379" were not correctly parsed. (cherry picked from commit bacb776cc90d8532d58f360e276a00977da15fad) 2022-11-16 Gang Zhuo * [3e851796a] : [db_oracle] Do not change asynch mode when connection lost. The sessions may be ended due to a network error, and change OCI_ATTR_NONBLOCKING_MODE attribute with no session will cause "ORA-03126: network driver does not support non-blocking operations" error. In the case, the function done_timelimit will failed with ORA-03126 error. The error is not considered as a connection loss, and subsequent operations will always throw this error, and the lost connection never reconnect. (cherry picked from commit a5657831f9b216168d2dc974b96e4474e15ff15a) 2022-11-15 Liviu Chircu * [4a04a661b] : usrloc: Avoid PN-related timer processing in "SQL/CacheDB Only" modes Since the "PN trigger" logic described in RFC 8599 is currently strongly tied to holding in-memory contacts, avoid any crashes or other side-effects when running in "CacheDB Only" or "SQL Only" together with PN support by simply avoiding linking contacts into the "PN trigger" timer list. Fixes #2902 (cherry picked from commit 60c1d54f9193e8fca733eb1d0fe92fd60ffe7a27) 2022-11-15 Bogdan-Andrei Iancu * [382d6ae08] : [rr] Fix handling on maddr param in RURI If present in RURI, maddr value should be considered (instead of host part) for testing if RURI points (as domain) to OpenSIPS or not (the is_myselg() test) (cherry picked from commit f3cb92df91edd7e472c7c5cb4a2692a0585fad62) 2022-11-14 Bogdan-Andrei Iancu * [818547118] : Fix pkg mem leak by var spec copying Commit fff57ac introduces a relativly useless memcpy (only for arm32 related). This copy of the var spec leaks the returned buffer containing the value of the spec, as per $dlg_val() - this implementation of the $dlg_val relys on the fact that the same spec will be received all the time, so a re-size-able buffer is attached to it. So, let's get rif of the culprit memcpy and replace it with a simpler cast, as per 7dc20e471bf89eef0e4586adae26744d38c38c01 Credits and many thanks go to Arto Kuiri for reporting and pin pointing the culprit commit. (cherry picked from commit f07e90aac92f33d3321d73ed69ca19850b7e10b4) 2022-11-13 OpenSIPS * [3792a6258] : Rebuild documentation 2022-11-08 Liviu Chircu * [592694bfb] : parse_via_param(): Fix out-of-bounds read edge-case (OSS-Fuzz) Similar to 5e9f72d3d, but for the parse_via_param() function. Severity: Low Fixes OSS-Fuzz#53080 (cherry picked from commit 6135ff05d0897342ca5c81585cef5a650eae67b9) 2022-11-08 Liviu Chircu * [4ba077c68] : db_flatstore: Fix another race condition around MI 'flat_rotate' This race condition was related to invoking 'flat_rotate' 2+ times during the same second (UNIX timestamp). Due to the way the timestamping logic was implemented, this could lead to files NOT being rotated at all on the 2nd 'flat_rotate', which falls in the same second. Although very rare, this race condition could lead to massive CDR loss, since all CDRs between 2nd and 3rd 'flat_rotate' commands have a great chance of being fully lost (unread and discarded). (cherry picked from commit e180b1536e89e7bc8d6e2dd3264786e8531c71d7) 2022-11-08 Liviu Chircu * [7e7035148] : db_flatstore: Fix missing CDRs due to 'flat_rotate' race conditions This commit simply adds R/W locking around the 'flat_rotate' MI command, and all the SIP worker processes. The race condition was as follows: * SIP worker checks the 'flat_rotate' stamp and proceeds to write CDR * 'flat_rotate' is ran (timestamp++) * external process scans & fully reads the rotated file (with deletion to follow later as well, but this is irrelevant) * SIP worker finally writes the CDR using flushed/vector'ed I/O (too late at this point, CDR is forever lost) (cherry picked from commit d3b1463ee115a8b7d4d6b9658c8b07b9ef3d0549) 2022-11-08 Liviu Chircu * [44a73d39e] : parse_via(): Fix out-of-bounds read edge-case (OSS-Fuzz) This patch fixes a possible off-by-one read overflow while parsing the Via buffer. Even so, the error was mostly harmless, as the supplied buffer is typically much larger and is guaranteed to be NULL-terminated (see udp_read_req(), for example). Severity: Low Fixes OSS-Fuzz#52326 (cherry picked from commit 5e9f72d3d90e8fc9cb20578a95c891631b4d91da) 2022-11-06 OpenSIPS * [d9942fbcf] : Rebuild documentation 2022-11-04 Liviu Chircu * [65d7b7ba3] : registrar: Add a unit test for lookup("r") Related to #2917 (cherry picked from commit 02ddcc6cc52e6c27d27870447c4df7a352508a75) 2022-11-04 Liviu Chircu * [52e2bcb10] : registrars: Fix an edge-case with lookup("r") This fixes a bug where the registrar library would return E_LOOKUP_NO_RESULTS upon encountering an AoR with 0 contacts, instead of continuing to walk the branches and expand the remaining AoRs. Many thanks to @MayamaTakeshi for a detailed bug report! Fixes #2917 (cherry picked from commit 9ac7739ef02079a22de6beb776d6a1628a4458cb) 2022-11-03 Răzvan Crainea * [ad6a2b74c] : Merge pull request #2919 from goharahmed/eventExpiry EVI: Event subscribers expiry enhancements (cherry picked from commit 3ddd19ea2a34cdc25ac43f3785bccab9ad0d42f9) 2022-10-30 OpenSIPS * [cd034c8af] : Rebuild documentation 2022-10-27 Liviu Chircu * [118810286] : dialog: Fix shtag restoration when loading from DB This fixes a hanging dialog profiles bug on the backup box (NULL shtag), in specific scenarios with dialogs + sharing tags, profiles with value and dialog + profile replication clusters (whole enchilada). In such cases, after restarting the backup box with active dialogs in the DB, it would end up with forever-hanging dialog profiles in memory, which would be continuously broadcasted to all cluster nodes, effectively adding (doubling) unnecessary counters to the overall limit. Credits to Vlad Pătrașcu for helping troubleshoot this bug! (cherry picked from commit d77a9c52c2becdd451ef19ec9b586d7152aa8884) (cherry picked from commit ab1e5d4a31e5a4d601ea1a7cef7a427d7e508ccf) 2022-10-27 Bogdan-Andrei Iancu * [b29a9026c] : [gflags] fix wrong quotes in example Credits go to Karsten Wemheuer (cherry picked from commit 5945746b09b480dd0b7f8ea4b3584e4521bdac3a) 2022-10-27 Bogdan Andrei IANCU * [6da77f423] : Merge pull request #2914 from MayamaTakeshi/reg_lookup_log_correction Corrected 'getting contacts' log (cherry picked from commit 9be68bf34f8d1d54708a6a3de8f689e1e91288fc) 2022-10-27 Bogdan-Andrei Iancu * [ba938f9d7] : [tracer] avoid parsing the shm cloned SIP msg The TM TMCB_MSG_SENT_OUT callback may be called when doing a retransmission for a locally generated request. If for the original sending, a pkg malloc'ed sip_msg is passed to TMCB_MSG_SENT_OUT callback, for the retransmissions the shm cloned sip_msg is passed. As the 'tracer' callback (on TMCB_MSG_SENT_OUT) requires some FROM hdr parsing (to get the from tag), it should NOT parse directly on the shm cloned SIP msg as it will tain the shm sip_msg with pkg pointers -> better do a local parsing (not attached to the sip_msg) of the FROM HDR. This issue was leading to pkg leaking (of the parsed FROM hdr in the shm cloned sip_msg) or it a crash if using failure route from the local route. Note: this is specific to using tracer module from the local route. Closes #2728 (cherry picked from commit 4eabea8a9eb0a08909854722972cd35164557c76) 2022-10-26 Liviu Chircu * [6f14bae9c] : Allow writing to AVPs with negative index This includes both SET and DELETE operations, for example: $(avp(foo)[-1]) = NULL; $(avp(foo)[-1]) = "42"; (cherry picked from commit df362fb231fc42735f6aedcbdb8f036a72a98f2e) 2022-10-25 ihsinme * [e9d875c3c] : Fix for access due to low memory. If you check after a memory access, then you always have access from outside. with stricter control of memory boundaries, this can lead to an abnormal termination of the program. (cherry picked from commit 9ed1485938944ae47f58ac081facb4470c30c47e) 2022-10-25 Vlad Pătrașcu * [a778bf8cf] : Merge pull request #2929 from nikbyte/b2b_fix_transfer_rollback B2B: Fix rollback of transfer in case of using of separate media server url (cherry picked from commit e6a848b65b3e16baf80820a90e2d2dd1fdfb3243) 2022-10-25 Bogdan-Andrei Iancu * [1e9652c59] : [tm] fix t_wait_no_more_branches() behaviour Fixes #2891 Alternative to #2898 Credits for the fix go to @man1207 (cherry picked from commit 14d900f2a7bb05609290de71876590703678612f) 2022-10-24 Vlad Paiu * [31e2f33ec] : Ignore faked replies 2022-10-23 OpenSIPS * [f2a220bc0] : Rebuild documentation 2022-10-21 Vlad Patrascu * [b65796dd9] : cachedb_local: fix expiration of keys received through cluster sync Credits to Kingsley Tart from CallTracks for reporting. (cherry picked from commit d0c4fc48c7d46ac3588e540574a5a32b3d61992b) =========================== Release 3.2.9 ============================== 2022-10-16 OpenSIPS * [5db8b4b81] : Rebuild documentation 2022-10-13 Razvan Crainea * [51aa2a8bc] : rtpengine: do not specify interfaces for non-offer/answer Avoid getting bogus `no more memory` errors when trying to specify in in/out interface when `direction` node is NULL. Close #2880 (cherry picked from commit bbb6f313bba3fdb7f32f80140ceb9c8dff1e8f1b) 2022-10-13 Razvan Crainea * [d030bfa74] : fix engaging rtp_relay in branch route Close #2879 2022-10-12 Vlad Patrascu * [b53931a5d] : proto_tls docs: fix typos in modparam examples (cherry picked from commit 4d0df03e04d6d0c2c8a550e71f4ce5e5cbf2465c) 2022-10-12 Liviu Chircu * [94b374043] : context API: Fix ctx cleanup API; Document context_destroy() behavior Although this patch fixes a memory leak in clear_global_context(), this function is not being used at all. (cherry picked from commit 02e1177714b91fa8b7e29f0162c8e9385767f6b1) 2022-10-12 Liviu Chircu * [6b6551ac7] : Fix global msg context leakage in error_route While commit b5bcf046 fixed an issue with missing contexts during error_route, it was missed that the "parse_error" label does *not* free up the global context. The effects of this bug were mostly hidden, affecting only opensips.cfg scripts which employ the "error_route", causing a slow PKG memory leak, proportional to the amount of bad SIP received. Moreover, if these scripts also use async(), they may occassionally run into a quick abort() in t_resume_async(), due to a context being already set (BUG). (cherry picked from commit 43ee34bbbb48cfcfe02217b03ef72726c01cc83e) 2022-10-12 Liviu Chircu * [fcd765665] : async(): Attempt to recover from abort() state It seems the "if" condition at the start of t_resume_async() is actually reachable under the right circumstances and causes an immediate program crash. As an intermediate improvement until the source of the issue is found, try to simply overwrite the unexpected context, if one is found. A small memory leak coupled with a CRITICAL log message is preferable to an instant, forced crash. (cherry picked from commit 7167bec5b6379ba1a6762501391133deaf5ba80d) 2022-10-12 Liviu Chircu * [2b4b96e90] : sipmsgops: Fix ruri_del_param() return value on success The issue was that set_ruri() actually returns 0/-1, not 1/0 as the developer expected. Also update docs to reflect the function's return code meaning. (cherry picked from commit eea215278c479a22434aefd651c95b2ad777ecc1) 2022-10-10 Liviu Chircu * [204092b41] : parse_msg(): Fix heap buffer overflow edge-case (OSS-Fuzz) This patch fixes a SIP message parsing error log which could lead to an unsafe printing of a non-NULL terminated string. Fortunately, the OpenSIPS PKG memory allocator minimizes the severity of this overflow, thanks to its pre-allocated, large chunk of heap memory. Severity: Low Fixes OSS-Fuzz#52204 (cherry picked from commit 2a6f8c67aa15ebf507cc9ff2bd881d771858fed7) 2022-10-10 Liviu Chircu * [1d314b2ad] : parse_content_length(): Fix integer overflow edge-case (OSS-Fuzz) This completes commit 7cab422e2f, where it was still possible to cause an integer overflow even after the fix, with input such as 2147483609, due to missing parentheses in the number equation. Fixes OSS-Fuzz#52112 (cherry picked from commit 837263b47dcb33909b109b5cc050c1ab4a6c64a2) 2022-10-10 Liviu Chircu * [9aa1033b9] : parse_to_param(): Rework previous fix (OSS-Fuzz) Invoking strlen() on a non NULL-terminated buffer is equally bad, possibly even worse. Instead, simply rely on the @end parameter being correct, which is an assumption already made by the current code of the function. Fixes OSS-Fuzz#41073 (cherry picked from commit 51b908f8fde0aa2eac8dbcfff319281625d6f3f2) 2022-10-10 Liviu Chircu * [bab0ab5dc] : parse_to_param(): Fix out-of-bounds read edge-case (OSS-Fuzz) Severity: Low Fixes OSS-Fuzz#41073 (cherry picked from commit 90aa25e64f36b22fbcae9aae910257b43f81641f) 2022-10-10 Liviu Chircu * [ff17c3686] : Fix rare UB on left-shift signed int overflow By default, most commonly used compilers *define* some behaviour when this overflow occurs, such that the program will continue normally, without any negative consequences. Severity: Minor Fixes OSS-Fuzz#40201 (cherry picked from commit 2ba963b0c5e2b6705a3f28ce44e57b248988a103) 2022-10-10 Liviu Chircu * [973b04d88] : parse_msg(): Fix out-of-bounds read edge-case (OSS-Fuzz) Also add a unit test suite for parse_msg(). Severity: low Fixes OSS-Fuzz#39802 (cherry picked from commit 66898d8208d158d95a27f1a76078a29bd1e08d7e) 2022-10-10 Liviu Chircu * [7e12f00dc] : parse_uri: Parse the port into an unsigned integer (OSS-Fuzz) Fixes OSS-Fuzz#51605 (cherry picked from commit b4a72a5f96f5726afa48854ad0850fe14f78909d) 2022-10-10 Liviu Chircu * [c46af85ca] : parse_uri: Complete the fix for undefined bitwise left-shift (OSS-Fuzz) The default auto-cast to (int) is not enough, as a value such as 255 << 24 can still overflow the 31 value bits... Fixes OSS-Fuzz#51542 (cherry picked from commit e0d90ec107484051e6c769056036447361c5724d) 2022-10-10 Liviu Chircu * [0c2e70058] : lib/csv: Fix some memleak corner-cases (reported by OSS-Fuzz) Fixes OSS-Fuzz#39925 (cherry picked from commit ff34d213cad9c2b24460aecc206520bac5411bdc) 2022-10-10 Razvan Crainea * [35e2ed8bb] : dialog: do not corelate the number of legs with branches For a single transaction branch, we may have multiple dialog legs resulted by forking downstream. Thanks go to Rizwan Syed and Jonathan Hulme from ConnexCS for reporting, providing testing environment and support the troubleshooting and fix! (cherry picked from commit 1b944d21229e3f598e31a1d946e56e6098026ac8) 2022-10-09 OpenSIPS * [5f7a2c249] : Rebuild documentation 2022-10-05 Liviu Chircu * [c058d8982] : drouting: Fix dr_match() docs * the groupID is actually mandatory * add missing "number" docs (cherry picked from commit a5236a863b9522ee2e7a5ed53bca4fbb51c2c234) 2022-10-02 OpenSIPS * [1452da6ab] : Rebuild documentation 2022-09-28 Liviu Chircu * [fa80bdf1a] : freeswitch: If-guard some verbose DBG logs Suggested by @NormB (cherry picked from commit 6ec8ddec144ce133a365bdc8a095a1f267376f58) 2022-09-25 OpenSIPS * [b24366609] : Rebuild documentation 2022-09-20 Vlad Patrascu * [6266d0cd6] : b2b_entities: fix shm memory leak For the write back db mode, the entity storage data was only freed after inserting/updating the entity in the database. This would lead to memory leaks if the entity was deleted before the DB timer task had a chance to be run. Thanks go to Norm Brandinger from Five9 for reporting! (cherry picked from commit aee014beb78be050bd2272ee0080a6f8063d9ec0) 2022-09-18 OpenSIPS * [5e42e9422] : Rebuild documentation 2022-09-16 Bogdan-Andrei Iancu * [54d8ff7c2] : [TCP] fix init TCP support for auto-scalled procs When starting the TCP Main proc, be sure we initialize the MAIN<>Worker communication sockets also for the procs to be potentially scaled in the future. `pt[n].unix_sock` is valid only for running procs (not for the "autoscale to-be"), so use the `pt[n].tcp_socks_holder[0]` holder (valid for all procs, running or not). Thanks go to Yury Kirsanov and Slava Bendersky for reporting and helping with the troubleshooting. (cherry picked from commit d7a4bf8f134d3d2cd761f528e6963445c9ef9b06) 2022-09-16 Razvan Crainea * [cf353bf61] : mi_script: fix value of parameters provided through AVP (cherry picked from commit d6e91459d3fb3fd8e8278561242af56047f51e16) 2022-09-15 Liviu Chircu * [c32349f48] : parse_uri: Avoid dereferencing invalid memory on error logging (cherry picked from commit 99c9a828dd80f2874e89a520150565fa9e9162c7) (cherry picked from commit 7df9ff7176497c3109ac0648f381aad751ec90dd) 2022-09-15 Liviu Chircu * [b54947624] : parse_uri: Fix some UB corner-cases (reported by OSS-Fuzz) * possible bitwise left shift with a negative value (UB) * possible integer overflow, due to multiplication (UB) Fixes OSS-Fuzz#48273 (cherry picked from commit cf95355290c64e2693f88d17e3830405f97962d9) (cherry picked from commit 7cc624275e6a98322a235062327f2469725dfbb2) 2022-09-15 Liviu Chircu * [1ddbcf3f9] : auth_db: Update docs on "password_column" (cherry picked from commit b57c53db1ec7938aa477663e581898fe134f91b9) 2022-09-14 Bogdan-Andrei Iancu * [570c0aafa] : [tm] fix adding rport in local route Force the VIA rebuild if add_local_rport() (for adding rport param to VIA) was called from local route Closes #2833 (cherry picked from commit c85d93c7a3c3e9177d4621163295816b77bcdddc) 2022-09-14 Bogdan-Andrei Iancu * [c3de32c06] : [dialog] fix bad unref leading to dialog leaking When using the dlg_on_timeout to set a new timeout for the dialog, due to the timer related operations (re-inserting in the list), an extra ref cnt happens. If not unref'ed, the dialog will stay (as terminated) forever in memory. Closes #2788 (cherry picked from commit 4062de45d0ccfe62bb4f9475f6320d2726349bab) 2022-09-13 Liviu Chircu * [ccfdb699b] : clusterer: Always broadcast a packet after shtag activation Due to network outages, it is currently possible for both sharing tags of an Active/Backup pair to end up in ACTIVE state. This patch makes it so a "cluster_shtag_set_active" MI command always broadcasts (forces) the ACTIVE state onto all neighbours, thus fixing the incorrect, post-outage state of the tags. Credits to @bogdan-iancu and @rvlad-patrascu for their contributions to this fix! (cherry picked from commit 77c24e2122ea6f66f251349e05984cfbdef9166c) 2022-09-12 Bogdan Andrei IANCU * [52a401875] : Merge pull request #2885 from john08burke/multipart_crash pvar: fix crash when parsing multi-part body with negative index (cherry picked from commit cd853142daa005c20f54cfb93ae99d48ba1e510c) 2022-09-11 OpenSIPS * [bf1cf0516] : Rebuild documentation 2022-09-09 Liviu Chircu * [819f7c62e] : mem.h: Avoid warnings when explicitly defining -DSYSTEM_MALLOC (cherry picked from commit a11f9c74064bd5ec79445e7042d85f151672d038) 2022-09-09 Razvan Crainea * [d4a05448c] : mi_script: fix infinite loop where there are multiple params (cherry picked from commit 34ce451c664a3f51299cccbc263a8fb1bca214c7) 2022-09-08 Vlad Patrascu * [806d0c469] : Add QM_DBG_MALLOC_HIST flag to Makefile.conf template (cherry picked from commit 4c748b3f8380185ed74ed8ea37e9e9e9470b685f) 2022-09-08 Razvan Crainea * [a93ce0afb] : media_exchange: make sure we do not unreference NULL dlg (cherry picked from commit 581a4b8e5b9575fb63c631886b58b051797f2642) 2022-09-06 Vlad Patrascu * [bc3e62f7e] : mem/q_malloc: add support for debug history By setting a size via the QM_DBG_MALLOC_HIST define, we now keep a history of the file, func, line debug information in each fragment. 2022-09-06 Liviu Chircu * [c5708b4c3] : dialog: Fix crash in debugging function (debug_main_timer_list()) DBG:dialog:debug_main_timer_list: testing forward loop with visited = 1 DBG:dialog:debug_main_timer_list: testing backward loop with visited = 2 DBG:dialog:insert_dlg_timer_unsafe: inserting 0x7f303dba8d80 for 7205 DBG:dialog:debug_main_timer_list: testing forward loop with visited = 1 ERROR:dialog:debug_main_timer_list: Detected something wrong with main timer list on forward linking for entry 0x7f303dba8d80 DBG:core:handle_sigs: OpenSIPS exit status = 134 INFO:core:handle_sigs: child process 139408 exited by a signal 6 (cherry picked from commit 4c6a8ec5d4ac6e0faceaa5e0acb6863d992f59a7) 2022-09-06 Liviu Chircu * [d6215c1fa] : dialog: Fix shm memleak on OOM error case (cherry picked from commit 6d03091833a0ee9a9d1294b0aff87a7435c60bf4) 2022-09-05 Liviu Chircu * [2f58ffa93] : rtpproxy: Fix bad error handling on rare OOM case (cherry picked from commit d2cec34346fea49a98b5c5d33ae20044e47eec69) 2022-09-04 OpenSIPS * [d8b60dca3] : Rebuild documentation 2022-09-01 Liviu Chircu * [a37fab2d5] : Cfg Parser: Allow whitespace before the "include_file" statement Fixes #2892 2022-08-30 Razvan Crainea * [80179471c] : tracer: fix trace_stop removal from list Fix the way we detect the previous element when removing from list Before this change, if there were multiple elements in the list, they were leaking due to the bad handling of the list removal. (cherry picked from commit dae9817b313cb98ed3d4d449064c64c9a4ac7cd8) 2022-08-29 Razvan Crainea * [81c2e7509] : mi_script: force a positive value in eventfd Thanks go to Suchi Sahoo from Five9 for reporting it (cherry picked from commit b2c6ce6551f6469e559599bfc47d314186755f36) 2022-08-28 OpenSIPS * [22c7c5824] : Rebuild documentation 2022-08-26 Vlad Patrascu * [9d41bfce8] : Throw startup error if event_route can never be run OpenSIPS would start without any error or warning if an event_route is used but the 'event_route' module is not loaded. (cherry picked from commit bb9bd920feb712cf8ec0c32d4e418056fae8cc81) 2022-08-25 Vlad Patrascu * [c6cc088ff] : clusterer: fix parameters for E_CLUSTERER_REQ_RECEIVED event Fixes #2899 2022-08-24 Razvan Crainea * [698baa104] : clusterer: advertise tag's active state only in defined cluster Thanks go to Vlad Patrascu for brainstorming this! (cherry picked from commit d741f1875cb2b01e6deb96ae2235e23e029dc35f) 2022-08-24 Razvan Crainea * [401c6069c] : mi_script: fix previous commit This is the commit that actually resolves the memory leak Thanks go to @liviuc for reporting this (cherry picked from commit ad02392053f8fb79f74886ca67f536202e24f1cc) 2022-08-24 Razvan Crainea * [f010ce818] : mi_script: prevent leak on write error case Thanks go to Suchi Sahoo from Five9 for reporting it (cherry picked from commit 443fdf90e635b48debcf71449e6c72754e3b24c7) 2022-08-22 Razvan Crainea * [0e3b40245] : b2b_entities: free key returned by client_new prevent pkg leak of b2b_key returned by client_new (cherry picked from commit 60043ae3713052614e535371c100a3668c47af8f) 2022-08-22 Razvan Crainea * [a518e41c0] : b2b*: consider dlginfo for requests an replies as well (cherry picked from commit 7aa2007300fac85645bb4edaea3085557aae7923) 2022-08-21 OpenSIPS * [de731a22b] : Rebuild documentation =========================== Release 3.2.8 ============================== 2022-08-17 Bogdan-Andrei Iancu * [0b270ad04] : Fix crash in bogus OOM handling while TCP async in enabled. The async support assums the c->async exists all the time, so error if we cannot alloc the c->async struct while creating a new TCP conn 2022-08-17 Bogdan-Andrei Iancu * [e4f454321] : [call_center] avoid a negative setup_time in CDR In the DB schema, the setup_time is an unsigned, and a -1 value was computed while a call was rejected by an agent (cherry picked from commit 9dc28a91c68db792f1df4cf1d6ce8d0faf83ad0e) 2022-08-16 Liviu Chircu * [aaaae0d15] : Various code/doc improvements; Var renames; Fix typos (cherry picked from commit 28d87ad30f99abcfaca678955cff6b38bdc2b24f) (cherry picked from commit 2aa0cafcbee13131bdc4793b893530fa8126576c) 2022-08-16 Liviu Chircu * [e0325625c] : Fix various doc typos; Improve wording (cherry picked from commit dd7b3da0397fe5ccc9978ec9138a6d4395c3f941) (cherry picked from commit 7cdbc996ee61eae1ed9757c9bb401c67d96b48fd) 2022-08-16 Razvan Crainea * [43f00304a] : b2b_entities: provide dlginfo for entity_delete Each module that uses b2b_entities, should duplicate the dlginfo structure and pass it to the entity_delete API call, otherwise wrong entities might be deleted due to mismatches (cherry picked from commit ce19581557c69dafee5095fecce831e2c2d80704) 2022-08-14 OpenSIPS * [470d780e5] : Rebuild documentation 2022-08-09 Razvan Crainea * [7ed3f00e8] : rtp_relay: reset late flag for new negotiations (cherry picked from commit 22fe3bef705e3de98b950065bb2a948789c8b3ae) 2022-08-09 Razvan Crainea * [b9a1cb0c9] : rtp_relay: fix typo in test for ACK in late (cherry picked from commit 118dcebac717b6a3299407ac152719f38fda5bd4) 2022-08-08 Bogdan-Andrei Iancu * [56eacbe95] : Fix possible bogus exec_msg_threshold reporting Reset the exec_msg_threshold stack (longest found actions) when a parse error is detected (before running the actual scritp). Otherwise we may inherit old records from previous runs (cherry picked from commit e7ed29e50f8dc76717fe38281945aa331958db25) 2022-08-07 OpenSIPS * [ce5e1c6b7] : Rebuild documentation 2022-08-01 Vlad Patrascu * [b93fbafed] : clusterer: add ability to disable replication packets dispatching Add a new "dispatch_jobs" modparam which controls whether the processing of replicated packets is dispatched through IPC or not. Disabling the dispatching mechanism prevents high CPU loads caused by the "thundering herd" problem. Credits go to Rizwan Syed and Connex Carrier Services for supporting the troubleshooting of this issue. (cherry picked from commit 0c66936f3d343226930042bc463b467d8a62fde3) 2022-08-01 Vlad Patrascu * [a3419dce8] : dialog: don't drop synced dialogs with no sharing tag (cherry picked from commit 3e98325e8546bcbfefa15644c4835c72da4c7aee) 2022-07-31 OpenSIPS * [b2f78b5ab] : Rebuild documentation 2022-07-29 Vlad Patrascu * [c5888125f] : dialog: fix typo in commit edc90fb (cherry picked from commit 3cebaf73059932183392761a040969efb887bcea) 2022-07-28 Vlad Patrascu * [edc90fb54] : dialog: fix incorrectly discarded dialogs after sync Syncing while the donor node is also sending live replication packets may lead to incorrectly discarding some of the newly received dialogs. There were two ways in which new dialogs were actually mistaken as old, "local" dialogs from before syncing: * overwriting the dialog flags when handling a replicated update; * not marking live replicated dialogs received during sync as "new" dialogs. (cherry picked from commit 46e9a53ead0574272609038dc9dbfb92f9087fe4) 2022-07-26 Liviu Chircu * [6aea5c5e2] : proto_hep: Fix log message severity (just a debug log) (cherry picked from commit 612e7a1feb28a6aa359b24a6237928c0e06a3605) 2022-07-24 OpenSIPS * [86c5f3ae2] : Rebuild documentation 2022-07-22 Maksym Sobolyev * [d5f20d862] : python: Don't leak memory in python_exec(). The bug was introduced in rev 302058d8d38 (April 2019) along with module API cleanup and affects all releases since 3.0. 2022-07-21 Vlad Patrascu * [6a71c1499] : sql_cacher: don't allow usage of a replicated local cache Using a replicated collection for cachedb_local would lead to invalid keys in the cache due to reload version inconsistencies. (cherry picked from commit 1b9662649d2e0606225b5e198a083619d0ca97e1) 2022-07-20 Vlad Patrascu * [99275f6de] : clusterer: issue sync request under lock (cherry picked from commit bf178b04ffec9fa22d75fc5266286f93721eec5d) 2022-07-19 Vlad Patrascu * [69031794f] : clusterer: fix deadlocks when syncing (cherry picked from commit 652d89fbeffc180aea68e8bdfcac799d53124e6b) 2022-07-17 OpenSIPS * [d1941d6a9] : Rebuild documentation 2022-07-16 Vlad Patrascu * [610420457] : tls_wolfssl: disable example applications from library build (cherry picked from commit 6d248c5eebef0abf27c594ed3d587d844fb52262) (cherry picked from commit ab31a563a855fdd582c19afd0f731566568f93ae) 2022-07-15 Vlad Patrascu * [731c8ddca] : clusterer: fix possible deadlocks when discovering a new node Use only standard RW locking operations for the global list lock instead of the "switchable" mechanism (aquiring the lock for writing when necessary). (cherry picked from commit e0e9e2f943ca5bd35f653f6e55a89000e8b262e6) 2022-07-13 Vlad Patrascu * [80a7df243] : clusterer: queue sync request after all send errors (cherry picked from commit 46e56d4170079eed46686c57986c2ccf5756779e) 2022-07-13 Vlad Patrascu * [5f99dd82e] : clusterer: properly compute sync fallback interval in all cases The timestamp of the sync request was not saved when queueing the sync after certain send errors. (cherry picked from commit 816ef38b7c97b811a5822ceab9ebbe81609b1b6b) 2022-07-13 Vlad Patrascu * [0d346f0b6] : clusterer: prevent permanent sync in progress state If the sync end marker packet is not received, nodes get stuck in a permanent "sync in progress" state. This commit introduces a timeout, configurable via the "sync_timeout" modparam, after which a node reverts to the not synced state, if no sync data packet is received. (cherry picked from commit 2e5bf28aa91d9cda8304bc19bbba770e83d7cb22) 2022-07-12 Razvan Crainea * [b9c092ede] : b2b_entities: fix the right number of rows when leg is missing Thanks go to Norm Brandinger from Five9 for reporting, testing and providing all the help to pinpoint this issue! (cherry picked from commit b005a3795f9a762011f488cb403f2e9bd7a7ade1) 2022-07-10 OpenSIPS * [69b651f9b] : Rebuild documentation 2022-07-08 Vlad Patrascu * [35b29e618] : tls_wolfssl: fix differing TLS version for write duplicate struct When using a range of supported TLS versions, the WOLFSSL write duplicate structure uses the highest TLS version set for the context instead of the one actually negociated for the current session. This may lead to errors for TLS write or shutdown operations, for ciphers that are not supported in the TLS version used by the write dup structure. Fixes #2729 2022-07-08 Liviu Chircu * [309bc93ba] : acc docs: Clarify that do/drop_accounting() can be called multiple times 2022-07-08 Liviu Chircu * [cb9c2d09a] : perl: Fix PKG corruption in perl_exec() (off-by-one) (cherry picked from commit d7f9a851149010d1b99aeb9e04339994414c8731) 2022-07-08 Liviu Chircu * [61e07cb53] : perl: Fix PKG memory leak in perl_exec() The leak would happen 100% of the time on each perl_exec(). (cherry picked from commit 0742814a7f72d99d0de6624acca7f107059f03bf) 2022-07-07 Nick Altmann * [b9c535e36] : DEB Packaging: don't build auth_jwt package for old distributives 2022-07-05 Vlad Patrascu * [86915d16b] : clusterer: fix seed fallback during sync Do not fall back to the synced state for a capability if syncing is actually in progress. (cherry picked from commit 3960008a14fa75395cc4b49c7e7cae52ac68aed7) 2022-07-04 Vlad Patrascu * [2a1012bcd] : xml: fix accessing node value with CDATA sections (cherry picked from commit 4a4248cbfd9c289ea16d68b45d1dbaa8a5daf064) 2022-07-03 OpenSIPS * [ad4df000f] : Rebuild documentation 2022-06-28 Vlad Patrascu * [801e72bbd] : b2b_logic docs: fix example for b2b_bridge_request() (cherry picked from commit 75fc8f0388b6505db1717a503a691c68dddd68df) 2022-06-28 Vlad Patrascu * [8eb0c6ff7] : b2b_logic: complete the Max-Forwards fix in commit cb6d7fa Also decrease Max-Forwards when bridging, based on the value from the initial INVITE of the server entity, if it's still present in the session. (cherry picked from commit c328eb06d01c52d7d0a1fadd717c59003c4456b8) 2022-06-26 OpenSIPS * [5cd73cc6c] : Rebuild documentation 2022-06-25 Vlad Patrascu * [07a6b2e3e] : clusterer: make sure a discovered node is not added multiple times Do not insert a new node into the list multiple times when: * receiving multiple CLUSTERER_NODE_DESCRIPTION BIN messages * we receive a CLUSTERER_NODE_DESCRIPTION message and the node also appears in CLUSTERER_FULL_TOP_UPDATE messages. (cherry picked from commit b8e107517fd032f16f16df242a02474efc2312d2) 2022-06-25 Vlad Patrascu * [ef2ac0d8f] : b2b_logic_xml: keep compatibility with b2b_context changes 2022-06-25 Vlad Patrascu * [fa2145b12] : b2b_logic: fix possible crash when init_callid_hdr param is set The crash would occur if the Call-ID header name is received in compact form("i" instead of "Call-ID"). Thanks to David Escartin from Sonoc for reporting. 2022-06-25 Vlad Patrascu * [c7a5f4175] : b2b_entities: fix possible shm memory leaks Fix leaking transactions when deleting an entity without sending a final reply. Thanks to David Escartin from Sonoc for reporting. 2022-06-25 Vlad Patrascu * [ff646336e] : b2b_logic: prevent possible crashes when accessing $b2b_logic vars Make sure to always search in the hash for the current tuple instead of relying on a pointer saved in the b2b context. There might be races between processing BYEs and deleting the tuple and running a b2b_logic reply route where we access a $b2b_logic variable. Thanks to David Escartin from Sonoc for reporting. 2022-06-25 Vlad Patrascu * [e8df85a64] : b2b_entities: properly handle negative replies to reINVITEs Do not change the dialog state to terminated as a result of a sending a negative reply to a reINVITE. This would have prevented the forwarding of further requests. Thanks to David Escartin from Sonoc for reporting and testing the fix. 2022-06-25 Vlad Patrascu * [81cb0903a] : b2b_entities: properly handle unexpected ACKs Fixes an issue where a 487 reply is not relayed after an unexpected ACK is received following a CANCEL. Thanks to David Escartin from Sonoc for reporting. 2022-06-25 Vlad Patrascu * [082379771] : b2b_entities: fix accessing $b2b_logic variables for PRACK requests Fixes #2686 (cherry picked from commit 3b6cf1640fc569a721574faaff4132b2e2d7c477) 2022-06-23 Vlad Patrascu * [cb6d7fa7a] : b2b_logic: properly decrease value and pass Max-Forwrads header This applies to requests that are effectively "passed" from one entity to its peer such as initial INVITEs handled with b2b_init_request() or requests handled with b2b_pass_request(). Fixes #2471 (cherry picked from commit fa84d8d0e6cf719c0d2c7bd215fa74e5e33e1a2f) 2022-06-23 Vlad Patrascu * [cd52ccc5e] : b2b_entities: allow enforcing the Max-Forwards value Related to #2471 (cherry picked from commit 404f580026f2bb67cdacf56e1384213643a0505e) =========================== Release 3.2.7 ============================== 2022-06-22 Vlad Patrascu * [205667d85] : clusterer: use the proper locking type when we might switch for writing Aquire lock for switchable reading when handling a full topology update, wich might trigger the insert of a new node in the list and thus using the lock switch mechanism. (cherry picked from commit ead6f1fcae3881a15b6ec4e8e6026bdd5d99ecb3) 2022-06-21 Vlad Patrascu * [159ffbbf5] : b2b_entities: use the proxy from b2b_client_new() for all requests Fixes #2759 (cherry picked from commit ceb1d6a074383bca96df0e7a592719dda52bd60b) 2022-06-19 OpenSIPS * [56a67f4d9] : Rebuild documentation 2022-06-14 Razvan Crainea * [0b38b5425] : rtpengine: fix API crash when no set/node is defined (cherry picked from commit 206b3a1d0f3cc899b6076657c9ccb89eeb3f8395) 2022-06-12 OpenSIPS * [b6211fc99] : Rebuild documentation 2022-06-10 Bogdan-Andrei Iancu * [a05893a63] : Fix body re-assembling when adding a new body part to an emptry received body This fixes a regression introduced in b0591d285ad966c2cb13672de8071c03fcba7414 Fixes #2823 Credits go to @pergolafabio for the detailed reporting 2022-06-07 Liviu Chircu * [40290bc41] : mi_script: Fix error log on mi() with NULL output pvars Proper handling for the 2nd parameter NULL case. Fixes this error: Jun 7 06:36:23 [61] ERROR:core:pv_set_value: bad parameters (cherry picked from commit bdc51cee33eb18c42abb37fe432e2c8c033384fa) 2022-06-05 OpenSIPS * [100cf117d] : Rebuild documentation 2022-05-27 Bogdan-Andrei Iancu * [6b7559920] : [db_virtual] fixed the MI db_get output Fix typos leading to bad json structure Reported by @bctff Closes opensips-cli/#94 (cherry picked from commit 96d8113e9da6f01dc1222364b80d975284d42336) 2022-05-25 Vlad Patrascu * [1628c902a] : Properly exclude tls_openssl/wolfssl when using menuconfig (cherry picked from commit 870f19040b2e28d671552ff2d1e62c7661333894) 2022-05-24 Razvan Crainea * [4ab4876f6] : clusterer: print the command that cannot be parsed (cherry picked from commit 8ba0309d4751ed5670800cf4fb0bdd85d6b6d7be) 2022-05-18 Nick Altmann * [ecaa59672] : Add missed condition for natping_partitions param in nathelper doc 2022-05-12 Liviu Chircu * [5582666ba] : aaa_diameter: Fix `app_opensips` compilation The "peer.h" import is not available when compiling "app_opensips" within freeDiameter. Moreover, it's not used anyway, so just remove it. (cherry picked from commit 7c3fef41a22b39d296c97a21ea5aed1d4d5770e7) 2022-05-09 Liviu Chircu * [382597eb9] : dialog docs: Improve "profiles_with_value" example Suggested by Fabien Aunay (cherry picked from commit d148f1dfa5c94418968cab6020d0dc9671023257) 2022-05-04 Nick Altmann * [bce846c99] : DEB package: add support for ubuntu 22 2022-05-04 Liviu Chircu * [eb415b5e1] : Makefile: Fix detection for gcc 11 and higher Context: newer OS'es, e.g. Ubuntu 22.04, ship with gcc 11 nowadays. (cherry picked from commit 7273a3f13a8bb29a4b4da529c2e8c9bc2cc45492) 2022-05-04 Bogdan Andrei IANCU * [7fea6beda] : Merge pull request #2821 from lemenkov/format_security Fix -Werror=format-security (cherry picked from commit 47bfb3e3292a1acca6562427038b25a302d65ff1) 2022-05-02 Razvan Crainea * [4408617e9] : rtpproxy+rtpengine: fair election when the first try is disabled When a first attempt to use a rtpproxy/rtpengine node picks a disabled node, the next attempt should not consider the disabled nodes at all. (cherry picked from commit 9d5dd9539d54b2186f31d2447823cae9108b9c31) 2022-05-02 Bogdan-Andrei Iancu * [0cca86fe7] : [presence_dialoginfo] Fix aggregating dialoginfo XML Fix the looping when aggregating the dialog info XML documents with multiple dialog elements. The xmlUnlinkNode() function inside the loop is breaking the looping (the "next" member is reset). Credits for reporting and fixing go to Damien Sandras (@dsandras) 2022-04-21 Razvan Crainea * [c74c2ef1f] : tm: use INVITE's AVPs when sending locally generated msgs This allows the TLS_MGM module to pick up the right tls_domain that should be used for sending the ACK/CANCEL message (cherry picked from commit 84c1614ecea5025230b46950408c8343c693ec8b) 2022-04-21 Razvan Crainea * [b15d63018] : rtpengine: fix switching set for rtpengine_play_dtmf Reported by Slava Bendersky, close #2808 =========================== Release 3.2.6 ============================== 2022-04-20 Liviu Chircu * [089daf6d3] : Bump version to 3.2.6 2022-04-20 Liviu Chircu * [6ecac89e5] : cachedb_redis: Allow quoting strings in raw queries In case the Redis raw query string arguments include whitespace (' ', \t, \r, \n), script developers can now enclose them in single (') or double quotes ("), and OpenSIPS will pass the correct string to Redis. For example: cache_raw_query("redis", "SET foo \"bar baz\"", "$avp(result)"); or: cache_raw_query("redis", "SET foo 'bar baz'", "$avp(result)"); ... are now possible and equivalent. Both of these will set the "bar baz" value, without the quotes. NEW module parameter in order to maintain backwards-compatibility with previous code (default: 0): modparam("cachedb_redis", "enable_query_arg_quoting", 1) Fixes #2036 2022-04-20 Liviu Chircu * [d03f17c4d] : cachedb_redis: Use argv API instead of fmt-string API for raw queries This change allows "%" to be safely used in raw queries (e.g. maybe some Redis key contains a random "%" char), while also making the raw query operation a lot more safe and/or unexploitable from the outside. Many thanks to David Escartin (Sonoc) for a detailed bug report! 2022-04-18 Liviu Chircu * [ed7a33a28] : aaa_diameter: Avoid all pthread_cond race conditions The recommended usage of the wait/signal pthread_cond_t functions includes using a "counter" variable in order to keep track of any "signal" events happening before the actual "wait". Many thanks to Ryan Caicse (@ryancaicse) for reporting this bug and the excellent fix suggestion! Fixes #2789 (cherry picked from commit 5422799e77662db58d23cbd38bc92875091f177a) 2022-04-12 Liviu Chircu * [d2c4bebc4] : re.subst transformation: Fix possible pkg memleak The leak would only happen under these simultaneous conditions: 1. the "subst" (last) part of the RE is a variable 2. the variable is using an index (e.g. an AVP) 3. there are at least two different "subst" strings in the script, which can run alternatively (see the global "subst_re" logic to understand more about the "reusage" mechanism and this effect) Many thanks to Richard Revels for a detailed report on this bug! Fixes #2761 (cherry picked from commit c739c2f4de2b26767e894765bb5f47d908f88603) 2022-04-12 Bogdan-Andrei Iancu * [c22da3e06] : [rtpengine] avoid returning 0 as it breaks the script execution Fixes #2796 (cherry picked from commit 1763c7a5c894c9adecd19023cd1470a408f626fb) 2022-04-12 Peter Lemenkov * [c2f62c45d] : Explicitly add fPIC and DPIC for gcc This addresses linking on Fedora 34 and later with gcc 11: ``` gcc -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-O2 -Wl,-E alarm_checks.o hashTable.o interprocess_buffer.o openserMIBNotifications.o openserObjects.o openserSIPCommonObjects.o openserSIPContactTable.o openserSIPMethodSupportedTable.o openserSIPPortTable.o openserSIPRegUserLookupTable.o openserSIPRegUserTable.o openserSIPServerObjects.o openserSIPStatusCodesTable.o snmpstats.o sub_agent.o utilities.o -L/usr/lib64 -lnetsnmpmibs -lnetsnmpagent -lnetsnmp -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -lm -lsensors -ldl -lm -lrpm -lrpmio -Wl,--enable-new-dtags -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -lm -lssl -lssl -lcrypto -o snmpstats.so /usr/bin/ld: /tmp/cccfDV1K.ltrans0.ltrans.o: warning: relocation against `event_shm_threshold' in read-only section `.text' /usr/bin/ld: /tmp/cccfDV1K.ltrans0.ltrans.o: relocation R_X86_64_PC32 against undefined symbol `ctime_buf' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status make[1]: Leaving directory '/builddir/build/BUILD/opensips-3.1.7/modules/snmpstats' make[1]: *** [../../Makefile.rules:39: snmpstats.so] Error 1 make: *** [Makefile:197: modules] Error 2 ``` Closes #2734. (cherry picked from commit 0896f9a46700005a304a65ddf7e09419a3963b82) 2022-04-08 Bogdan Andrei IANCU * [6c6461c20] : Merge pull request #2790 from Transatel/FIX_TOS_IPV6 Add TOS in IPV6 (cherry picked from commit f461e38d3c8fd65a479c5a363520410aaed49ea1) 2022-04-08 Bogdan Andrei IANCU * [f3dacc35a] : Merge pull request #2779 from ppisar/openldap-2.6.1 Rename an ldap_connect() to opensips_ldap_connect() (cherry picked from commit 457111cebc2010225dffa668edd8155fdca6a62a) 2022-04-08 Bogdan Andrei IANCU * [e8c084e4d] : Merge pull request #2773 from carstenbock/use_library_for_require_parsing Use library function to fix edge case in require parsing (cherry picked from commit 432a53305ba421067f2feb7b19cb2c3f1b0289ee) 2022-04-07 Bogdan-Andrei Iancu * [53017e0f8] : [cachedb_redis] re-align code with 3.1 The cherry-pick 7cb182d mixed a bit the order of the code lines Thanks to @john08burke for this, see #2806 for more 2022-04-06 Bogdan-Andrei Iancu * [34e144783] : [cachedb_redis] Fix merging error on 7cb182de0bf1f31dfe6e697b4321d0b7528268f3 2022-04-06 Bogdan Andrei IANCU * [7cb182de0] : Merge pull request #2806 from john08burke/redis_bugfix_3_1 [cachedb_redis] cleanup stale context pointer, branch 3.1 (cherry picked from commit 6ea4a7ac1cddae536a4bc3d2a3fe8ed279d671dc) 2022-04-06 Bogdan-Andrei Iancu * [2d49e1f3a] : Fix bad body re-assembling when handling a multi part with empty parts Credits for the finding and for the fix go to John Burke ( @john08burke ) Closes #2794 (cherry picked from commit b0591d285ad966c2cb13672de8071c03fcba7414) 2022-03-30 Razvan Crainea * [852f9d9d7] : Fix crash in parse_sdp for fmtp, rtpmap and hold When invalid strings would have been passed, the remaining value would have resulted in an invalid memory access. Issue discovered during OpenSIPS Security Audit 2021, by Alfred Farrugia & Sandro Gauci (Enable Security) 2022-03-28 Liviu Chircu * [209218c91] : Parser: Be more fuzzer friendly, using -DFUZZ_BUILD Since fuzzers typically use the system allocator in order to run ASan checks (i.e. -DPKG_MALLOC is not enabled), they will often run into false-positive crashes in the parse_hname2() function due to various read overflows which are harmless in production, thanks to the pre-allocated nature of the PKG memory chunk. This patch adds the HAVE() parser macro (tied to -DFUZZ_BUILD), which will be optimized (removed) in the public build (0 changes), while protecting against any read overflow when building with -DFUZZ_BUILD. Issue discovered during OpenSIPS Security Audit 2021/2022, by Alfred Farrugia & Sandro Gauci (Enable Security) (cherry picked from commit 7312678bb5b2e9fd602fefbb869896a1875589ed) 2022-03-24 Vlad Patrascu * [417568707] : cJSON: fix memory leak on object parsing error Issue discovered during OpenSIPS Security Audit 2021/2022, by Alfred Farrugia & Sandro Gauci (Enable Security) https://github.com/OpenSIPS/opensips/security/advisories/GHSA-2mg2-g46r-j4qr 2022-03-24 Bogdan-Andrei Iancu * [1d60e7422] : [sipmsgops] fix codec_delete_XX() parsing Issue discovered during OpenSIPS Security Audit 2021/2022, by Alfred Farrugia & Sandro Gauci (Enable Security) https://github.com/OpenSIPS/opensips/security/advisories/GHSA-3ghx-j39m-cw4f (cherry picked from commit dd051f8ed5ae3347fb1d556ced3c97822c9d8450) 2022-03-18 Liviu Chircu * [f569a5844] : core: Fix Content-Length parsing Issue discovered during OpenSIPS Security Audit 2022, by Alfred Farrugia & Sandro Gauci (Enable Security) https://github.com/OpenSIPS/opensips/security/advisories/GHSA-c6j5-f4h4-2xrq (cherry picked from commit 7cab422e2fc648f910abba34f3f0dbb3ae171ff5) 2022-03-16 Razvan Crainea * [9a47ad9be] : b2b_entities: properly handle PRACK after dlg is matched Otherwise, simply relay the PRACK. (cherry picked from commit 8edf6ff627456c8cfa5c496e44c477e9ba8852a6) 2022-03-16 Liviu Chircu * [4dadf7782] : dispatcher: Fix IP printing on error case Many thanks to @Cossack9989 for the report! Fixes #2780 (cherry picked from commit e2f13d3747577937152346b031b86639b37bc2b5) 2022-03-15 Vlad Patrascu * [a821997cd] : b2b_entities: fix entity storage memory leak Do not reset the pointer to the storage buffer when there is nothing to serialize after running the callback. (cherry picked from commit e19ed6eaaf8d238ada6b9868760127f097412439) 2022-03-09 Liviu Chircu * [bef8a7343] : dialplan: Always set the "attrs" pvar on success; Improve docs This patch avoids leaving an untouched "attrs_pvar" variable after a successful dp_translate(), in case the attributes are NULL or empty-string. In order to both prevent scripting bugs as well as boilerplate initialization code, the "attrs_pvar" is now always set to "" (empty-string) in case the "attrs" field is either NULL or empty-string. (cherry picked from commit a8f964c8f565f5fb66797ca7f352e013ec3aa79a) 2022-03-09 Răzvan Crainea * [d587d89eb] : Merge pull request #2771 from labman000/3.2 fix tracer.c "dest port" print error 2022-03-07 Razvan Crainea * [2d5e755c1] : rtpengine: fix hostname detection for IPv6 (cherry picked from commit 4d921360eb9dfa4dffe100de3444849afc7af5c9) 2022-03-04 Liviu Chircu * [9a0a3b728] : mi_fifo: Fix double fclose() during error handling Example double-free scenario (multiple ones were possible): mi_fifo_callback -> mi_fifo_reply -> mi_fifo_flush -> mi_fifo_write -> ERROR -> fclose() -> mi_throw_error -> mi_fifo_write -> ERROR -> fclose() Many thanks to David Escartin (Sonoc) for a detailed report! (cherry picked from commit 85ba95d105dd564bdd1b02282dff1e6ab8ac109a) 2022-03-04 labman000 <316660150 at qq dot com> * [54d44b084] : fix tracer.c "dest port" print error 2022-03-03 Razvan Crainea * [62c7f0127] : lib/hash: fix hash_insert Thanks go to Bogdan Iancu for spotting the issue and providing the fix (cherry picked from commit 36a123856b9953a41a934f3efe0629757ab512a0) 2022-03-02 Liviu Chircu * [67bb6e2cf] : HP_MALLOC: Fine-tune the "frag split size" constants It seems that "split on 4096 or larger" is too large a value, leading to fragmentation issues on typical 1G - 4G SHM pools. With this patch, HP_MALLOC will visibly use less shared memory, but will also split fragments more often. (cherry picked from commit 043d4f31d084560681733358438e5cb13926f84d) 2022-03-02 Liviu Chircu * [1f3a0f625] : fraud_detection: Do not raise call-duration alerts for CANCEL/487 calls (cherry picked from commit 1c4a8a5ac7f685d5515191cd1654aa93c1f72739) 2022-03-02 ihsinme * [86dcecb58] : incorrect error handling. (cherry picked from commit 336e6b0b2ccdf53673eac2c9d27d6923b977ab7b) =========================== Release 3.2.5 ============================== 2022-02-23 Liviu Chircu * [847f341db] : Bump version to 3.2.5 2022-02-23 Bogdan-Andrei Iancu * [31d99cdaa] : Fix switch-case levels for Replaces and Feature-Caps header name parsing (cherry picked from commit 6b49736cca0d1e8ebf0440cf51f95a08f31b9222) 2022-02-23 Bogdan-Andrei Iancu * [b2dffe4b5] : [core] fix parse_uri() parsing Issue discovered during OpenSIPS Security Audit 2022, by Alfred Farrugia & Sandro Gauci (Enable Security) https://github.com/OpenSIPS/opensips/security/advisories/GHSA-358f-935m-7p9c 2022-02-22 Bogdan Andrei IANCU * [35dfd3a20] : Merge pull request #2757 from nikbyte/master Fix crash in tracer module when negative hop-by-hop ACK received during b2b tracing (cherry picked from commit 34f3947b48640cfede8b0d281a6d32163057c3d6) 2022-02-22 Liviu Chircu * [a275c41a9] : parse_msg: Fix possible buffer read overflow with whitespace input Fixes OSS-Fuzz#44887 (cherry picked from commit a880e1faee1df2b23054de13689de97b2ec08f28) 2022-02-22 Liviu Chircu * [0a0c8a0eb] : parse_uri: Fix possible buffer read overflow with urn: URIs Fixes OSS-Fuzz#39800 (cherry picked from commit 0b6e9db4fcdcd1ff91e4727be07c95ecef26c50d) 2022-02-18 Liviu Chircu * [886d1ebc6] : Fix inet_pton() error handling in various modules (cherry picked from commit 594a5140a4677ed2d21c7d7d997c8d92ffb94597) 2022-02-16 Razvan Crainea * [b7c9aa588] : cgrates: properly parse $cgr index Many thanks to Sergei Lavrov (@ccppprogrammer) for reporting it Close #2737 (cherry picked from commit b6c4beb3547ec2bcc1b8ad9e9f508c34064d19c1) 2022-02-15 Vlad Patrascu * [175dc99ee] : dialog docs: put the cluster_auto_sync param in the proper section (cherry picked from commit 25ba2d55b3bb70ede77b242cfd9f1e7ff75b2be1) 2022-02-15 Vlad Patrascu * [86064cbb7] : clusterer: fix crashes when loading bad local node URL from DB Closes #2746 (cherry picked from commit e9932270ba593f2c95f7cc572cbb67e0174040d9) 2022-02-15 Vlad Patrascu * [7d6d840fa] : clusterer: fix sync status when attempting to overlap sync requests In the case of dialog syncing, this would lead to incorrectly discarding received dialogs marked with an active sharing tag, when the "auto_sync" feature is enabled(default). (cherry picked from commit 2e0cf9b53d8b33efd8f4e3a439a73c195abdf75b) 2022-02-15 Bogdan-Andrei Iancu * [c6252d79e] : [uac_redirect] update script sample in docs Reported by Slava Bendersky (cherry picked from commit 14179bf7e0c7b3d5a3fe321cedc76afbcb9b4476) 2022-02-11 Vlad Patrascu * [a5d8ba8af] : b2b_logic: fix and document the b2b_terminate_call MI command Closes #2530 (cherry picked from commit 0a6b2607fcf3282c941e4dedae122ddfc2fd927a) 2022-02-10 Liviu Chircu * [6da81c2ac] : fraud_detection: Complete previous commit (cherry picked from commit dea72f1c47eca22b14773aa23e70158e21448382) 2022-02-10 Liviu Chircu * [6128df70d] : fraud_detection: Fix the 'call duration' events The 'call duration' events were not being raised anymore since commit a0fcf857ddb, due to the mismatching callback type check in dialog_terminate_CB(). Also rework commit a0fcf857ddb, where instead of switching the decrement operation on the DLGCB_DESTROY callback (to guarantee it only gets called one time), we just store and use a boolean marker, thus achieving the same effect but while using the optimal callbacks! (cherry picked from commit 7aa272aec749702627404c0d518b4b4fada5ec93) 2022-02-09 Razvan Crainea * [f9b259311] : proto_tls: disable async by default According to ticket #2724, async tls might lead to unexpected behavior. We are disabling it by default until we figure out what is going on and fix the core problem. 2022-01-31 Liviu Chircu * [28101e124] : Re-introduce the $rT (top route type) variable Although the recently introduced $route variable holds all necessary information (including route type), saying $rT (just as before) is preferable to the convoluted $(route[-1]{s.select,0,[}) alternative. Many thanks to Nick Altmann / Bogdan Iancu for pointing this out! 2022-01-28 Vlad Patrascu * [22c63d06f] : dialog: fix previous commit (cherry picked from commit 7ab192753b3d14a87357099cb830b8152c4c8bd7) 2022-01-28 Vlad Patrascu * [25f43caaf] : dialog: fix crash when dropping unsynced dialogs (cherry picked from commit da47168d02a9359de5f95ab83f6f040bbb7c9db9) 2022-01-28 John Burke * [e1c137a6c] : db: add `DB_BLOB` to string parsing macro Mysql/Mariadb return BLOB type when `group_concat_max_len`<=512. This will only occur when using custom SQL schema for OpenSIPS tables (such as VIEWs). (cherry picked from commit 969a5a304df20b875d53259950c234f80c48d41a) 2022-01-28 John Burke * [3038ba2c9] : domain: add support for `DB_BLOB` attrs type (cherry picked from commit 0ed1ee5726c470f95de40bfff04b8d47b73e9e86) 2022-01-28 Vlad Paiu * [16d73398c] : Force re-connection on the new MySQL 4031 code ER_CLIENT_INTERACTION_TIMEOUT in MySQL and ER_REFERENCED_TRG_DOES_NOT_EXIST in MariaDB (cherry picked from commit cde6757a3ebaaea09949107c2a49536681c8a88e) 2022-01-26 Razvan Crainea * [fc00a66c9] : cgrates: properly restore replication acc and dst Credits go to Barnaby Ritchley (from sipsynergy) for reporting it. (cherry picked from commit 914f95aeff075d61843b4b54d11f0e21af8d75cd) 2022-01-25 Vlad Patrascu * [cfd879188] : dialog: fix crash when receiving replicated cseq update Prevent crash when receiving a cseq update for an unknown dialog. The dialog may be already deleted due to timeout or other unexpected race conditions. Fixes #2651 (cherry picked from commit bd7f5e4b7ab215c4affe72e927013f0033088836) 2022-01-25 Liviu Chircu * [070dfa0fa] : httpd: Fix ending newline in DBG log (cherry picked from commit 29188a85d5da0bbcf2b28a0ccd041d29fd17e858) 2022-01-25 Liviu Chircu * [4541680d3] : mid_registrar: Skip usrloc callbacks for foreign domains In case mid_registrar is used alongside registrar using separate domains (location tables), then mid_registrar must not process any callbacks for Contacts/AORs which it is not responsible for. A similar logic should be added for registrar as well, however it currently does not subscribe to any usrloc callbacks. Fixes #2716 (cherry picked from commit 30cdbd674eb6a974088e531a8206659c494f5868) mid_registrar: Improve previous commit Check the domain list for duplicates before appending a new one. (cherry picked from commit c5d884e60d1a708fd49540b622c66cfb6eb170b1) 2022-01-21 Razvan Crainea * [19f1541ff] : rtpproxy/rtpengine: update sockets when a node is forced (cherry picked from commit 8b4f8d19087e67f01d7b9b999125494add65c769) 2022-01-21 Vlad Patrascu * [6f8a184b7] : xml: allow '.' character in node name Fixes #2420 (cherry picked from commit d28805f9bc10b8dce5dc2ec45ab953b46b14a76f) 2022-01-20 Razvan Crainea * [a0b9fa786] : rabbitmq: proper detection of AMQP version completes previous commit (cherry picked from commit 6982bad6dc0d5e3ef3f95668a8dc899dfe0318cf) 2022-01-20 Razvan Crainea * [03c30ec20] : rabbitmq: fix amqp_ssl_socket_get_context version detection Completes commit f7877f9c Thanks go to @axyi on GitHub for reporting this. Close #2713 (cherry picked from commit 8e4b17adc939af92c0a4de8a08b8fa9e6f42caed) 2022-01-19 Razvan Crainea * [a179e2dd8] : rtpengine: only re-negociate used node during offer (cherry picked from commit b5049ac5614d97899deca0635eea3b3f75c81066) 2022-01-19 Vlad Patrascu * [e60d6e1bf] : tls_wolfssl: change remote of wolfssl submodule to official repo (cherry picked from commit 75350ef3ffe3cc80cce11aae58dc00617c23cecc) 2022-01-18 Vlad Patrascu * [f3a3a2640] : tls_wolfssl: properly fix crash when clearing the error queue Make sure the wolfssl error queue is empty after module init so that multiple processes would not try to free the same elements. Drop the custom locking callbacks mechanism introduced in commit 0b75867, as each process allocates it's own queue elements even though shm is used. Fixes #2667 (cherry picked from commit 91abb6c4fd3851da57c751ac8c97d0757d4b09dc) 2022-01-18 Liviu Chircu * [9c53945bd] : dialog: Add quotation mark escaping in get_dialogs_by_val() In case a dialog name/value contained the '"' character (ASCII 34), such as values stored by pua_dialoginfo, the resulting JSON would be invalid. Also optimize the function code a bit, by merging lots of DEC_AND_CHECK_LEN() calls together wherever possible. Credits to Giovanni Maruzzelli for a detailed reporting on this issue! (cherry picked from commit 2b6c3239da501ec4d4627c48d58bd723785566ba) 2022-01-18 Bogdan-Andrei Iancu * [c3767d930] : [mid-registrar/registrar] fix setting default max_contacts Be sure max_contacts global limit is set even when there are no flags passed to hte save() function. Credits go to John Burke / @john08burke Closes #2727 (cherry picked from commit 1aa6aa2ceea2b50e9b84bb8354877dba61ab7141) 2022-01-14 Liviu Chircu * [1c672d51e] : PN PURR processing: Handle "no Route headers" as success If the ";pn-purr=" parameter is not present in the R-URI and the request has no Route headers to search for it, it is a non-PN request. So return a "success" return code (2), as there is nothing left to do here. (cherry picked from commit b1fed3e74ea3529f6b1190f8104bf4181d28ec9a) 2022-01-14 Liviu Chircu * [ce72f89f6] : speeddial: NULL-terminate commands array Completes ae4e8256 (cherry picked from commit 7756d34316e1bc21f4d800bea43308af50c3e9ea) 2022-01-14 Razvan Crainea * [f89a96813] : modules: fix array termination in cmd_export_t Terminate the commands array with an NULL entry, as this breaks on some architectures that do add enough padding after the structure, and allocates it right next to the following structure. Many thanks to Dan Jenkins (@danjenkins) for reporting it! (cherry picked from commit 05115c42e40bc54c2210a1ab5b89607383e18343) 2022-01-12 Razvan Crainea * [9444f15da] : tracer: prevent crash when xlog tracing broken msg Prevent crash generated by xlog tracing a SIP message that lacks Call-ID (cherry picked from commit 0925ce379e8af9e4297e3f17a07232e54549b105) 2022-01-12 Liviu Chircu * [fa5459500] : Merge pull request #2701 from ar45/fix_b2b_logic_lock b2b_logic: Fix missing lock release 2022-01-11 Razvan Crainea * [013fe427d] : rtp_relay: rework answer flags to match $rtp_relay (cherry picked from commit 095ffcd83ace71f956c47bb0c0f36045d3a3183f) 2022-01-10 Razvan Crainea * [e6460628d] : rtpengine: suppress error for chosen set without context (cherry picked from commit 5b07db60e3855307eb36c7d9dbfb37a52e3ab8f7) 2022-01-10 Alexey Vasilyev * [2dfacce0b] : [mid_registrar] Fixes expires parameter when it must be 0. Fixes #2722 (cherry picked from commit 5d50923f40000dd8e36404845d22d55e3c70ed0a) 2022-01-10 Vlad Patrascu * [13424143e] : sql_cacher: fix parsing of 'cache_table' with trailing newline Closes #2682 (cherry picked from commit 312ab9fa032e9cfca231519110e30286e1c804cf) 2022-01-07 Gang Zhuo * [6b4226dfe] : [db_oracle] fix crash when executing db_oracle_raw_query(), function db_oracle_submit_query() require that CON_ORA(_h)->pqdata is not null. (cherry picked from commit d0fdbc04b608f003cad0a68e0e48b269ff5d98a9) 2022-01-07 Gang Zhuo * [a6bd812b4] : [db_oracle] Using DB_STRING as character type Fix https://github.com/OpenSIPS/opensips/issues/2706 All modules (e.g. load_balancer) using DB_STRING as character type to checking column type. (cherry picked from commit 36d98a7c53f4acaf9e476d1fe34f28ab4f9c4c43) 2022-01-07 Liviu Chircu * [1aa0f0e55] : Fix some corner-case file descriptor leaks Credits to @ryancaicse for the analysis and report in #2714 (cherry picked from commit 3ca4d8ce7218865ee81ae201f332ba034be56ae3) 2022-01-04 Bogdan-Andrei Iancu * [c318205ce] : [sipcapture] Fix array-out-of-bound when converting proto ID to string/name Instead of using a local array for mapping the proto IDs to names, better use the core get_proto_name() function - this will avoid duble code maintaining and risks of looking up IDs out-of-bound. Closes #2671 (cherry picked from commit 7de9b15f8bbac3f1294c418ec1e4bbe9111e1454) 2022-01-04 Nick Altmann * [ad51838b7] : DEB packaging: add auth_jwt module package 2022-01-04 Bogdan-Andrei Iancu * [3b9112a8b] : Fix race condition on reporting successful per-proc cfg reload Set the initial per-proc reload status (to SENT) before actually sending the IPC job, to avoid any race condition (in updating the status) with the IPC callback (ran in the target process). Fixes #2584 Many thanks to @etamme on providing the troubleshooting logs (cherry picked from commit e85072cd6e9f54d0a593449b87e492c488393301) 2021-11-25 Aron Podrigal * [73f60301b] : b2b_logic: Fix missing lock release When `new_entities_no` is not 2 we get dead locked. =========================== Release 3.2.4 ============================== 2021-12-22 Liviu Chircu * [25aaa04b7] : Bump version to 3.2.4 2021-12-22 Liviu Chircu * [632efdd20] : clusterer: Fix missing lock_release() on capability error cases Credits to @ryancaicse for the report in #2714 (cherry picked from commit a8509eaf40166c92d0cca04e65fc28d55c978b3d) 2021-12-22 Liviu Chircu * [3b2a0da6a] : db_text: Skip grabbing cache lock during shutdown The destroy() callback is only called if there is a single process left, there is no need for any locking anymore. Also, the lock wasn't released afterwards, which was bogus. Credits to @ryancaicse for the report in #2714 (cherry picked from commit ad28bcbd02ed37f4ef0e77b379d81ceadf53dc86) 2021-12-22 Liviu Chircu * [eb20d18fb] : clusterer: Fix missing lock_release() on "out of PKG" Credits to @ryancaicse for the report in #2714 (cherry picked from commit 3b26cc5656c74cdab899144e6f82d5493f501559) 2021-12-22 Liviu Chircu * [f4ba59997] : presence: Fix missing lock_release() ops on error cases Credits to @ryancaicse for the report in #2714 (cherry picked from commit 9bffaa2792828c0d2c1981d11ec1045d114bbf45) 2021-12-22 Vlad Patrascu * [5dab31f23] : tls_wolfssl: fix possible crashes when clearing the wolfssl error queue Set custom locking callbacks for wolfssl using the custom wolfSSL_SetUserMutexCb() function added in our wolfSSL fork. (cherry picked from commit 0b7586731333c1e984db8277044e7a7ae31b58db) 2021-12-22 Vlad Patrascu * [9697af166] : tls_wolfssl: change wolfssl submodule to a fork of the repo (cherry picked from commit e045e924e95074ac5d661d824d954211f0af411c) 2021-12-22 Bogdan-Andrei Iancu * [ca87a6e1d] : [auth_jwt] fix sql raw query Use simple quoting for values and avoid mysql specific time functions - better push the unix timestamp values from opensips side. Reported by Jonathan Hunter via user's mailing list (cherry picked from commit 05212f01291fd939db42c6d16adbf25492a41348) 2021-12-21 Liviu Chircu * [18bb9f607] : httpd: Document libmicrohttpd regression between v0.9.53 - v0.9.71 (cherry picked from commit ed48286c9bab2cd5eb4a4d5c180859d8d0ee275e) 2021-12-21 Vlad Patrascu * [16da70cbb] : b2b_logic: properly restore b2b sessions from database When continuing a b2b session loaded from database, the dedicated b2b_logic routes would no longer be run for the received request/replies. Also, fix the detection of the current entity when using the $b2b_logic.entity variable. (cherry picked from commit 452d01dbe8338b53970720cd779678ca31ae9563) 2021-12-21 Liviu Chircu * [ae9d2e2d9] : $route variable: Add support for script "callback routes" The idea of "callback routes" was missed during the development of $route, with this feature having been first introduced in 3.1. Conceptually, a "callback route" is a contextless route that may be invoked in a nested fashion, during the processing of a SIP message in any of the routes. For example, on a SIP BYE: 1. route 1.1 loose_route() (this triggers the "callback route", e.g. see dlg_on_hangup()) 1.2 route "dlg_on_hangup" is run, contextless! 2. script processing continues! <--- here, $route output was broken This patch fixes the issue, by adding recursion detection into the run_top_route() function, such that the $route variable works as expected regardless of how many (nested) times it is called. Many thanks to Ben Newlin for catching this issue, as well as providing a detailed report! Fixes #2681 (cherry picked from commit bb1fcc27e279e3021537d197e97bee900fbbae37) 2021-12-20 Liviu Chircu * [20f59af70] : time_rec.h: Use a global constant for uninitialized timestamps (cherry picked from commit fb1e770a7075e8c5f091bb9d91bd88644fc5fcd9) 2021-12-20 Liviu Chircu * [a77fe018c] : fraud_detection: Properly initialize self-built tmrec_t structs Credits to Adrian Fretwell for reporting this issue! Fixes #2712 (cherry picked from commit c972fe15b11265efb3b2e0e8e2d8a299c9d8930d) 2021-12-20 Liviu Chircu * [290c3e613] : qrouting: Fix missing lock_release() on error case Credits to @ryancaicse for the report in #2714 (cherry picked from commit f0ab96eb6b08868ec0ec8571a4164378b73ba30b) 2021-12-20 Liviu Chircu * [0b8bf0eb6] : event_virtual: Fix several missing lock_release() ops Credits to @ryancaicse for the report in #2714 (cherry picked from commit e958b02a50bc9bbf5acd5aa793dbadaff34bf537) 2021-12-20 Liviu Chircu * [6fba783f0] : event_flatstore: Fix missing lock_release() on OOM Credits to @ryancaicse for the report in #2714 (cherry picked from commit 3db06b98263a4700720c78cd69fec642d6314d79) 2021-12-20 Liviu Chircu * [98bd48586] : event_routing: Fix missing lock_release() on error case Credits to @ryancaicse for the report in #2714 (cherry picked from commit 6ea748c768fe9f77c97840cc0f1fc76950f076d3) 2021-12-20 Liviu Chircu * [3438cc2ff] : fraud_detection: Fix missing lock_release() on OOM error case Credits to @ryancaicse for the report in #2714 (cherry picked from commit 80eeb52bd23ba6e76f48ca38e6cb31fa8eb09c14) 2021-12-20 Liviu Chircu * [7be75cdb6] : cachedb_local: Fix missing lock_release() on error case Credits to @ryancaicse for the report in #2714 (cherry picked from commit 1e5dd94dbc3ecf9176e1bf88ec032b7773f2d57e) 2021-12-20 Liviu Chircu * [7d2a8de57] : aaa_diameter: Fix missing lock_release() on error case Credits to @ryancaicse for the report in #2714 (cherry picked from commit ffe3b6f34944c75df251c849e1795ba644db5fdf) 2021-12-15 Bogdan-Andrei Iancu * [f32089b8c] : Solve the problem of recognizing the local SIP msg We need a consistent and solid way to recognize the internanlly generated SIP msg (as a result of t_uac) - these are msg structs resulted from the parsing of buffers with SIP msgs (cherry picked from commit 02c6ed9eaa3751623f19ed160dc802e11862df3d) 2021-12-14 Bogdan-Andrei Iancu * [d60a7be84] : Revert "[topology-hiding] fix detection of the UAC requests" This reverts commit abeeb36d77e05df4a4a3fc71af1f0795dc2a7e61. 2021-12-14 Liviu Chircu * [cfb6f0c52] : nathelper: Fix bug introduced in ecbd9856efb Credits to Alexey Vasilyev (@vasilevalex) for reviewing the commit and catching the regression! (cherry picked from commit 54bb91a373a2457ad5c5ccc22ab70bd4c83c01d8) 2021-12-06 Bogdan-Andrei Iancu * [abeeb36d7] : [topology-hiding] fix detection of the UAC requests Use a more generix approach (check VIA2 presence) to see if we deal with a locally generated or proxyed requests. Fixes #2690, credits go to @bcnewlin for reporting. 2021-12-06 Bogdan-Andrei Iancu * [107dcba5b] : [core] build_res_buf_from_sip_req(): fix hdr correlation Issue discovered during OpenSIPS Security Audit 2021, by Alfred Farrugia & Sandro Gauci (Enable Security) https://github.com/OpenSIPS/opensips/security/advisories/GHSA-7pf3-24qg-8v9h (cherry picked from commit 9cf3dd3398719dd91207495f76d7726701c5145c) 2021-12-06 Bogdan-Andrei Iancu * [f6790c075] : [usrloc] fix contact matching on registrations handling instead of pron-to-error string matching, use the SIP wise matching when matching the registered contacts. The SIP URI matching is more complex, mainly when comes about the URI parameters - some important (user, transport, etc) params must be present in both URIs in order to match, other generic params may match even if the param is present in only one URI. Some devices may use during registration some proprietary params for the contact, but without sending the full list when re-registering or when deleting the contact - and this is perfectly ok from the perspective of the SIP RFC3261. Prior to the fix, in the above scenario, OpenSIPS will have failed to re-register or un-register the contact, leaking registrations. (cherry picked from commit 85e67d890cc0e225d1a4512ccb8cadc1a5090a41) 2021-12-03 Vlad Patrascu * [33ab41052] : db_text: return a valid empty string for a null DB value This prevents crashes in modules which do not check the null flag in the db result before using the string value (eg. doing strlen()). Fixes #2658 (cherry picked from commit ddbec155fc89d2085149f2debc66edecb0789554) 2021-12-02 Vlad Pătrașcu * [5d5fe4b5a] : Merge pull request #2676 from GangZhuo/issues-2649 [sql_cacher] When on demand mode, get column types at mod_init (cherry picked from commit 69966d71127f34b6dec1f4d2a4b431a9778f5d72) 2021-12-02 Vlad Patrascu * [139fed304] : tls_mgm: fix variable name from previous commit (cherry picked from commit 008196a5308a09af0ed9a76d369ccd7c2cf17ed0) 2021-12-02 Vlad Patrascu * [e46889349] : tls_mgm: properly free TLS domain when failing to initialize it (cherry picked from commit 8af30c076d6e7b3d7f267782f20a27056cff0e31) 2021-11-25 Razvan Crainea * [fb82bacce] : rtpengine: add support for all replace options (cherry picked from commit 4f41b09eb116bcf4c1e8325f260e85b9d4eaebfb) 2021-11-25 Razvan Crainea * [d4eecc538] : rtpengine: rework media-address fix by checking if value is specified Thanks go to @wangduanduan for reporting it in #2692 (cherry picked from commit 83e0bf6a62e38949e1c3c96cfee711775558f52c) 2021-11-25 Razvan Crainea * [b1f6778da] : Revert "rtpengine: pass the media-address as we get it" This reverts commit d0db03b0007e16b176e81686c631b5f69ed3b0ab. 2021-11-25 Razvan Crainea * [d0db03b00] : rtpengine: pass the media-address as we get it Thanks go to @wangduanduan for reporting it in #2692 (cherry picked from commit 7411e62a38e5d479dc41df6ee883aa165d8e3b56) 2021-11-25 Liviu Chircu * [97233f49a] : nathelper: Fix rare message corruption due to bitwise opts on strings Credits to Damien Sandras for the report and initial PR! Closes #2695 (cherry picked from commit ecbd9856efb7a420e2fceff6769951d307be8c03) 2021-11-24 Vlad Patrascu * [089b653f3] : event_route: allow a 'route' subscriber to be used from event_virtual (cherry picked from commit 447a88a19c86fc4159e290b2aa8475e4db5ce551) 2021-11-24 Razvan Crainea * [58fc8e31a] : prometheus: unlock stats mods on error 2021-11-23 Liviu Chircu * [d4503e074] : drouting: Allow 64-bit integers for dr_rules.sort_profile This allows SQL views to represent the NULL value as a 64-bit integer without getting rejected by OpenSIPS, which expected a 32-bit integer for that column. Admittedly, any 64-bit integer "sort profile" will now be truncated to 32 bits, but OpenSIPS had no full support for 64-bit sort profile values in the first place, so it's better to just truncate and NOT error. (cherry picked from commit 7fb5ddf64826bc9d6c1c3d3c0d58cf7275e748dc) 2021-11-23 Liviu Chircu * [cc50f825e] : perl: Fix PKG corruption in perl_exec_simple() (off-by-one) Credits to Kingsley Tart for the report! Fixes #2666 (cherry picked from commit 38e67d4ce6bbfec9f30188cedfd73bd80b18e1bc) 2021-11-23 Liviu Chircu * [8aba9d3cc] : perl: Allow perl_exec_simple() from any route This function is neither tied to a SIP message nor does it perform any SIP signaling, so we can call it from any route! (cherry picked from commit 4dbd2ced3a1db3326b7201c64bba165033ab2d95) 2021-11-23 Liviu Chircu * [c3abd8507] : Dialplan docs: Update the time recurrence syntax text (cherry picked from commit 36ba2af3e6d2cee05c098f5bc719b8f9279e4f32) 2021-11-23 Liviu Chircu * [5d8465107] : drouting docs: Update the time recurrence section Credits to Pete Kelly for spotting the issue! (cherry picked from commit 2831178c2cfde30e15a2d47edd976de97f430096) 2021-11-23 Razvan Crainea * [fe0da3e1b] : rtp_relay: fix flags order for answer (cherry picked from commit 95ecb77c5e23c532a994d3ac57060f60c403c176) 2021-11-23 Razvan Crainea * [23ba1eeee] : Revert "rtp_relay: do not offer the same request twice" This reverts commit d3b93d663a6607f893ea4fbabc2bd806971a0e5e. 2021-11-23 Liviu Chircu * [6059c4298] : httpd: Fix const pointer conversion warnings (CentOS 7) httpd.c:136:5: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] vi = ver; ^ httpd.c:137:7: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] rend = ver + strlen(ver); ^ (cherry picked from commit 43046101b9a1830cfc65dbfb73babe13a569f0d4) 2021-11-19 Bogdan-Andrei Iancu * [79eb24e38] : [drouting] update docs on carrier sorting algorithms (cherry picked from commit 394ba080486f97f44afaf794fa82aba1f630b186) 2021-11-18 Vlad Paiu * [aaa3831c6] : Fix ACK CSEQ generation for in-dialog RE-INVITEs where in-dialogs pings have been sent out Closes #2678 2021-11-18 Vlad Patrascu * [614661cab] : tls_mgm: fix possible crash when reloading from DB The crash would occur after multiple DB reloads when there are also TLS domains defined in the script. (cherry picked from commit f877f8752f3ce334924c2b22985c89997aa0ffc2) 2021-11-17 Liviu Chircu * [f4980dd63] : proto_hep: Do not corrupt PKG memory if HEP3 buffer too small This patch makes proto_hep more stable in production, so it doesn't cause a crash if it reaches an unexpected state, such as "buffer too small" followed by overrunning the PKG buffer, for example: CRITICAL:core:qm_debug_frag: qm_*: prev. fragm. tail overwritten(f00000a000c0000, abcdefedabcdefa0) [0x7f1b840306c8:0x7f1b840306f8] (build_hep3_buf, hep.c:1347)! Now, the respective tracing will simply fail and OpenSIPS processing continues safely. Still, the original bug remains to be understood and addressed. Issue discovered during OpenSIPIt'02, thanks to Alfred Farrugia & Sandro Gauci (Enable Security) (cherry picked from commit 78e4356aee36eb4cc4b89f712462588c1af28470) 2021-11-17 Liviu Chircu * [41f78830a] : rest_client: Add the 'max_transfer_size' setting Sets a limit on the maximum size of a single download. May be important for security purposes, to prevent certain attack vectors such as malicious "x5u" certificate URLs in STIR/SHAKEN setups. Default: 0 KB (check disabled) Issue discovered during OpenSIPIt'02, by Alfred Farrugia & Sandro Gauci (Enable Security) 2021-11-15 Bogdan-Andrei Iancu * [7193c5d8d] : Proper stack of the AVP list when running the dialog specific routes Fixes #2464 Credits go to Ben Newlin for reporting and assisting with the fixing. 2021-11-12 Razvan Crainea * [1777dadb0] : pvar: allow $socket_out matching based on tags Do not force a port, if not specified in the socket's string, otherwise the socket will no longer match its token (cherry picked from commit 1e952a7f13c7e78faec1afc2667758d1e7825a54) 2021-11-12 Bogdan-Andrei Iancu * [03743dba9] : [core] fix parse_via() parsing Issue discovered during OpenSIPS Security Audit 2021, by Alfred Farrugia & Sandro Gauci (Enable Security) https://github.com/OpenSIPS/opensips/security/advisories/GHSA-wxfg-3gwh-rhvx (cherry picked from commit ab611f74f69d9c42be5401c40d56ea06a58f5dd7) 2021-11-12 Bogdan-Andrei Iancu * [eab8ff654] : [sipmsgops] fix parse_to_param() parsing Issue discovered during OpenSIPS Security Audit 2021, by Alfred Farrugia & Sandro Gauci (Enable Security) https://github.com/OpenSIPS/opensips/security/advisories/GHSA-qvj2-vqrg-f5jx (cherry picked from commit cb56694d290530ac308f44b453c18120b1c1109d) 2021-11-11 Bogdan-Andrei Iancu * [4ec0f086c] : [sipmsgops] fix codec_delete_XX() parsing (2) Issue discovered during OpenSIPS Security Audit 2021, by Alfred Farrugia & Sandro Gauci (Enable Security) https://github.com/OpenSIPS/opensips/security/advisories/GHSA-67w7-g4j8-3wcx (cherry picked from commit c6ab3bb406c447e30c7d33a1a8970048b4612100) 2021-11-11 Bogdan-Andrei Iancu * [b2f934cab] : [sipmsgops] fix codec_delete_XX() parsing Issue discovered during OpenSIPS Security Audit 2021, by Alfred Farrugia & Sandro Gauci (Enable Security) https://github.com/OpenSIPS/opensips/security/advisories/GHSA-xj5x-g52f-548h (cherry picked from commit 8f87c7c03da55f9c79bd92e67fa2c94b2a7ce5cf) 2021-11-08 Bogdan-Andrei Iancu * [1796502c1] : [core] improve logging when IPC blocking is detected Throw a CRITical log with info on the target process (cherry picked from commit dce2643e5716f082847a90e409c2156dde9e4852) 2021-11-08 Bogdan-Andrei Iancu * [babfb7d34] : [core] make the per-process IPC sending non-blocking A process may get stuck (history showed us such real cases) and we do not want to have other processes getting blocked by trying to do an IPC to such procs (if they are stuck, they will not consume their IPC cmds, so the IPC sender will also block after some time, when the pipe's buffer is full). So, better make the write pipe non-blocking, discard the current IPC cmd and avoid escalating the blocking over other procs. (cherry picked from commit 62af720cd5a9d04d982b474398294ef5068e9f45) 2021-11-02 Razvan Crainea * [671cc256a] : rtpproxy: fix buffer dump of multiple media streams (cherry picked from commit 86eabcffe993a67e36eede3c9f6109d50dc1debb) 2021-11-02 Bogdan-Andrei Iancu * [5fb90d277] : [core] fix printing cfg file context for errors after a reload_routes Reset the file context list each time a new cfg parsing starts, to be sure we do not inherite the context from a previous parsing. If we do not do this, when doing a reload_routes, if an parsing error occurs, we will get references and dumps (of the faulty lines) from the original, startup script, not from the reloaded one. (cherry picked from commit 52e51809ca219c97ea9e348f5dab6a109859eece) 2021-11-02 Bogdan-Andrei Iancu * [14f6aeda3] : [core] proper re-init of cfg parser during reload_routes The lex parser needs an explicit reset/init after a parsing attempt completed with a parsing error. This is needed to be able to start a new parting session, via the route_reload MI cmd (cherry picked from commit 5dd7976c03b6364f307b993bfdff1d8c1c010aa0) 2021-11-02 Razvan Crainea * [a865b2a99] : evi: fix shm duplicate of multiple params This fix ensures that all parameters are duplicated in SHM, instead of only the first one. Thanks go to Rob Moore for reporting it in #2669 (cherry picked from commit 3a9b4a1f0c259b95cb29d1240f134c687c925755) 2021-11-02 Razvan Crainea * [f792bfa68] : db_sqlite: fix memory leak for row values (cherry picked from commit 06a35a635e71778342ee272411657040ecdcb0e6) 2021-11-01 Vlad Patrascu * [7e38fb2a2] : tls_wolfssl: enable support for static RSA ciphers (cherry picked from commit 8900ba4e5a3a2d8590dbac43af363ac2071cf2fb) 2021-11-01 Vlad Patrascu * [7e2ff655b] : clusterer: fix internal traffic flood caused by node UP event The capability update broadcasting mechanism would generate an unncessarily large number of packets, especially for clusters of more than 6,7 nodes. (cherry picked from commit 32dbcbae74bfaec095849d8c0349ab2f7ecc97bb) 2021-10-28 Razvan Crainea * [b47afef19] : rtpproxy: fix ptime insertion when body is used (cherry picked from commit e38569baa74f70ddae55c1421ca153b65b0a3162) 2021-10-28 Razvan Crainea * [bc6d2b4c5] : ratelimit: always update last local used when pipe is accessed Thanks go to SIPNav for troubleshooting and providing a fix for the problem. (cherry picked from commit 668acafc90f807b97ffe55a887a1b30e492bb65c) 2021-10-27 Liviu Chircu * [cf9791fba] : parse_param_name(): Improve param parsing macros Issue discovered during OpenSIPS Security Audit 2021, by Alfred Farrugia & Sandro Gauci (Enable Security) https://github.com/OpenSIPS/opensips/security/advisories/GHSA-jrqg-vppj-hr2h (cherry picked from commit dd9141b6f67d7df4072f3430f628d4b73df5e102) 2021-10-26 Bogdan-Andrei Iancu * [b5302fc1e] : Fix the DB saved description of the caller/callee sockets Use the internal description of the socket when saving in DB. This means using the socket TAG when defined, versus the proto:ip:port description. This is how the replication is also doing, to cope with potential changes of the socket IP during a replication. And in our case, during a restart. (cherry picked from commit 7aa24e1c1973fb56da2d03aceaf843b71e87c8b0) 2021-10-22 Vlad Patrascu * [f8dc4e5ca] : clusterer: don't try to sync after seed_fallback_interval (cherry picked from commit 89a3d52e157124f5abd0b7499e60eb9bf2dbc8f3) 2021-10-22 Razvan Crainea * [1abcbd8b1] : cgrates: search for ctx in trans as well when reading When reading a $cgr* variable, we shall also check if the context is stored in transaction, not only in the current processing ctx. (cherry picked from commit be1e32e5839c5dc71dd89be1506760de95c5df48) 2021-10-21 Bogdan-Andrei Iancu * [91b2dc9e5] : [msilo] Fixed setting proper time in offline message (cherry picked from commit cc20f738b83f5a9c7f24630309ddb5bab889bf56) 2021-10-21 Bogdan-Andrei Iancu * [d9a11509c] : [msilo] Fixed len calculation for added time Reported by "jacky z" on user's mailing list (cherry picked from commit 9bc117953730a0ea761e3ceaeea9fee7facea2cc) =========================== Release 3.2.3 ============================== 2021-10-20 Liviu Chircu * [20278cf7b] : Bump version to 3.2.3 2021-10-19 Vlad Patrascu * [eb18952b1] : tls_mgm: fix double free when no TLS library is used (cherry picked from commit 834ab5a577e8b7986f763c540aefc81a0303dd32) 2021-10-18 Liviu Chircu * [05b3d1dca] : is_ws(): Play well with UndefinedBehaviorSanitizer (UBSan) Avoid bitwise shifting by 31 of a signed integer type. Practically, this patch does not fix any bug on the widely used arches (the resulting assembly is 100% the same on these), but at least it makes the code more C-standards compliant. OSS-Fuzz#39920 (cherry picked from commit 6581e0efeace51234932d97621aaa1636ad56cc3) 2021-10-13 Razvan Crainea * [e597df449] : fraud_detection: allow empty prefix (cherry picked from commit ae8ec85b8b04703948846f871d6f6e18ce484c6a) (cherry picked from commit 8aabc2049832dc4fce87d7e8bad3b676d702c53c) 2021-10-11 Răzvan Crainea * [debe7c928] : Merge pull request #2614 from danlshields/dshields/wsPartialExtendedLength Wait for more data if WS header doesn't have extended length yet (cherry picked from commit 078c57b515e0f3a2111205e058d431817d9e1d42) 2021-10-11 Nick Altmann * [d7d143c6c] : RPM package: don't build smnpstats for fc==33 because of broken lib 2021-10-10 Nick Altmann * [dff6ec904] : RPM package: stop docs recoding 2021-10-10 Nick Altmann * [d15e06b24] : RPM package: don't build smnpstats for fc>=34 because of broken lib 2021-10-08 Vlad Patrascu * [ce81ade54] : tls_wolfssl: fix memory leaks Do not use the wolfSSL ECC Fixed Point cache as it is not freed until library cleanup. Also, clear the error queue after each call to wolfSSL_read(). Fixes #2604 (cherry picked from commit d5d069d37a1dddfff002337c5d39f2ad2d83b69e) 2021-10-08 Razvan Crainea * [7e317da0f] : cgrates: make sure default connection can reconnect (cherry picked from commit e941c1f248116fcee608ef0f2b7b5b54b1671dd3) 2021-10-08 Razvan Crainea * [50b61365e] : Fix crash in parse_sdp when a= is empty When a bogus SDP was provided, with an empty `a=` line, there was no check for the length to be compared, resulting in a bad memory access, hence a crash. Issue discovered during OpenSIPS Security Audit 2021, by Alfred Farrugia & Sandro Gauci (Enable Security) (cherry picked from commit 2617c97207b1fe2afead9f887f7a5df4da3b7d55) 2021-10-07 Vlad Patrascu * [b5e78e547] : tls_wolfssl: allow range of accepted TLS methods Closes #2564 (cherry picked from commit 8ea4ca09270ce4bdb74fe5b3b6cc8350d1b5a60e) 2021-10-06 Razvan Crainea * [38b54db9c] : ut.h: fix off-by-one check in str_casematch when the string length is 0, the first char of the string would have been checked, resulting in a possible memory corruption (cherry picked from commit a96190e97e9bd073740c1959678884bf6595cd04) 2021-10-06 Razvan Crainea * [d4b98ad3a] : httpd: port epoll fd get to older version Credits go to Nick Altman for reporting (cherry picked from commit 9fa482b40f903faad1816344ef0a49c383a9e7ea) 2021-10-06 Vlad Patrascu * [1f80fd151] : proto_tcp/tls/ws/wss: fix doc example for trace_destination (cherry picked from commit cc00b7fb53c834f198c34e48a63b02b54916b027) 2021-10-06 Vlad Patrascu * [1f72f2290] : tls_openssl: fix trace message for successful connect (cherry picked from commit 1c6fa0b4768c716b1e405f925ffe6cc769c8924d) 2021-10-06 Vlad Patrascu * [d8cd0c84c] : tls_wolfssl: add TLS tracing support (cherry picked from commit d4377e8853c475d9c4817ae829878e8210205805) 2021-10-05 Razvan Crainea * [f80034915] : httpd: fix fetching epoll fd when more than FD_SETSIZE are used (cherry picked from commit 5e94bece0b2c62d8a8c411033df7dffbe3381fa4) 2021-10-05 Razvan Crainea * [f8f671a50] : sipmsgops: disable stream when all codecs are deleted (cherry picked from commit 5f9c333d45242c7caa55513f2d84cad8fe24547c) 2021-09-30 Razvan Crainea * [563a78533] : cgrates: returning a non-object response is not a problem (cherry picked from commit f7f66d39baef10ce0db4fce02119c23454dca940) 2021-09-28 Liviu Chircu * [6765b7d95] : mid_registrar: Fix regression introduced in c11f92698 Avoid re-using anonymous structures outside of the block scope they were declared in, as the compiler may easily re-use that stack memory outside the given scope. Credits to Andrew Yager for providing debugging info, as well as bisecting down to the exact culprit commit! (cherry picked from commit 8df8fd960b3311487b58e10244023ca547884536) 2021-09-28 Maksym Sobolyev * [4e1bb9cf6] : Add str_static() macro similar to the const_str() but returning const str *, not const str_const *. This provides useful construct to initialize time-of-use const str * that won't go out of scope. This is another way to address issue fixed by @liviuchircu in the 0fadc0a6cb, one that is bit more cleaner and generates a slightly smaller compiled code. (cherry picked from commit ea3436b26108fe129d04b47b02dd8d60255487c3) 2021-09-28 Liviu Chircu * [cb0680ab8] : Fix crash with REGISTER + incomplete Authorization header Avoid re-using anonymous structures outside of the block scope they were declared in. The compiler allows such broken code, yet it is also quick to re-use/re-claim that memory quickly after exiting the block, leading to stack corruption later down the road, when the "now re-used struct" is read. Issue discovered during OpenSIPS Security Audit 2021, by Alfred Farrugia & Sandro Gauci (Enable Security) (cherry picked from commit 0fadc0a6cb130d40fba6cf36bb1399d45d0496aa) 2021-09-28 Maksym Sobolyev * [83fee1c7a] : Avoid passing pointer to a structure that might be already out of scope. This fixes crashing issue reported here: http://lists.opensips.org/pipermail/users/2021-September/045122.html 2021-09-23 Liviu Chircu * [33097b43f] : Revert "drouting: route_to_gw() returns also the carrier's attributes" This reverts commit 7d8c08f5288fbba29b83e621aa9f52a19cda421f. 2021-09-23 Bogdan-Andrei Iancu * [7d8c08f52] : drouting: route_to_gw() returns also the carrier's attributes (cherry picked from commit 2011a9f1e2fb0980c9668adec044b780509c54c6) 2021-09-23 Bogdan-Andrei Iancu * [1a8e4853b] : Fix the timeout for wait_for_event() Even if a timeout is provided, it was not taken into account, leading to a potential permanent blocking of a request execution thread if there was no event ever delivered to it. 2021-09-20 Vlad Patrascu * [688bbbab0] : dialog: complete fix from previous commit (cherry picked from commit 5eb5c8f89de7ec135b83aad7755a10083bc3cbce) 2021-09-20 Vlad Patrascu * [d357f9488] : dialog: properly handle BIN pop errors in previous commit (cherry picked from commit 4d969df83aaf5c08ea4de25dab4eabc0cd05a538) 2021-09-20 Vlad Patrascu * [fb613129b] : dialog: match replicated dialogs by did This fixes issues in call looping scenarios when trying to replicate multiple dialogs with the same SIP coordinates. (cherry picked from commit b3c31fbff198ee551b62dcf42ef7e2e45d2e8fcf) 2021-09-16 Vlad Patrascu * [3a0cde5f4] : b2b_logic: fix crash when b2b_trigger_scenario fails to init scenario (cherry picked from commit 586a4a22d0c1691696fdc5434547aca84f4ee9f3) 2021-09-16 Vlad Patrascu * [f04722f2b] : b2b_logic: prevent crash if 'server_address' modparam is not set Do not crash when 'server_address' modparam is not set and the 'b2b_trigger_scenario' MI function is used. (cherry picked from commit e17f8193753b1d423ec2a472702f3c01e0b38d5a) 2021-09-16 Vlad Patrascu * [43d73a7b7] : b2b_logic: fix possible crash after peer entity is disconnected The crash would happen when a receiving a request and the current entity has no peer. (cherry picked from commit afbff6a00842d8d02395a8f793636123319978da) 2021-09-16 Liviu Chircu * [976319f5d] : rtpproxy: Document adv+weight socket syntax; Improve dbg log (cherry picked from commit 067b547e98504eca688fb6e20977a00b17c63b34) 2021-09-14 Liviu Chircu * [716c95f48] : proto_bin docs: Fix 'bin_port_send_timeout' typo (cherry picked from commit 48aba0aed73af04f9860936a204496b9006d01af) 2021-09-14 Liviu Chircu * [229bf72f4] : dialog: Fix missing unlock ops on DB load error-cases This patch fixes some startup deadlocks in case a dialog loaded from database has an incorrect DID (failed checksum check) or if OpenSIPS runs out of shared memory while importing dialogs from DB on startup. (cherry picked from commit 9e8d36c34390d18d5996121deddcce5cd143830f) 2021-09-10 Razvan Crainea * [a903c1840] : cgrates: make MaxUsage optional for InitiateSession reply In newer versions of CGRateS, MaxUsage is no longer returned - this means that the session should be allowed without any duration limitation. (cherry picked from commit ae596cccbcb89c9d66a6878421fd672201856f09) 2021-09-03 Razvan Crainea * [dc45f112e] : rtpengine: only add mux flags if answer/offer (cherry picked from commit c342ab0633b5a774b81c1eedcefc17bf43474ce4) 2021-09-03 Razvan Crainea * [f87c3ff36] : rtp_relay: proper detection of last available session (cherry picked from commit 9e18d404ff2a1eb416a57d2bf6e5d0d4e6caa10e) 2021-09-02 Razvan Crainea * [d3b93d663] : rtp_relay: do not offer the same request twice When engaging rtp_relay on branches, make sure that the RTP relay does not get engaged twice (once per main request, and second time per branch) (cherry picked from commit 562962a0589f332920cd4c962704a3d0ca5ab51c) 2021-09-02 Razvan Crainea * [a7398993f] : rtpengine: fix memory coruption when using branches through API (cherry picked from commit 3f0af75f404c7127a5d6dd6a1627cf2e513797d2) 2021-08-30 Liviu Chircu * [7b7347575] : dialplan/drouting: Fix time recurrence check interpretation The tmrec_expr_check() function actually returns 1/-1 on success/failure and not 1/0, as expected by the calling modules. Many thanks to Flavio Goncalves for the report! Fixes #2616 (cherry picked from commit 3056a37407f4cd29dc5e486c12449efe7f4c634e) =========================== Release 3.2.2 ============================== 2021-08-19 Liviu Chircu * [4963c4ee0] : Bump version to 3.2.2 2021-08-19 Razvan Crainea * [2232f6a33] : proto_bin: fix crash when parsed data is printed on error The module was trying to print the parsed data in case of an error, however it was using the `start` field of the tcp_conn. The problem is that the module does not use the `start` field, therefore when a request is not entirely read from the begining, it is not updated to point to the new structure. Therefore, when we're trying to print the buffer, it is pointing to an address on stack. The fix for this bug was to suppress the parsed printing, as it is binary anyway and it is the same value as the `buf`. Many thanks to Bernard Buitenhuis for reporting the issue. (cherry picked from commit 4c52754b8cb2ade4f877d6a03c4b84d84608d49a) 2021-08-19 Razvan Crainea * [a802c934a] : cfg: enhance description when an unknown route is called (cherry picked from commit ca9f428a4d59a9b40ebd7235edf545e9609ddfeb) 2021-08-19 Razvan Crainea * [3378261ef] : httpd: fix feature detection for older libraries Feature detection has been added in version 0.9.35, thus we can't compile older version. However, when running cross compiling, we might compile aginst an older version, but run with a newer one - that's why we'd rather do the version detection at runtime - that's what this commit does. (cherry picked from commit e4065aaf3734409e05b59954057be4fed5d2479d) 2021-08-19 Liviu Chircu * [e0823818b] : drouting: Fix startup crash with no clustering The crash was a regression, introduced in 40355a3c1. Many thanks to @masudmuborakshohi and Sasmita Panda for the reports! (cherry picked from commit 4206f768923dd95deb1b51ebcfda4905c334f2ce) =========================== Release 3.2.1 ============================== 2021-08-17 Liviu Chircu * [8dd29f668] : Bump version to 3.2.1 2021-08-17 Vlad Patrascu * [73c39ec8f] : tls_wolfssl: fix behavior of is_peer_verified() with session tickets If TLS session tickets were used for session resuming, the is_peer_verified() script function would not be able to verify the peer even if it did present a valid certificate in the initial TLS handshake. Even so, this fix can only guarantee that the peer can be verified when resuming a session, if the TLS domain is configured to require a peer certificate initially. Otherwise, wolfssl does not provide a way of retrieving the peer certificate from the received session ticket. Fixes #2541 (cherry picked from commit b1c67295c1ae5937df316df3152b8ecf4da6e067) 2021-08-17 Liviu Chircu * [70e8b24b6] : usrloc DB schema: Extend location.contact from CHAR(255) to TEXT This extension is especially useful with RFC 8599 (SIP Push Notifications), which may lead to sizeable Contact header URIs, often reaching 300+ bytes in size. Credits to John Quick for the suggestion! (cherry picked from commit ec09a18f6c240dd3159e284370bd6f4dc6747f03) 2021-08-17 Razvan Crainea * [f312eaa1d] : ratelimit: proper expire for replicated pipes Instead of updating the last_used on every received pipe, we shall only consider the last locally used value when we want to expire. This way, we only replicate pipes that have been locally used recently, if the ones that are not, will not be replicated, thus will eventually be deleted by the backup nodes. Thanks go to Ken Rice (SIPNav) for reporting this and troubleshooting the problem. (cherry picked from commit d430c1ae8e77bc0ae2d2eb0ac4eb31d779a8101f) 2021-08-17 Liviu Chircu * [bf73b9f6e] : mid_registrar: Properly trigger PN during lookup() in modes 0/1 This fixes a bug where one or more Push Notifications are not triggered because the "regtime" was not initialized near the start of the mid_reg_lookup() routine... Many thanks to John Quick for the report and accurate logs describing the issue! (cherry picked from commit 9ea64cc6cfa290e8c97c921330d6379ed6cd25b3) 2021-08-16 Liviu Chircu * [22bec4036] : auth docs: Mention RFC 8760 support in Overview (cherry picked from commit 6ebf56a670ac4dcd9bcf3968c2822039d8e4316c) 2021-08-16 Liviu Chircu * [79d20aeea] : auth_db docs: Eliminate references to "HA1b"; Document new columns Credits to Adrian Georgescu for the report! (cherry picked from commit b4b24ca7a14aaaa02fe2b15f7c69cf970b0aa81f) 2021-08-16 Liviu Chircu * [c871d9edf] : db_mysql: Fix regression in PS handling Commit 87f241651 introduced a regression in db_mysql where modules using prepared statements on top of it would run into errors. Example behavior of auth_db on a basic user auth query: ERROR:db_mysql:db_mysql_store_result: driver error: Commands out of sync; you can't run this command now ERROR:auth_db:get_ha1: failed to query database Credits to @masudmuborakshohi for the accurate report and logs! Fixes #2593 (cherry picked from commit 4ef6bab4d95d9c23127cad776c126afb0ed77106) 2021-08-16 Liviu Chircu * [8f4c24adc] : Update CREDITS file for 3.2 release 2021-08-16 Bogdan-Andrei Iancu * [31d3cd382] : Add code to troubleshoot some BUG report on weight sorting alg. Dump all the gws, their weights and the running sums, so we can undestand why the alg fails here - this dump will happen only when the bug is detected. Also, in case of this BUG, avoid dropping the call (by return -1), but rather return something usefull, so the call can be routed further. (cherry picked from commit 35cf96e2cc3d9a0f1e280d47a5ff1ee526940bef) 2021-08-16 Bogdan-Andrei Iancu * [7a67af9b6] : Be sure we have support for MHD_USE_EPOLL. Check if MHD_USE_EPOLL is supported at startup, to be sure we have a proper version of the library. Closes #2580 (cherry picked from commit bb4de46e49904d351c05e5f16ed887edb828a580) 2021-08-16 Bogdan-Andrei Iancu * [3b8f19ad0] : Fix self-IPC for cfg reloading on the MI process. As starting 3.2 the MI procs also have IPC and cfg files, they are also eligible for receiving the cfg reload IPC command - so we need to run this IPC cmd inline for the MI proc triggering the reload. Also adding some extra logging to help in understanding why a reload cmd may fail. Fixes #2584. (cherry picked from commit 4c3150e461c31c29908a7ddd20e550bbfcbb69e3) 2021-08-16 Vlad Patrascu * [cb7d907e6] : stir_shaken: add ability to skip Date header checks when verifying Add a new "require_date_hdr" modparam that controls whether the Date header is mandatory when verifying. (cherry picked from commit 736ad5cc3b4ba4a25ac81d3b98af6e83b4129404) 2021-08-15 Nick Altmann * [ad015c0de] : packaging/debian: fix Debian Bullseye build 2021-08-13 Liviu Chircu * [e8494eb97] : mid-registrar: Avoid generating De-REGISTER from Passive node * enhance the usrloc API with a contact ownership checking function * mid-registrar now only generates De-REGISTER for owned contacts Credits to Giovanni Maruzzelli for detailed reporting and instructions on how to reproduce this issue! Fixes #2559 (cherry picked from commit 4128f67d271b4851a194ebf69da0349c4403e2a9) 2021-08-13 Liviu Chircu * [04259f637] : mid-registrar: Improve replication behavior on INSERT Ensure all mid-registrar data tied to a contact gets included in the very first "INSERT" packet. This prevents some unnecessary error logs on the backup box when doing a quick REGISTER/De-REGISTER in Active/Passive scenarios: ERROR:mid_registrar:unregister_record: 'from' key not found, skipping De-REGISTER ERROR:mid_registrar:mid_reg_aor_event: failed to unregister contact Credits to Giovanni Maruzzelli for an accurate report and detailed logs on this issue! Fixes #2525 (cherry picked from commit c11f92698c6f345d8921d645177f71aa36c9791d) 2021-08-13 Liviu Chircu * [9ff14e3b4] : usrloc: Learn the active node AoR rlabel (as backup node) When using timer-based contact cleanup in Active/Passive user location scenarios, the two timers may run in such a way that the backup node still has a given AoR, while the AoR does _not_ exist on the active node... Now, if a phone registers, the backup node complains that the replicated AoR's auto-generated rlabel differs from its own one, since the old AoR has yet to be cleaned up. And as long as the AoR has no contacts, we can safely re-learn (overwrite) the AoR's rlabel on the backup node and fix this race condition. Credits to Giovanni Maruzzelli for reporting this issue and providing accurate debug logs! Fixes #2524 (cherry picked from commit 24ec0d23d6f9193548bf0f4296acdba039a4483b) 2021-08-12 Vlad Patrascu * [1cf4abb68] : tls_mgm: document possible ca_dir warning when using wolfSSL Closes #2545 (cherry picked from commit a29cbcf38fddc9e75f406ddcf63a9cc1c1a3672c) 2021-08-11 Bogdan-Andrei Iancu * [8b2daa805] : Fix race between data sync and data load Be sure we trigger the startup cluster sync AFTER loading the data from DB. Also, when receiving replicated data, be sure the data is actually loaded. Closes #2581 (cherry picked from commit 3b8bdb794da3828a4fe7639f460c36fffe03031a) 2021-08-10 Norm Brandinger * [6d781a1ef] : fix: From Nick Altmann: Fix wrong variable usege when escape STR type in db_postgres (cherry picked from commit 0d2dac363256e8bcacfc1391f63715fe10a905c6) 2021-08-10 Norm Brandinger * [c7ca79313] : Fix spelling (cherry picked from commit 41b4a018af55f08815dec7e19001d68442e19370) 2021-08-03 Liviu Chircu * [2c5c19627] : permissions: Fix loader conflict on multi-defined hash_destroy() With hash_destroy() defined both in lib/hash.c and modules/permissions/hash.c, this would enable the following shutdown crash: 0 map_destroy ... at map.c:484 1 0x0000557055f1d75d in hash_destroy ... at lib/hash.c:83 2 0x0000557055f1df9a in hash_destroy ... at lib/hash.c:76 3 0x00007f20948edf75 in clean_address ... at address.c:493 4 0x00007f20948e7208 in mod_exit () at permissions.c:702 5 0x0000557055eb03a1 in destroy_modules () at sr_module.c:562 (cherry picked from commit 996a677e356f98ab5058a6cbbec164e732d609a7) 2021-07-30 Liviu Chircu * [601be97f1] : drouting: Allow TEXT type for `dr_rules.gwlist`, `dr_rules.attrs` Similar to b7b45ff3032, but for the `dr_rules` table. (cherry picked from commit 5ab329cdf365460fc80c4622d55c54846e70f5ac) 2021-07-29 Liviu Chircu * [4fc7d7c01] : tls_wolfssl: Add library build files to .gitignore (cherry picked from commit 59b939f7740b2901e6668b30b6bf43869c01e091) 2021-07-28 Razvan Crainea * [2cab8820a] : siprec: handle denied re-invites by SRC Credits go to MikhailKalashnikov on GitHub for reporting it. Close #2398 (cherry picked from commit 1804bad76ed30688e609dd03654e242fd9e68d00) 2021-07-26 Razvan Crainea * [43b1c3c48] : dialog: bump dlg replication version to 3 Commit 58343d45 introduced some new fields in the binary packet, changing its structure. Thus, when using different versions, they may crash due to the packet's mismatch. (cherry picked from commit 7af3886511a8cd37bd6121025ab88b41864775dc) 2021-07-23 Vlad Patrascu * [a9bd831a6] : b2b_logic: properly end dialog with notified entity Send BYE instead of just deleting the entity after completing the bridging action, when using the "n" flag for b2b_bridge(). (cherry picked from commit 250a33c61c677642f74a242d4b600165f8803643) 2021-07-23 Vlad Patrascu * [ad0de36e1] : b2b_logic: fix bad NOTIFY body for 100 Trying The static variable representing the new message body would point to the buffer of the SIP message from the previous call to process_bridge_notify(), resulting in garbage data. Credits to @nikbyte for catching the issue. Alternative fix to #2503. (cherry picked from commit 947c7e3c295cffde48ddb4c35d928ae7339722dd) 2021-07-23 Vlad Patrascu * [21669417f] : b2b_logic: fix a crash when using the "n" flag for b2b_bridge() The crash would occur when using the "n" flag even though the current entity has already been deleted with b2b_delete_entity(). (cherry picked from commit 6e6d876ba9173531c78787f71b7da30e71c520ec) =========================== Release 3.2.0 ============================== 2021-07-21 Liviu Chircu * [d5a0f2a3d] : Bump version to 3.2.0 2021-07-21 Razvan Crainea * [80ff0f404] : rtp_relay: fix uninitialized warning 2021-07-21 Liviu Chircu * [20fc08a49] : uac_registrant: Fix buggy gcc 7.x "uninitialized" error reg_records.c:302:7: error: ‘new_elem’ may be used uninitialized in this function 2021-07-21 Razvan Crainea * [7a92b0240] : freeswitch: fix string maipulation warnings in esl (cherry picked from commit 7bc88e2d029e664149609b093bba3d9bc76fce79) 2021-07-21 Razvan Crainea * [d4b7a6150] : sip_i: fix (buggy) uninitialized warning 2021-07-21 Liviu Chircu * [2b3d73d8b] : cachedb_mongodb: Fix possible uninitialized variable 2021-07-21 Liviu Chircu * [6d26478e7] : statistics: Fix possible uninitialized output variable 2021-07-21 Razvan Crainea * [28f7a0d5e] : tracer: replace un-necessary strncpy with memcpy 2021-07-21 Liviu Chircu * [a098fe047] : tracer: Mask buggy gcc 9.x warnings on Ubuntu 20.04 In function ‘strncpy’, inlined from ‘trace_slreply_out’ at tracer.c:2290:2: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: ‘__builtin___strncpy_chk’ output may be truncatedl copying between 1 and 21 bytes from a string of length 153 [-Wstringop-truncation] This is a false positive, since the "153" bytes are actually 7 * 22 bytes, packed as a (char **) array of 7 buffers. So just mask the warning for now, just at "tracer" module level. 2021-07-21 Liviu Chircu * [2d98eefa0] : jabber: Fix off-by-one strncpy() error warning: ‘__builtin_strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bo... | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... xjab_wlist.c: In function ‘xj_wlist_set_aliases’: xjab_wlist.c:455:34: note: length computed here 455 | i = jwl->aliases->proxy->len = strlen(pa); | ^~~~~~~~~~ 2021-07-21 Liviu Chircu * [5b5f2f68b] : httpd: Fix gcc warning for unchecked fread() retcode 2021-07-21 Liviu Chircu * [4675b1fff] : ldap: Fix possible buffer overflow If gcc says "2050 chars can overflow a 2049 buffer", gcc is definitely not wrong... 2021-07-21 Vlad Patrascu * [f921eba0f] : b2b_logic: overwrite existing context keys when using b2b_bridge_request() Closes #2424 (cherry picked from commit ba3bd6f4d18b2edca3ba942545aa3524d44f08e4) 2021-07-21 Vlad Patrascu * [b470b29b1] : b2b_logic_xml: fix compilation (cherry picked from commit 5e105b3dae2dba8259d74ac472a8f7e7b1082680) 2021-07-21 Vlad Patrascu * [125b2af25] : b2b_logic: fix crash when receiving an INFO or unsupported method Thanks to David Escartin from Sonoc for reporting. (cherry picked from commit b59a436cb12854105f379512f32758987b911f47) 2021-07-21 Vlad Patrascu * [802ce9d2a] : b2b_entities/logic: fix a race condition with simultaneous reINVITEs Fix behavior when receiving reINVITES from the connected entities at the same time, one replied with 491 and the other with 200OK. The 200 OK would not be passed to the other entity and the tuple would never be deleted in this case. Thanks to David Escartin from Sonoc for reporting and testing the fix. (cherry picked from commit 9c9ab8f948be65dc6a99024f901e748d629f8e56) 2021-07-21 Vlad Patrascu * [944002af5] : b2b_entities/logic: properly reply to canceled/expired entities Generate a 487 reply from opensips to the server entity if: * no final reply from the client entity received and the tuple expires after a CANCEL request has been received; * a 200 OK has be received after a previous CANCEL request. Also, reply with 408 to the server entity if the tuple expires and no final reply from the client entity has been received. Credits to David Escartin from Sonoc for reporting and testing the fixes. (cherry picked from commit 3261d2cb59f4477495cb770af6e3489ce186bc6b) 2021-07-21 Razvan Crainea * [9112ad6bd] : siprec: add mandatory +sip.src Contact header param Credits go to @jofiy on GitHub for reporting this. Close #2383 (cherry picked from commit be6ce6a5982559e9fa37a2823b219b04e3bd5b55) 2021-07-21 Razvan Crainea * [61e4863bd] : tm: add Route headers to CANCEL of locally generated INVITE Thanks go to David Escartin from Sonoc for reporting and testing the fixes for this bug (cherry picked from commit 4e6ea0a356267272b8b2b9b48382bcef08756bf4) 2021-07-21 Razvan Crainea * [5c3554413] : b2b_entities: do not terminate dialog for CANCEL on reINVITE Thanks go to David Escartin from Sonoc for reporting and testing the fixes for this bug (cherry picked from commit 66f9cfcd56a04235eea43f11cdc93db839136436) 2021-07-21 Vlad Patrascu * [6eba44156] : b2b_entities: fix callid collisions for client entities Prevent the possiblity of using the same seed for generating the random part of the callid for a new client entity. (cherry picked from commit 62728f1775c4ce61645faed3d0130e6c09540b6c) 2021-07-21 Razvan Crainea * [3c84aae84] : rtpengine: remove special handling for ICE This allows the module to blindfully pass the ICE variables to RTPEngine Reported by @wenyuanZZ on GitHub in sipwise/rtpengine#1319 (cherry picked from commit 0936ec3f9ca565f434a133adc42b51b811411af8) 2021-07-20 Razvan Crainea * [6bd1d9284] : cgrates: prevent crash when a reply without request comes Reported by Vasilios Tzanoudakis (@vtzan on GitHub) in #2571 (cherry picked from commit 882450d9e0b9d4f5f314786f90d64bd707f81e78) 2021-07-16 Razvan Crainea * [3c6712d16] : mi_fifo: proper parse multiple commands received at once (cherry picked from commit e107b029be250b61ff2027fdbe03258d096e9344) 2021-07-15 Vlad Patrascu * [08c258418] : b2b_logic: properly release lock in case of error for create event Credits to @nikbyte for the fix Related to #2425 Closes #2426 (cherry picked from commit aba8ae577ba3e6f1c00b239140bc948714774d1b) 2021-07-13 Artiom Druz * [f6c711b18] : Fix crash when vendor hasn't price for prefix (cherry picked from commit be9caba4ad469224c9213edcb1e8bdb11192c823) =========================== Release 3.2.0-rc1 ============================== 2021-07-12 Liviu Chircu * [02bef88d2] : Bump version to 3.2.0-rc1 2021-07-09 Bogdan Andrei IANCU * [f664db885] : Merge pull request #2469 from wdoekes/fix-uac_registrant Make FORCE_SINGLE_REGISTRATION work again (cherry picked from commit c9839c8dfa30f0fb5178075cd943e2480e711400) 2021-07-09 Liviu Chircu * [d757073d5] : rtpproxy: Allow the RTP streaming functions in local_route This enables new media playback scenarios, especially when coupled with dlg_send_sequential() and/or dlg_on_timeout(). Credits to Pete Kelly for the suggestion (cherry picked from commit dcc9f0abfed6206cf658185b055c7e8c72171025) 2021-07-07 Bogdan-Andrei Iancu * [5ced69683] : Fix deadlock upon BUG/ERROR report Credits for finding this issue go to Damien Sandras @ Seconix (cherry picked from commit 2e042353ecdaa14cc3e901478c07965830ee5a3b) 2021-07-07 Razvan Crainea * [ddc8dc39a] : cgrates: don't bind socket before creating it Credits go to @volga629-1 on GitHub for reporting it in #2568 (cherry picked from commit 34acfcc2ff3c62f3075f264709d56f6526aa71af) 2021-07-06 Vlad Patrascu * [95f4812ae] : b2b_logic: fix crash when handling reply to forked INVITEs Fixes #2473 (cherry picked from commit d25ccb705c0427195d968a59ea1fba6d57945df6) 2021-07-06 Vlad Patrascu * [9b09cc3c9] : tls_mgm: fix domain matching after MI reload After doing an MI reload, old domains might still be matched for new connections while there are ongoing connections that use those domains. Credits to Alexey Vasilyev (@vasilievalex) for troubleshooting and suggesting the fix. Fixes #2433 (cherry picked from commit 9412ed271172810e55cc771fa9fd2c82007eafbd) 2021-07-06 Bogdan-Andrei Iancu * [499a507a1] : Be sure there is no "exit" between setting the PS and running the query 2021-07-06 Bogdan Andrei IANCU * [c0c49788a] : Merge pull request #2470 from wdoekes/con-ps-reference-cleanup-2 Change CON_SET_CURR_PS pattern to always call it _directly_ before db call (cherry picked from commit f54e5f95ac7869d983e41ee2a880a8e450a8eb4b) 2021-07-05 Razvan Crainea * [17bde34d7] : stir_shaken: fix pkg_memleak of params parsing do not change the `params` while iterating through the list, as it will prevent `free_params` from releasing the list Thakns go to Nick Altmann for reporting and testing the fix (cherry picked from commit 2b0dde30258da947b023737338f165dfa44a135d) 2021-07-05 Liviu Chircu * [b8d12d1e0] : cachedb_mongodb: Fix possible raw query crashes This patch fixes a series of bugs: * raw queries with no result AVP holder, causing a crash, e.g.: cache_raw_query("mongodb", ' "delete": "test", "deletes": [ {"q": {}, "limit": 0} ]}'); * raw queries with bad syntax, causing a crash * pkg memory leak during the "out of pkg memory" condition Credits to Bogdan-Andrei Iancu for the finds! (cherry picked from commit 0f748f46cf4b164890d024e8f9938b076137ce84) 2021-07-05 Razvan Crainea * [bdaea991f] : b2b_logic: mark the lock to be released as soon as it is acquired This prevents deadlocks when lock is taken, but the `do_unlock` marker is not yet set, this never released in case of errors. (cherry picked from commit bc8af8024609326b00cc0b15004ebb5a2727d6df) 2021-07-05 Liviu Chircu * [2100e649b] : sipmsgops: Fix sipmsg_validate() regression Commit b03cb41a31 introduced a regression while attempting to simplify some character-checking macros. Reported by Alexey Vasilyev Fixes #2563 (cherry picked from commit 21547d571d0ceaf19e5892b684a27c80e95987c9) 2021-07-02 Liviu Chircu * [967073f55] : Memory allocators: Revert Q_MALLOC to 8-byte alignment Commit 1f55d05c2b actually upped Q_MALLOC's address alignment from 8-bytes to 16-bytes. While this isn't necessarily a bug (in fact, it makes OpenSIPS more crash-safe), it enables new scenarios where buffer overrun crashes would happen with F_MALLOC but not with Q_MALLOC. And since Q_MALLOC is the intended crash debugger, these scenarios must not be allowed, so we stick to 8-byte alignment. If anyone needs 16-byte aligned memory, they can just re-define ROUNDTO and re-compile. (cherry picked from commit c29652fa10dbd34ce499f817891abe25964ee63b) 2021-07-01 Liviu Chircu * [6fc17804e] : Fix ARM32 warnings (cherry picked from commit e89b09e9eac4dfd4ac6673b9b7aaed9610466384) 2021-07-01 Liviu Chircu * [b491d44f8] : Memory allocators: Improve the memory alignment support This patch fixes the support for configurable memory alignment, such that the ROUNDTO macro is now truly customizable, for any allocator. As long as the ROUNDTO is a multiple of 2, the allocators will return memory aligned to any required multiple. The defaults are still the same, as follows: * F_MALLOC: 8-byte aligned memory addresses * HP_MALLOC: 8-byte aligned memory addresses * Q_MALLOC: 16-byte aligned memory addresses (the default in libc!) Also extend the allocator testing suite with memory alignment tests. Related to #2546 (cherry picked from commit 1f55d05c2b786ee8cca227ff367d49145bed51a4) 2021-07-01 Liviu Chircu * [7fd9cc6e9] : aaa_diameter: Fix mem leak on startup (cherry picked from commit d7bbb2951e6c923c4c6eaab95553cfe181589d20) 2021-07-01 Walter Doekes * [8da4b56eb] : Reduce db_is_neq_type complexity The code was correct, but overly verbose. Boil it down to the intention and rely on the compiler to work its magic. Reviewed-by: Liviu Chircu (cherry picked from commit c381060f9b5f67d0a6792fc82d86450ad93501c6) 2021-06-30 Razvan Crainea * [06f212467] : b2b_entities: fix tags parsing from request Fix bug introduced in 5e5fc98a (cherry picked from commit 9e29b549190e133b1fdbbb136acebd9b4229ba85) 2021-06-28 Bogdan-Andrei Iancu * [5e7ddc82f] : Fix pkg memory leak when building pres ID. This leak was introduced durin the 29e86ddf2b rework Reported by Bernard Buitenhuis (cherry picked from commit c893c237872c6823259a1fb087b62cfbc5d4fc70) 2021-06-28 Liviu Chircu * [329527bc4] : aaa_diameter: Fix acc_extra / acc_leg accounting This commit adds support for dynamically configured AVPs in both OpenSIPS (client-side) and freeDiameter (server-side), such that they can be added to the sent message and parsed from the received message. The syntax is identical to the RADIUS configuration file, e.g.: ATTRIBUTE out_gw 231 string ATTRIBUTE trunk_id 232 string ... (cherry picked from commit ba7077ade98570c1ad61618ae9130b77893d64bd) 2021-06-22 Liviu Chircu * [df5bee897] : dialog: Avoid storing id/entry values as signed integers This patch does not necessarily fix an immediate issue, however it's never advisable to compare / assign integers of different signedness. (cherry picked from commit 41a3230df25a53634e310e0ed874adcb829e885d) 2021-06-22 Liviu Chircu * [87e901827] : dialog: Fix a subtle bug in parsing dialog IDs from DB This fixes a rare issue where the dlg_parse_db_id() macro would right-shift a signed "long long" value, potentially leading to implementation or compiler defined behavior. The fact that there is a binary diff after applying this patch proves that there was an underlying, hard-to-detect issue in there: - 4b192: 48 c1 f8 20 sar $0x20,%rax + 4b192: 48 c1 e8 20 shr $0x20,%rax Credits to Nick Altmann for providing some hints on this issue! Related to #2504 (cherry picked from commit 103bdb48ae3f29e0121a180c8b3c53c0d6704df8) 2021-06-22 Nick Altmann * [95e1a3a90] : Dialog module: skip bogus dialogs when loading from DB (cherry picked from commit dd6cab3dac6d0c87f04aab4ff3d0027282098a06) 2021-06-22 Liviu Chircu * [ec854715e] : dialog pinging: Avoid nested pinging transactions This fixes a rare condition that could occur whenever the OPTIONS/Re-INVITE pinging interval was lower than the SIP transaction timeout (typically 15 seconds, so a pinging interval of < 15 seconds). In this case, a new pinging transaction would be continuously started, before the previous one would get the chance to complete, e.g. with 408 Timeout for a dead SIP endpoint. Fixes #2535 (cherry picked from commit ae1ffaf892f6a018bb1639d39665fffbe6bb3a1e) 2021-06-22 Liviu Chircu * [84f0c1e6b] : dialog: Minor rewrite of get_timeout_dlgs() * re-define the ping state values, as they are NOT meant to be combined or checked as a bitmask (they are mutually exclusive) * eliminate copy-pasted list detachment blocks (merge into one "if") (cherry picked from commit d1e2fdc5f44b1950d65ddcb4c97fc0d2d93d49e6) (cherry picked from commit 4b6097de408ab93682ee719764f12aba3d5b552c) 2021-06-18 Liviu Chircu * [6c78fdd7e] : mid-registrar: Make the "%40" Contact user substring configurable This patch adds the "at_escape_str" modparam, which is only relevant for mid-registrar running in "mode == 2" (AoR throttling). This setting gives developers more control over the mid-registrar's Contact headers in case the default sequence is problematic. This may fix issues where, for example, the "%40" string is un-escaped by the backend registrar, causing errors during DNS lookup of something resembling, e.g., "alice@1.1.1.1@2.2.2.2". ^-------------^ (the hostname that gets looked up) The default value remains unchanged: "%40" Related to #2367 (cherry picked from commit a5501ab3d2476382a3e6cb0382689c17a30c1a9f) 2021-06-18 Liviu Chircu * [7ea363272] : usrloc: Include the matching algorithm in replication packets Although this commit also bumps the usrloc BIN packet version from 2 -> 3, there is added logic for backwards-compatibility with version 2 packets, so the migration in a clustered environment should be silky smooth! Many thanks to Giovanni Maruzzelli (@gmaruzz) for catching this issue and providing a detailed bug report! Fixes #2351 (cherry picked from commit 60f1a532531cefe5696edc0844b7ccb0b36be4c6) 2021-06-18 Liviu Chircu * [cad9b171c] : registrar: Update the Contact URI on param-based matching (cherry picked from commit 8cc4b3249625802f2b3a11fb5f8b264cae6c6a11) 2021-06-17 Liviu Chircu * [54cf93cc6] : Fix compiler warnings with -DUSE_FUTEX Specifically: futex_lock.h:78: warning: implicit declaration of function ‘syscall’ This warning appears since glibc version 2.19, along with the introduction of the _DEFAULT_SOURCE FTM, which is a macro that seems to be additionally required when defining any of the previous FTMs... man feature_test_macros (cherry picked from commit 24c8ee9ed38ccc41ef45dce3065b9d88cb959782) 2021-06-15 Vlad Patrascu * [9bb66411a] : cachedb_redis: fix usage of ssl context from tls_mgm Closes #2538 (cherry picked from commit 0ddcb2bdbf845e92ef659042adb6524488268d8f) 2021-06-15 Liviu Chircu * [e6daa9e4a] : aaa_diameter: Add the "app_opensips" freeDiameter application This is the server-side component of the Diameter integration, permanently maintaining an open-connection to the "aaa_diameter" module's Diameter peer in OpenSIPS (or at least, ideally). The main goals of the app: * to offer support for all Diameter applications and interactions, e.g. accounting, digest authentication, etc. * to be fully pluggable into commonly-found package-based freeDiameter installs on newer distros (e.g. Debian 10+, Ubuntu 20+, possibly others). (cherry picked from commit ed397f948b5ff65479e41646e491bdc6bc83031e) 2021-06-15 Liviu Chircu * [2498904f8] : auth_aaa: Downgrade auth failure log to DEBUG This will prevent unnecessary log spam (cherry picked from commit 8661d315d07009d75075665c34279a139d0f9700) 2021-06-15 Liviu Chircu * [9bc98e10f] : aaa_diameter: Improve handling for digest auth Result-Code Add synchronization between SIP workers and freeDiameter peer threads, in order to pass the value of the Result-Code to the blocked SIP worker. As a next iteration, there is also the option of making this entire process asynchronous, possibly with something like: ... async (aaa_proxy_authorize("sipdomain.invalid"), resume_route); } route [resume_route] { if ($rc < 0) proxy_challenge("sipdomain.invalid"); ... } (cherry picked from commit 5139dfa01cb7bb0c7fed273f1ac2a8e1316a5d41) 2021-06-15 Liviu Chircu * [4f352c822] : aaa_diameter: Re-structure code; Share common AVPs with fD app (cherry picked from commit e00a71cb65814fff1929df02450dc2bfb3904ba9) 2021-06-15 Razvan Crainea * [999096021] : Module deps: do not run child init twice make sure mod init is not run multiple times when it is declared as a dependency, but is defined after it's dependent module (i.e. dialog is defined in script after topology_hiding) (cherry picked from commit 57df749c7d2b3cc47d82b05a4bd4492e76e758fd) 2021-06-15 Razvan Crainea * [61890536f] : call_center: check table version Credits go to Level 7 Systems Ltd. for reporting this. Close #1020 (cherry picked from commit ac9ff1e3827f6a801c3b0a9173d194c18e7bfb1c) 2021-06-15 Razvan Crainea * [a00426bb8] : presence: fix memory leak when receiving an unmatched replicated publish (cherry picked from commit d1d898878555abe48cd3584ab1f3a8fe6f84ced7) 2021-06-11 Vlad Patrascu * [28e15224c] : tls_wolfssl: do not compile module by default (cherry picked from commit d6361e95725f9fef6dddc3b0d2ebf1899ac13439) 2021-06-11 Razvan Crainea * [7fc0d491b] : acc: remove acc_created_avp_name param as unused The acc_created_avp_name parameter is no longer being used, so it has been dropped (cherry picked from commit 2bcb9fc719fd6fd11a958d74020faad70d5accc4) 2021-06-11 Razvan Crainea * [fbdaacb91] : b2b_entities: cover all cases where param is not printable Completes commit 0bd7fbe7 (cherry picked from commit 8ea5ce536664083b526e7fcf567e624bf9b7fe78) 2021-06-11 Vlad Patrascu * [f605759a7] : tls_wolfssl: remove all generated files with make clean (cherry picked from commit 0279e3d66c30fbff0dbecce34af19082b600157b) 2021-06-11 Vlad Patrascu * [5d1b3b531] : tls_wolfssl: improve documentation regarding compilation (cherry picked from commit ce38c621f8b0ddaf47da1b290e7fd5436c0e2dbe) 2021-06-10 Vlad Patrascu * [89f45a34e] : b2b_entities: run the create callbacks for the proper entities (cherry picked from commit 39f7aefb031ddafa5bd9dcebf0f8875f9d4c03fb) 2021-06-10 Vlad Patrascu * [3aaf3990e] : b2b_entities: fix entity type in create callbacks (cherry picked from commit 291417cc1f6564c6fe72dba50dd6adc5d5c86793) 2021-06-09 Bogdan-Andrei Iancu * [1772ac909] : [pua] fix starting pua without clustering Close #2550 Reported by @ovidiusas 2021-06-09 Walter Doekes * [da98caf62] : Fix memory corruption in usrloc/ul_evi Problem spotted by Liviu Chircu and bisected to fe28d3ea9. Fixes #2529. (cherry picked from commit 1c5e895db551c3272568d2c21f55ed14fbbb719e) 2021-06-08 Bogdan-Andrei Iancu * [503814cdd] : [presence] Fix inconsistent handling of optional "event_id" column If no value, the event_id could end up with a NULL or "" value. This was failing the later update query (no match on the event_id value), resulting in broken subscription status after a re-subscribe. (cherry picked from commit eaa2fd6510f533c357e8536fcdf22cad6f455322) 2021-06-08 Razvan Crainea * [8e457e68f] : rtp_relay: reverse flags for answer (cherry picked from commit 5f03b3ab298926ddb6c9a2ed8a9fa03f041e2a41) 2021-06-08 Razvan Crainea * [ce47e815f] : rtp_relay: fix rtp_relay_engage() example syntax (cherry picked from commit f6687cb5d857d477ef001b42652e6015b357106f) 2021-06-08 Razvan Crainea * [19d2a6340] : rtp_relay: fix new_node debugging message (cherry picked from commit af5a19632addcdb73e5e166481b0795861571fe3) 2021-06-08 Razvan Crainea * [a70cc72e2] : rtp_relay: allow any of new_node and new_set in the update command (cherry picked from commit 74afa1c93fdc5ff0724ca236b525b02a397a505c) 2021-06-08 Razvan Crainea * [8df886692] : rtp_relay: initialize session list after deleting it (cherry picked from commit 90cea7afa51a442d4973fe91e756ffab6f75b9de) 2021-06-08 Razvan Crainea * [6b22406c5] : rtp_relay: provide received information taken from contact for update (cherry picked from commit 802ecddf68b117018f79025a85ab1a1f2201c5e8) 2021-06-08 Razvan Crainea * [fc9ef0df6] : rtp_relay: remove commented code (cherry picked from commit 5adaeb295c00c193233750496933034b60932252) 2021-06-08 Razvan Crainea * [a1cb2bfda] : rtpproxy: fix parsing and changing SDP session c= line (cherry picked from commit 33a68841891b5e101118d0759dcdb291d75fbc5c) 2021-06-08 Razvan Crainea * [9d9ed9f9e] : rtpproxy: do not start notification process unless explicitely used (cherry picked from commit c16ef2e0c5e8abac345c4246d29aa4ab954ae4a9) 2021-06-07 Vlad Patrascu * [bc777333c] : tls_wolfssl: fix bad status returned by is_peer_verified() Closes #2541 (cherry picked from commit f9d8f66e1e1ef1453246b1e159b110cfcf4fb937) 2021-06-07 Vlad Patrascu * [9b343e0a6] : tls_wolfssl: fix possible crashes and bogus values for TLS variables (cherry picked from commit 79422f56d94a22bfa4156937c1a690c74a25a7c6) 2021-06-07 Vlad Patrascu * [0534d659c] : tls_wolfssl: fix double free when destroying tls domain Fixes #2540 (cherry picked from commit 4c0ff874d4cfa4125d7d9202a7614a4f9870e49e) 2021-06-07 Liviu Chircu * [72bbc4cf4] : F_MALLOC: Always perform an O(1) defragmentation on free() Changes: * remove the "memory space" runtime computation, as well as the 95% defragmentation "start threshold" (better performance!) * change the defragmentation heuristic from O(N) to O(1). This way, we avoid any performance issues caused by _too much_ defragmentation The main idea is to get rid of the dreaded "not enough shared memory, attempting defragmentation..." state, where SHM performance goes down dramatically, to the point where SIP traffic processing may stall. (cherry picked from commit fb9a377768f250a8f99a0e29f1fc9689d564dd5c) 2021-06-04 Liviu Chircu * [e7eea18df] : registrar & mid-registrar: Do not always force the matching mode When the "M" save() flag is not used, the registrars should not default to forcing the Contact-only matching mode (0), rather they should use the None mode (-1), and let usrloc use its own default setting. Part of a set of fixes for #2351 (cherry picked from commit 700b718db6520094c8ab458698088fd1d60c6eb3) 2021-06-04 Bogdan-Andrei Iancu * [93490e3c6] : Fix docs, removed old rule_attrs_avp modparam This was replaced for a long time by the `rule_attrs_pvar` param of `do_routing()` Reported by @MosinAnton Closes #2537 (cherry picked from commit 8ffc647af7d28d9be08c4805ad1fd0b7aa852966) 2021-05-31 Liviu Chircu * [7168e1d8c] : registrant: Rebuild DB schema (cherry picked from commit 7649696656ae9069c8d8d7d28c76809d68101ad0) 2021-05-31 Ovidiu Sas * [b15526a65] : db/schema: fix table version for registrant (cherry picked from commit d1d70ba89276c8b5f22258717a79b989d8739ede) 2021-05-29 Vlad Patrascu * [4c0f15ad9] : tls_mgm: fix module dependencies docs (cherry picked from commit 9d0ed55f83d31ae858eb1347f2132d85d32c707b) 2021-05-29 Vlad Patrascu * [e6caed988] : tls_mgm: fix tls_openssl dependency (cherry picked from commit 2cde93ccb0815b109bec528c69b9af430e6a5a7d) 2021-05-28 Liviu Chircu * [810934034] : Update MySQL DB migration scripts for "3.1 to 3.2" New tables in 3.1, now added to the migration procedure: * jwt_profiles * jwt_secrets * qr_profiles * rc_clients * rc_vendors * rc_ratesheets * rc_demo_ratesheet Changed tables in 3.2 (their columns no longer match 1:1, however the migration procedure still migrates their data): * b2b_logic * pua * registrant * subscriber 2021-05-27 Bogdan-Andrei Iancu * [cdf25709a] : [db] fix docs to point to 3.2 modules 2021-05-27 Razvan Crainea * [d5319228c] : Bump version to beta 2021-05-27 Nick Altmann * [cd250d850] : packaging/rpm: don't build tls_wolfssl for el7 2021-05-27 Vlad Patrascu * [eb332793c] : tls_openssl: fix kerberos check for openssl < 1.1.0 2021-05-27 Nick Altmann * [6f40c3565] : packaging/rpm: build aaa_diameter only on supported os 2021-05-27 Nick Altmann * [07c0b8934] : packaging/deb: build aaa_diameter only on latest distributives 2021-05-27 OpenSIPS * [795964d41] : Rebuild documentation 2021-05-27 Razvan Crainea * [a5914d832] : tracer: fix documentation related to file creating permissions 2021-05-27 Razvan Crainea * [ccf1669ff] : proto_wss: fix documentation xml typo 2021-05-27 Liviu Chircu * [51dc3c300] : aaa_diameter: Add initial README 2021-05-27 Razvan Crainea * [7296f24b5] : packaging/debian: add libfreediameter-dev dependency 2021-05-27 Liviu Chircu * [02b8c838e] : aaa_diameter: Add module documentation 2021-05-27 OpenSIPS * [c07944daf] : Rebuild documentation 2021-05-27 Nick Altmann * [b6770ad78] : package/rpm: add missed descriptions 2021-05-27 Nick Altmann * [418a7ad4f] : package/rpm: add aaa_diameter module, package/deb: fix aaa_diameter description 2021-05-27 Nick Altmann * [96f2a6bd9] : package/rpm tls_openssl and tls_wolfssl support 2021-05-27 Razvan Crainea * [518db2e22] : packaging/debian: add Diameter support 2021-05-27 Razvan Crainea * [cffb40572] : packaging/debian: add tls-openssl and tls-wolfssl packages 2021-05-27 Vlad Patrascu * [f99419e10] : proto_tls/wss: don't include openssl specific Makefile 2021-05-27 Liviu Chircu * [d980fe630] : build-contrib.sh: Add the b2b_logic rename sequence 2021-05-27 Nick Altmann * [150276430] : Packaging: fix description and name of package for b2b_logic_xml module 2021-05-27 Razvan Crainea * [5ca2955ef] : packaging/debian: revert renaming of the opensips-b2bua-module 2021-05-27 Nick Altmann * [8513e1992] : RPM package: remove b2bua-module, add b2b-logic-xml-module, move b2b modules to main package 2021-05-27 Liviu Chircu * [9f15980f5] : GitHub Worlflows: Exclude aaa_diameter from build 2021-05-27 Razvan Crainea * [0038520bf] : b2b_logic_xml: do not compile it by default 2021-05-27 Razvan Crainea * [0afd79e83] : packaging/debian: rename opensips-b2bua-module module renamed to and only putting b2b_logic_xml there opensips-b2bua-xml-module 2021-05-27 Razvan Crainea * [49bed2966] : add contributors for mi_script and rtp_relay 2021-05-27 Razvan Crainea * [803cea047] : mi_script: add new module 2021-05-27 Liviu Chircu * [60bef90ee] : aaa_diameter: Exclude from default build 2021-05-27 Bogdan-Andrei Iancu * [a51410d00] : [b2b_logic] mute error when the module cannot be loaded Let the upper function to generate an err log; by doing this we avoid annoying err logs when other module are simply probing to use the b2b_logic module (like tracer does). Similar fix as for load_dlg_api() from dialog module 2021-05-27 Vlad Patrascu * [483a52c51] : proto_bins: add missing xml files and update contrib and README 2021-05-27 Liviu Chircu * [d05e86273] : Merge branch 'feature/aaa-diameter' 2021-05-27 Liviu Chircu * [999caa0d3] : aaa_diameter: Add support for RFC 4740 (SIP Application) digest auth 2021-05-27 Vlad Patrascu * [721ad77c3] : tls_openssl: remove unused function 2021-05-27 Vlad Patrascu * [3cebcc660] : Makefile: add tls_openssl to excluded modules 2021-05-27 Vlad Patrascu * [62590a42d] : tls_wolfssl: update wolfssl library to 4.7.1r version 2021-05-27 Vlad Patrascu * [351a4eda2] : tls_wolfssl docs: update README file 2021-05-27 Vlad Patrascu * [049fdef0e] : tls_openssl docs: add contrib and README files 2021-05-27 Vlad Patrascu * [b27c3ec53] : wolfssl: rename module to tls_wolfssl 2021-05-27 Vlad Patrascu * [c73c1a8ad] : wolfssl: change wolfssl submodule path for an upcoming module rename 2021-05-27 Vlad Patrascu * [dd0701874] : wolfssl: port module to updated tls_mgm API 2021-05-27 Vlad Patrascu * [92ad53278] : tls_mgm: refactor module to be able to switch between TLS libraries 2021-05-27 Vlad Patrascu * [69ed4f782] : tls_mgm: split openssl code into a separate module 2021-05-27 Liviu Chircu * [81c3f2fd3] : aaa_diameter: Parameterize the realm and server peer 2021-05-27 Bogdan-Andrei Iancu * [dfcc74721] : [drouting] fix doc identation 2021-05-27 Bogdan-Andrei Iancu * [ee051d376] : [ratelimit] add docs for rl_dump_pipe MI cmd 2021-05-27 Bogdan-Andrei Iancu * [3df7195b6] : [tm] adding t_wait_no_more_branches() function This function helps in controling how long to wait for dyanmic branches (during a Push Notification scenario) 2021-05-27 Bogdan-Andrei Iancu * [5fc9a6172] : [pua] update docs with clustering support 2021-05-27 Nick Altmann * [acea7d81e] : RPM spec: fix date 2021-05-27 Liviu Chircu * [7cd25c214] : aaa_diameter: Add support for auth_aaa custom AVPs 2021-05-27 Liviu Chircu * [7ce4b13cf] : aaa_diameter: Add built-in definitions for all RADIUS digest AVPs 2021-05-27 Liviu Chircu * [68abe045c] : AAA auth: Fix names of well-known RADIUS digest auth AVPs 2021-05-26 Bogdan-Andrei Iancu * [ebb584e1e] : [pua] adding file related to clustering support Part of ea18d8 2021-05-26 Bogdan-Andrei Iancu * [672485ddf] : Regenerated dbschema for pua 2021-05-26 Bogdan-Andrei Iancu * [2aaa949b0] : [pua] add a new column for sharing tags 2021-05-26 Bogdan-Andrei Iancu * [ea18d8290] : [pua] Added clustering support The PUA data can be shared between multiple OpenSIPS instances using a mixage of DB sharing and clsutering/BIN support. This allows full support for HA or anycast scenarios. 2021-05-26 Bogdan-Andrei Iancu * [dbcc13cb5] : Fix callback triggering for calls with inactive clustering tags 2021-05-26 Bogdan-Andrei Iancu * [0ccb7c89d] : Fix debug message to properly show the tag's status 2021-05-26 Bogdan Andrei IANCU * [84b0bc7b5] : Merge pull request #2505 from nikbyte/drouting_default_db_url Drouoting: Use db_partitions_url if db_url field is empty in dr_parti… 2021-05-26 Razvan Crainea * [ea3e435b6] : rtpengine: break and continue after param is found This will avoid checking if a different parameter match and Thanks go to Walter Doekes (@wdoekes on GitHub) for spotting this. 2021-05-26 Nick Altmann * [d0310fac9] : rtpengine: support for manually setting received-from flag, fix copy-paste typo 2021-05-26 Răzvan Crainea * [4a8de6004] : Merge pull request #2509 from nikbyte/rtpengine_received_from rtpengine: possibility to set received-from flag from script 2021-05-26 Nick Altmann * [bbed603a5] : rtpengine: support for manually setting received-from flag 2021-05-26 Nick Altmann * [ecb7b0890] : rtpengine: support for zero-address flag, fix copy-paste typo 2021-05-26 Răzvan Crainea * [49dca8f75] : Merge pull request #2508 from nikbyte/rtpengine_zero_address rtpengine: support for zero-address flag 2021-05-26 Nick Altmann * [95c761174] : rtpengine: support for zero-address flag 2021-05-26 Nick Altmann * [913aa73d0] : Packaging RPM: rtp_relay module support 2021-05-25 Razvan Crainea * [c2814f3be] : event_rabbitmq: fix crash when dynamic sockets When freeing dynamic sockets, the pointer to the default user/password was lost, resulting in a bad check. 2021-05-25 Razvan Crainea * [da2f6dfa0] : event_rabbitmq: add support for persistent queues Specify a queue is persistent by adding the `;persistent` token to the rabbitmq url. Credits go to @gtanetwork on GitHub for requesting this feature Close #2252 2021-05-25 Razvan Crainea * [b2dd8fb67] : Merge branch 'feature/rtp_relay' 2021-05-25 Razvan Crainea * [9de1c975c] : cgrates: add possibility to store a JSON in request Using the `:=` operator when setting a variable, one can set an arbitrary json into the request sent to CGRateS. Thanks go to Vasilios Tzanoudakis (@vtzan on GitHub) for the feature requst in #2034 2021-05-25 Razvan Crainea * [9ea46a1f7] : cgrates: reset NULl flag if the variable is set 2021-05-25 Bogdan Andrei IANCU * [fdd0ddb4e] : Merge pull request #2421 from swk/rl_dump_pipe add rl_dump_pipe MI command. 2021-05-24 Razvan Crainea * [449130332] : proto_ws: add suport for requiring Origin header Thanks go to @robdyck on GitHub for reporting this in #2342 2021-05-24 Razvan Crainea * [adf18b033] : mi_fifo: fix syslog protected_fifos setting Credits go to Liviu Chircu (@liviuchircu) for spotting the error. 2021-05-24 Razvan Crainea * [dd65cbb95] : tracer: provide a way of modifying the tracing file mode Change default permissions mode to 0600 2021-05-24 Razvan Crainea * [0882e7d6f] : mi_fifo: document fifo /tmp directory error Starting with linux kernel 4.19, by default, the kernel no longer allows users to write in fifo files that are stored in a sticky-bit directory but they are not owned by the user trying to access it. The limitation was introduced in torvalds/linux@30aba6656f This problem was reported in OpenSIPS/opensips-cli#83 2021-05-24 Razvan Crainea * [ba730cd8b] : mi_fifo: proper print of fifo mode error 2021-05-24 Razvan Crainea * [00789877b] : tracer: fix uninitialized variable 2021-05-24 Razvan Crainea * [4d712a252] : tracer: add support for file and syslog tracing 2021-05-24 Razvan Crainea * [3215ee021] : tracer: fix typo and error handing when db insert fails 2021-05-24 Nick Altmann * [dc51592ab] : RPM spec: some cleanup 2021-05-23 OpenSIPS * [d1e0e8105] : Rebuild documentation 2021-05-21 Bogdan Andrei IANCU * [8fb3842fc] : Merge pull request #2415 from john08burke/dispatcher_setID_support Add support for set id substitution for dispatcher algorithm 9 2021-05-21 Bogdan Andrei IANCU * [53aeb090e] : Merge pull request #2511 from nikbyte/dr_is_gw New flag for dr_is_gw() which allows to check protocol of gateway 2021-05-21 Liviu Chircu * [621e0c431] : net/net_tcp: Fix compile error with -DEXTRA_DEBUG 2021-05-21 Vlad Patrascu * [726fca152] : b2b_logic: add support for dynamic advertised contact 2021-05-20 Razvan Crainea * [5414d5b34] : event_route: fix documentation typo 2021-05-20 Razvan Crainea * [850691634] : Merge branch 'nikbyte-multihome_socket_fix' 2021-05-20 Razvan Crainea * [35b26f2dd] : net/net_tcp: fix typo 2021-05-20 Razvan Crainea * [9ebf16679] : Merge branch 'multihome_socket_fix' of https://github.com/nikbyte/opensips into nikbyte-multihome_socket_fix 2021-05-20 Razvan Crainea * [0e81390c4] : stats: add support for grouping statistics in core Use the statistics groups to dump prometheus stats in a more prometheus-friendly interface. Suggested by Ovidiu Sas(@ovidiusas on GitHub) in #2482 2021-05-20 Razvan Crainea * [886466543] : statistics: turn on total pkg statistic 2021-05-19 Razvan Crainea * [67fc69ecf] : rtp_relay: properly pass body in rtp_offer/answer seq 2021-05-19 Razvan Crainea * [294ce0ed4] : prometheus: add support for exposing all statistics Close #2428 2021-05-19 Razvan Crainea * [1f414fd20] : statistics: add support for iterating modules list 2021-05-19 Razvan Crainea * [8e016f8e1] : prometheus: do not expose hidden stats 2021-05-18 Liviu Chircu * [87af91764] : aaa_diameter: Encode the Event-Timestamp as NTP octets; Fix ACR bugs 2021-05-18 Liviu Chircu * [2d44cb7c1] : str2const lib: Document some cryptic macros 2021-05-18 Liviu Chircu * [ce78e559d] : acc: Set the Sip-Call-MSDuration AVP during AAA CDR accounting 2021-05-18 Liviu Chircu * [8bf18679f] : acc: Fix bad data offsets for old AAA accounting Bug introduced along with the most recent "Sip-Call-MSDuration" AVP. 2021-05-18 Razvan Crainea * [f8b50fafd] : prometheus: make sure the stat's name is not changed if the stat starts with a number and there's nothing else to be prefixed, append a `_` before the stat's name 2021-05-18 Razvan Crainea * [4da337338] : prometheus: replace unpermitted chars with '_' Credits go to Rob Moore (@RobWMoore on GitHub) for reporting it and Ovidiu Sas (@ovidiusas on GitHub) for the solution. Close #2478 2021-05-18 Liviu Chircu * [9294f336c] : aaa_diameter: Add IPC between peer and workers (may send ACR) 2021-05-18 Liviu Chircu * [f895e1b04] : aaa_diameter: Pre-provision all known OpenSIPS RADIUS AVPs 2021-05-18 Liviu Chircu * [a2c6c62ba] : Complete the RADIUS dictionary with all known, custom AVPs Note that the below AVP codes have been changed, since the originally proposed codes have been re-used in some actually standardized AVPs: Sip-Method 101 (used by Error-Cause). New value: 204 Sip-Response-Code 102 (used by EAP-Key-Name). New value: 205 Sip-From-Tag 105 (used by Digest-Nonce). New value: 206 Sip-To-Tag 104 (used by Digest-Realm). New value: 207 2021-05-17 Razvan Crainea * [23a8bbf0b] : rtp_relay: add rtp_relay_update mi commands These commands can be used to re-anchor RTP during an ongoing call 2021-05-17 Razvan Crainea * [8e219b4f2] : rtp_relay: duplicate the node when restoring from dlg 2021-05-17 Razvan Crainea * [7671eb9c4] : dialog: for indialog requests, first ACK, then run handlers This change allows user to send the same peer another request, since it has already sent ACK for the current one 2021-05-17 Razvan Crainea * [48d04e204] : mi: fix init_mi_result_number Actually use a number instead of string 2021-05-16 OpenSIPS * [b77f50a8d] : Rebuild documentation 2021-05-14 Razvan Crainea * [cf6824b45] : rtp_relay: lock when printing RTP context 2021-05-13 Vlad Pătrașcu * [92835d614] : Merge pull request #2498 from nikbyte/b2b_fix_to_header Allow to pass To: header in b2b_init_request() as we do in create_top… 2021-05-13 Vlad Pătrașcu * [7cff0c985] : Merge pull request #2497 from nikbyte/b2b_fix_hardcoded_timeout B2B: fix hardcoded 60 seconds tuple timeout, allow 0 as tuple timeout… 2021-05-13 Vlad Pătrașcu * [ebfe08bca] : Merge pull request #2495 from nikbyte/b2b_contact_user B2B: Contact user feature 2021-05-13 Nick Altmann * [402ba465f] : B2B: Contact user feature 2021-05-13 Nick Altmann * [d7a5c372a] : Allow to pass To: header in b2b_init_request() as we do in create_top_hiding_entities(). RURI is not always a good candidate for To: header. 2021-05-13 Liviu Chircu * [edbd44ffb] : aaa_diameter: Initial version (functional peer) 2021-05-13 Nick Altmann * [699a9a3f7] : Fix documentation 2021-05-13 Vlad Patrascu * [e60a55664] : mi: fix possible crash when optional params are missing 2021-05-13 Razvan Crainea * [a0cb21642] : Revert "mi: make sure params list exists when fetching items" This reverts commit 3cb5de0d51dc5fe6777aee22acc307e64ae5e7e1. 2021-05-13 Razvan Crainea * [c6645f664] : mi: increase the max number of recipies 2021-05-13 Razvan Crainea * [9d8fb461b] : rtpproxy: only fallback to a new node during offer 2021-05-13 Vlad Patrascu * [debf908cf] : b2b_entities: fix crash when B2B tracing is disabled 2021-05-13 Razvan Crainea * [4c22af33f] : rtpproxy: remove unused snode var 2021-05-13 Razvan Crainea * [013b61850] : rtp_relay: add rtp_relay_list MI command 2021-05-13 Razvan Crainea * [3cb5de0d5] : mi: make sure params list exists when fetching items 2021-05-13 Razvan Crainea * [a7491867b] : rtp_relay: node should always be a string no need to add useless function for converting a node to string back and forth - it's always string, so the modules should use them accordingly 2021-05-12 Liviu Chircu * [df42ab92a] : Add the 'log_stdout' global parameter May be useful when working with 3rd party libraries which log important information to stdout. By default, all of these logs are discarded, since stdout is redirected to /dev/null. 2021-05-12 Vlad Pătrașcu * [9f4e13c48] : Merge pull request #2501 from nikbyte/b2b_increase_static_buffer B2B: Fix static buffer size because 1024 bytes is not enough often fo… 2021-05-12 Vlad Pătrașcu * [d26aa91d4] : Merge pull request #2496 from nikbyte/b2b_fix_contact_for_replaces_invite B2B fix contact header when do bridge on multi-home b2b 2021-05-10 Razvan Crainea * [45d3e65cf] : rtpengine: initialize ret variable for all code paths 2021-05-10 Razvan Crainea * [1d6bd56bf] : github: remove Xenial builds Xenial had become unmaintained on 30th of April 2021, and on 4th of May 2021 GitHub Actions deprecated it: actions/virtual-environments#3302 2021-05-10 Razvan Crainea * [7306e64cd] : rtp_relay: add documentation for new module 2021-05-10 Liviu Chircu * [7f7118bbf] : drouting docs: Fix modparam types 2021-05-10 Razvan Crainea * [a90eccf9c] : github: remove Xenial builds Xenial had become unmaintained on 30th of April 2021, and on 4th of May 2021 GitHub Actions deprecated it: actions/virtual-environments#3302 2021-05-09 OpenSIPS * [0ce16c283] : Rebuild documentation 2021-05-07 Razvan Crainea * [e13d06204] : ratelimit: repurpose the repl_buffer_threshold Instead of defaulting it to MTU (due to an old datagram limitation), we should use a higher value, that would only control the fragmentation of the send buffer. Moreover, do not send the buffer to the clusters nodes under lock, since it might block, thus block the entire ratelimit function. 2021-05-07 Razvan Crainea * [40e660d74] : cgrates: initialize sessions lock Without the init, the lock might start as locked, thus OpenSIPS would have locked at first context. This was initially reported in ticket #2271. Credits go to Barny Ritchley (@barnabyritchley on GitHub) from SIPSynergy for reporting and providing testing environments. 2021-05-06 Liviu Chircu * [5f850e191] : Packaging: Fix tarball URL for BSD systems 2021-05-05 Liviu Chircu * [51a7c2834] : Function fixups: Be less verbose Closes #2492 2021-05-05 Nick Altmann * [9880d8539] : Fix tcp/tls socket reusage for multihome opensips 2021-05-03 Nick Altmann * [78cac0cbb] : New flag for dr_is_gw() which allows to check protocol of gateway 2021-05-03 Nick Altmann * [eef4af9c3] : Drouoting: Use db_partitions_url if db_url field is empty in dr_partitions table. Useful when you need different partitions in the same DB 2021-05-03 Nick Altmann * [452f22796] : B2B: fix hardcoded 60 seconds tuple timeout, allow 0 as tuple timeout which means maximum duration 2021-05-03 Nick Altmann * [d4315d5e6] : B2B: Fix static buffer size because 1024 bytes is not enough often for messages with large number of headers 2021-05-03 Nick Altmann * [e28d70fd8] : B2B fix contact header when do bridge on multi-home b2b 2021-05-02 OpenSIPS * [e7e6ba61c] : Rebuild documentation 2021-04-29 Liviu Chircu * [6703ab5ac] : WolfSSL: Use HTTPS instead of SSH for the git URL Fixes #2491 2021-04-29 Liviu Chircu * [78dd040af] : Function fixups: Include a backtrace on runtime errors Old behavior: ERROR:core:get_cmd_fixups: Variable in param [1] is not an integer ERROR:core:do_action: Failed to get fixups for command New behavior: ERROR:core:get_cmd_fixups: Variable in param [1] is not an integer ERROR:core:do_action: Failed to get fixups for command in cfg-tests/aaa-diameter.cfg, line 66: $var(mf) = "10"; if (!mf_process_maxfwd_header($var(mf))) { ^ sl_send_reply(483, "Too Many Hops"); exit; Credits to Kingsley Tart for the report! Related to #2492 2021-04-28 Razvan Crainea * [48193208e] : rtpproxy: rework locking while used over rtp_relay 2021-04-28 Razvan Crainea * [5d10a34c3] : rtpengine: add rtp_relay implementation 2021-04-27 Liviu Chircu * [8caa3d0c6] : qrouting: Use a reverse-dependency to drouting instead Taking advantage of the recently added support to specify this dependency in a cleaner way (in the qrouting code, not drouting). 2021-04-27 Liviu Chircu * [707ff810a] : qrouting: Use an IPC to load data during child_init() This fixes a design issue where qrouting _always_ loads its data before drouting, simply because it's doing it via an inline child_init() load, while drouting is lazy-loading via an IPC job. 2021-04-27 Liviu Chircu * [0fa6b96bc] : Module deps: Re-order the child_init() callbacks The child_init() callbacks are now processed in the same order as the mod_init() callbacks (obeying any existing "init" module dependencies). 2021-04-27 Razvan Crainea * [563ed865f] : rtpproxy: remove redundant check 2021-04-27 Liviu Chircu * [63cbf4c32] : dialog: Force "tm" to always destroy first This should fix all types of shutdown issues where tm cleans up after dialog, with dialog having leaked some of its own cleanup callbacks in tm, but which are now segfaulting because all dialog internal structures have been already freed. Credits to Peter Lemenkov for reporting this issue! Closes #2487 2021-04-27 Liviu Chircu * [c46979bc0] : Module deps: Re-order mod_destroy(); Add reverse dep support Expanding on 5deded37fb9, this commit adds two new features: * the mod_destroy() callbacks are now also ordered using the module dependencies. By default, modules are destroyed in the reverse-order of their dependencies (e.g. approximately opposite to mod_init() callback sequencing) * using the new DEP_REVERSE_INIT and DEP_REVERSE_DESTROY flags, any module dependency may be manipulated to behave in the opposite way, during either startup or shutdown Related to #2487 2021-04-27 Razvan Crainea * [6db7ea74e] : WIP: rtp_relay: cleanup dialog ctx var, as it is useless 2021-04-27 Razvan Crainea * [205d02a0d] : WIP: rtp_relay: register dialog pointer in pre-init Make sure that all dialogs that are loaded do have the dialog pointer registered, otherwise the dialogs get to be corrupted. 2021-04-27 Razvan Crainea * [cf9afd02a] : rtpproxy: load rtp_relay in reversed order 2021-04-27 Razvan Crainea * [3666289a9] : deps: rework deps to allow specifying a reversed order 2021-04-27 Razvan Crainea * [5deded37f] : deps: rework deps to allow specifying a reversed order 2021-04-27 Bogdan Andrei IANCU * [407f5f66c] : Merge pull request #2481 from wdoekes/release-insertq-lock-when-downscaling Don't forget to release the insertq lock when downscaling workers 2021-04-26 Liviu Chircu * [f7b8e1bf0] : Merge branch 'fix-usrloc-crash-in-db_timer_udomain' of https://github.com/wdoekes/opensips into wdoekes-fix-usrloc-crash-in-db_timer_udomain 2021-04-26 Liviu Chircu * [551c1ed41] : Update contributors 2021-04-26 Liviu Chircu * [4e43db731] : io_watch_del(): Suppress DEL errors for closed fds Similar fix to 21344d1f7 (from 6 years ago), but for newer Linux kernels (e.g. 5.8.0), which return ENOENT instead of EBADF. Fixes: DBG:rest_client:_resume_async_http_req: HTTP response code: 200 DBG:tm:io_watch_del: [UDP_worker] io_watch_del op on index -1 246 (0x561edd52c560, 246, -1, 0x10,0x1) fd_no=5 called ERROR:tm:io_watch_del: [UDP_worker] removing fd from epoll (246 from 171) list failed: No such file or directory [2] 2021-04-26 Liviu Chircu * [fc88b2c99] : rest_client: Fix async rest_get() stalling with local web server Similar issue to #2483, where the async GET operation would stall indefinitely, due to curl_multi_perform() not being called multiple times during the single invocation of the "resume" callback. In this case, the issue was caused by a misplaced "enable_expect_100" check. Not using the "Expect: 100" feature doesn't mean that curl_multi_perform() should be called at most once. Using libcurl 7.68 2021-04-26 Liviu Chircu * [f3b1c3d9b] : Merge pull request #2484 from john08burke/async_rest_issue [rest_client] Fix async connection logic 2021-04-26 Bogdan-Andrei Iancu * [a1eb48011] : Fix missing tracing for UAS in-dialog requests Expand the tracing function to take the UAC incoming request as param also, so we can trace it too. 2021-04-25 OpenSIPS * [ce9d94a65] : Rebuild documentation 2021-04-23 Bogdan-Andrei Iancu * [eccdb130a] : [b2b_entites] fix typos in the b2b tracing code 2021-04-23 John Burke * [98c6652a0] : [rest_client] Fix async connection logic Fixes #2483 2021-04-23 Bogdan-Andrei Iancu * [c38eff729] : [tracer] added b2b session tracing Based on the PR from @nikbyte Credits to @nikbyte for the idea and for the initial patch Closes #2409 2021-04-23 Bogdan-Andrei Iancu * [149b4ab05] : Add "free param" function for the tracer 2021-04-23 Razvan Crainea * [aee0cb0e7] : rtpproxy: if a session has a node, try to use it 2021-04-23 Razvan Crainea * [d8fcd2649] : rtpproxy: port notify process to new proc IPC interface 2021-04-23 Bogdan-Andrei Iancu * [c6c8ee0fb] : Align to the changes in b2be.client/server_new Set the tracing funtion to NULL. 2021-04-23 Bogdan-Andrei Iancu * [3458d8a0e] : Add b2b_logic level tracing Expose tracing callback, to enable tracing for the whole b2b session. Push the tracing functions to all b2b entities involved in the session. 2021-04-23 Bogdan-Andrei Iancu * [452d72ac3] : Align to the changes in b2be.client/server_new Set the tracing funtion to NULL. 2021-04-23 Bogdan-Andrei Iancu * [2e10c2f24] : Added tracing capabilities for b2b entities The B2B server and client may take as parameter a tracing function (callback + param) for performing transactional tracing. The B2B entities will trigger this tracing function for each transction created (UAC or UAS) 2021-04-22 Bogdan-Andrei Iancu * [aff3084ad] : Add "tranction created" callback for UAC transactions The idea is to get access to the created transaction before actually doing the SIP signaling, for example to be able to set some callbacks before the request is sent out. 2021-04-22 Razvan Crainea * [e97941406] : WIP: rtp_relay: proper handing of sequentials replies 2021-04-22 Razvan Crainea * [b57a77bc8] : WIP: rtp_relay: rename rtp_relay_node to rtp_relay_server 2021-04-22 Razvan Crainea * [aa100d2ac] : WIP rtp_relay: add support for dialog persistency 2021-04-22 Razvan Crainea * [d45c06d32] : WIP: rtp_relay: add support for getting rtpproxy node 2021-04-22 Walter Doekes * [ad7a1c1d4] : Don't forget to release the insertq lock when downscaling workers Not sure if this is a problem or of the locks gets freed correctly after exit(). But it looks nicer this way. 2021-04-22 Bogdan-Andrei Iancu * [b707c3864] : Added PROC_FLAG_NEEDS_SCRIPT for module procs By this flag, the module process indicates that it needs access to the script routes. The core will expose the loaded routes to this process and also do the routes reload for it (via IPC). Note: having the routes requires also the reloading (IPC), so PROC_FLAG_NEEDS_SCRIPT will automaticall imply PROC_FLAG_HAS_IPC also, just to be sure we have a consistent setting for the process. 2021-04-22 Bogdan-Andrei Iancu * [a2187f039] : Cleanup - drop IPC from t_uac_dlg() Now the MI related processes do have script routes (thanks to the IPC support provided by the reactor proc), so we do not have to do the IPC hack here anymore - run the local route inline, in the same process. 2021-04-22 Razvan Crainea * [f5f85b677] : dialog: only raise event if someone is listening 2021-04-21 Răzvan Crainea * [386802a1f] : Merge pull request #2468 from wdoekes/con-ps-reference-cleanup Prefer CON_SET_CURR_PS over CON_PS_REFERENCE 2021-04-21 John Burke * [2515c7499] : Instead of summation, use combination schema for cookie: `PID_RAND_SEQN` (cherry picked from commit cc851498a3d1345cd680e69d18da7303d26bcb06) 2021-04-21 John Burke * [f9958d777] : Fix cookie collision when using rtpengine/rtpproxy modules When using Docker, PIDs often are the same between OpenSIPS instances and cannot be used as a good source for cookie prefix. Use prefix with random influence instead. Fixes #2459 (cherry picked from commit e6cfd6f3c7e358ee9581aa9adca6398f4eead033) 2021-04-21 Razvan Crainea * [355e15b1a] : WIP: rtp_relay: do not reverse type during replies 2021-04-21 Liviu Chircu * [55e2a3b65] : Rebuild DB Schema (new `subscriber` table columns) 2021-04-21 Liviu Chircu * [3d743ac24] : db_mysql: Add a new 'ps_max_col_size' modparam Useful in case your column data size exceeds the default 1024 bytes setting. 2021-04-20 Razvan Crainea * [afc97fac6] : WIP: rtp_relay: handle sequentials 2021-04-20 Vlad Pătrașcu * [e773301da] : Merge pull request #2475 from vasilevalex/tls_ipv6 [tls_mgm] Store IPv6 address in full form for TLS domain matching 2021-04-20 Bogdan-Andrei Iancu * [ef3518bf2] : Fix race condition between accept and write on TCP conn Upon accepting a new TCP conn, the TCP Main is adding the conn into the hash, but the conn is initialized by the protocol just after being passed to the TCP Worker. So, for a short time (while the conn is passed from TCP Main to TCP Worker), the conn is not properly initialized, so not safe to use. And here we have the race condition, as the conn, being already in the tcp hash, it is foundable by any other process trying to do a write op. So, a process may end up trying to do a write on an not fully init tcp conn -> crash :( The fix is to avoid "finding" in hash the uninit conns. Closes #2258 2021-04-20 Bogdan-Andrei Iancu * [ead4e2c3c] : Fix missing MHD_USE_EPOLL on older than 0.9.50 versions 2021-04-20 Bogdan-Andrei Iancu * [ba253c2e3] : [httpd] Migrated to the reactor framework (for the I/O process) 2021-04-19 Bogdan-Andrei Iancu * [1f5ad8f60] : [mi_datagram] Migrated to the reactor framework (for the I/O process) 2021-04-19 Bogdan-Andrei Iancu * [59e589f8e] : Test if adding the fg into reactor was a success or not 2021-04-19 Razvan Crainea * [065784586] : sipcapture: establish the procs number at parsing Updating the number of extra procs needed by the module in mod_init() is a bad idea, since the attendant does not see any changes made by the process that runs mod_init, thus it waits for more children tha it should have, resulting in some bad pipe errors. Credits go to @ghmj2417 for reporting this in #2259 and to Bogdan Andrei IANCU (@bogdan-iancu) for brainstorming the final solution. 2021-04-19 Razvan Crainea * [6a920dd3f] : rtpproxy: fix initializing child If a process is not started with flag PROC_FLAG_INITCHILD, OpenSIPS will not be interested in its init status, thus the extra process will not be able to report its initializing state. If however it was doing that, it would hit the bug reported in ticket #2259, where the attendant was badly couting the number of processes that need to be initialized, due to the fact that it would not see any updates (in this case of the exports.procs structure) the process would be doing in its mod_init(). Credits go to @ghmj2417 for reporting this in #2259 and to Bogdan Andrei IANCU (@bogdan-iancu) for brainstorming the final solution. 2021-04-19 Bogdan-Andrei Iancu * [420f34876] : Fix foobar typo 2021-04-19 Bogdan-Andrei Iancu * [16e45b7a7] : For itself, avoid IPC and do inline pkg stats If it will send an IPC to itslef, this will get exectuted AFTER the WHOLE pkg-stts job is done, so useless. 2021-04-19 Bogdan-Andrei Iancu * [7b2e8c371] : Introduce F_GEN_PROC for I/O reactor Part of 0f67fc1 2021-04-19 Bogdan-Andrei Iancu * [037d4f638] : Migrated to the reactor framework (for the I/O process) 2021-04-19 Bogdan-Andrei Iancu * [0f67fc136] : Added reactor framework for custom/module procs. See the reactor_proc.h for details. 2021-04-19 Aleksei Vasilev * [eca45b731] : [tls_mgm] Store IPv6 address in full form for TLS domain matching Fixes #2474 2021-04-18 OpenSIPS * [9155c0fe9] : Rebuild documentation 2021-04-16 Razvan Crainea * [e7b7f954e] : WIP: rtp_relay: add dialog support 2021-04-16 Bogdan-Andrei Iancu * [d38c5765f] : Fix internal detection of DUMMY messages. Closes #2464 (cherry picked from commit faafd673dddf2c0784e570565c2c18dcb5520f36) 2021-04-16 Razvan Crainea * [1cade2b35] : rtp_relay: add support for printing the relay node 2021-04-16 Razvan Crainea * [cd1df2aac] : rtp_relay: store established session in ctx->main 2021-04-16 Bogdan-Andrei Iancu * [6a89cb8eb] : Migrate tcp conn ID from int to unsigned int As used to generate array indexes (for tcp partitions), the ID of the TCP conn must be a positive number. Still it was initialized with rand() (so possible high valules) and continously incremented -> this may lead to an overflow, resulting into a negative value (for an int data type). The solution was to move to unsigned int, so we are safe when overflowing (still resutling into a positive number) Fixes #2344 2021-04-16 Razvan Crainea * [86147b941] : rtp_relay: fix engaging rtp_relaying in main branch 2021-04-16 Razvan Crainea * [db5f7ed87] : stats: remove unsupported_methods statistic Removing the statistic as it is not reliable, due to the fact that the term "unsupported_methods" is quite generic and does not reflect the actual methods supported by OpenSIPS' script. Reported by Ben Newlin (@bcnewlin) in Ticket #2460 2021-04-16 Razvan Crainea * [8ec9b41fa] : mmgeoip: proper description of database open error 2021-04-16 Razvan Crainea * [e3fdc964f] : dialog: allow dialog timeout set by different modules Addresses ticket #2380 opened by Adolphe Cher-Aime (@acheraime) 2021-04-15 Liviu Chircu * [7b87cbc03] : Update contributors 2021-04-15 Liviu Chircu * [129834d12] : stir_shaken: Fix two OpenSSL BIO memory leaks Patch provided by John Burke Fixes #2472 2021-04-15 Liviu Chircu * [42d1fabcf] : auth: Complete e31b525e08f (CentOS 7 build issues) Credits to Nick Altmann for the report, once again! 2021-04-14 Liviu Chircu * [db899f6df] : stir_shaken: Fix heap corruption due to X509_STORE_CTX misusage As advised by the OpenSSL docs: "The certificates and CRLs in a store are used internally and should not be freed up until after the associated X509_STORE_CTX is freed." ... whereas the code would attempt to create a global X509_STORE_CTX object a single time, at OpenSIPS startup, then re-use it on each stir_shaken_verify() call. However, the certs would unfortunately get freed after each verification, thus breaking the library requirements. The solution is to simply create and free a X509_STORE_CTX object on each verification. Many thanks to Sandro Gauci (Enable Security) for the find! Issue discovered during OpenSIPIt'01 (https://opensipit.org/) 2021-04-14 Liviu Chircu * [ecf5d64d5] : stir_shaken: Fix missing "return -1;" statements Issue discovered during OpenSIPIt'01 (https://opensipit.org/) 2021-04-14 Liviu Chircu * [d6aa971e3] : stir_shaken: Further improve commit 9c9cce6f36 It's not enough to check for missing PASSporT payload fields, as the code can also crash on a cJSON type mismatch (malicious input?), e.g.: {... "orig": {"tn": ["1234"]} ...} Here, the "orig-tn" is incorrectly given as a list, where it should be a string. Without an extra check for a NULL cJSON string subfield, the code would still crash. Many thanks to Sandro Gauci (Enable Security) for the find! Issue discovered during OpenSIPIt'01 (https://opensipit.org/) 2021-04-14 Liviu Chircu * [9c9cce6f3] : stir_shaken: Fix $identity variable crash on missing fields Although stir_shaken_verify() correctly handles an incomplete PASSporT such as this one: {"orig":{"tn":"7778888"},"attest":"A","origid":"X","iat":1618403426} (notice the "dest" claim is missing) ... if the script writer were to xlog() the $identity(dest) value before the verification step, they would crash OpenSIPS. Many thanks to George Joseph for helping with testing! Issue discovered during OpenSIPIt'01 (https://opensipit.org/) 2021-04-14 Razvan Crainea * [af6399101] : signals: remove log in SIGCHLD handling Avoid deadlock generated when a SIGCHLD (caused by the completion of a process started through for example `exec`) handler tries to log something to syslog while the actual process was writing at syslog. Kudos to Javier Gallart from Sonoc for reporting the issue and testing the fix. 2021-04-14 Razvan Crainea * [f97797058] : WIP: rtp_relay: remove unused function 2021-04-14 Razvan Crainea * [e751c9a82] : WIP: rtpproxy: fix uninitialized variable 2021-04-14 Razvan Crainea * [c9e6902dc] : WIP: rtpproxy: imlement rtp_relay offer, answer and delete 2021-04-14 Razvan Crainea * [b6056ca95] : WIP: rtp_relay: add new RTP relay module Currently only initial request is handled 2021-04-14 Liviu Chircu * [e31b525e0] : Digest auth: Fix compilation issues on CentOS 7 * rename "static_assert" to "_Static_assert" (better compatibility) * avoid variable declarations inside for loops * avoid _BSD_SOURCE re-definition 2021-04-14 Liviu Chircu * [46e4d1433] : stir_shaken: Improve reply code/reason on missing Date If the mandatory Date header field is missing, change the reply from "403 Stale Date" (??) to "400 Bad Request (Missing Date)". Also, normalize macro naming and error message format across all 400 response reasons. Issue discovered during OpenSIPIt'01 (https://opensipit.org/) 2021-04-13 Walter Doekes * [d5885552f] : Prefer CON_SET_CURR_PS over CON_PS_REFERENCE They were used in the same fashion. And as the Zen of Python teaches us: There should be one-- and preferably only one --obvious way to do it. (See also discussion at 57caa6c03.) 2021-04-13 Walter Doekes * [50fe41d2d] : Fix crash in db_timer_udomain() when the database has little work The previous code, added in 1f0be8f02 but mostly fixed by 0d0909fc1, added this interesting erroneous pattern: static db_ps_t my_ps = NULL; db_key_t keys[2]; db_op_t ops[2]; if (my_ps == NULL) { keys[0] = &expires_col; ops[0] = "<"; ... That is: the initialisation of the stack depended on a global (local static). Once it was set, the initialisation would be skipped, causing keys and ops to contain undefined values. Due to the way the CON_PS_REFERENCE() prepared statement handle code has become, my_ps would always be reset to NULL after use, hiding this bug. However, if you have a flaky database connection (for instance an auto-closing socket on a machine with little traffic) then the following happens: CRITICAL:db_mysql:wrapper_single_mysql_stmt_execute: driver error (2003): Lost connection to backend server. ERROR:usrloc:db_timer_udomain: failed to delete from table location ERROR:usrloc:synchronize_all_udomains: synchronizing cache failed When this happens, my_ps is _not_ reset to NULL, and the next time this function is invoked, keys and ops are undefined, causing a segfault down the road. This changeset adds an if around use_table() because all the other code in this module does so. The actual fix is the removal of if(my_ps==NULL). (An alternative fix could have been to explicitly reset the prepared statement handle to NULL like 57caa6c03 does. Or to make keys and ops static too and set them only once.) 2021-04-12 Liviu Chircu * [2aff7cf51] : Digest auth: Fix MD5 regression on missing client "qop=" This fixes a bug with clients which may not include a "qop=" parameter in their Authorization header. Since the ".response" API function is invoked with some struct member address, the pointer check was always TRUE, even for NULL or empty "qop" strings received from the client. Issue discovered during OpenSIPIt'01 (https://opensipit.org/) 2021-04-12 Bogdan-Andrei Iancu * [ad0fccf81] : Fix internal detection of DUMMY messages. Closes #2464 (cherry picked from commit faafd673dddf2c0784e570565c2c18dcb5520f36) 2021-04-12 Liviu Chircu * [afae3363e] : stir_shaken: Fix several unset code/reason output vars on error cases Also add new 400 and 500 SIP retcodes to signify client / server errors. (cherry picked from commit 7cff7b60ce74e2a652d984b87a3ea5ec3847a3eb) 2021-04-12 Liviu Chircu * [91eca076c] : stir_shaken: Several logging improvements * add better separation between server-side / client-side errors, throughout both of the orig / dest telephony number extraction and validation phases. * bump client-side errors from INFO to NOTICE, for better visibility. * add extra logging details (phone numbers, timeouts, etc.) (cherry picked from commit b3f511f7bc2fa2fdb78f0c005abcd295af2e4176) 2021-04-12 Liviu Chircu * [1db73b680] : stir_shaken(): Fix too relaxed E.164 conditions; Add number checks Commit 8c842cc33d made it such that any string is accepted as valid STIR/SHAKEN identity, in "loose mode". For example, "From: sip:foobar@test.com" would pass as valid CLI and "foobar" would get written in the PASSporT, which cannot be OK. This commit also makes it so the new "e164_strict_mode" modparam makes the leading "+" mandatory in the From/To URIs. Otherwise, the "+" is optional and will get discarded if necessary. Moreover, by moving the number checks around a bit, this commit also fixes a bug where the opensips.cfg inputted orig/dest numbers are never checked. For example, if the developer were to have a bug where some $var(cli) contains a SIP URI and gets passed to stir_shaken as originator, the module would happily write the URI into the PASSporT as "orig" and return success. (cherry picked from commit 140e4c0ef810bd75fbbc4cbbfb1a80c72da67271) 2021-04-12 Liviu Chircu * [ab447c15a] : dprint.h: Add LM_GEN() macro (generic logging with prefix) 2021-04-12 Liviu Chircu * [775c35972] : is_e164(): Extend with optional '+' support This patch makes it so the _is_e164() check can be invoked in a way that does not mandate the leading '+' sign. (cherry picked from commit 35009a868cd85a63b46c1a30d25de0b0e9d48ca8) 2021-04-11 OpenSIPS * [2938786f5] : Rebuild documentation 2021-04-10 Vlad Patrascu * [8c842cc33] : stir_shaken: relax E.164 number restrictions by default Add a "e164_strict_mode" module parameter that enables a strict check on the originating/destination identity derived from the SIP message. 2021-04-10 Vlad Patrascu * [b3fb33643] : b2b_logic: fix handling of integer values in the extra header AVPs Reported in #2431 2021-04-09 Vlad Patrascu * [fd10448de] : mi: fix possible crash when optional params are missing 2021-04-09 Vlad Patrascu * [fab0e2173] : clusterer: add MI function that disables/enables a capability 2021-04-09 Vlad Patrascu * [a7425d4ad] : dialog: add ability to auto sync from cluster on node UP event Issue a sync request automatically when a node becomes reachable, for all sharing tags in backup state. 2021-04-09 Vlad Patrascu * [74cb23a89] : dialog: mirror dialogs from donor node when syncing from cluster Drop existing dialogs from memory if they are not received in the sync data. Also, improve the dlg_cluster_sync MI command by adding the ability to sync only the dialogs that are marked with a specific sharing tag. 2021-04-09 Razvan Crainea * [e3221aa16] : dialog: replace hash_id and hash_entry with id and db_id in event Thanks go to Kingsley Tart(@kingsleytart) for reporting it in #2463 2021-04-09 Razvan Crainea * [a64635706] : dialog: fix docs about the default value of `dlg_id_column` param 2021-04-09 Razvan Crainea * [d2cc4f91d] : parser/body: provide has_body_part() and get_body_part() in core 2021-04-07 Razvan Crainea * [ce45460ec] : Makefile/mem_stats: only modules Makfiles are used Without specifying a depth, when building per-groups statistics, only modules' Makefiles should be used, not other whatever libs are in each module. This commit is needed because the wolfssl libs has its own Makefile, with its own NAME= variables declared, resulting in redundant (and unused) declarations. 2021-04-06 Bogdan-Andrei Iancu * [197dd6aba] : Added Caller/callee only SIP tracing. Using the new "C" and "c" control flags, the tracing may capture only the caller or calle related traffic. 2021-04-05 Razvan Crainea * [50858e8aa] : dialog: update contact on TMCB_RESPONSE_FWDED Before this change, the contact was updated on the RESPONSE_OUT callback - the problem is that in that callback, when using topology hiding, you wouldn't know the actual Contact advertised (or fixed) by the client, because you would only see the topology hiding's advertised Contact. Thus, on replies, we couldn't update the remote's target properly. Moving the update logic on TMCB_RESPONSE_FWDED exposes the right Contact. Credits go to John Burke (@john08burke) for documenting this in ticket #2444. 2021-04-05 Liviu Chircu * [977d74ce0] : make menuconfig: Add new event_kafka module to selection list 2021-04-05 Liviu Chircu * [752b457d5] : Dauth parser tests: Fix compile warning Compiling parser/test/test_parser.c parser/test/test_parse_authenticate_body.c:90:2: warning: missing initializer for field ‘tres’ of ‘const struct tts’ [-Wmissing-field-initializers] 90 | } | ^ parser/test/test_parse_authenticate_body.c:35:6: note: ‘tres’ declared here 35 | int tres; | ^~~~ ...using gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 2021-04-05 Razvan Crainea * [720a8dded] : mem: fix previous commit by specifying mem name 2021-04-05 Razvan Crainea * [fa027d00b] : mem: improve f_malloc logging during defragmentation Instead of triggering an ERROR before defragmenting, let the defragmentation try to find a free frag, and only if it doesn't, trigger the ERROR. Thanks Liviu Chircu (@liviuc) for brainstorming 2021-04-05 Liviu Chircu * [875add647] : Merge pull request #2442 from sippy/pr-RFC8760 Implement RFC8760 digest authentication. 2021-04-05 Bogdan-Andrei Iancu * [c15dc8db3] : [siptrace] added custom correlation ID in sip_trace() A new optional 5th param to sip_trace() allows the overriding of the default SIP correlation ID (the Call-ID) with a custome value. This new correlation ID covers the entire tracing scope. 2021-04-05 Razvan Crainea * [a8f8aabc2] : transfromation/regex: remove unnecessary regex limitation Thanks go to Calvin Ellison for reporting this in the mailing list Completes 6e1afe64 2021-04-05 Bogdan-Andrei Iancu * [8684370eb] : Fix tracing the outbound ACK in transactional tracing 2021-04-04 OpenSIPS * [a35206860] : Rebuild documentation 2021-03-31 Razvan Crainea * [a8e98f9db] : tm: do not forward replies addressed to a different anycast node When a node receives a reply that is not addressed to himself (the cid parameter points to a different node), it should not forward the reply downstream, as it was already forwareded to the node where the transaction was initially created. Credits go to Jonathan Hulme for spotting this and reporing it in #2445 2021-03-31 Razvan Crainea * [40b968fb8] : Makefile.defs: add clang compiler handling for mode=debug Credits go to Andriy Pylypenko (@bambyster) for spotting the issue 2021-03-31 Răzvan Crainea * [23d8f38fb] : Merge pull request #2447 from bambyster/fix_for_makefile_defs Fix for Makefile.defs 2021-03-30 Nick Altmann * [2060eec70] : Packaging: support for wolfssl in rpm 2021-03-30 Nick Altmann * [786b2532c] : Packaging: fix typo in rpm spec 2021-03-28 OpenSIPS * [a56793a77] : Rebuild documentation 2021-03-26 Andriy Pylypenko * [2d4448c66] : Allow to override the INSTALL_* variables. 2021-03-26 Andriy Pylypenko * [a48b5e1ca] : Fix the order of ifeq statements. 2021-03-25 Razvan Crainea * [3f964878b] : cgrates: fix timeout precision loss when MaxUsage is in ns Converting the MaxUsage from nanoseconds to int was causing an overflow, setting the dialog timeout to 0, thus terminating the call immedately after the 200 OK was received. Reported by Adolphe Cher-Aime (@acheraime) 2021-03-24 Liviu Chircu * [8e0b00940] : Merge pull request #2439 from wdoekes/restore-registrar-save-f-flag-for-sqlonly-2372 Restore registrar 'f' flag behaviour for "sql-only" db_mode 2021-03-24 Maksym Sobolyev * [e53751e26] : Implement RFC8760 digest authentication. Merged up to the top of the branch RFC8760, 18550dca1596. 2021-03-23 Vlad Patrascu * [1f8f6b1f8] : clusterer: don't drop rerouted messages 2021-03-23 Vlad Patrascu * [f76baad60] : net: mark closed FD for expired tcp connections If the socket fd is closed and not marked appropriately in the tcp connection structure, the proto modules might try to do a connection cleanup with an invalid FD. 2021-03-23 Vlad Patrascu * [07774e9da] : Add support for BIN over TLS using the wolfssl library The actual TLS operations required by the proto_bins module are provided by a wolfssl module which includes the wolfssl library code. 2021-03-23 Liviu Chircu * [de8a5ddca] : Proper fix for 6c7cb2806b 2021-03-23 Liviu Chircu * [6c7cb2806] : time_rec.c: Fix gcc warning on i386 2021-03-23 Liviu Chircu * [031f1d641] : cfgutils: Fix check_time_rec() with BYXXX rules Most unit tests added in 4942bfca4d were incorrect as they were using an invalid "19700000T000000" Date-Time (both month and day should be 01). This patch fixes both the tests and the code to work as expected, while also extending BYYEARDAY to support ascending daily intervals. Additionally, the following logic is added: * protection against invalid Year, Month, Day or Frequency specified in the time recurrence string. Previously, this kind of bad input would have passed undetected! * auto-recovery for some invalid recurrences, e.g.: - missing DTSTART (assume UNIX timestamp 0) - missing DURATION, without a recursion rule (assume infinity) - missing DURATION with a recursion rule. Here, the assumed duration varies according to the recurring interval size 2021-03-22 Razvan Crainea * [b38e8ff5e] : b2b_entities: retransmission ACK with SDP for late negociation 2021-03-22 Razvan Crainea * [756916e1a] : prometheus: add more custom tuning for group 2021-03-22 rance * [f598271ea] : Fix memory cleak from freeswitch events. (cherry picked from commit 3d9d0f4f6dab86e132ed5f26de0f7e30b8a6cf03) 2021-03-21 OpenSIPS * [2c7843eba] : Rebuild documentation 2021-03-19 Razvan Crainea * [0f98f489c] : prometheus: add a prefix to the statistics' names Also allow customization of the statistics group prefix Credits go to Ovidiu Sas (@ovidiusas) for brainstorming and opening the feature request. Close #2427 2021-03-19 Liviu Chircu * [d8f647f89] : drouting: Fix some log messages 2021-03-19 Liviu Chircu * [a500c6bd3] : drouting: Add the "rule_tables_query" feature This patch adds optional support for an SQL-based way of building a set of dr_rules-compatible table names, to be each loaded and joined into a single "dr_rules" table, for any chosen partition. Usage example, where we build a single "dr_rules" table out of two other ones, named "dr_rules_a" and "dr_rules_b": modparam("drouting", "rule_table_query", "MY_RULES_QUERY: SELECT 'dr_rules_a' UNION SELECT 'dr_rules_b'") For the "MY_RULES_QUERY" token to be recognized, it must be provided as the name of the "dr_rules" table inside the partition DB entry, i.e. the `dr_partitions.drr_table` column. This module parameter may be set multiple times, where each definition will update the query for the respective "dr_rules" table name (token). Credits to Vlad Paiu for the initial prototype of this concept! 2021-03-19 Liviu Chircu * [92541f2d2] : Improve SHM / PKG / RPM memory block logging on startup * bump up the log level to NOTICE (matching the default `log_level`) * display the used allocator for each memory block * correct the unit from Mb (megabits??) to MB (megabytes!) 2021-03-19 Liviu Chircu * [32e41a8c1] : -d binary option: Evaluate before PKG malloc initializations There is no need to delay the evaluation of '-d'. By moving it earlier, we gain the ability to control the logging of PKG memory initialization. This patch doesn't change the fact that '-d' is somewhat broken, because it will immediately get overridden by the 'log_level' configuration file option. But this is subject to a future patch. 2021-03-19 Liviu Chircu * [c64d8cb3d] : drouting: Fix incorrect is_from_gw() examples Reported by Alexey Kazantsev 2021-03-18 Razvan Crainea * [68806c4b0] : b2b_entities: do not search dlg by NULL from_tag b2b_search_htable_dlg() always requires a non-NULL from_tag, therefore when searching the dialog with an empty one (for example in case of a b2b client timeout), we shall check agains a 0-length totag, rather than NULL, otherwise it would result in a crash 2021-03-18 Razvan Crainea * [855467245] : uri: fix memory leak generated by uri_param() The `params` list was changing while iterating through params, thus at the end of the function, the first parameters within the list whould have leaked. This commit fixes the leak 2021-03-18 Walter Doekes * [18932e3db] : Restore registrar 'f' flag behaviour for "sql-only" db_mode On 2020-05-25 fix 3a1f9c1e2 for #2118 was introduced into opensips 3.1. This change also modified things so cid_keys and cid_vals would *not* be allocated when the database was in "sql-only" mode. When "sql-only" mode is used, all usrloc records are saved to the DB immediately, and are loaded from DB immediately. The relevant settings: modparam("usrloc", "working_mode_preset", "sql-only") Which equals the deprecated db_mode setting 3: modparam("usrloc", "db_mode", 3) # 3 = "sql-only", DEPRECATED Or, as three separate settings: modparam("usrloc", "cluster_mode", "sql-only") # CM_SQL_ONLY modparam("usrloc", "restart_persistency", "none") # RRP_NONE modparam("usrloc", "sql_write_mode", "none") # SQL_NO_WRITE # This last option is slightly awkwardly named, but it refers # to *additional* SQL writing which is not performed. Because, # the is only *direct* SQL reading/writing. In any case: the changeset removed the access to temporary storage of cid_keys/cid_vals for the CM_SQL_ONLY case, under the assumption that it was not needed: ``` if (rr_persist == RRP_LOAD_FROM_SQL) { if (!(sync_lock = lock_init_rw())) { LM_ERR("cannot init rw lock\n"); return -1; } - } - } - if (cluster_mode != CM_NONE || rr_persist == RRP_LOAD_FROM_SQL) { - cid_keys = pkg_malloc(max_contact_delete * - (sizeof(db_key_t) + sizeof(db_val_t))); - if (!cid_keys) { - LM_ERR("oom\n"); - return -1; - } + /* initialize the "merged contact deletes" array */ + cid_keys = pkg_malloc(max_contact_delete * + (sizeof(db_key_t) + sizeof(db_val_t))); + if (!cid_keys) { + LM_ERR("oom\n"); + return -1; + } ``` However, those "merged contact deletes" were still needed when the registrar save() function tries to limit the number of Contacts (using the 'f' force overwrite flag). registrar:add_contacts() calls usrloc:release_urecord() with the contacts that should be removed (from the database). This calls usrloc:db_only_timer() (and wb_timer) and finally usrloc:db_multiple_ucontact_delete(). The wb_timer was supposed to populate the cid_keys/cid_vals with the database IDs passed along from the registrar module. But because that temporary cid_vals storage was not available, that bit would be skipped: ``` /* Should we remove the contact from the database ? */ if (cid_vals && st_expired_ucontact(t) == 1 ``` The result: usrloc:db_multiple_ucontact_delete() had nothing to delete; the max contacts save settings would be ignored. This changeset restores the `cluster_mode != CM_NONE` alternative that initialises cid_keys/cid_vals, restoring the force/max_contacts behaviour. 2021-03-18 Liviu Chircu * [c4eb952cc] : drouting/qrouting: Avoid trailing "\n" in MI responses 2021-03-18 Bogdan-Andrei Iancu * [a1faad648] : Clean/Reset the timestamp too Completion to 6aab0da937fbf3bc07a1587b1b1cc29fb78ebbc6 2021-03-18 Bogdan-Andrei Iancu * [6aab0da93] : Fix cleanup of the re-used dummy sip msg. Be sure to clean ALL the fields in the msg, not only the ones related to the msg parsing. The prevent inheriting of data between sequential usage of the message, we need to clean the flags, sockets, etc. (cherry picked from commit 4a2183a620c2ede9481b4369a459e2cf65dcaa48) 2021-03-18 Razvan Crainea * [d3d955fed] : acc: improve the accuracy of CDRs duration in secs Up until this commit, if a call's duration would have been T.56 ms, the duration of the CDR might have been computed as Ts. This commit makes sure that the number of seconds is always higher than the duration in ms by ceil-ing the number of ms. 2021-03-18 Razvan Crainea * [f1a412698] : acc: use the time in the message instead of getting it This improves the accuracy of the CDRs, as the time of the message is only fetched once and used by all the logic to compute different durations 2021-03-18 Razvan Crainea * [a74ed1401] : add time in msg struct 2021-03-16 Liviu Chircu * [0395eaf80] : dialog: Relax the allowed output variable types This patch also allows module variables to be passed as output variables to various dialog functions, e.g.: get_profile_size("tot-calls/b", $avp(dst), $acc_leg(ongoing_channels)) Fun fact: commit 4ba14e51cbb did exactly the same thing ~2 years ago, but the logic was lost during the function interface migration :-) 2021-03-16 Bogdan-Andrei Iancu * [68cca59e4] : Fix transactional tracing via LOCAL route * in local route do not trace as IN msg (on the spot) as logically speaking, there is no IN request here (it is generated by opensips itself) * trace the OUT request via the TMCB_MSG_SENT_OUT callback, which is now available for the UAC transactions. The tracing must be done AFTER the local route completion, so we can trace the resulting msg (with its changes) and the correct destination (as per local route changes) 2021-03-16 Bogdan-Andrei Iancu * [23d9bf68b] : Revert "Fix transactional tracing via LOCAL route" This reverts commit 61e89088fe52ce99bb9d37565477548b61d37444. Some work-in-progress leaked in this commit 2021-03-16 Bogdan-Andrei Iancu * [61e89088f] : Fix transactional tracing via LOCAL route * in local route do not trace as IN msg (on the spot) as logically speaking, there is no IN request here (it is generated by opensips itself) * trace the OUT request via the TMCB_MSG_SENT_OUT callback, which is now available for the UAC transactions. The tracing must be done AFTER the local route completion, so we can trace the resulting msg (with its changes) and the correct destination (as per local route changes) 2021-03-16 Vlad Patrascu * [9352c513b] : Add event_kafka to excluded modules 2021-03-15 Vlad Patrascu * [dac973404] : proto_tls/wss: complete fix in commit b6b7520 2021-03-15 Liviu Chircu * [0f4e738b9] : freeswitch: Fix memory leak with Sockets not being cleaned up (cherry picked from commit d2a561f40f7832fa5d59d62fe6b76f9d7bcf63fe) 2021-03-15 Liviu Chircu * [16b45293f] : Merge pull request #2396 from lemenkov/tm_async_verbose tm: Be more verbose when async detected in non-request route 2021-03-15 Liviu Chircu * [9611e8680] : dispatcher: Fix algorithm 9 regression Completes commit d9d1b9660b. Credits to John Burke for the report! Fixes #2413 2021-03-14 OpenSIPS * [17d149b32] : Rebuild documentation 2021-03-12 Razvan Crainea * [18a106147] : b2b_entities: don't require to_tag if empty (cherry picked from commit 963d87a932ec2e3eb7d0f3a9567ebd6ad3c93fa2) 2021-03-12 Liviu Chircu * [b8166f567] : db_sqlite docs: Remove extraneous wall of text Reported by Nick Altmann 2021-03-11 Liviu Chircu * [0236912c7] : Module docs: Fix obsolete SIP authorize / challenge examples 2021-03-11 Liviu Chircu * [593ff1e9c] : clusterer: Simplify/Improve cluster_check_addr() docs 2021-03-11 Liviu Chircu * [635ef0480] : drouting docs: Avoid str vs. int confusion 2021-03-09 Razvan Crainea * [efb9e16de] : rtpproxy: alocate anonymous structures in local scope RTPP_CMD_IOVEC and RTPP_VCMD_INIT_STATIC are initializing a variable with the content of another (anonymous one). If we however create the anonymous variable in a block's scope, it will be unavailable at the end of the block, resulting in invalid memory access - allocating the structures in the function's context (rather than a block's context) fixes this issue. Bug introduced in 0d7a71b2. 2021-03-07 OpenSIPS * [2886f8bb7] : Rebuild documentation 2021-03-03 Liviu Chircu * [39e5dfd6d] : qrouting: Fix bad column names during reload Many thanks to Abdoul Osséni for the report! 2021-03-02 Vlad Patrascu * [0a336899d] : event_kafka: migrate to the global DUMMY SIP msg support 2021-03-02 Bogdan-Andrei Iancu * [2d5420ab2] : Migrated to the global DUMMY SIP msg support This is a completion to the 84d1bad2c41b4b58170c0943edd837b08d15012f 2021-03-02 Razvan Crainea * [666959e19] : [evi] Migrated to the global DUMMY SIP msg support 2021-03-02 Liviu Chircu * [24432524e] : db_mysql: add debug for failed to create ctx err 2021-03-02 Liviu Chircu * [8da72779a] : db: add extra logging for bogus integers 2021-03-01 Bogdan-Andrei Iancu * [db41b3dd9] : Fix building the presentity ID when publishing dialoginfo Following the re-work for being able to publish per-branch dialog info (when the the ID of the dialoginfo document was extanted to callid.branch format), we also need to do the same with the internal ID of the presentities being published (between the pua_dialoginfo and pua modules), so the PUBLISHing should be done as from different sources (call1 versus call2). Otherwise, the PUBLISHes for the branches of the same call will mix at the pua level, looking as coming from the same source. (cherry picked from commit 29e86ddf2bec43227323c432ec4ca8431f4212ff) 2021-03-01 Liviu Chircu * [b7b45ff30] : drouting: Allow DB_BLOB for `dr_carriers.gwlist`, `dr_carriers.attrs` Similar reasons as in a34456845 -- these colums may get quite large! 2021-03-01 Liviu Chircu * [a34456845] : drouting: Allow DB_BLOB for the `dr_rules.timerec` field The recent extension to the time recurrence strings has caused the max possible column size for `timerec` to easily exceeed 1KB, so BLOB becomes the most appropriate column type in that case. 2021-03-01 Razvan Crainea * [a9ba24ba8] : prometheus: resolve stat modules later, when all are registered Thanks go to Ovidiu Sas (@ovidiusas) for reporting it. 2021-02-28 OpenSIPS * [b98a10b59] : Rebuild documentation 2021-02-27 Nick Altmann * [b16619b87] : Packaging: fix typo 2021-02-27 Nick Altmann * [5d2a53b91] : Packaging: small fixes for rpm spec 2021-02-27 Nick Altmann * [f37bea25a] : Packaging for even_kafka 2021-02-26 Robert Moss * [5389a4472] : add rl_dump_pipe MI command. Dump underlying buckets for SBT rate limits. 2021-02-26 Vlad Patrascu * [9dbb0b8ac] : event_kafka: fix compilation for librdkafka versions 0.9.2 to 1.0 2021-02-26 OpenSIPS * [3fe92afe0] : Rebuild documentation 2021-02-26 Razvan Crainea * [d57593fa5] : add packaging for Prometheus module 2021-02-26 Vlad Patrascu * [6ecb3fe48] : CI build: exclude event_kafka 2021-02-26 Vlad Patrascu * [74fb67a22] : event_kafka: fix missing initializer in module exports 2021-02-25 Vlad Patrascu * [f179f5cfe] : Add new event_kafka module 2021-02-25 Vlad Patrascu * [495380cf6] : Add support for async status reporting for the event interface In order to properly report the status of a raise operation, transport modules no longer have to implement a synchronous mode, where the triggering process has to block and wait for the dedicated module process to return back the status. As such, the "sync_mode" module parameter has been dropped from event_rabbitmq, event_xmlrpc and event_stream modules. At the moment, only the event_virtual module actually registers an async status callback. The evi raise function used by all other modules always returns success if the raise "job" has been "pushed" succesfully. 2021-02-25 Razvan Crainea * [fac2247c2] : prometheus: fix typo in documentation 2021-02-24 Liviu Chircu * [ed74875df] : Cache DB: Escape all logged URL passwords Additionally: * fix similar security issues in the Mongo and Redis clients * rewrite some cachedb unit tests Suggested by @ChrisZhangJin Related to #2416 2021-02-24 Razvan Crainea * [7c41fe5ff] : prometheus: add module to export statistics to Prometheus 2021-02-24 Liviu Chircu * [4ca36b1f7] : cacheDB URLs: Do not mandate the "/" URL portion Whether the "/" is given or not, semantically, the conclusion is the same: "the name of the database is NULL". Reported by Chris Zhang (@ChrisZhangJin) Fixes #2416 (cherry picked from commit c6baca41a23852a5337167a4e6fdd464b5513bd5) (cherry picked from commit 50b2dfe463815c48f18929e10ea7e0e505ac6ba2) 2021-02-24 Liviu Chircu * [5572fbe3c] : Merge pull request #2407 from danlshields/dshields/makeDebugMessages Use DBG level for per-connection nominal log messages 2021-02-24 Liviu Chircu * [5290203d5] : Merge pull request #2417 from fgast/wrong_route_description Fix wrong route type in error message 2021-02-24 Fabian Gast * [786fd9b96] : Fix wrong route type in error message 2021-02-23 John Burke * [343e4846b] : dispatcher: update docs 2021-02-23 John Burke * [6e9c1af5d] : dispatcher: substitute set ID (%i) when using algorithm 9 2021-02-22 Razvan Crainea * [bfb158dcf] : acc: populate setup and created even for missed 2021-02-21 OpenSIPS * [824587552] : Rebuild documentation 2021-02-18 Dan Shields * [a595cf174] : Use DBG level for per-connection nominal log messages 2021-02-18 Vlad Patrascu * [f925153d1] : db_http: fix crash when loading module along with tls_mgm 2021-02-18 Vlad Patrascu * [e968cb5a3] : uuid: complete fix in previous commit (91ce542) 2021-02-18 Vlad Patrascu * [91ce54298] : uuid: fix compilation if UUID version 3 or 5 not available 2021-02-18 Razvan Crainea * [50e1db5ed] : statistics: expose function that returns a statistic group name 2021-02-17 Liviu Chircu * [5f2f276d4] : dispatcher 'ds_list': Include the DNS SRV lookup results 2021-02-16 Vlad Pătrașcu * [cc4bc2f9f] : Merge pull request #2403 from john08burke/uuid_version_support Add support for UUID versions 3 and 5 2021-02-16 kworm83 <21957311+kworm83 at users.noreply.github dot com> * [a84d72f44] : Fix raise_node_state_ev parameter order Calls to raise_node_state_ev had the node status and cluster_id parameters reversed. (cherry picked from commit 6b9d6e8c572d75d8daab5155f75b5654d44adb39) 2021-02-15 John Burke * [562f11eed] : uuid: update docs 2021-02-15 John Burke * [24ee33378] : uuid: add support for UUID version 3 and 5 2021-02-15 John Burke * [c6e874f76] : uuid: remove unnecessary RET_UNSAFE check from $uuid pv creation, as version 0 never calls uuid_generate_time_safe 2021-02-14 OpenSIPS * [2fdfca88a] : Rebuild documentation 2021-02-12 Razvan Crainea * [09c3fb94d] : call_center: fix MI cc_list_calls state print 2021-02-12 Vlad Patrascu * [b6b752002] : proto_tls/wss: fix crashes when dumping the openssl error stack This commit serializes the execution of openssl's connect/accept/read/write operations in order to prevent adding/removing entries concurrently to/from the openssl error stack. If the performance penalty is deemed too high, the NO_SSL_GLOBAL_LOCK compilation flag can be used to disable this behavior and retain the risk of crashes. Reported in #2362 Credits to Alexey Vasilyev for helping troubleshoot this. 2021-02-10 Liviu Chircu * [872c4e89d] : usrloc ct IDs: Never pack more than 14 bits from a contact label 2021-02-10 Liviu Chircu * [93163b9eb] : usrloc: Several fixes regarding contact IDs * always increment record.next_clabel modulo CLABEL_MASK (this is critical, because clabels are 14-bit wide, while an unsigned short is 16-bit, so we'd overflow into the rlabel) * regen_broken_contactid: do not re-insert all contacts to DB if a single one is broken * do not update urecord contact labels on contact updates (the label may have rotated! by setting it to a high value, we're almost encouraging a conflict once it rotates again) 2021-02-09 Razvan Crainea * [e0152488f] : ratelimit: add support for debugging PIPEs 2021-02-09 Razvan Crainea * [451591f8e] : Variables comparing: first try to interpret operands as int Before this commit, all variables were interpreted as strings, thus comparing was always done against strigs. This broke simple comparisons such as $var(x) < $var(y), where $var(x) = 7 and $var(y) = 100; introduced in c13786c4 2021-02-08 Maksym Sobolyev * [024b93bda] : Merge pull request #2393 from sippy/tmerge_20210203 Refactor structure(s) packing code to do not put C structures at random unaligned offsets 2021-02-07 OpenSIPS * [6aba946eb] : Rebuild documentation 2021-02-05 Vlad Patrascu * [a1ad260de] : b2b_logic: properly check entities required for notity/rollback 2021-02-05 Vlad Pătrașcu * [f641a99c7] : Merge pull request #2392 from nikbyte/b2b b2b_logic: support for rfc3515 NOTIFY and rollback after failed transfer 2021-02-05 Vlad Patrascu * [ac2f9c813] : b2b_entities: don't pass empty storage packet to entity callbacks Reported in #2387 2021-02-05 Vlad Patrascu * [2617ca44a] : b2b_entities: fix crash if DB loaded entity hash_index is too large 2021-02-05 Nick Altmann * [38b0974d5] : b2b_logic: Apply new changes only in REFER state 2021-02-04 Liviu Chircu * [34af3c454] : pvv_is_int(): Be even more flexible This patch further improves commit 6191f278a, where the macro will now also work with code such as: (excerpt from pv_set_count()): ... pv_val.flags = PV_TYPE_INT; pv_val.ri = pv_name->pvp.pvi.u.ival-1; ... Notice how the flags are poorly set, since the PV_VAL_INT bit should have been used instead. 2021-02-04 Liviu Chircu * [96f12ac27] : usrloc + mid-registrar: Fix possible SHM leak of "" strings Credits to Pete Kelly for the report! 2021-02-04 Peter Lemenkov * [d7145869e] : tm: Be more verbose when async detected in non-request route If async operation is detected in non-request route then tm tries to switch to sync mode emmitting just a debug message. Debug messages are relatively rarely being turned on, so this switch to sync can be left unnoticed. Let's raise the severity to WARN so this situation can be spotted much easier. 2021-02-03 Maksym Sobolyev * [fe28d3ea9] : Alocate complex structure using anonymous struct, not pointer arith. This is to get rid of warnings on ARM32. 2021-02-03 Maksym Sobolyev * [9d1504016] : Do not break platform alignment rules by placing struct right after variable-length string. Instead, pack all fixed-length structs first and append variable portion at the end of the allocated buffer. This is particularly important on ARM32, but even on i386/amd64 would produce slowish code and might have some extra synchronization quirks when shared across multuple cores. 2021-02-03 Liviu Chircu * [f4b73ccce] : $socket(port): Indicate an integer type, not a string Also applies to $socket(advertised_port) and $socket(anycast). Many thanks to Alex Kinch for the report! 2021-02-03 Maksym Sobolyev * [b88c129cd] : Cast char * to void * to avoid "cast increases required alignment" warning on ARM32. 2021-02-03 Maksym Sobolyev * [5de77f56d] : Don't break alignment rules accessing h_addr_list members of the hostent structure. 2021-02-03 Maksym Sobolyev * [d83a128a8] : o Fix printf format warnings on ARM32. o Use PRIx64 not %lx to convert 64-bit value into hex. o Use strtoull() to prevent 64-bit wraparound on 32-bit arches. 2021-02-02 Nick Altmann * [9faaa3170] : b2b_logic: Support for rfc3515 NOTIFY and rollback on failed transfers 2021-02-02 Liviu Chircu * [f3c3ed53e] : $socket(af) variable: Fix returned value type Credits to Alex Kinch for the report! 2021-02-02 Razvan Crainea * [5267295ec] : statistics: fix statistics series typo 2021-02-02 Razvan Crainea * [7aa054dee] : statistics: fix iteration of unsinged int instead of int 2021-02-02 Razvan Crainea * [4fea2cfb8] : statistics: add statistics series implementation 2021-02-02 Razvan Crainea * [8107e3065] : dispatcher: set proper group when raising event Thanks go to Slava Bedersky (@volga629-1 on GitHub) for reporting it Close #2391 2021-02-02 Nick Altmann * [1c3e6e375] : b2b_logic: Fix B2BL_FLAG_USE_INIT_SDP flag value because it's used for bitwise operations 2021-02-02 Nick Altmann * [2b2a1743f] : b2b_logic: Fix newline character in debug message 2021-02-01 Razvan Crainea * [d698da1af] : dialog: swap the leg when starting 2nd re-INVITE in challenge mode 2021-01-31 Razvan Crainea * [be76c413d] : Makefile.defs: avoid creating stdin.o Use the generic `-` stdin read for platforms that do not expose `/dev/stdin`. Completes commit 5af4f120 2021-01-31 OpenSIPS * [aa1763c0b] : Rebuild documentation 2021-01-29 Maksym Sobolyev * [c6842064b] : Make 3rd arguments of the reg_lookup() API const str *, not just str *. Another small fallout of the 0147baa210. Reported by: @liviuchircu 2021-01-29 Maksym Sobolyev * [a7b591a60] : Fix small fallout (in tests) from the 0147baa210 - make str *hdr const. 2021-01-29 Maksym Sobolyev * [e26ac7d92] : Switch get_stat() and __get_stat() to take const str *, not str *. 2021-01-29 Maksym Sobolyev * [fc22e1784] : Use const_str() not _str() when generating point of use literals to be used in str_match() / str_casematch(). As discussed with @liviuchircu here https://github.com/OpenSIPS/opensips/commit/0147baa21072c5b9#commitcomment-46519279 it saves us some code size and also should have at least some positive performance effect by not saving 2 values into memory that nobody reads. 2021-01-29 Maksym Sobolyev * [ce8b994d1] : Extend str_match() and str_casematch() APIs to work on any combination of str and str_const's. 2021-01-29 Liviu Chircu * [2d9b5130c] : drouting: Change `dr_rules.gwlist` to NULL by default 2021-01-29 Liviu Chircu * [a764ea3e6] : drouting: Tolerate a NULL dr_rules.gwlist In build_rt_info(), there is a NULL check anyway: if ( dstlst && dstlst[0]!=0 ) { ... so this patch can only do good, by making the code compatible with even more flavours of the `dr_rules` table. 2021-01-28 Maksym Sobolyev * [2b455a392] : Set .iov_base = NULL for cookie and terminator when initializing on stack. This is to silence compiler warnings on Centos 7. 2021-01-28 Maksym Sobolyev * [0147baa21] : Convert _str() from inline to a macro and make it return (const str *), not (str *). This is to limit potential damage from its (mis)use in non-testing modules code by first making its value stored locally at point of use (which should allow compiler to throw it away when used properly) and also provide at least some protection from any function from messing with its fields. Fix any fallout where str * has been passed around. 2021-01-28 Razvan Crainea * [d85d0b50e] : dialog: do not update advertised contacts on dlg update When replicating a dialog update, we shall not update the advertised contacts, as we don't have all the needed information. If we do, we break the re-homing scenario that uses different advertises for different instances. Bug introduced in 52e6c42 2021-01-28 Maksym Sobolyev * [4ac1ad5a1] : Fix generics test: void main() -> int main(). 2021-01-28 Maksym Sobolyev * [609f22f6a] : Having space in file name is bit rude. 2021-01-28 Maksym Sobolyev * [cb1520090] : Remove unnecessary and harmful CROSS_COMPILE conditinal here. 2021-01-28 Maksym Sobolyev * [18b46da60] : Use const_str(), not _str() to generate point-of-use string literal for calling the str_strcmp(). 2021-01-28 Maksym Sobolyev * [5c7282447] : Add const_str() macro, a better way to generate point-of-use string literal of type const str_const * to be used in cases like: str_strcmp(in, _str("header")) The problem with the _str() usage in this scenario among many is that it updates the static pointer burried somewhere in application guts with length and location of the buffer containing its argument (e.g. "header" in this case) each time the operation is performed and that extra work cannot be optimized away. I have confirmed it with the Compiler Explorer, it costs us two memory writes each time str_strcmp() is invoked. Which not only isn't secure but also should have at least some negative performance effect. Use of: str_strcmp(in, const_str("header")) in this scenario will not only be free of that effect, but also pointer provided by the const_str can generally be passed along and saved as needed, it will always be valid as long as the application runs. 2021-01-27 Maksym Sobolyev * [a14c74f60] : Move all _Generic() statements into lib/str2const.h, so that we can have a less-typesafe callback for older compilers. Provide a fallback if HAVE_GENERICS is not definedi (e.g. CentOS 7). 2021-01-27 Maksym Sobolyev * [5af4f1202] : Test if _Generic() is supported and set HAVE_GENERICS if so. 2021-01-27 Maksym Sobolyev * [66feeea59] : Revert "Add strSC_strcmp() to compare const str * to const str_const *" This reverts commit cab6edbf80044272ce0325a41a1341e28603f104. Revert "Unbreak build on legacy arches (i.e. CentOS), turns out we are not ready to use _Generic()," This reverts commit 2f554c80a659b34c3e3105f654792fee50115156. 2021-01-27 Maksym Sobolyev * [cab6edbf8] : Add strSC_strcmp() to compare const str * to const str_const * and use it to undo damage the reversal of the 5e04676e3a5 did. 2021-01-27 Maksym Sobolyev * [2f554c80a] : Unbreak build on legacy arches (i.e. CentOS), turns out we are not ready to use _Generic(), which is C11 feature. :( Reported by: @liviuchircu Revert "o Fix escape_common(), unescape_common(), unescape_xml() and compute_md5()" Revert "Extend str_strcmp(a, b) to take any combination of const str * and" This reverts commits f5ce9537cc and 5e04676e3a5. 2021-01-26 Maksym Sobolyev * [7c6d61828] : Convert flag_list_to_bitmask() to use const str_const *. 2021-01-26 Maksym Sobolyev * [5e04676e3] : Extend str_strcmp(a, b) to take any combination of const str * and const str_const *. 2021-01-26 Maksym Sobolyev * [f5ce9537c] : o Fix escape_common(), unescape_common(), unescape_xml() and compute_md5() to take "const char *src", not "char *src"; o Extend escape_user(), unescape_user(), escape_param() and unescape_param() to take either "const str *src" or "const str_const *src". This is to allow other code to use either. 2021-01-26 Bogdan-Andrei Iancu * [87f235a1e] : [proto_hep] Fix payload extraction for HEP2 If time is present, offset the "payload" buffer accordingly, as "start" and "length". Reported by JP Hindin 2021-01-26 Liviu Chircu * [2cb4e8fa7] : Fix build on CentOS 7 Completes commit 1d261f0a2. 2021-01-26 Maksym Sobolyev * [b1343990f] : Simplify str2const() some more and make sure that type of the str2const((const str *)x) is "const str_const *", not just "str_const *". This prevents "promoting" const str * into [non-const]str_const * when passing it via that macro. 2021-01-26 Maksym Sobolyev * [1d261f0a2] : o Reorder includes, put system ones first, opensips core next and local the last, not the other way around, this fixes some weird compilation errors after adding assert.h into str.h. o Add missing include time.h and define _XOPEN_SOURCE to get strptime(3) going on linux. Fixes: https://github.com/sippy/opensips/runs/1753076545?check_suite_focus=true#step:4:212 2021-01-25 Vlad Patrascu * [090088155] : clusterer: properly persist MI changed node state in DB 2021-01-25 Vlad Patrascu * [73e63eed9] : clusterer: allow disabling a specific node with clusterer_set_status 2021-01-25 Vlad Patrascu * [a8da45c87] : b2b_logic: add an optional outbound proxy parameter to client_new() Add a new optional parameter to the client_new() script function to allow choosing an outbound proxy to send the INVITE to. Closes #2374 2021-01-25 Vlad Patrascu * [9ff81fe32] : b2b_logic: check if script functions are used from the proper routes 2021-01-25 Maksym Sobolyev * [87b9286fb] : Use core_hash(x, NULL, y), not core_hash(x, 0, y). 2021-01-25 Maksym Sobolyev * [81523d0c6] : o Simplify str2const() using the fact that struct __str and struct __str_const have the same structure. Make sure that (void *)str2const(p) == (void *)p. o Check that argument of str2const() is either str * or const str *. 2021-01-25 Liviu Chircu * [8fcb97e4f] : cachedb_local: Improve "cache_collections" docs The "default" collection always gets created, even when not included in the list of collections. 2021-01-24 OpenSIPS * [57d313d05] : Rebuild documentation 2021-01-22 Maksym Sobolyev * [985f1e6b5] : Cleanup pvar.c code a bit: o mark bunch of functions not used anywhere else static; o make lots of str * arguments "const" (overflows to some modules). Two modules in particular abused API by writing into str *in directly: modules/sipcapture/sipcapture.c modules/acc/acc_vars.c o make some of pv_spec_p arguments "const"; o make _pv_names_table[] const. 2021-01-22 Maksym Sobolyev * [9cf484340] : Add immutable version of the struct str - str_const and associated helper macros (STR_NULL_const, str_const_init() and str2const()). 2021-01-20 Bogdan-Andrei Iancu * [0625fa0df] : [dbschema] remove bogus second primary key Issue introduced with 7d38cb85bc18e9831d7ef507383a9388d73578a6 Reported by @kuuse Closes #2379 2021-01-20 Liviu Chircu * [2a3a1050e] : fraud_detection: Optimize time-recurrences which always match Rather than always (re)evaluating a time rec which matches 100% of the time, just set it to NULL, so drouting quickly skips the check. 2021-01-19 Vlad Patrascu * [eb3341ae6] : b2b_logic: fix deadlock in b2b_bridge_request() Do not re-aquire the same lock when the entity storage callback is called for a delete event. Fixes #2373 2021-01-19 Maksym Sobolyev * [0bb57b49a] : Use str_init("abc") instead of {"abc", (sizeof("abc")-1)}. No functional changes (confirmed by md5sum pvar.o). 2021-01-19 Liviu Chircu * [6191f278a] : $json set: Correctly interpret the content of pv_value_t 2021-01-19 Razvan Crainea * [0043bb0e6] : dialog: store dialog in transaction in dlg_onroute When the transaction is created before matching the dialog, there is was no callback to store the dialog in the transaction - as a consequence, the acc cdr callbacks were not able to find the dialog, thus no longer generate dialogs. This commit fixes this bevavior. 2021-01-18 Vlad Patrascu * [5b551ba35] : uac_registrant: improve managing of registrants through MI Add MI functions to enable or disable a particular registrant. Also improve the reg_list and reg_reload MI functions in order to list/reload a specific registrant. 2021-01-18 Vlad Patrascu * [01fc1bd55] : uac_registrant DB schema: extend unique index with contact, registrar 2021-01-18 Vlad Pătrașcu * [47576e0de] : Merge pull request #2375 from sagarmalam/patch-1 Fix for : uac_registrant using same call id for two different registrants 2021-01-18 Vlad Patrascu * [2fe15bb20] : proto_tcp: fix possible crash when looking up connection Reported by Adrien Martin in #2369 2021-01-18 sagarmalam <47811226+sagarmalam at users.noreply.github dot com> * [41b9bc575] : Fix for : uac_registrant using same call id for two different registrants sharing same sip credentials uac registrant was using AOR to generate call ID each time due to which two registrants have same AOR will always have same Call ID. To fix this issue i have appended timestamp at the end of the AOR before passing it to MD5string array. 2021-01-17 OpenSIPS * [0f367e593] : Rebuild documentation 2021-01-16 Bogdan-Andrei Iancu * [606d278dd] : [b2b_logic_xml] Fix extracting URI from hdr When extracting a new URI from a SIP hdr, expect a NAME ADDR format, not a just a URI. The From/To/PAI/PPI/Refer hdrs do follow the NAME ADDR format Thanks to @nikbyte Alternative to #2371 2021-01-15 Bogdan-Andrei Iancu * [ca2b087a0] : [drouting] proper ending of fallbacks at last cycle (cherry picked from commit cdcfe4435c5d30446593bec5ce679c72333c6ecb) 2021-01-15 Maksym Sobolyev * [b9e71e89c] : Merge branch 'master' of github.com:OpenSIPS/opensips into fix_workflow_on 2021-01-15 Maksym Sobolyev * [84d6ccb27] : Only notify Slack about failures when github.repository == 'OpenSIPS/opensips'. 2021-01-15 Liviu Chircu * [bcdb417d5] : mid_registrar: Complete the 386f1cd fix (more edge-cases) The runtime-defined "outgoing_expires" would still not be honored when either: * the UAC uses a larger expiration than "outgoing_expires" itself * the UAC uses Contact ";expires=" instead of "Expires" hf Fixes #2350 (for good) 2021-01-15 Maksym Sobolyev * [7eb191d2d] : There is no god reasons to limit GitHub Actions to master branch only. Most of the work is done (hopefully) in custom branches, so we need to make sure contributors can see any breakage before PR is submitted. 2021-01-15 Liviu Chircu * [6c5953033] : mid_registrar: Fix "Expires" edge-case in AoR throttling mode This fixes a bug where the mid-registrar, in mode == 2, would not correctly process REGISTER requests containing both: * an ";expires=" Contact param * an "Expires" header field Specifically, the "Expires" header would incorrectly transit "as is", without being changed. Related to #2350 2021-01-15 Bogdan-Andrei Iancu * [34b16db25] : Revert "[auth] Proper auth username check" This reverts commit 2d02dc85a3fbf168bb8457d5e5b6827092fb8cc8. 2021-01-15 Razvan Crainea * [a3892587a] : github/workflows: use #devel channel on slack 2021-01-15 Razvan Crainea * [9a77ccc0a] : proto_tls: fix unsigned return handling in proto_tls_send 2021-01-15 Razvan Crainea * [296f3cb4a] : tls: update fd for async writing 2021-01-15 Razvan Crainea * [77f6ec8ba] : tls_mgm: add more information about the error 2021-01-15 Razvan Crainea * [507851760] : proto_tls: if chunk cannot be written, postpone it 2021-01-15 Razvan Crainea * [806221f8e] : tls: add async support for proto_tls 2021-01-15 Razvan Crainea * [7d12ba18b] : net: allow tcp connection creation without sending to main This is needed by proto WS and WSS 2021-01-15 Razvan Crainea * [46a3b428a] : net: merge async chunks in core Next steps towards #1511 2021-01-15 Razvan Crainea * [06d2bc6bf] : tcp: merge similar code in a common tcp file First steps towards #1511 2021-01-15 Razvan Crainea * [ba3e349db] : Completely migrate repo to travis-ci.com 2021-01-15 Vlad Patrascu * [aad28f39c] : mi: improve error message for generic server errors 2021-01-15 Vlad Patrascu * [e9627e9dc] : mi: further improve invalid params errors * handle an unexpected param as error when receiving named params and get rid of the "ambigous call" error for named params * return appropriate error for bad number of params even when receiving named params / no params at all * include a hint when returning "ambigous call" error for positional params 2021-01-14 Vlad Patrascu * [dc4199b15] : mi: include more details in invalid params errors 2021-01-14 Bogdan-Andrei Iancu * [7dc20e471] : Fix wrong memcpy() To get the memcpy working correctly, we should have: memcpy(&xlp, &lev, sizeof(xl_level_p)); NOTE: xl_level_p == xl_level_t * The above change was introduced in fff57ac955 But I prefer to try to use an extra cast (via 'void*') here (following the initial model), let's see if this holds on ARM 2021-01-14 Liviu Chircu * [b03cb41a3] : Export is_username_char() to core and reuse it Also remove the duplicate IS_ALPHANUM() module macro while at it. Work in progress for #2367 2021-01-14 Bogdan-Andrei Iancu * [2d02dc85a] : [auth] Proper auth username check As when populating the credentials from script the username var contains only a username part, check only against "user" part of the auth username extracted from the SIP request (as the auth username may contain a domain part also). Fixes #2356 2021-01-14 Liviu Chircu * [6cd76760e] : registrars: Do not save() AoR URIs with no 'username' Also add some protection on the receiving end of the cluster communication for such strings which could crash the server. Fixes #2232 2021-01-14 Liviu Chircu * [e4708c2aa] : Sample opensips.cfg: Avoid double-replying after save() 2021-01-14 Liviu Chircu * [46553a9aa] : registrars: Correctly reply on all save() edge-cases This patch fixes several corner-cases when calling [mid_registrar]_save(), where: * the registrar would not send a reply * the registrar would send a bad reply (e.g. 200 OK on an error!) 2021-01-13 Liviu Chircu * [386f1cd7c] : mid_registrar: Fix the runtime override of "outgoing_expires" Fixes #2350 2021-01-13 Liviu Chircu * [c8b28d417] : mid_registrar: Add extra startup/runtime checks; Re-org code 2021-01-13 Razvan Crainea * [588b1f55e] : uac_auth: fix gcc uninitialized warning 2021-01-13 Razvan Crainea * [a00353429] : python: remove deprecated PyEval_InitThreads call since python v3.7 2021-01-13 Razvan Crainea * [62a8b3c57] : httpd: adapt implementation to microhttpd v0.9.71 2021-01-13 Razvan Crainea * [46e4d8326] : nathelper: prevent memory overwritten during pinging 2021-01-13 Razvan Crainea * [7514a57a3] : lua: init uninitalized value 2021-01-13 Razvan Crainea * [a5da4b138] : ldap: fix copying value in smaller buffers 2021-01-13 Razvan Crainea * [dcb4571eb] : remove obsolete modules 2021-01-13 Razvan Crainea * [6106aac02] : cachedb_cassandra: prevent logging NULL at threashold expire 2021-01-12 Vlad Patrascu * [71bbd4caf] : clusterer: complete commit 0b7a94a 2021-01-12 Liviu Chircu * [46952b01f] : drouting: Document outdated "W" flag of do_routing() 2021-01-12 Liviu Chircu * [f03a95848] : cachedb_mongodb: Return DB_STRING strings, not DB_STR Several modules relying on SQL data do not fully handle the DB_STR data type, e.g. drouting. So when db_cachedb is used on top of cachedb_mongodb, these modules may report errors such as: ERROR:drouting:dr_load_routing_info: column gwid has a bad type [4], accepting only [3] Many thanks to Sasmita Panda for the report and helping with testing! 2021-01-12 Vlad Patrascu * [db652d89d] : clusterer: acquire RW lock for switchable reading only if needed 2021-01-12 Vlad Patrascu * [f4262155f] : clusterer: also check source IP for internal BIN packets 2021-01-12 Vlad Patrascu * [b78ed716b] : clusterer: add MI function to remove a node from the cluster 2021-01-12 Vlad Patrascu * [eeaf59e4b] : clusterer: restrict dynamic node joining in db mode 2021-01-12 Vlad Patrascu * [0b7a94a60] : clusterer: refactor topology related code into a new file 2021-01-12 Vlad Patrascu * [9ae8ca78a] : clusterer: refactor evi related code into a new file 2021-01-12 Bogdan-Andrei Iancu * [eee990d84] : [core] run post processing callbacks only on SIP traffic Credits go to @lemenkov Alternative to #2316 2021-01-12 Liviu Chircu * [107b6fa58] : usrloc: Fully document the module API 2021-01-12 Liviu Chircu * [8880b5f33] : Fix missing "\n" log line endings Credits to Nick Altmann for the hint! 2021-01-12 Liviu Chircu * [1104a21d5] : async(): Report an error when using timeouts incorrectly 2021-01-12 Razvan Crainea * [dcd46ffb7] : Add notification for GitHub Workflows 2021-01-11 Liviu Chircu * [8959b9f71] : rest_client: Add optional timeouts to all async functions Fixes #1838 2021-01-11 Bogdan-Andrei Iancu * [c8743de27] : [drouting] set sort_profile column to default NULL If Quality Routing module is not used (on top of Dynamic Routing), this column is not used, so we do not have to explicitly provision it. 2021-01-11 Liviu Chircu * [97c6bc78a] : tm: Fix t_on_branch() PKG memory leak Commit dddf9c253d introduced a regression because add_uac() is sensible to the addresses of the (str *) address provided. "Premature optimization is the root of all evil"... 2021-01-11 Liviu Chircu * [85379e5eb] : db_mysql: Properly disable auto-reconnect According to https://dev.mysql.com/doc/c-api/8.0/en/mysql-options.html, mysql_options() MUST NOT be called after mysql_real_connect(). 2021-01-11 Razvan Crainea * [9b0863e9c] : dialog: release cloned leg if failure 2021-01-10 OpenSIPS * [88a0f7d66] : Rebuild documentation 2021-01-08 Bogdan-Andrei Iancu * [7d38cb85b] : [cachedb_sql] fixed definition of the "cachedb" table In postgres, the tables must have an auto-increment Fix for #2310 (cherry picked from commit 3f3dc8a45d44eed76204c1ebc82e8ae6be03b335) 2021-01-08 Bogdan-Andrei Iancu * [0e9249da6] : [topology_hiding] fix printing formater 2021-01-08 Bogdan-Andrei Iancu * [78909c344] : [topology_hiding] fix vulnerability in TH decoding Extra checks were added to prevent buffer overflow/underflow when decoding the TH information (in non-dialog module) extracted from the Contact hdr. This information may be subject to malicious changes from an external attacker. Credits for reporting and for the fix go to @wdoekes. The suggested fix was re-worked a bit, but the idea is the same. Fixes #2338 2021-01-08 Razvan Crainea * [647bb69d2] : db_sqlite: fix memory overwrite error when reallocing rows 2021-01-07 Vlad Patrascu * [342e6c5da] : bin_interface: fix crashes due to bad capability length 2021-01-07 Bogdan-Andrei Iancu * [45b29f93b] : [topology_hiding] consider NOTIFY as an in-dialog method When handing in-dialog requests, consider the NOTIFY requests as candidates for TH. Credits go to @nikbyte Fixes #1991 2021-01-07 Liviu Chircu * [2e17eb063] : Improve doc & code quality; Fix typos & inaccuracies 2021-01-07 Razvan Crainea * [d329e00f6] : freeswitch: esl: use OpenSIPS's cJSON implementation if available 2021-01-07 Razvan Crainea * [396a0fa92] : Fix lgtm errors and warnings 2021-01-06 Razvan Crainea * [b1ce111bc] : dialog: load from DB call looping dialogs When loading a dialog from DB that has the same coordinates (same callid+to-tag+from-tag pair) with a different dialog in memory, we should not ignore it if it comes with a different `hash_id`, as it might be a completely different dialog, resulted from a call looping scenario (call that passes through the same OpenSIPS instance twice), which legitimately creates a new dialog with a new `hash_id`. Thanks go to @perwx3 (GitHub) for reporting it in ticket #2311. Complements commit b26d59e3. Fix #2311. 2021-01-06 Razvan Crainea * [3081483af] : sql_cacher: prevent memory leak for keys not present 2021-01-05 Liviu Chircu * [cbc0922bd] : sipmsg_validate(): Allow escape sequences in SIP URI usernames This regression was introduced in 269ad7a3f0, where the R-URI, From and To header usernames were no longer accepting escape sequences, e.g. "%23". Many thanks to Nexphone for sponsoring this fix 2021-01-05 Liviu Chircu * [c82d074d3] : sipmsg_validate(): Allow "(" and ")" in SIP URI usernames According to RFC 3261: mark = "-" / "_" / "." / "!" / "~" / "*" / "'" / "(" / ")" ... so both parantheses are legal within URI usernames. 2021-01-05 Liviu Chircu * [59918856b] : ut.h: Add some helpful comments 2021-01-05 Liviu Chircu * [3ea93397c] : Fix compilation warnings 2021-01-05 Liviu Chircu * [6ebbd9a2d] : dialog: Fix crash due to a "tmp SDP" race condition This fixes a race condition on the following code which runs, e.g., on a 200 OK to a Re-INVITE (added in d447626c2531): if (dlg->legs[leg].tmp_out_sdp.s) { shm_free(dlg->legs[leg].tmp_out_sdp.s); dlg->legs[leg].tmp_out_sdp.s = 0; <--- we are here dlg->legs[leg].tmp_out_sdp.len = 0; } At this point, if the Re-INVITE is retransmitted and, e.g., dlg_callee_reinv_onreq_out() is run, the code may read a corrupt str value from "tmp_out_sdp" (e.g. {NULL, 172}), which will crash in shm_str_sync(). Many thanks to Ken Rice for the report! 2021-01-05 Bogdan Andrei IANCU * [0ad1df3cc] : Merge pull request #2358 from ccppprogrammer/patch-1 dialog: move "No matched dialogs" msg from LM_ERR to LM_DBG 2021-01-04 Bogdan Andrei IANCU * [5b3052f5f] : Merge pull request #2319 from lemenkov/tm_respect_async_close_fd tm/async: Handle ASYNC_DONE_CLOSE_FD when switching to sync 2021-01-04 Razvan Crainea * [a8cd0ed61] : export _ISOC11_SOURCE to see static_assert macro 2020-12-31 sergei lavrov <7936874+ccppprogrammer at users.noreply.github dot com> * [7c38d6281] : dialog: move "No matched dialogs" msg from LM_ERR to LM_DBG Get rid of spam messages "No matched dialogs" in LM_ERR. We only need these messages in LM_DBG. 2020-12-28 Nick Altmann * [f16897c90] : RPM spec: fix source path 2020-12-27 Maksym Sobolyev * [b1e6f2a4a] : Merge pull request #2324 from sippy/pr_github_actions Move main CI action to GitHub Actions, put TraviCI to a backburner. 2020-12-27 Maksym Sobolyev * [2b25cddbd] : Merge branch 'master' into pr_github_actions 2020-12-27 OpenSIPS * [b7368f4c0] : Rebuild documentation 2020-12-22 Razvan Crainea * [9621cac20] : ratelimit: keep only local values in pipe->counter for SBT Up until this commit, the SBT algorithm would keep in pipe->counter the sum between its local value, as well as the values gathered from the other servers in the cluster. This means that it would replicate the other's counters as well, leading to a broken behavior. This fix makes sure that the SBT algorithm only stores the local counter in the pipe->counter field, therefore it will not replicate other's counters. 2020-12-20 OpenSIPS * [a611127f1] : Rebuild documentation 2020-12-18 Razvan Crainea * [0b94a2c7e] : rtpengine: provide code to rtpengine_play_dtmf command Thanks go to Slava Bendersky for reporting it. Close #2349 2020-12-18 Razvan Crainea * [5835780b3] : Migrate repo to travis-ci.com 2020-12-18 Razvan Crainea * [ef9ab051c] : cachedb: document return values of get_counter() 2020-12-18 Razvan Crainea * [dd1446bb0] : cachedb_mongodb: treat case when counter is missing 2020-12-17 Vlad Patrascu * [12ae86900] : dialog: fix a memory leak when using topology hiding Credits to Anton Mosin for troubleshooting this. Fixes #2346. (cherry picked from commit fd0e4b7e4ae4853a27b6dcbf4a8b825aeae16b79) 2020-12-17 Vlad Patrascu * [82c4f9466] : sip_i: fix setting of Subsequent number parameter 2020-12-17 Vlad Patrascu * [454f7db04] : sip_i: fix setting of Generic number parameter 2020-12-17 Vlad Pătrașcu * [2835fe065] : Merge pull request #2133 from SIfoxDevTeam/sip_i_generic_number Add support for Generic Number parameter into sip_i 2020-12-17 Vlad Pătrașcu * [6766a47e3] : Merge pull request #2345 from l2dy/b2b_logic b2b_logic: fix use of uninitialized pointer 2020-12-17 Maksym Sobolyev * [58b0190a1] : Merge remote-tracking branch 'upstream/master' into pr_github_actions 2020-12-16 Razvan Crainea * [b8dee70e1] : tm: initiate cancel_bm in t_inject_branch Make sure we're not canceling unwanted branches if there is some garbage in the cancel_bm mask Thanks go to Bogdan Iancu for debugging and fixing 2020-12-16 Bogdan-Andrei Iancu * [539958944] : [proto_tcp] Fix cleaning an un-init'ed conn When handling a TCP accept event, if there is an error on dispatching the conn to the TCP workers, the conn is cleaned and destroied, without ever actually being initialised So, we need to be sure we can clean conns which were not init'ed. (cherry picked from commit 46d0b75243372375162ab64ca66aff42cdd7b547) 2020-12-16 Razvan Crainea * [07eedd064] : signaling: fix sig_local_totag pvar name length 2020-12-16 Maksym Sobolyev * [b528652e6] : Merge pull request #2341 from l2dy/residential opensips_residential.m4: Limit rtpproxy function calls to messages with an SDP body 2020-12-16 Maksym Sobolyev * [6f62e23fa] : Merge pull request #2300 from sippy/pr_split_main Split out gigantic main.c into 3 more TUs: globals.c, shutdown.c and signals.c. This is to allow unit tests to be build and executed outside of the main OpenSIPS executable. 2020-12-16 Zero King * [4ff9437b4] : b2b_logic: fix use of uninitialized pointer 2020-12-15 Vlad Patrascu * [600cd1c3d] : sql_cacher: properly support integer caching keys Add a new parameter "key_type" to the caching entries configuration that specifies an integer or string data type for the caching key. Fixes #2335 2020-12-14 Vlad Patrascu * [176e28ebc] : rabbitmq: complete fix in commit f7877f9 2020-12-14 Vlad Patrascu * [f7877f9cc] : rabbitmq: fix build for librabbitmq versions < 0.9 Address the openssl multiprocess issues with librabbitmq versions that don't provide access to the lib's SSL_CTX, by serializing the CA, certificate and key loading. 2020-12-13 Zero King * [0a7d74123] : opensips_residential.m4: Limit rtpproxy function calls to messages with an SDP body Fix for "ERROR:rtpproxy:force_rtp_proxy: Unable to parse body". 2020-12-13 OpenSIPS * [e56751a67] : Rebuild documentation 2020-12-12 Maksym Sobolyev * [370d74b10] : When ECONNRESET has been received calling connect() try one more time. This has observed to be happening on some of our voiptests runs and we've got this patch since 2017: https://github.com/sippy/voiptests/commits/master/install_depends/opensips/mod.rtpproxy_retry.diff 2020-12-12 Maksym Sobolyev * [6073cdd05] : Fix "off-by-one" error sizing vstat. 2020-12-11 Vlad Patrascu * [472ae546c] : rabbitmq modules: add TLS support Closes #2306 2020-12-11 Vlad Patrascu * [113ecf499] : tls_mgm: add API functions for operations with a SSL_CTX Add API functions to set the CAs, certificate and private key for a given SSL_CTX (with a different SSL_CTX, or a file in case of private keys, as a source). These functions can be used from modules which require some TLS operations but without having to link with openssl directly. 2020-12-11 Vlad Patrascu * [c9a4681a0] : tls_mgm: improve error reporting when loading info Print openssl's error stack when failing to load ceritificates, private keys, CAs and CRLs. 2020-12-10 Liviu Chircu * [b7bcfd310] : HEP logging: Fix a bug causing all xlog()'s to be L_ERROR Many thanks to Artiom Druz (@Shkiperon) for reporting this issue and helping with testing. Fixes #2329 Closes #2331 2020-12-10 Liviu Chircu * [2442f67f2] : Merge pull request #2339 from sippy/pr_stdatomic_strikes_back Re-introduce using stdatomics for the purposes of core stats. 2020-12-10 Maksym Sobolyev * [c9d924274] : Put back stdatomic to be used by default if compiler supports it. Keep old, non-portable atomic.h and use that as poor-man's stdatomic when it's not available. Add some wrappers to make API more like stdatomics. Auto-detect if stdatomic.h is available. 2020-12-09 Maksym Sobolyev * [a91ab9c70] : Revert "Revert "Use stdatomic.h, which is part of C standard since C11."" This reverts commit dd417cb7e84ccb704d73eaa4450f7e8795dea8bb. 2020-12-09 Maksym Sobolyev * [745fe0c0d] : Revert "Revert "Fix last reference to atomic_set() (replace with atomic_init)."" This reverts commit 670b203f2d7b4ebd6533062537167129609d08e3. 2020-12-09 Vlad Patrascu * [80eecb92f] : dialog docs: fix examples for dlg_list MI function 2020-12-09 Liviu Chircu * [cff06b07f] : atomic.h: Add a deprecation notice 2020-12-09 Liviu Chircu * [dd417cb7e] : Revert "Use stdatomic.h, which is part of C standard since C11." This reverts commit 18f4c3d9b34583c7464eba2e5ca8fe24f72e9fc9. 2020-12-09 Liviu Chircu * [670b203f2] : Revert "Fix last reference to atomic_set() (replace with atomic_init)." This reverts commit 4ed5ba188a969ab02829bbbb33bd5c87ac457b19. 2020-12-09 Liviu Chircu * [e229e18e6] : Revert "packaging: We no longer have atomic.h" This reverts commit 9dacffd696efcefe93e020adec0f25bb91aaeab7. 2020-12-09 Liviu Chircu * [b95c2ed5a] : xlog(): Remove unused function parameter 2020-12-09 Liviu Chircu * [2eda596a2] : Merge pull request #2327 from ar45/patch-2 Fixed double release of read_lock in dr_match 2020-12-09 Liviu Chircu * [50a794c18] : usrloc: Fix `matching_mode` regression in 3aae7e652d2d Commit 3aae7e652d did too many things at once, including the refactoring of CT_MATCH_NONE from -1 to 0 (along with all other enum members!), causing a mismatch of this module parameter with its documentation, and leading to failed startup checks under ul_init_globals(). Credits to @98oi98 for the report! Fixes #2337 (cherry picked from commit dc8cfe85abd7f38e476a02a47862a034c2a272ce) 2020-12-06 OpenSIPS * [f623b9e51] : Rebuild documentation 2020-12-04 Bogdan-Andrei Iancu * [28c95c134] : [presence_dfks] Migrated to the global DUMMY SIP msg support 2020-12-04 Bogdan-Andrei Iancu * [7d4db24c4] : [dialog] Migrated to the global DUMMY SIP msg support 2020-12-04 Bogdan-Andrei Iancu * [81618cf75] : [sipcapture] Migrated to the global DUMMY SIP msg support 2020-12-04 Bogdan-Andrei Iancu * [be1527355] : [event_routing] Migrated to the global DUMMY SIP msg support 2020-12-04 Bogdan-Andrei Iancu * [63107bddb] : [event_route] Migrated to the global DUMMY SIP msg support 2020-12-04 Bogdan-Andrei Iancu * [84d1bad2c] : Add proper support for dummy sip msg's The dummy sip messages are used when there is the need of running a script route, but without actually having a real SIP msg, like for event_routes, startup routes, timer routes, etc. This new support is solving two problems: * the dummy message is actually a proper/complete SIP message, with all the mandatory sip headers. This prevents crashing when "reading" something (that is expected to be there, like the callid) from this SIP message. * this is a global support, meant to be used from all the places, replacing the local implementation (from like 4 different modules/places) 2020-12-03 Vlad Patrascu * [5f965a68b] : sql_cacher: remove unused variable 2020-12-03 Nick Altmann * [fb5178da4] : Packaging: b2b_logic_xml module 2020-12-03 Bogdan-Andrei Iancu * [6f6906636] : Fixed copy paste error in module name (cherry picked from commit 0888db78a543292e9281eca437a43233497e147e) 2020-12-02 Razvan Crainea * [5e5fc98ad] : b2b_entities: parse from & to structs if they aren't This fix aims to solve a crash in case the from/to headers are not parsed (yet). We are parsing them in a different structure, to make sure it doesn't overlap with any ongoing processing of the request 2020-11-29 Aron Podrigal * [878621769] : Fixed double release of read_lock in dr_match 2020-11-29 Maksym Sobolyev * [fff57ac95] : Fix a lot of "cast increases required alignment of target data type" which is particularly bad in ARM32 (aka armhf). Straighten the code where possible, drop in (void *) to break alignment "chain" in other cases. This hopefully will make ARM32 build for core warning-free. 2020-11-29 Maksym Sobolyev * [22f8efa94] : Refactor evi_dup_shm_params() to not break platform alignment requirements by interleaving fixed-length structures with variable-lenth string buffers that those structures are referring to. This sort of works on X86, however the performance is likely to be so-so, but it would blow up on ARM and other arches with strong alignment requirements. 2020-11-29 Maksym Sobolyev * [6a072927a] : Refactor lock_set_alloc() to not trigger unaligned access warning on arm32: net/../lock_alloc.h: In function lock_set_alloc net/../lock_alloc.h:70:13: warning: cast increases required alignment of target type [-Wcast-align] This also produces cleaner code and it might be also bit faster too. 2020-11-29 Maksym Sobolyev * [3fad84723] : Recognize ARM64 (aka aarch64) in the cross-compile mode. 2020-11-29 Maksym Sobolyev * [a4b23f350] : o Add GitHub Actions CI workflow to supplement / replace TravisCI which is now in "money scavenging mode". Turns out, Actions are actually much better, flexible and faster platform. Unify core of CI jobs configuration, so we are not repeating the same code. o Add ARM32 build and bunch of Ubuntu-20 builds on Actions now that we can. o Add missing libmaxminddb-dev package to be installed. 2020-11-29 OpenSIPS * [99a5e77d2] : Rebuild documentation 2020-11-27 Vlad Patrascu * [2ad1e1590] : sql_cacher: abort startup if DB connections/queries tests fail 2020-11-27 Vlad Patrascu * [2f3ee99c6] : Fix crash when calling script functions with omitted optional params The crash would happen if the script function is exported with the CMD_PARAM_FIX_NULL flag and does not actually change the parameter value. Currently, only forward() uses the flag in this manner and is the only function affected by this crash. (cherry picked from commit 278c1646451ab75196e0440c15047d25a7b4b2f4) 2020-11-26 Vlad Patrascu * [b82b85b6a] : cachedb_redis: add TLS support Closes #2264 2020-11-26 Vlad Patrascu * [4d672aeb8] : cachedb: allow empty database name in URLs 2020-11-26 Vlad Patrascu * [4db941316] : Fix detection of forward() usage when called without parameter This would cause stateless replies to no be forwared even though the forward function was used. (cherry picked from commit 8aab9f2218a083dc43bc7a7e282e26e63d3beee3) 2020-11-25 Răzvan Crainea * [75cfd7e0a] : Merge pull request #2309 from sippy/pr_rtpproxy_tcp46 Add TCP and TCPv6 communication modes for RTPProxy control sockets. 2020-11-25 Bogdan-Andrei Iancu * [cff27be9c] : [tm] Added ways to control the branches to be waited In order to cotrol for how many branches you want to wait to be injected, we have now: * you can pass to t_wait_for_new_branches(), as optional param, the max no of branches to wait * in t_inject_branch() you can pass the "l" flag to instruct that this is the last injected branch, not more further waiting Closes #1811 2020-11-25 Liviu Chircu * [971431a41] : cfgutils: Add support for dynamic shared vars ($shv) OpenSIPS script developers now have the ability to use dynamic names for the $shv variables (e.g. "$shv($avp(customer_id))"), rather than be constrained to work with the statically-named $shv variables defined throughout the script. Moreover, shared variables may now be dynamically created and read via the well-known MI commands: "shv_set" and "shv_get". Closes #2140 2020-11-25 Liviu Chircu * [0ed7a0ace] : Add the `$route` variable (current route call stack) The new $route variable offers access to the current route call stack. Assuming a call stack of "route > route[FOO] > route[BAR]", we have: Positive indexing: * $route == $(route[0]) == "route[BAR]" * $(route[1]) == "route[FOO]" * $(route[2]) == "route" * $(route[3]) == "" Negative indexing: * $(route[-1]) == "route" * $(route[-2]) == "route[FOO]" * $(route[-3]) == "route[BAR]" * $(route[-4]) == "" Full printing: * $(route[*]) == "route > route[FOO] > route[BAR]" Closes #1963 2020-11-25 Liviu Chircu * [7790bf929] : Merge pull request #2301 from sippy/pr_fastlock_merge Fix MIPS64, add MIPS64 cross-build for travis, merge updates into fastlocks.h 2020-11-24 Vlad Patrascu * [85a484eab] : tm: simplify the fix in commit 82b8d20 Just unref the transactions and avoid the extra checks done by do_t_cleanup(). (cherry picked from commit e8a7cadd7e265f71d13c11682043814dbdd8caf6) 2020-11-24 Liviu Chircu * [5f8361179] : Missing route on startup: Lower severity from ALERT to ERROR 2020-11-23 Razvan Crainea * [e02a5563f] : add support for generic hash table 2020-11-23 Peter Lemenkov * [65bdd61ca] : tm/async: Handle ASYNC_DONE_CLOSE_FD when switching to sync One more place where we have to close file descriptor according to the specification while doing async packet processing. 2020-11-22 OpenSIPS * [711bbd72d] : Rebuild documentation 2020-11-20 Vlad Patrascu * [d48008a5b] : tm: fix transaction leakage when receiving replicated CANCELs (cherry picked from commit 82b8d20f20914654938630e59edd0ca29e4e9e36) 2020-11-20 Vlad Patrascu * [7112cf4eb] : tm: fix crash when receiving replicated CANCELs This commit fixes a crash on replicated CANCELs when doing pre-RFC3261 transaction matching. (cherry picked from commit 15d1d612077b0311aed179972afa199f38e74e00) 2020-11-20 Vlad Patrascu * [1ca7ca8c0] : db_mysql: fix doc example for use_tls modparam 2020-11-20 Vlad Patrascu * [29db5674f] : cachedb_local: fix outdated docs for cache_remove_chunk MI cmd 2020-11-19 Maksym Sobolyev * [323896a65] : Add MIPS64 cross-build. 2020-11-19 Maksym Sobolyev * [6924b5b5d] : Reduce diff to a83e261254. Merge few more ARM/Sparc fixes from the d3da8467113. 2020-11-19 Andrei Pelinescu-Onciul * [30329f67b] : - moved sched_yield() wrapper into sched_yield.h at Miklos's request. 2020-11-19 Maksym Sobolyev * [d986daa83] : Small arm optimization from the d3da8467113. 2020-11-19 Andrei Pelinescu-Onciul * [6871464c4] : - ppc fixes (s/stw/stwx/, s/lwz/lwzx) - missing early clobbers added for x86, sparc*, armv6, ppc*, alpha 2020-11-19 Andrei Pelinescu-Onciul * [7ad38e5cb] : - x86/x86_64 lock optimizations: spinning on a lock should be friendlier now for the other cpus caches (at the extra cost of a cmp mem + jump) ; tried to arrange a little better the instructions to allow for some parallel execution. - x86 unlocks with xchg by default (since some x86s reorder stores, so a simple mov is unsafe) 2020-11-19 Andrei Pelinescu-Onciul * [722fd2bd6] : - fastlock: minor fixes 2020-11-19 Andrei Pelinescu-Onciul * [c84bee61a] : - support for mips cpu which don't implement full mips isa2, but do support ll and sc 2020-11-19 Andrei Pelinescu-Onciul * [498dd2af8] : - mips inline asm gcc 3.x warnings fixed - mips2 NOSMP mode (skip sync) - minor x86 & mips optimizations 2020-11-19 Vlad Patrascu * [8b8ac4f89] : tm: support interface tags for local socket when replicating (cherry picked from commit 1dbea20409ac1063f62db04873ac5dad193e0638) 2020-11-19 Vlad Patrascu * [b9f013ff2] : tm: fix crash when having an anycast listener and no replication (cherry picked from commit c57d62be4101dfc41d1031ff4e583c8efa50155e) 2020-11-18 Maksym Sobolyev * [0d7a71b2f] : Add TCP and TCPv6 communication modes for control sockets. Those modes are supported on RTPProxy end since 2.0 and are getting popular recently due to Kubrenetes and Docker's networking shenanigans and peculiarities. As discussed with @razvancrainea in the scope of the PR#2309, shuffling elements of the iovec command structure might have some unintended consequences with regards to the multiple nodes / failover. As such, it ended up in rabbit hole of refactoring messaging mechanism to automatically extend user-supplied buffer with some pre/post elements. Provide sub-set of allocated vectors and expose it as "vu" member. Only send_rtpp_command() is allowed to access "vs" part. Code conversion is helped by some script and basic functionality tested here: https://travis-ci.com/github/sippy/voiptests/builds/202257620 2020-11-18 Maksym Sobolyev * [0f8bfb953] : Add file to define optional assertions. 2020-11-18 Vlad Patrascu * [d446796d2] : b2b_logic: rework the method of controlling the B2B logic This commit removes the XML scenario files in favor of native OpenSIPS scripting in order to control the B2B logic. The B2B scenarios will now be implemented mostly in dedicated b2b_logic routes, using specific script functions for actions in a B2B context. 2020-11-17 Vlad Patrascu * [7648b78d1] : Duplicate b2b_logic code to a deprecated b2b_logic_xml module 2020-11-17 Vlad Patrascu * [99479fa95] : dialog: fix dlg_list[_ctx] MI output when passing identifier params Reported by Mark on the mailing list. 2020-11-16 Ovidiu Sas * [c2cb01734] : dialog: fix -Wmaybe-uninitialized compiler warning 2020-11-15 OpenSIPS * [3b6862068] : Rebuild documentation 2020-11-13 Vlad Patrascu * [0d20cd55d] : pua_mi: fix parameter name in pua_subscribe MI command Also improve the docs for pua_subscribe by adding an usage example and proper indexing. 2020-11-13 Vlad Patrascu * [582170270] : tls: fix certificate matching when reusing connections The SSL_CTX pointers may not be equal for the same SSL pointer (connection) after the rework that changed the storage of the context to be per-process. The tls_domain saved in the SSL extra storage will now be used for matching the certificates instead. 2020-11-13 Liviu Chircu * [11750c2b9] : Merge pull request #2308 from sippy/pr_fix_atomic_set Fix last reference to atomic_set() (replace with atomic_init). 2020-11-13 Liviu Chircu * [f82d09ad5] : Merge pull request #2307 from lemenkov/no_longer_have_atomic_h packaging: We no longer have atomic.h 2020-11-13 Maksym Sobolyev * [4ed5ba188] : Fix last reference to atomic_set() (replace with atomic_init). This one got missed from the PR#2289. 2020-11-12 Peter Lemenkov * [9dacffd69] : packaging: We no longer have atomic.h This file was replaced by stdatomic.h in commit 18f4c3d9b34583c7464eba2e5ca8fe24f72e9fc9. 2020-11-12 Bogdan-Andrei Iancu * [cfcac3db3] : [tm] fix mem leak when passing a proxy to t_relay() The actual proxy structure needs to be also freed. Reported by @Sigmast-Michael Closes #2304 (cherry picked from commit 1cd5d2be2696d72192d07efa388ad1f255c92762) 2020-11-12 Bogdan-Andrei Iancu * [55c8669c0] : [event_route] fix reseting the dummy sip msg after each usage (cherry picked from commit ef5073d9da5da6880bbb5ed033642eed6a36bf7d) 2020-11-11 Liviu Chircu * [3a25c0b28] : tm: Fix transaction leakage with global onreply_route Given that the opensips.cfg execution order for replies is: 1) onreply_route (global) 2) reply_received(), i.e. "tm" module scope 2.1) onreply_route (branch) 2.2) onreply_route (transaction) ... this patch fixes some transaction leaks where if the script developer matches the current transaction within global onreply_route, e.g. with a random statement such as xlog("$T_reply_code\n"), it would cause an extra ref after a transaction matching operation would be performed yet again (??) within reply_received(), as the "tm" scope begins executing. The fix is to simply avoid transaction lookups when evaluating tm variables within the non-transactional, global SIP reply route. Credits to Bogdan-Andrei Iancu for suggesting this solution 2020-11-10 Liviu Chircu * [fccb5bfdf] : mid_registrar_save(): Fix shm memleak with no t_relay() Since mid_registrar_save() is stateful by definition, it needs the SIP transaction to properly function, so always forcing its creation if the REGISTER is about to be forwarded is not that significant of a change, if any at all. Thus, this patch fixes a SHM memleak on the following type of logic: mid_registrar_save(); # script terminates without having created the transaction, # so mid_registrar's "prepped" data does not get freed on T deletion exit; (cherry picked from commit b14a7eaff60b719c8b80af4f8bfdffe2bc7e995b) 2020-11-09 Vlad Patrascu * [dd237c001] : b2b_entities: fix restoring of DB persisted server entities Server entities restored from DB would not use the original To tag due to regenerating the timestamp part of the entity key. 2020-11-09 Vlad Patrascu * [af19d5073] : b2b_entities: fix DB serialization of the entity storage The entity storage written to DB was always either a NULL value or bogus data. 2020-11-09 Liviu Chircu * [1a231008a] : dialplan: Fix MI 'dp_translate' with 3 parameters 'partition' should be last, not first. (cherry picked from commit ac01ed5e02c5a1d96e2021df9cc5feb223041dc7) 2020-11-08 OpenSIPS * [05fc15e6e] : Rebuild documentation 2020-11-06 Liviu Chircu * [d9fba7776] : dialog docs: Fix missing quote (") in example 2020-11-06 Liviu Chircu * [0b7d4d1fa] : usrloc: Add the "req_callid" field to contact refresh events Providing the Call-ID of the pending SIP request during the Push Notification event_route execution gives the ability to load the dialog context of the pending INVITE. From here onwards, data can be freely passed between the two execution contexts and included in the Push Notification body (e.g.: caller ID, callee number, dialog Call-ID, etc.) Credits to Răzvan Crainea for suggesting this concept 2020-11-06 Liviu Chircu * [0d88fa909] : usrloc: Re-structure contact events; Remove useless globals 2020-11-06 Liviu Chircu * [e78f0d05e] : SIP PN Support: Change harmless log to DEBUG Empty (non-set) EVI parameters are possible and should be ignored. 2020-11-06 Liviu Chircu * [9943f5965] : EVI: Small optimization 2020-11-06 Maksym Sobolyev * [ad9db9067] : Split out signal handling routines and shutdown-related routines out of giantic main.c TU to make it more manageable. 2020-11-06 Maksym Sobolyev * [fac187f72] : Convert global str parameters into str * const. This allows globals.h to be used without str.h. 2020-11-06 Maksym Sobolyev * [d68757ed5] : Split out globals from main into a separate file. No functional changes at this point. 2020-11-05 Liviu Chircu * [1f3e56fbf] : default opensips.cfg: Explicitly set the "xlog_level" It is easy to forget about or be completely unaware of this recently introduced setting (spring 2019), then start troubleshooting why some of your xlog() statements are not working. 2020-11-05 Razvan Crainea * [699832c98] : dialog: enhance errors when dlg cannot be inserted in db 2020-11-05 Razvan Crainea * [6330ba656] : dialog: lower info when dialog not found in profile When calling unset_dlg_profile() for a dialog that is not in that profile, or there's no matching value, warn (instead of error) and add the name of the affected profile. 2020-11-05 Razvan Crainea * [52e6c425b] : dialog: update contact & SDPs for replicated updates 2020-11-05 Liviu Chircu * [e21e31ce7] : dialplan: Fix broken MI 'dp_show_partition' cmd and output 2020-11-05 Liviu Chircu * [a67b74d4e] : dialplan: Fix startup with a single, non-default partition 2020-11-04 Liviu Chircu * [5b868337e] : acc: Fix prepared statements for the missed/acc tables Commit 4bc134fe3b introduced a regression where the reused PS for the "missed_calls" table (9 fields) would no longer match the PS for the "acc" table (11 fields). By reusing the former PS array, which is shorter than required, the code would segfault. Example scenario: * simple call from A -> B with: * do_accounting("db", "missed|failed") * call failure (e.g. 408 Request Timeout) * code crashes as soon as the "failed" acc entry is written Many thanks to Nexphone for sponsoring this fix 2020-11-03 Liviu Chircu * [79a55786e] : registrars: Re-link the .so file after a lib/reg change Before this commit, the registrars were not getting rebuilt after making changes in the lib/reg source code. 2020-11-03 Liviu Chircu * [55eae8f4d] : SIP PN support: Add detection for pn-* params with no value This is a client-side error condition and the server must reply with "400 Bad Request". 2020-11-02 Liviu Chircu * [7ad6af074] : usrloc: Improve E_UL_CONTACT_REFRESH docs This event will not be raised for non-RFC 8599 contacts. 2020-11-02 Liviu Chircu * [4207074de] : RFC 5445 (time rec): Fix BYDAY + YEARLY frequency 2020-11-01 OpenSIPS * [e1381357c] : Rebuild documentation 2020-10-31 Liviu Chircu * [4942bfca4] : RFC 5445 time rec: Fix several "byxxx" bugs * fix incorrect quick-exit returning always "true" even though there are "byxxx" rules within the recurrence which restrict the matching * BYMONTH, BYWEEKNO, BYYEARDAY: - accept 1-indexed input instead of 0-indexed (per RFC 5445) * BYDAY: - fix off-by-one bugs and inaccurate logic 2020-10-30 Liviu Chircu * [e64006eec] : time_rec.c: Remove superflous checks 2020-10-30 Liviu Chircu * [6f4165f18] : 'max_while_loops': Bump to 10000; Improve error log 2020-10-29 Razvan Crainea * [2ea8f8681] : topo_hiding: always allocate space for DID in user When contact could not be parsed, the new Contact's prefix was not allocating bytes in buffer for storing for the dialog ID in the user part. However, the DID was appended to the prefix without any error checks, resulting in a memory corruption. This commit always allocates spaces for storing the Dialog ID, even if the contact could not be parsed. This fixes all uses of the topology_hiding() function with the `D` flag. Thanks a lot Sergei Lavrov (@ccppprogrammer) for reporting this in ticket #2285 and for offering information for figure it out. Close #2285 2020-10-28 Razvan Crainea * [f4ef3cc45] : proto_smpp: escape from and to users Reported by Johan De Clercq (@johandeclercqdemocon) in #2085 2020-10-28 Razvan Crainea * [87e17276a] : event_rabbitmq: cleanup connection after creating the socket Reported by @ycxwoo in ticket #2230 2020-10-28 Razvan Crainea * [32f739b0d] : tls_mgm: log error when SSL_new() fails 2020-10-26 Liviu Chircu * [b0b825b09] : registrar: Fix possible crash with save("o") flag Similar problem as in b3bdf7ce29d 2020-10-25 Liviu Chircu * [dacfef760] : dispatcher: Fix doc build 2020-10-23 Razvan Crainea * [aba6edf24] : tracer: ignore trace_on flag for dynamic entries Thanks go to Alexey Vasilyev (@vasilevalex) for reporting this. Fixes #2240 2020-10-22 Liviu Chircu * [33d4743e5] : check_time_rec(): Also set the tz during matching, not just parsing 2020-10-21 Liviu Chircu * [0e430d803] : Merge pull request #2289 from sippy/pr_travis_bionic Expand Travis setup, add 10 more build variants. Fix many issues. 2020-10-21 Liviu Chircu * [cdcac5bb3] : Merge pull request #2286 from sippy/pr_misclibs Add ability to build various static supporting libraries to contain code that is shared between several modules. 2020-10-21 rance * [dff186948] : Fix Memory leak in Freeswitch ESL module. (cherry picked from commit 294e8c489c22fce345450e0441dfbc5a79205d94) 2020-10-17 Maksym Sobolyev * [74bf0bcdf] : If CC_NAME is set to gcc, CC could be anything, like gcc-X. 2020-10-17 Maksym Sobolyev * [ba4282354] : Make definitions of the ST_CHECK_PATTERN, END_CHECK_PATTERN1 and END_CHECK_PATTERN2 independent of sizeof(long). 2020-10-17 Maksym Sobolyev * [bd7aca676] : Treat both clang and gcc the same for the purpose of figuring out CC_ARCH. Also use -m32 when linking on i386 with clang. 2020-10-17 Maksym Sobolyev * [27634ffef] : Use int, not char, which could be either signed or unsigned. 2020-10-17 Maksym Sobolyev * [08617f262] : Avoid warning on ARM64 when compiled with Clang 7: rest_methods.c:575:21: error: result of comparison of constant -3 with expression of type 'char' is always true [-Werror,-Wtautological-constant-out-of-range-compare] 2020-10-17 Maksym Sobolyev * [7330ce09f] : Fix warning compiling with Clang 7 on ARM64: prefix_tree.c:158:8: error: result of comparison of constant -1 with expression of type 'char' is always true [-Werror,-Wtautological-constant-out-of-range-compare] 2020-10-17 Maksym Sobolyev * [2f18d8a76] : Fix logic error picked up by Cang 10: b2b_logic.c:1789:14: error: overlapping comparisons always evaluate to false [-Werror,-Wtautological-overlap-compare] 2020-10-17 Maksym Sobolyev * [42f6c3601] : Fix another instance of the implicit conversion from 'int' to 'float' Clang 10 warning. 2020-10-17 Maksym Sobolyev * [541d832c6] : Fix Clang 9 warning: http_fnc.c:679:22: error: adding 'int' to a string does not append to the string 2020-10-17 Maksym Sobolyev * [cb2ba2ad8] : Make identation consistent to not upset Clang 10: parser/parse_privacy.c:161:2: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] 2020-10-17 Maksym Sobolyev * [c20bb225a] : Fix printf-style formats to match argument when building on 32-bit arches. 2020-10-17 Maksym Sobolyev * [18f4c3d9b] : Use stdatomic.h, which is part of C standard since C11. 2020-10-17 Maksym Sobolyev * [736163f0e] : Fix warning converting from int to float with Clang 10: resolve.c:1454:34: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-int-float-conversion] 2020-10-17 Maksym Sobolyev * [b7dcc4aa9] : Switch to bionic (aka Ubuntu 18) as main test vehicle and add bunch of extra jobs: o Build with GCC 7 @ Ubuntu 18; o Build with GCC 9 @ Ubuntu 18; o Build with GCC 10 @ Ubuntu 18; o Build with Clang 7 @ Ubuntu 18; o Build with Clang 9 @ Ubuntu 18; o Build with Clang 10 @ Ubuntu 18; o Build with GCC 7 @ Ubuntu 18 (ARM); o Build with Clang 7 @ Ubuntu 18 (ARM); o Build Core with GCC 7 @ Ubuntu 18 (i386); o Build Core with Clang 7 @ Ubuntu 18 (i386). Fix Travis warnings: o GC sudo, fixes "root: deprecated key sudo (The key `sudo` has no effect anymore.)"; o add dist into global; o add os. 2020-10-15 Razvan Crainea * [0e5377c64] : drouting: fix printing gw list for dr_number_routing Thanks go to Kirill Galinurov for reporting it on Slack 2020-10-14 Maksym Sobolyev * [6101cf9b2] : Build / use libreg.a. 2020-10-14 Maksym Sobolyev * [956916043] : Add ability to build various static supporting libraries to contain code that is shared between several modules. Discussed with @liviuchircu & @bogdan-iancu. 2020-10-13 Razvan Crainea * [25e55f10c] : packaging: fix typo in emergency module description Thank you @SB-JohnK for reporting it! Close #2263 2020-10-13 Razvan Crainea * [56e941130] : dialog: restore SDP and advertised contacts Reported by @jpyle490 on GitHub. Close #2275 2020-10-13 Liviu Chircu * [312fd3f52] : cfgutils: Fix a timezone parsing bug in expressions The timezone's "/" middle-part and the "/" (OR operator) were conflicting from the parser's PoV, and there were no tests to emphasize this issue. Credits to Bogdan-Andrei Iancu for the catch! 2020-10-13 Razvan Crainea * [c45c71411] : rtpengine: fix start and stop forwarding Credits go to Roman Kokorev for reporing and fixing in ticket #2281. Close #2281 2020-10-12 Razvan Crainea * [a66164811] : ratelimit: fix displaying pipes in rl_list This fix solves the problem where only one pipe per hash were listed by the rl_list command, resulting in missing pipes. Reported by Alain Bieuzent on users list and Robert Moss 2020-10-09 Liviu Chircu * [8ce9eb22e] : auth: Fix doc regression in d9574358d :) Although $var() variables are awesome, some module params (e.g. the "rpid_avp") really mandate an AVP and won't settle on anything else. 2020-10-09 Liviu Chircu * [e8dd676f9] : Merge pull request #2277 from sippy/pr_str_improve2 Clean up UAS auth code a bit before I dive into RFC8760 rework. 2020-10-09 Liviu Chircu * [899a89f52] : Merge pull request #2279 from sippy/pr_auth_doc_fix Improve auth module examples 2020-10-09 Maksym Sobolyev * [d9574358d] : Improve auth module examples: o Use $var(xyz) consistently. $avp's take shared resources and aren't really justified in this use case; o fix www_challenge / proxy_challenge second argument to match reality. 2020-10-09 Maksym Sobolyev * [c9e0f70e8] : Mark "text", i.e. status message argument of the build_res_buf_from_sip_req() as "const *" and propagate it into relevant functions of tm, sl and signalling modules. 2020-10-08 Liviu Chircu * [f91c13af1] : emergency: Remove bogus curl_global_cleanup() at runtime Suggested by Walter Doekes (@wdoekes) 2020-10-08 Liviu Chircu * [cfe658653] : Merge pull request #2228 from l2dy/emergency emergency: fix memory leak on error 2020-10-07 Liviu Chircu * [f235ad2e3] : usrloc is_contact_registered(): Add useful debug logs (cherry picked from commit 64c3724faa3b90918bda4c95ee716d487a3f0f1f) 2020-10-06 Maksym Sobolyev * [36e0281b7] : Extend STR_NULL and str_init() to set a type explicitly. This allows those macros to be used elsewhere in the function body, not only in variable declaration(s), i.e.: void foobar(int baz) { str localstr; if (random() == 42) { localstr = str_init(I_STR LUCKY_STR FIN_STR); } else { localstr = str_init(I_STR UNLUCKY_STR FIN_STR); } some_api(&localstr); } 2020-10-06 Maksym Sobolyev * [9dcff69df] : Clean up UAS auth code a bit before I dive into RFC8760 rework. o Get rid of the XYZ_LEN constants; o normalize parameters to not pass char * + len, pass str * instead; o add const where appropriate; o GC stale _PRINT_MD5 section, it's going to be replaced with the new code really soon; o avoid calling strlen() when the string lenth is well known. No functional changes (I hope). 2020-10-06 Liviu Chircu * [6e1c01c96] : Add a time rec expression parsing & checking API ... as a continuation of 8338276fc39. Also integrate all of this with: * drouting (added time rec expr support) * dialplan (added time rec expr support) * fraud_detection (just so it compiles) * cpl_c (just so it compiles) 2020-10-06 Liviu Chircu * [c299d1403] : check_time_rec(): Move the tz into the recurrence string This allows full control over each time recurrence's timezone, when combining multiple such recurrences into logical expressions (see the recently added multi-rec support). 2020-10-06 Bogdan Andrei IANCU * [903c24c0d] : Merge pull request #2272 from flaviogoncalves/flavio Fix in the residential script. Does not make sense to send a plus cha… 2020-10-04 Flavio E. Goncalves * [f82d3b107] : Fix in the parameters trust-address and SIP-source-address of the rtpengine 2020-10-04 Flavio E Goncalves * [fc3978d48] : Fix in the residential script. Does not make sense to send a plus character to drouting who does not support the plus in a prefix 2020-10-01 Vlad Patrascu * [466f96eeb] : cachedb_local: fix processing of replication and sync packets Fixes #2092 2020-10-01 Vlad Patrascu * [3a05dc1de] : cachedb_local: fix an ERR log when syncing from cluster 2020-10-01 Bogdan Andrei IANCU * [bd33a4e4d] : Merge pull request #2269 from sippy/unify_openssl_makefoo Unify openssl make-foo 2020-10-01 Liviu Chircu * [f97470deb] : Merge pull request #2270 from sippy/pr_fix_digest_parser Cleanup digest_parser code a bit. 2020-10-01 Liviu Chircu * [c036539f3] : Merge branch 'sippy-use_alg_t_luke' 2020-10-01 Maksym Sobolyev * [7dc3a4fb5] : Re-use alg_t from "digest/digest_parser.h" and get rid of the duplicate AUTHENTICATE_MD5 and AUTHENTICATE_MD5SESS definitions. 2020-09-30 Maksym Sobolyev * [936bb99bf] : Cleanup digest_parser code a bit: o replace another implementation of is_ws() with a is_ws call; o use str.len as the primary and the only way to see if string has zero lengh. Depending on how algorithm works, str.s might be non-NULL even if str.len == 0. 2020-09-30 Maksym Sobolyev * [dcd15129a] : Move the same openssl make-foo code that has been copied and pasted around into a central location and include it from there. 2020-09-29 Razvan Crainea * [7ba72d434] : sipcapture: fix overlapping function name the build_dummy_msg() function being used without the static identifier causes confusion for some compilers. An example is the AL2 compiler, which instead of using the module's implementation, it uses the core's one, hence resulting in broken behavior. Credit goes to @ghmj2417 (GitHub) for reporting this in ticket #2255 Close #2255 2020-09-28 Liviu Chircu * [1faf76642] : Merge pull request #2260 from sippy/fix_parse_authenticate_body Clean up parse_authenticate_body(), fix small bug. Add Unit Test. Improve OOB test. 2020-09-28 Maksym Sobolyev * [025463a90] : Move test data struct out of test function and format it a bit better. Suggested by: @liviuchircu 2020-09-28 Maksym Sobolyev * [a76e4421a] : Rename enum members: o OOB_PRE -> OOB_UNDERFLOW; o OOB_POST -> OOB_OVERFLOW. Convert repeating debug expression into a resuable macro. Suggested by: @liviuchircu 2020-09-28 Maksym Sobolyev * [7bb120612] : Merge branch 'master' of github.com:OpenSIPS/opensips into fix_parse_authenticate_body 2020-09-28 Liviu Chircu * [b8d86380b] : Merge pull request #2262 from sippy/test_freebsd_fix Few FreeBSD fixes into test system. 2020-09-28 Maksym Sobolyev * [b0612c10f] : o Don't assume bash lives in /bin; o fix arguments ordering while calling head to work correctly on non-GNU systems. 2020-09-28 Liviu Chircu * [20090c44e] : Merge pull request #2261 from sippy/fab_oob Fix empty body check in the parse_authenticate_body(). 2020-09-28 Maksym Sobolyev * [b0997b1fb] : Use body->len as the only authoritative way to check if the provided body is empty or not. 2020-09-28 Maksym Sobolyev * [92cf30bb1] : Merge remote-tracking branch 'upstream/master' into fix_parse_authenticate_body 2020-09-28 Ovidiu Sas * [a298b6779] : presence: update docs for cluster_federation_mode param - completes commit d4e82ea2beb24666201fe731b46f350708192c81 2020-09-26 Maksym Sobolyev * [080f34d3c] : Improve OOB test to provide a direction hint, so we can have a more useful debug output. 2020-09-26 Maksym Sobolyev * [382757cd2] : Add unit test for the parse_authenticate_body(). 2020-09-26 Maksym Sobolyev * [30ef0c688] : Rework parse_authenticate_body to be more clear. Fix issue always accessing body.s[0] even if the length is 0. 2020-09-25 Liviu Chircu * [6a63f35ca] : Merge pull request #2217 from egreenmachine/dev-sqlite Fix db_insert_update (upsert) in sqlite 2020-09-25 Liviu Chircu * [ad55f654e] : parse_qop_value(): Simplify trimming code 2020-09-25 Liviu Chircu * [b532509db] : Merge branch 'master_fix_parse_qop_value' of https://github.com/sippy/opensips into sippy-master_fix_parse_qop_value 2020-09-25 Liviu Chircu * [da7307796] : Merge branch 'feature/multi-time-rec' 2020-09-25 Liviu Chircu * [d4383f4c5] : cfgutils: Update check_time_rec() docs 2020-09-25 Liviu Chircu * [8338276fc] : cfgutils: Enhance check_time_rec() with multi-rec support This gives developers the ability to combine multiple time recurrences into a compact, easy-to-evaluate string expressing a complex schedule. The linking is done using the logical operators: AND ("&"), OR ("/") and NEG ("!"). Assuming A, B and C are vanilla check_time_rec() time recurrence strings, here are some example expressions that now become available: A & B A / B (A & B) / C A & !B !((A / B) & C) / D 2020-09-24 Liviu Chircu * [285550d0b] : cfgutils: Prepare for multi time-rec support * differentiate error codes (no match, bad input, internal error) * refactor into a validation function for a simple time rec 2020-09-24 Liviu Chircu * [dc9b295d0] : time rec support: Remove dead code * simplify "always false" if conditions * get rid of redundant (duplicate) memset() operations 2020-09-24 Liviu Chircu * [a100b7ad8] : cfgutils: Add initial test suite for multi time rec 2020-09-23 Maksym Sobolyev * [7741da5af] : o Make test_parse_qop working with the new parse_qop_value() API; o Add few more checks for error handling; o Organize the code better; o Add out-of-buffer testing API, which verifies that FUT is not accessing memory before supplied buffer or after. The API is fairly generic, so it might be used in other unit tests too. 2020-09-23 Liviu Chircu * [eb5a90062] : gflags: Allow functions to be called from any route Reported by Jeff Pyle 2020-09-22 Maksym Sobolyev * [b26026589] : Merge remote-tracking branch 'upstream/master' into master_fix_parse_qop_value 2020-09-22 Liviu Chircu * [4755826f7] : Fix gcc warning 2020-09-22 Liviu Chircu * [6757f56cd] : SIP PN Support: Add the "reason" param in E_UL_CONTACT_REFRESH This gives developers the ability to distinguish between the different types of Push Notifications (e.g. binding refresh, incoming call, etc.). 2020-09-22 Liviu Chircu * [b30ac6be3] : EVI: Improve debug logs 2020-09-21 Maksym Sobolyev * [bf3799554] : Fix parse_qop_value() to not access memory outside of the qop value region. Noticed by: liviuchircu Use is_ws(), not isspace() while I am here. 2020-09-18 Vlad Patrascu * [6ad5d4e9e] : stir_shaken: improve debug and error logs 2020-09-18 Vlad Patrascu * [14cce667e] : presence_dfks: fix dfks_set_feature doc example 2020-09-18 Liviu Chircu * [baddd32e2] : Merge pull request #2253 from sippy/master_2020 Fix a rather obscure copy-n-paste bug in the digest parser 2020-09-18 Maksym Sobolyev * [d3b071a2d] : Steal highly optimizable and smart algorithm to do LWS detection invented by the clang project. It does LWS detection in just a handful instructions and no branches, as compared to the dozen instructions and 4 branches currently. Some info on how it works here: https://pdimov.github.io/blog/2020/07/19/llvm-and-memchr/ ==== C code === int is_ws_original(char cp) { return ((cp == ' ') || (cp == '\r') || (cp == 'n') || (cp == '\t') || (cp == ',')); } int is_ws_new(unsigned char ch) { const unsigned int mask = (1 << (' ' - 1)) | (1 << ('\r' - 1)) | (1 << ('\n' - 1)) | (1 << ('\t' - 1)); ch--; return ch < ' ' && ((1 << ch) & mask); } ==== Compiled, latest clang/trunk, -O2, x86_64 ==== is_ws_original: # @is_ws_original mov eax, 1 cmp dil, 32 ja .LBB6_1 movzx ecx, dil movabs rdx, 4294976000 bt rdx, rcx jb .LBB6_4 .LBB6_1: cmp dil, 110 jne .LBB6_2 .LBB6_4: ret .LBB6_2: xor eax, eax cmp dil, 44 sete al ret is_ws_new: # @is_ws_new add dil, -1 cmp dil, 32 setb al movzx ecx, dil mov edx, -2147478784 bt edx, ecx setb cl and cl, al movzx eax, cl ret ==== 2020-09-18 Maksym Sobolyev * [659b32939] : Use is_ws() in two more places where appropriate. 2020-09-18 Maksym Sobolyev * [156460ee9] : Fix a rather obscure copy-n-paste bug in the digest parser causing "Digestn" to be accepted just as well as "Digest" would, however if the header happens to overflow to the next line right after that, i.e.: Authorization: Digest[CRLF] username="opensipit2020"... The header would fail to be parsed at LF. Use is_ws() macro here, don't reinvent a wheel. 2020-09-16 Razvan Crainea * [f17737985] : dialog: fix bug when "state" was not shown by dlg_list Commit d883a0d72a introduced a bug in the dialog module that was no longer printing the "state" node in the MI output; this commit fixes the bug. 2020-09-15 Bogdan-Andrei Iancu * [807c13b59] : [load_balancer] Fix wrong param name on MI lb_resize Correct the name of the MI lb_resize command parameter used for the new capacity of the destination Credits go to @zhanghaiming Closes #2246 (cherry picked from commit 411f456606d55c40ce98511222c8231fbb57a18d) 2020-09-15 Bogdan-Andrei Iancu * [97d074207] : [core] missing file from e1347ebe4 (cherry picked from commit 72e4b9d4f85ed5f8a745811fd47f6a2d02a6a993) 2020-09-15 Bogdan-Andrei Iancu * [3f053873f] : [core] fix limited support for transport vals in PATH The transport of the received parameter was limited to TPC/TLS/SCTP (no WS or WSS) (cherry picked from commit e1347ebe47984492f5a7d383ef00559ce41da8be) 2020-09-15 Bogdan-Andrei Iancu * [e2aa23ba8] : [core] fix building path hdr for IPv6 IPv6 addresses in path received parameter are not enclosed in brackes Credits go to @hafkensite / Jasper Hafkenscheid Closes #2247 (cherry picked from commit 58bead88852993877237984e32d4da47f01a7ba9) 2020-09-10 Vlad Patrascu * [e0704c7bf] : cJSON lib: fix double free in case of string parsing error Fixes #1977 (cherry picked from commit a53f3bd689a01c495809214823d07bfc3cab512a) 2020-09-08 Bogdan Andrei IANCU * [926d7c715] : Merge pull request #2244 from vasilevalex/cfg_parse Reset config errors counter on every config parsing 2020-09-08 Alexey Vasilyev * [6ddfe6221] : Reset config errors counter on every config parsing 2020-09-08 Ovidiu Sas * [2efaeee24] : dialog: fix/reformat some logs 2020-09-07 Liviu Chircu * [e74829d44] : nathelper: Do not crash on bad ping reply Credits to Alexey Vasilyev for the report! Fixes #2242 (cherry picked from commit fb34cbc51405d7928dac0768be4ad912f1bb0bed) 2020-09-04 Liviu Chircu * [d29d45f78] : Merge pull request #2239 from l2dy/rtpengine-signed rtpengine: fix single-bit field type 2020-09-04 Liviu Chircu * [ef7a6801c] : List new / missing contributors 2020-09-03 Liviu Chircu * [5c8f8c027] : load_balancer: Fix AB/BA deadlock in lb_start() Assuming we have resources A, B, before this patch we would have the following lock grab order on the corresponding resource locks: (see lb_data.c +743): lb_start(): A, B lb_next(): B, A This patch fixes this type of deadlock by inverting the resource AVP elements, such that both functions grab the array locks identically: lb_start(): A, B lb_next(): A, B (cherry picked from commit f4d5d31e9217b6c270f693d847fd714f019f2bb1) 2020-09-03 Zero King * [9c4f6c1c7] : rtpengine: fix single-bit field type 2020-09-02 Liviu Chircu * [3af502dc4] : Merge pull request #2229 from l2dy/parser-r Accept single \r as EOH in multipart 2020-09-02 Liviu Chircu * [7c19af348] : Merge pull request #2237 from wdoekes/wjd-fix-comment usrloc: Update doxygen comment about packing get_all_ucontacts 2020-09-02 Walter Doekes * [fc1c3ec32] : usrloc: Update doxygen comment about packing get_all_ucontacts 2020-09-02 Liviu Chircu * [4d81a7f55] : Merge pull request #2233 from wdoekes/wjd-fix-next_hop-reading-freed-mem Fix next_hop crash (seen in nathelper nh_timer) due to reading reused mem 2020-09-02 Bogdan-Andrei Iancu * [5ec53788c] : [permissions] Fixed mem leak on pattern field Closes #2197 (cherry picked from commit d6f3424d1fe71de94a545a36d0e14fbd9ecd3b3f) 2020-09-02 Vlad Pătrașcu * [234e508fd] : Merge pull request #2209 from bambyster/master A crash in stir_shaken module. 2020-09-02 Vlad Pătrașcu * [bbcace782] : Merge pull request #2212 from lemenkov/verbose_events Fix NULL values for str params in EVI API 2020-09-01 Peter Lemenkov * [b801f04c4] : evi: Str params can contain NULL values. NULL value as a str param is totally fine according to JSON specification. So let's not crash when adding str parameter with NULL value. 2020-09-01 Peter Lemenkov * [9ee8c0648] : evi: More verbose about which param caused crash When using evi interface sometimes we need to know exactly which parameter led to failure. At least we need its name and event's name. 2020-08-31 Walter Doekes * [5a6b3abe4] : Fix next_hop crash (seen in nathelper nh_timer) due to reading reused mem Problem: - get_domain_db_ucontacts (through get_domain_ucontacts) was handing out (next_hop) pointers to memory that was unused. This resulted in a crash when this memory was reused before the invalid pointer was reused. Relevant issues and commits: - #1652 [OpenSIPS crashes since of child that serves rtpproxy] - e162f5f10 [fix 1652: usrloc: make next_hop point within the shared buffer] - #1710 [nathelper next_hop off by one for usrloc path] - 0300eb1d5 [fix 1710 / revert 1652: usrloc: fix next hop compute for ...] That is: e162f5f10 fixes this exact problem in get_domain_db_ucontacts, in get_domain_mem_ucontacts and in get_domain_cdb_ucontacts (cdb_pack_ping_data). But in 0300eb1d5 it is reverted for only get_domain_db_ucontacts. This fix: - Rewrites the fix for get_domain_db_ucontacts and get_domain_cdb_ucontacts, making it less fragile/bug-prone. - Adds comments about fragility to get_domain_mem_ucontacts - Fixed unaligned memcpy that might affect non-intel CPUs: `((struct proxy_l *)cp)->name.s = next_hop_host` Bug reported and fix tested by Jasper Hafkenscheid @hafkensite (VoIPGRID). 2020-08-28 Vlad Patrascu * [488c56b4c] : tls_mgm: fix setting TLS method from DB Fixes #2226 (cherry picked from commit 1f896fa044aa8aa2f54c442bb40bb51c13f06022) 2020-08-28 Vlad Patrascu * [f597319fa] : tls_mgm: fix crash when setting an unsupported TLS method Closes #2204 Closes #2213 (cherry picked from commit 6ee7b856b7e3257d8b7451cbffe32fe7c1cada31) 2020-08-27 Liviu Chircu * [aa53fe6c7] : Merge pull request #2188 from fgast/fix-doc-clustere_list_cap Fix command in documentation for clusterer_list_cap 2020-08-27 Liviu Chircu * [968063d9f] : rtpengine: Fix docs for `extra_id_pv` Suggested by Nick Altmann 2020-08-27 Liviu Chircu * [c4c7a3e97] : .lgtm.yml: Fix libjson package name (Ubuntu, not Red Hat) 2020-08-27 Zero King * [f5d1b55aa] : Accept single \r as EOH in multipart This completes commit 3ec9d1b25430715f2b800c455c8518104a243f49. 2020-08-27 Zero King * [18f9f7873] : emergency: fix memory leak on error 2020-08-26 Razvan Crainea * [68f8f9d5c] : rtpengine: fix order of specified interface flags When both 'external' and 'internal' flags were specified, 'internal' was always assigned as iniface, and 'external' as outiface. This commit makes sure that the order they are specified in is respected. 2020-08-26 Razvan Crainea * [948c43915] : dialog: parse contact in separate structure This avoids concurrent access to the contact header's parsed structure in request messages saved in shm - addresses ticket #2095 (cherry picked from commit df68e3b191a4bc3565d9bc7bc3f6275d41921e88) 2020-08-26 Liviu Chircu * [e21beb40c] : Merge pull request #2222 from l2dy/cfg Fix tls_method typo in cfg templates 2020-08-22 Zero King * [ff17c8f0b] : Fix tls_method typo in cfg templates 2020-08-20 Liviu Chircu * [2c008cd92] : tls_mgm: Avoid creating a shared DB conn at mod_init() Many thanks to Adrien Martin (@adrien-martin) for the immense help in reporting, troubleshooting and helping close this one out. Fixes #2161 2020-08-19 Eric Green * [6f71f3f06] : sqlite - fix upsert in db_insert_update 2020-08-18 Razvan Crainea * [d447626c2] : dialog: do not update SDP on rejected INVITE/UPDATEs Reported by @nikbyte in #2177 2020-08-18 Liviu Chircu * [775b9d97d] : Rework previous commit Although the protocols listed in the @proto array "seem" to be initialized, they are still missing some essential data, which is only later provided by trans_load(), during the startup phase. (cherry picked from commit 7f5480ceb7d2b13b4aa2ed1e90f741e11b8c4876) (cherry picked from commit 7ee0bf40db428d8b8b0daf39b949b29f8c6f4cf0) 2020-08-18 Liviu Chircu * [7b3a482aa] : hep_udp listener: Fix "use_children" regression Commit 899f65c8f4 introduced a regression where "use_children" would be ignored for the HEP UDP protocol, possibly leading to extra forked workers after an OpenSIPS upgrade, failed restarts due to exceeded MySQL max connections, etc. (cherry picked from commit 2801fae6f88bd6b4c958b76ecb96c7cd7ba80d72) 2020-08-18 Razvan Crainea * [1f9b433fd] : rtpengine: handle PRACK for answer Thanks go to @nikbyte for the report. Close #2208 2020-08-18 Razvan Crainea * [4ffb3d2fe] : lgtm: fix before_index node No way to test this, we need to get this confirmed later on. Thanks go to @fgast for reporing it in #2194 2020-08-18 Liviu Chircu * [4f414366e] : fraud_detection: Fix a bug causing negative CC/CPM Following a reset of the statistics for a (user, dialed_number) pair, skip any pending subtraction operations scheduled during a previous interval (e.g. a dialog which started during fraud detection interval A and ended in interval B should not decrement CC anymore if it has already been reset to 0 in the meantime during a more recent check_fraud() call). Many thanks to Inderjeet Sharma (@inderjeetsharma) for reporting and helping track down this bug. Fixes #2079 2020-08-14 Bogdan-Andrei Iancu * [ad178c575] : [tm] run the per-branch on reply route also as ONREPLY type Closes #2201 2020-08-14 Bogdan-Andrei Iancu * [1f1414a38] : Fix optional param for forward() If missing, there is nothing to be done for the parameter. Closes #2210 (cherry picked from commit 5206467cfff481c62ad23147cca86db64d770c20) 2020-08-12 Andriy Pylypenko * [a75dd2106] : Wipe out the pointer to already destroyed data so a later error does not cause a crash. 2020-08-07 Vlad Patrascu * [1feaed465] : core: fix parameter type for cache_raw_query() Reported in #2198 (cherry picked from commit 81d079958e813f47551da39b21e9f57fc7a53c8a) 2020-08-07 Vlad Paiu * [8f702a688] : Added s.eval transformation eg. $var(format) = "limit-$si-$tU"; xlog("Expanded format is $(var(format){s.eval}) \n"); prints Expanded format is limit-127.0.0.1-vlad 2020-08-07 Vlad Patrascu * [ebd6f8b65] : tls_mgm: fix crashes with db_text and null string values Closes #2192 (cherry picked from commit 3d26747cc309d7f5c461e3be49fb30db78bc3591) 2020-08-06 Bogdan-Andrei Iancu * [b5bcf0463] : Supply a processing context to error route. When the error is triggered outside the context of another route, be sure it also have a processing context Closes #2187 (cherry picked from commit d17d0ed6cd36dd358c9260eb091ef2002198737d) (cherry picked from commit a69377484018f194836b2aa2633238f52cbaa4d1) 2020-08-05 Răzvan Crainea * [94cec7540] : Merge pull request #2193 from fgast/httpd_https Add TLS support to module/httpd 2020-08-04 Liviu Chircu * [689531e6f] : drouting: Do not start with NULL DB connections Force all DB connection objects to be created right from the start, otherwise strange, hard to diagnose errors may _occasionally_ pop up during runtime: ERROR:core:db_use_table: invalid parameter value (nil), 0x7ff31329a108 ERROR:drouting:dr_state_flusher: cannot select table "dr_gateways" ... or: INFO:drouting:dr_reload_cmd: dr_reload MI command received! CRITICAL:core:db_table_version: invalid parameter value ERROR:core:db_check_table_version: querying version for table dr_gateways CRITICAL:drouting:dr_reload_data_head: failed to load routing info CRITICAL:drouting:dr_reload_cmd: Failed to load data head (cherry picked from commit 8a9a396d4d1a7025a1fe93d564f1ebe5150961b4) (cherry picked from commit e2e989ddb851b98ef1419c146d857ab7da1b4800) (cherry picked from commit c10248b88b3f227e0f6dd40fd7ec4f643824ab33) 2020-08-03 Liviu Chircu * [4dba11213] : fraud_detection: Fix misleading 'show_fraud_stats' docs * the 'fraud_profile' MI command parameter is both invalid and not at all required by the current code * document the "stale statistics" limitation of this function 2020-08-03 Liviu Chircu * [2404b96c8] : fraud_detection: Improve accuracy for 'concurrent calls' Avoid using the DLGCB_FAILED callback, since it has no protection against the "408 Request Timeout / 200 OK" race condition, and simply use DLGCB_DESTROY in order to decrement the concurrent calls counter. This fixes a bug where a "408 Timeout / 200 OK" call would cause a concurrent calls value of 4294967295, due to an extra decrement. Fixes #2079 2020-08-03 Fabian Gast * [adfa0d63a] : Add TLS support to module/httpd 2020-08-03 Razvan Crainea * [724a3cbf1] : presence: reset delete prepare statement when delete not performed 2020-07-31 Liviu Chircu * [5ba1e90cf] : SIP PN Support: Start OpenSIPS with PURR + topology hiding pn_process_purr() has yet to be extensively tested with topology_hiding(), but it should work in theory, at least! (cherry picked from commit 6f26ea1e70299b7939de0807252f15d026a95127) 2020-07-30 Liviu Chircu * [c1464a1c7] : fraud_detection: Add the possibility to disable stats A (0) value for any of the fraud detection thresholds now means: "ignore this threshold", instead of: "raise an event on each call for this threshold?!". Although (0) values could, in theory, have been useful for event generation testing purposes before this patch, this is a small price to pay in order to gain the ability to disable a stat. Developers can now add 1 more CPS and still keep testing with a new (1) value :) Although the DB schema changes slightly, due to the added "DEFAULT 0", it is fully backwards-compatible with the previous one, except fraud_detection row INSERTs will now be more quiet, generating no more warnings from the backend (e.g. "Column does not have a default value..." -> but still defaults to 0, thanks to non-strict mode, leading to strange warnings from the module). Fixes #890 (cherry picked from commit 214f105ae52593bd53aef83f4426e1bbb0a09666) 2020-07-30 Vlad Patrascu * [a9e78b446] : stir_shaken: complete fix in commit 3bf2b98 2020-07-30 Liviu Chircu * [f9fd982be] : userblacklist: Be compatible with db_cachedb over MongoDB Issue reported by Ryan Embgrets 2020-07-29 Vlad Patrascu * [3bf2b9890] : stir_shaken: fix compilation with openssl < 1.1.1 2020-07-29 Fabian Gast * [7a0f5991d] : Fix command in documentation for clusterer_list_cap 2020-07-29 Vlad Patrascu * [294926bc6] : Cleanup null "id" from doc examples for evi transport modules 2020-07-29 Vlad Patrascu * [8e4a47790] : event_rabbitmq: remove unused modparam (cherry picked from commit 0734be9dc7eb11d420b00a52591d3736b7009aae) 2020-07-28 Vlad Patrascu * [c7dcc779e] : event_interface: don't include a null 'id' field in notifications The use of a NULL value for the 'id' member in a JSON-RPC notification is unncessary and also discouraged by the specification. (cherry picked from commit 31dae10a8b08f1fb8148e6063f76c39a068cd416) 2020-07-28 Vlad Patrascu * [0294b2680] : event interface: fix crash when raising event with no params Reported by Mark Allen on the mailing list. (cherry picked from commit 123d9ccb1d956837cc06f8bd871cc6c40dbdad94) 2020-07-28 Bogdan-Andrei Iancu * [1da7da1c5] : [core] fix missing data type flags for $socket_in(af) Reported by @hamid-elaosta Closes #2185 2020-07-22 Razvan Crainea * [f868191cf] : dispatcher: prevent possibl uninitialized access 2020-07-22 Razvan Crainea * [d7ad0b7bd] : fix some unused values Fixes Coverity CID #40940, #40943, #40944, #40947, #40948, #211385, #211395, #211382 2020-07-22 Razvan Crainea * [859f0e025] : cpl_c: prevent possible buffer overflow Fixes Coverity CID #40882 2020-07-22 Razvan Crainea * [7e8120da1] : permissions: fix possible buffer overflow Fixes Coverity CID #40880 2020-07-22 Razvan Crainea * [108a5d4b7] : ldap: prevent possible buffer overflow Fixes Coverity CID #40879 2020-07-22 Razvan Crainea * [f38dec26f] : presence_xml: fix possible buffer overflow Fixes Coverity CID #40877 2020-07-22 Razvan Crainea * [5a094bfeb] : carrieroute: fix possible buffer overflow Fixes Coverity CID #40876 2020-07-21 Liviu Chircu * [c13786c43] : Expression evaluator: Improve code performance * evaluate comparisons against network addresses (NET_ST) last, since they are rarer than string / int comparisons * use switch instead of if/else if/else if * speed up comp_s2s() code 2020-07-21 Liviu Chircu * [7d0df27a4] : ut.h: Fix str_casematch() implementation Since str's have a known length, we should not stop the iteration at '\0'. 2020-07-21 Razvan Crainea * [aaf99dc6b] : add lgtm file 2020-07-21 Razvan Crainea * [44a4b5a24] : statistics: rework internal functions to use str instead of char * 2020-07-21 Razvan Crainea * [33dc0320a] : time_rec: use safe localtime_r function instead of localtime 2020-07-21 Razvan Crainea * [804c9a049] : tm: use msg_flags to indicate message is replicated 2020-07-21 Razvan Crainea * [06f729706] : rtpengine: fix late negociation detection of rtpengine_manage() When a reply is received, do not look into the request if it has body, since that could lead to headers parsing in pkg - that might leak. Thanks go to @bogdan-iancu for spotting the issue 2020-07-21 Razvan Crainea * [d0641318f] : rtpengine: fix offer vs answer detection for replies When late negociation is not used, rtpengine_manage() should send an answer command, not an offer one. 2020-07-20 Razvan Crainea * [8d3bab520] : cgrates: fix useless null check Fixes Coverity CID #200007 and #200082 2020-07-20 Razvan Crainea * [888a135c3] : tracer: fix possible null dereference Fixes Coverity CID #199929 and #200006 2020-07-20 Razvan Crainea * [44d14d6e1] : tracer: proper distinction between types and flags/scope Fixes coverity CID #199984 2020-07-20 Razvan Crainea * [083383c4b] : db_berkeley: prevent possible overflow Fixes Coverity CID #40868 2020-07-20 Razvan Crainea * [6a73b79fe] : drouting: remove useles code Fixes Coverity CID #199955 2020-07-20 Razvan Crainea * [507cffda1] : mi_fifo: fix concatenated commands Fixes Coverity CID #199915 2020-07-20 Razvan Crainea * [8e0d3981e] : presence: fix passing large structure Fixes Coverity CID #40791 2020-07-20 Bogdan-Andrei Iancu * [3b6d0de16] : [load_balancer] Spelling over log messages 2020-07-18 Vlad Patrascu * [182ceb0ca] : dialog: don't allow RE-INVITE and OPTIONS pinging at the same time Enabling both RE-INVITE and OPTIONS pinging for the same endpoint causes issues with the CSEQ value in: * ACK (incremented value compared to the corresponding INVITE) * INVITE and OPTIONS (decreasing values between the requests), in case races occur between computing the new CSEQ values and sending the messages. 2020-07-17 Liviu Chircu * [1b4fcc06a] : tracer: Fix possible crash on NULL context CID #200069 2020-07-17 Liviu Chircu * [374fde456] : rest_client: Mask Coverity false positive It is fine to push a stack pointer into libcurl during a sync transfer, since the control flow never leaves the original function before it is completely done with the library. CID #200078 2020-07-17 Liviu Chircu * [82dfe4c40] : tracer: Fix unchecked return codes CID #200092, #200088 2020-07-17 Liviu Chircu * [58fa56c6e] : registrar: Fix possible crash with no Contact CID #211379 2020-07-16 Vlad Patrascu * [e7ba58543] : rabbitmq: fix crash in case of bad parameter for rmq_publish Fixes Coverity CID #199894 2020-07-16 Vlad Patrascu * [1319c4722] : lua: remove an useless null check Fixes Coverity CID # 199899 2020-07-16 Vlad Patrascu * [dca4868a0] : rabbitmq_consumer: suppress coverity warning Fixes Coverity CID #199947 2020-07-16 Vlad Paiu * [67ce5cab1] : Fix excluding vendors with no price Closes #2169 2020-07-15 Vlad Patrascu * [9bac91d55] : tm: fix bad string in the MI output of t_uac_dlg Fixes Coverity CID #199965, #199943 2020-07-15 Vlad Patrascu * [4a18ce89c] : tls_mgm: set the TLS session id context with the proper length Fixes Coverity CID #207904 2020-07-15 Bogdan-Andrei Iancu * [d4abd53b2] : [presence] fix ugly copy-paste error in MI output Reported by coverity CID 200057 2020-07-15 Bogdan-Andrei Iancu * [b1d796344] : [nathelper] Proper testing upon extracting hash value Be sure it is valid hexa and it it within the correct range. The lack of these tests may open the gate for some nasty exploits. Reported by coverity CID 199958 2020-07-15 Bogdan-Andrei Iancu * [249b80741] : [nathelper] Fix bad test on resolving flag name get_flag_id_by_name() may also return other negative codes than -1 Reported by coverity CID 200026, 200005, 199906 2020-07-15 Bogdan-Andrei Iancu * [e001abe34] : [pua_dialoginfo] Fix condition on empty "callee" string 2020-07-15 Bogdan-Andrei Iancu * [ab7d44309] : [drouting] removed useless code Makes no sense to select the table at db_con init time, as various queries (from various modules) may set and use different tables. Related to coverity report CID 58405 2020-07-15 Bogdan-Andrei Iancu * [11e63b359] : [presence] Proper testing for the return code of get_body() Reported by coverity CID 207911 2020-07-15 Bogdan-Andrei Iancu * [f3530c10a] : [pua_dialoginfo] Fix bad test on resolving flag name get_flag_id_by_name() may also return other negative codes than -1 Reported by coverity CID 207914 2020-07-15 Vlad Patrascu * [596c572da] : event_flatstore: prevent NULL deref in case of bogus param Fixes Coverity CID #207918 2020-07-15 Bogdan-Andrei Iancu * [c489f462d] : [core] proper checking on return code for getsockname() Reported by coverity CID 200064 2020-07-15 Vlad Patrascu * [44abb30bb] : tls_mgm: fix uninitialized variable Fixes Coverity CID #199976 2020-07-15 Razvan Crainea * [a682789d5] : rtpproxy: ignore unknown payload type media streams Thanks go to @wangduanduan for reporting and providing troubleshoot info 2020-07-15 Bogdan-Andrei Iancu * [b0135bb01] : [drouting] Avoid handling a NULL 'gw' upon bogus function call Reported by coverity CID 211365 2020-07-15 Vlad Patrascu * [3112b5942] : xml: properly handle oom when extending $xml result buffer Fixes Coverity CID #200068 2020-07-15 Bogdan-Andrei Iancu * [3b20c9db0] : [registrar] Proper init of delete_nh_he variable The logic may end up to free_hostent(delete_nh_he) without actually using the delete_nh_he, leading to freeing so random pointers. Reported by coverity CID 199942 2020-07-15 Razvan Crainea * [a094bbc34] : pua_dialoginfo: always parse callid Fixes coverity CID #199930 2020-07-15 Razvan Crainea * [24aea8e63] : pua_xmpp: release memory in case of error Fixes Coverity CID #199967 2020-07-15 Razvan Crainea * [b805adcc8] : rls: release memory in case of error Fixes Coverity CID #199983 2020-07-15 Bogdan-Andrei Iancu * [259e6f3a3] : [core] Fix printing the async cmd name in error log Reported by coverity CID 199935 2020-07-15 Bogdan-Andrei Iancu * [e43b6e52e] : [core] do not use LM_xxx if log_level is NULL This may never happen, but as LM_xxx is testing the log_level value, it is not wise to use it to report that log_level is NULL Reported by coverity CID 207925 2020-07-15 Bogdan-Andrei Iancu * [f564faa0d] : [core] log error if add_alias() fails Reported by coverity CID 211363 2020-07-15 Bogdan-Andrei Iancu * [86158c895] : [call_center] Fix ETA when no agents are logged Reported by coverity CID 211393 2020-07-15 Bogdan-Andrei Iancu * [0d6f7beb9] : [presence] use the right event type. Use the event type corresponding to the handled presentity. Reported by covrity in CID 199919. 2020-07-11 Liviu Chircu * [673cf7f9e] : db_text: Complete 65b18091 2020-07-10 Razvan Crainea * [65b180914] : db: merge db_is_neq_type() in db_ut Fix coverity CID #40717, #40718, #40719, #40720, #40721, #40722 2020-07-10 Razvan Crainea * [87a1f31d2] : fix more switch fall through Coverity CID #199932, #199927, #164020, #164013, #150486, #58380, #58379, #58375, #58374, #40705, #40700, #40701 2020-07-10 Razvan Crainea * [c447ea337] : db_text: complete coverity CID #200093 2020-07-10 Razvan Crainea * [4d5465e57] : b2b_logic: fix coverity errors Fixes CID #200000, #211411, #211412, #211413, #211414, #211362, #40885, #40835, #40827, #40826, #40825, #40703, #40704 2020-07-10 Razvan Crainea * [6169e1b7f] : proto_tls: make sure we have destination to connect to Fixes Coverity CID #58361 2020-07-10 Razvan Crainea * [58df2d1f4] : proto_wss: add fall through indication Fixes Coverity CID #58373 2020-07-10 Razvan Crainea * [20736cc65] : proto_hep: remove useless NULL check Fixes Coverity CID #163991 2020-07-10 Razvan Crainea * [31899c1c7] : proto_smpp: prevent NULL deref in case of bogus input Fixes coverity CID #199973 and #199931 2020-07-10 Razvan Crainea * [e22045c93] : proto_smpp: skip entries with bad IP Fixes Coverity CID #200075 2020-07-10 Razvan Crainea * [c7f72410f] : proto_ws: make sure we have destination to connect to Fixes Coverity CID #58340 2020-07-10 Razvan Crainea * [ac2329474] : fix coverity detected false positives CID #40557, #211391 2020-07-10 Razvan Crainea * [1b1dcaf3b] : proto_smpp: smpp_bind_transceiver_resp_t system id Reported by Coverity CID #199918 2020-07-10 Razvan Crainea * [6c4da323a] : db_text: fix no-op code fixes Coverity CID #200004 2020-07-10 Razvan Crainea * [4a3dbd9df] : tm: cleanup replicated cancel msg Fixes Coverity CID #200031 2020-07-10 Razvan Crainea * [ce03fc2b7] : parse_to: add fallthrough comments/indications for coverity CID #200094 2020-07-10 Razvan Crainea * [574276035] : qos: fix getting SDP 2020-07-10 Razvan Crainea * [4ad1ce959] : remove dead code Fixes Coverity CID #163971, #40603, #163958, #163961, #200036, #211354, #211370, #211394 2020-07-10 Razvan Crainea * [5fea3d3c8] : mi_html: fix improper free on error Fixes Coverity CID #200040 2020-07-10 Razvan Crainea * [395bfdc0c] : db_text: prevent buffer overflow Fixes Coverity CID #200093 2020-07-10 Razvan Crainea * [99f06ba10] : tracer: make sure vars are initialized Fixes Coverity CID #200098 2020-07-10 Razvan Crainea * [6326acd76] : dialog: correctly handle str2int return code (CID #150473) 2020-07-10 Razvan Crainea * [e68afc628] : dialog: initialize dummy value to sink CID #199944 2020-07-10 Razvan Crainea * [633822eaf] : rework some annotations to make coverity happy 2020-07-10 Razvan Crainea * [22df0da6f] : dialog: use correct dialog for sync (fix CID #40673) 2020-07-10 Razvan Crainea * [ec67fe3bf] : dialog: fix coverity CID #40494 2020-07-10 Razvan Crainea * [e3ca30ec9] : dialog: rework coverity fix CID #40640 2020-07-10 Razvan Crainea * [f02101aee] : callops: rework coverity CID #211369 2020-07-10 Razvan Crainea * [fe07e5de7] : callops: fix coverity CID #211388, #211360, #211369 2020-07-10 Razvan Crainea * [2bc8ff22b] : evi: annotate evi_param_set_int to fix Coverity Fixes several Coverity alarms 2020-07-10 Razvan Crainea * [03ad3337e] : dialog: fix coverity issues CID #40640, #40494, #199944, #211361, #211358, #150473, #40673 2020-07-10 Razvan Crainea * [c63f26200] : rtpproxy: fix coverity issues CID #207908, #207917, #150494, #40688 2020-07-10 Razvan Crainea * [306f9e20a] : rtpengine: fix some coverity warnings CID #211356 and #199981 2020-07-10 Razvan Crainea * [c8afa69cc] : callops: fix several coverity issues CID #211388, #211360, #211378, #211373, #211369 2020-07-10 Razvan Crainea * [0983847c9] : comment fall through switches Fixes Coverity #40710, #211397, #40716, #40726, #40727, #40728, #40730, #40732, #58373, #58381, #199975, #200059, #200094, #211380, #211372, #211359 2020-07-10 Razvan Crainea * [439e4d41a] : fix tcp_persistent_flag when list is not defined properly Fixes Coverity #211381 2020-07-10 Razvan Crainea * [f213a24a1] : prevent leak in case of oom Fixes Coverity #211383 2020-07-10 Liviu Chircu * [33a0d617d] : proto_udp: Supress Coverity false positive CID #200029 2020-07-10 Liviu Chircu * [0eee21199] : mi_datagram: Minor improvements * always NULL-terminate the read buffer (CID #200029). Doesn't fix any known bug, just a good practice * avoid redundant memset(65535) on each read * improve startup error log 2020-07-10 Razvan Crainea * [1f699bce5] : travis: s/4spaces/2spaces 2020-07-10 Liviu Chircu * [0230f9c90] : exec: Always NULL-terminate the read buffer CID #200052 2020-07-10 Liviu Chircu * [df2ce6d82] : drouting: Always NULL-terminate the GW buffer While this doesn't immediately fix any bug, it should make Coverity happy. CID #200062 2020-07-09 Liviu Chircu * [7f244f17a] : mpath: Fix possible buffer underrun Also attempt to mask the false positive in CID #200070. CID #211377 2020-07-09 Vlad Patrascu * [9459f5d3a] : db_mysql: fix crashes when loading module along with tls_mgm 2020-07-09 Liviu Chircu * [2e60b5022] : mid_registrar: Add paranoid safety check This extra check doesn't fix anything right now, but at least it makes Coverity happy. CID #200020 2020-07-09 Liviu Chircu * [f305fa88f] : usrloc: Remove unnecessary NULL check CID #200086 2020-07-09 Liviu Chircu * [7a638403e] : mid_registrar: Remove unnecessary check CID #199954 2020-07-09 Liviu Chircu * [39fc05ec0] : statistics macros: Avoid unsigned integer comparisons against 0 CID #199900, #199913, #199923, #199934, #199941, #199964, #199998, #200032, #200049, #200074, #200096. 2020-07-09 Liviu Chircu * [fcdd224a5] : HP_MALLOC status logging: Fix incorrect bitwise shift CID #200101 2020-07-09 Liviu Chircu * [3263b2701] : Module deps: Fix missing va_end() during error handling CID #211355 2020-07-09 Liviu Chircu * [c9753a050] : SIP PN Support: Fix a rare NULL pointer dereference This fixes a possible crash when using a non-standard list of PN-matching parameters (e.g. something different than [provider, prid, param]). CID #211368 2020-07-09 Liviu Chircu * [8cec5cbc5] : SIP PN support: Fix NULL pointer dereference Severity: high CID #211371 2020-07-09 Liviu Chircu * [a5fbad573] : SIP PN support: Fix possible NULL dereference CID #211389 2020-07-09 Liviu Chircu * [cfb4967ec] : qrouting: Avoid unnecessary NULL check CID #211396 2020-07-09 Liviu Chircu * [2a9824cdc] : freeswitch: Fix a rare memleak CID #164007 2020-07-09 Liviu Chircu * [5f03b8556] : usrloc: Fix unitialized variable CID #199971 2020-07-09 Liviu Chircu * [36a361d63] : preprocessor: Fix memleak on preprocessing failure Fixes CID #200047 2020-07-09 Liviu Chircu * [a4684d54f] : mid_registrar: Fix uninitialized variable Although the severity is low, this code path could be triggered by a bogus downstream registrar which returns a 200 OK without the Contact advertised by the mid-registrar in its REGISTER request. Fixes CID #200051 2020-07-09 Liviu Chircu * [c6682f208] : stop_expire_timer(): Fix uninitialized memory access The severity is low, however, since uninitialized integer math is still safe (from a stability PoV), with the resulting value being ignored anyway. Fixes CID #199911, #199922, #199926, #199966, #199987, #199990, #200085, #200054. 2020-07-09 Liviu Chircu * [eb018ad58] : mid_registrar: Simplify lookup() code 2020-07-09 Liviu Chircu * [96432213b] : mid_registrar: Fix uninitialized variable Fixes CID #211376 2020-07-09 Liviu Chircu * [70d2e8f10] : qrouting: Fix Coverity paranoid warning Even if the buffer can never be overflown here thanks to the CHAR(64) DB schema restriction, if the user were to change the DB schema by hand and extend the column to 65+ chars, it would crash OpenSIPS, so the warning makes some sense. Fixes CID #211387 2020-07-08 Liviu Chircu * [5df8b636a] : pua: Fix some list management bugs; Improve code * do not use strncmp() to compare "str" structs, since it may lead to false positives (e.g. strncmp("foobar", "foo", 3) == 0). Use str_match() or str_strcmp() instead. * do not read memory after pkg_free() (severity: low, since it's PKG memory, so reading "invalid" heap memory works anyway...) * simplify list_pop() and list_free() code 2020-07-08 Liviu Chircu * [6b56ca5fa] : db_text: Fix Coverity warning (bad 'switch' fallthrough) Thanks to Răzvan Crainea for the help! 2020-07-08 Liviu Chircu * [11560e35e] : Merge branch 'bugfix/db-default-url-inheritance' 2020-07-08 Liviu Chircu * [ff7b58497] : b2b entities/logic: Inherit `db_default_url` if possible If there is still no DB URL, simply start without DB support (just as before) 2020-07-08 Liviu Chircu * [990d18f79] : proto_smpp: Fix crash on startup 2020-07-08 Liviu Chircu * [24f9e7b29] : proto_smpp: Inherit DB URL from 'db_default_url' 2020-07-08 Liviu Chircu * [c8d442df6] : drouting: Improve confusing error logs 2020-07-08 Liviu Chircu * [efee34387] : dialplan: Allow re-pointing the default partition This is useful in situations where script writers do not intend to cache the default 'dialplan' table, rather only the named partitions. Example syntax: db_default_url = "mysql://opensips:opensipsrw@127.0.0.1/opensips" ... modparam("dialplan", "partition", " pstn: table_name = dialplan_pstn") modparam("dialplan", "partition", "default: pstn") 2020-07-08 Liviu Chircu * [89a618be1] : dispatcher docs: Update partition, db_url and table_name 2020-07-08 Liviu Chircu * [c7d668bad] : dispatcher: Integrate with 'db_default_url' * both 'db_url' and a partition DB URL will inherit their starting value from the 'db_default_url' global * add the option to point the default partition to a known one, in order to avoid unwanted loading of the default table. Example: modparam("dispatcher", "partition", "default: trunks") modparam("dispatcher", "partition", "trunks: db_url = ...") 2020-07-07 Liviu Chircu * [198687e17] : dispatcher: Add useful debug log 2020-07-07 Liviu Chircu * [cc2f4a8c4] : dispatcher: Fix a bug with the 'default' partition This commit allows the "default" partition to be populated just like the other ones: modparam("dispatcher", "partition", "default: db_url = mysql://opensips:opensipsrw@127.0.0.1/opensips_3_2; table_name = v1_dispatcher") 2020-07-07 Razvan Crainea * [ad472dc29] : dispatcher: add support for matching attributes in ds_is_in_list 2020-07-07 Bogdan-Andrei Iancu * [59ad9e7fd] : [dispatcher] expose attributes in local route when pinging 2020-07-07 Liviu Chircu * [180674b83] : permissions docs: Update partition, db_url and address_table 2020-07-07 Liviu Chircu * [6443ad582] : dialplan docs: Update partition, db_url and table_name 2020-07-07 Liviu Chircu * [2e8164368] : dialplan: Integrate with 'db_default_url' * DB partitions now inherit their DB URL (if not given explicitly) from 'db_url' -> 'db_default_url' * the above is similar for the 'table_name' property (inherit from the 'address_table' modparam) * rewrite the 'partitions' parser: no more coding style limitations * backwards-compatible: at least one partition must be specified (even through simply defining a global 'db_default_url') before the module can start Part of a series of patches for #2117 2020-07-07 Liviu Chircu * [657a8b53f] : dialplan MI 'dp_show_partition': Indicate client-side errors 2020-07-07 Liviu Chircu * [bb57cc1c3] : permissions: Integrate with 'db_default_url' * DB partitions now inherit their DB URL (if not given explicitly) from 'db_url' -> 'db_default_url' * the above is similar for the 'table_name' property (inherit from the 'address_table' modparam) * rewrite the 'partitions' parser: no more coding style limitations * backwards-compatible: the 'db_url' is still mandatory if you are not specifying a partition definition! This is due to the fact that the module has a non-DB based usage mode Part of a series of patches for #2117 2020-07-06 Liviu Chircu * [b4293384f] : MI JSON-RPC commands: Fix incorrect examples Many thanks to Adrian Fretwell for the report! 2020-07-06 Bogdan Andrei IANCU * [34433c1e5] : Merge pull request #2162 from lemenkov/rtpproxy_rtpengine_remove_unused rtpengine/rtpproxy: Remove unused defines (leftovers) 2020-07-05 OpenSIPS * [1c419431c] : Rebuild documentation 2020-07-02 Peter Lemenkov * [463e815cf] : rtpengine: Remove unused defines 2020-07-02 Peter Lemenkov * [681d9c41a] : rtpproxy: Remove unused defines 2020-07-02 Liviu Chircu * [8c017c2ba] : clusterer: Fix some startup corner-cases (crashes) The first extra check fixes a crash in 'db_mode = 0', if only 'neighbor_node_info' is given, so cl->current_node will be NULL. The second extra check prevents: (gdb) bt full 0 check_seed_flag (cl_list=) at node_info.c:307 1 load_db_info (dr_dbf=dr_dbf@entry=0x7f2e65996300 , db_hdl=, db_table=db_table@entry=0x7f2e65993370 , cl_list=) at node_info.c:485 2 mod_init () at clusterer_mod.c:408 Fixes #2086 (cherry picked from commit 0b609f03165ee80f525795f278128162f6418817) 2020-07-01 Liviu Chircu * [fd61a6224] : cluster sync logging: Fix incomplete "if" condition Reported by William Jin (cherry picked from commit 892c2ee4776b18e3345d0d7bfd8353dd33442487) 2020-06-30 Liviu Chircu * [dd45419d0] : check_time_rec(): Fix the timezone handling Do not adjust the UNIX timestamp to the timezone, rather keep it intact so the input times can be specified in local time, rather than UTC time. Also rewrite all bad tests (and add new ones) so the above requirements are met. 2020-06-30 Bogdan-Andrei Iancu * [61e07ad30] : Fixed potentially un-init dlg variable Thanks to Trevis for its report :) (cherry picked from commit 9de8dd193c1b948aff7d4cb6cff67a3816473ee6) 2020-06-30 Bogdan-Andrei Iancu * [7daa10d25] : Fixed uac_auth() on sequential requests in dialogs were uac_auth() was already used The fix solves the conflict between the changes over the cseq value coming from (1) dialog module, trying to increment the cseq to compensate the cseq change during INVITE auth and (2) the uac module incrementing the cseq again because of auth'ing a sequential request. The solution was to first indetify such case in uac_auth() and to use a larger delete lump (when replacing the cseq) in uac_auth(). Such a larger/wider delete lump will invalidate the lump added by the dialog module. This is a follow up on #1969 Credits to Ben Newlin for reporting and assisting with the testing (cherry picked from commit 994ab68ffccc28a8cb0cd03bc586570ad8bc5dba) 2020-06-29 Vlad Patrascu * [d60830f49] : cachedb_cassandra: fix unsupported protocol version errors This commit prevents the Cassandra driver with version >= 2.15 from throwing errors while trying to negociate the appropriate protocol version. Closes #2145 2020-06-29 Ovidiu Sas * [f4ba69bc6] : rtpproxy: improve error logs: print # iovec buffers along errno/strerror on writev failure 2020-06-29 Ovidiu Sas * [565e25ba9] : rtpproxy: fix writev error 22:Invalid argument - align code with rtpengine implementation for systems with no IOV_MAX defined 2020-06-29 Liviu Chircu * [84bea49d7] : mid_registrar: Be compatible with gcc 4.x ... it seems named initializers were not supported back then. This commit also makes the initialization more human-friendly by using the "10" value (UL_EXPIRED_TIME) instead of the opaque "0" value -- the end result is the same. Thanks to Nick Altmann and Răzvan Crainea for their help! 2020-06-27 OpenSIPS * [81fad7ccc] : Rebuild documentation 2020-06-27 Ovidiu Sas * [eda6ec3b6] : rtpengine: fix writev error 22:Invalid argument - this fix is based on a similar fix implemented in the rtpproxy module - if the # of iovec buffes is to high, concatenate last buffers and reduce the # of buffers 2020-06-27 Ovidiu Sas * [bd099afa3] : rtpengine: improve error logs: print # iovec buffers along errno/strerror on writev failure 2020-06-27 Ovidiu Sas * [b1bf482df] : rtpengine: use proper buffer iovec count when calling writev to send commands to rtpengine daemon - this went undetected for a long time probably because the last buffer had a zero iov_len ... 2020-06-27 Liviu Chircu * [05c1579cb] : Fixes #2138 - mid_reg_save() mid_registrar_save() not forwarding REGISTER in aor throttling mode after unregister when in write-back mode. (cherry picked from commit 6ee1664559e65fefb2f9cc5f59772b4997711ce0) 2020-06-26 Liviu Chircu * [765a84b29] : Code quality: Use str_match() instead of !str_strcmp() Reasons behind this change: - better performance: str_strcmp() includes lots of redundant checks and performs worse than the simplistic str_match() - safer code: although by making this change we increase the chance of a segfault (if either "a" or "b" strings are NULL), the crash will immediately indicate the coding bug and will be easy to troubleshoot. By the same argument, nobody complains that memset() or strcmp() include zero NULL checks: they don't have to! - more meaningful code: logically speaking, in most cases, the programmer simply intends to _match_ two strings, rather than to order them lexicographically... 2020-06-25 Liviu Chircu * [e05c80fef] : rr: Fix ordering issues with add_rr_param() and create_dialog() Commits bd1719dcf and c263182ee4d introduced regressions for record_route() and record_route_preset(), respectively, which caused add_rr_param() to not work anymore in the following sequence of function calls: create_dialog() with a "dlg_match_mode" != DID_NONE record_route() or record_route_preset() add_rr_param() # would not do anything, simply acting as a NOP The reason is that the "fake" lump chain which was meant to hold all add_rr_param() operations prior to an eventual record_route() call would no longer be masked after the record_route() and would continue to accumulate data from subsequent add_rr_param() calls. Since it was meant to be a "fake" chain from the beginning (maybe the user doesn't call record_route() at all!), the data would simply be lost. Many thanks to John Quick for the accurate report and instructions on how to reproduce the issue! (cherry picked from commit e3ca95ecd0b3f33b7f42f3a7eda4a6e686cb241d) 2020-06-25 Liviu Chircu * [63b2e06f6] : TLS: Refresh expired default certificates ... and also extend their lifetime from 1 year -> 10 years (cherry picked from commit 96517d4860e0a7d744f38ce496b92a5565c96574) 2020-06-24 Bogdan-Andrei Iancu * [749685c7a] : Fix test of recognizing SCTP as UDP-based protocol ...and allow per-socket/listener definition of number of workers/processes Closes #2125 2020-06-24 Liviu Chircu * [1f2c8c485] : dialog API: Clarify documentation for DLGCB_FAILED The DLGCB_FAILED callback is subject to the "200 OK" vs. "408 timeout" SIP race condition during dialog establishment and developers should use it with extra caution :) 2020-06-24 Bogdan-Andrei Iancu * [11d5f7b83] : Fix wrong type of lumps. As the eoh (Enf Of Header) is determined during the on-demand parsing, the add_lump() may wrongly lable a lump as "header" or "body" (as the add_lump() may be used before the parsing reached the EOH). So, better identify all headers asap, so the add_lump() will properly work all the time. This will not add any overhead, as in 99.9999% of the case, due the functions used in cfg, anyhow you end up parsing the whole message. Fixes #2144 This is a 100% safe fix, there are 0 chances for side effects. (cherry picked from commit 23e098f0ec465b376eccfee587ce2f648331ccbc) 2020-06-24 Bogdan-Andrei Iancu * [038717c35] : [core] Fix the access to the Q param append_branch() The qvalue holds the integer value directly into the int*. Also fixed the usage of append_branch(,"1.0") -> the Q param should be used. Closes #2151 2020-06-24 Liviu Chircu * [fcbe480f2] : acc: Remove redundant code 2020-06-23 Razvan Crainea * [a69e6ada6] : acc: fix no name tags in extra lists Before this commit, extra_fields that were having spaces after the last tag (such as: `last; ` would generate an extra field with no tag. This commit fixes this case. 2020-06-23 Bogdan-Andrei Iancu * [b2c37f74f] : Fix the building of RR param holding the dialog ID Closes #2148 2020-06-23 Razvan Crainea * [b4cd13273] : siprec: send BYE for sessions not established When a SIPREC session was started on a 183 reply, but the session was not stopped, a BYE to the SIPREC server should be sent to close the session. Thanks go to Krunal Patel for reporting this and offering the fix. Close #2136 2020-06-22 Liviu Chircu * [132600160] : dispatcher: Do not run timer routines after shutdown ... as the "partitions" list may be freed and zeroed, causing a crash. Related to #2114, see both backtraces there, in each of the timers. 2020-06-22 Liviu Chircu * [ae5d06ee0] : check_time_rec(): Fix more DAILY evaluation corner-cases Commit 96acc92f2bec wasn't entirely correct on the DAILY rule evaluation logic. This commit adds more tests and refines the implementation. 2020-06-22 Vlad Patrascu * [311042194] : rest_client: complete fix in commit f4227fa Related to #2115 2020-06-20 OpenSIPS * [22df4256f] : Rebuild documentation 2020-06-17 Vlad Patrascu * [f4227fa77] : rest_client: fix crash when loading module along with tls_mgm Closes #2115 2020-06-17 Razvan Crainea * [d105f2007] : cgrates: properly parse multiple jsons in buffer When CGRateS has issues multiple SessionSv1.GetActiveSessionIDs requests to OpenSIPS in parallel, some of them get merged in a single buffer - thus we need to treat this case by advancing the json buffer properly. Credits go to @vtzan for reporting this and for offering detailed explanations in ticket #2103. 2020-06-16 Razvan Crainea * [896be267d] : dialog: clarify usage scope of $DLG_dir Reported by @imdrpn in #2132 2020-06-16 Razvan Crainea * [84211d826] : drouting: fix mi commands examples when names are required Credits go to @kertor for reporting this Close #2141 2020-06-16 Razvan Crainea * [a41a859f4] : dialog: check advertised contract against peer's leg Full credits go to @dioris-moreno for reporting this and providing a fix in ticket #2108 2020-06-16 Razvan Crainea * [700bd7bd3] : rpm: fix crash at startup for RPM statistics Credits go to @samk-acw for reporting it Close #2122 2020-06-15 Razvan Crainea * [b150486a6] : proto_wss: proper cleanup wss connection in case of tls error When TLS domain is not found, or the SSL context cannot be created, make sure the connection does not keep an hanging `proto_data` that will be later double-freed by the cleanup routine. Credits go to Jonathan Hulme (@digipigeon) for reporting this. Close #2123 2020-06-15 Razvan Crainea * [3e862f0e3] : net/tcp: mark connections as being added in reactor This way we can "remember" to remove them from the reactor when the connection times out. Full credits go to @vitalikvoip for reporting, troubleshooting and fixing this problem. Close #2134 2020-06-15 Razvan Crainea * [bfd2bbe30] : callops: proper naming of the module 2020-06-15 Razvan Crainea * [78c3ef044] : modparam: allow both int and strings as parameters when function is used 2020-06-13 OpenSIPS * [817df752d] : Rebuild documentation 2020-06-13 Vlad Patrascu * [9f454463e] : cachedb_mongodb: complete fix in commit 298bf6b for openssl < 1.1.0 2020-06-12 Vlad Patrascu * [298bf6b31] : cachedb_mongodb: fix crashes when loading module along with tls_mgm Loading the cachedb_mongodb module causes the openssl library to be initialized in the pre-daemon process, by the mongoc library's constuctor, before tls_mgm gets the chance to do its own initialization in the attendant process. This commit overwrites the openssl functions used by the mongoc library in order to actually skip the initialization and leave it to tls_mgm. Related to #2091 (cherry picked from commit a3e87277f275d2b26a3f1472e78a07baea9de85c) 2020-06-12 Vlad Patrascu * [3cebeed77] : tls_mgm: fix a cleanup crash when failing to create a SSL_CTX (cherry picked from commit c6ac01258b61608b06ca400815e3b89302724107) 2020-06-11 Bogdan-Andrei Iancu * [1856155a6] : Fixed 3 x htons(), reducing to one :) 2020-06-11 Bogdan-Andrei Iancu * [98c397769] : Fix the src/dest info for the HEP "log" packages This fixes the way the logs are displayed in the call flow of Homer 2020-06-11 Razvan Crainea * [69223a7ec] : media_exhange: handle case where body does not exist 2020-06-11 Bogdan-Andrei Iancu * [7b36e441a] : Fixed the HEP type for the logs Credits go to @bibace Closes #2137 2020-06-11 Razvan Crainea * [e18613462] : callops: do not delete parameter if not inside R-URI 2020-06-10 Razvan Crainea * [a592d100e] : callops: always check for orig RURI when searching for param 2020-06-10 Razvan Crainea * [8cb9d0a55] : media_exchange: rework the way of generating on hold SDP 2020-06-10 Liviu Chircu * [a031a778c] : check_time_rec(): Implement MONTHLY and YEARLY rules 2020-06-10 Liviu Chircu * [96acc92f2] : check_time_rec(): Fix DAILY rules; Implement WEEKLY rules Both DAILY and WEEKLY rules now also correctly implement overlapping intervals, e.g.: 20200610T230000|20200611T070000||DAILY 2020-06-09 Liviu Chircu * [63eda69b7] : check_time_rec(): Add timezone support 2020-06-09 Bogdan-Andrei Iancu * [b0a63d96c] : Fix crash in tracing xlogs from routes without SIP msg 2020-06-05 Liviu Chircu * [128c54567] : Module dependencies: Improve debug log text Suggested by Mark Farmer 2020-06-05 Rustam Safargalin * [1cc5d62bc] : Add support for Generic Number parameter 2020-06-02 Bogdan-Andrei Iancu * [bf2023eb6] : Fixed missing column in cc_agents table defintion Credits go to @Shkiperon Closes #2130 Closes #2127 2020-05-30 OpenSIPS * [7a5080774] : Rebuild documentation 2020-05-30 Liviu Chircu * [3e83412d5] : db_perlvdb: Fix incorrect integer downcast Credits to Aaron Meriwether for spotting the bug and suggesting the fix Fixes #1952 2020-05-29 Liviu Chircu * [cd8d77143] : [mid-]registrar: Add high-level docs for the SIP PN Support 2020-05-29 Vlad Patrascu * [b3c141834] : Makefile.defs: increase version to 3.2 2020-05-27 Liviu Chircu * [20b880b56] : DB schema: Update copyright years 2020-05-27 Razvan Crainea * [ef951af14] : Add ChangeLog for 3.1 2020-05-27 Razvan Crainea * [b9e959bc6] : Modify beta tag