=========================== Release 2.4.8 ============================== 2020-06-30 Bogdan-Andrei Iancu * [9de8dd193] : Fixed potentially un-init dlg variable Thanks to Trevis for its report :) 2020-06-30 Bogdan-Andrei Iancu * [994ab68ff] : 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 2020-06-29 Vlad Patrascu * [6bc65176b] : 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 (cherry picked from commit d60830f49c9c0ac6c161b56cddbc2572c04d3c66) 2020-06-29 Ovidiu Sas * [b73d99365] : rtpproxy: improve error logs: print # iovec buffers along errno/strerror on writev failure (cherry picked from commit f4ba69bc6708e94faeefe8d008f48c0a80d66eb8) 2020-06-29 Ovidiu Sas * [f034b349f] : rtpproxy: fix writev error 22:Invalid argument - align code with rtpengine implementation for systems with no IOV_MAX defined (cherry picked from commit 565e25ba9b967bb5442d62f2ef5791c51787f078) 2020-06-29 Ovidiu Sas * [248ff5264] : 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 (cherry picked from commit eda6ec3b6260db52a8420d3a9f0cc2f82273af0f) Conflicts: modules/rtpengine/rtpengine.c 2020-06-29 Ovidiu Sas * [48adee32d] : rtpengine: improve error logs: print # iovec buffers along errno/strerror on writev failure (cherry picked from commit bd099afa394a8033f6d988f355ff0923592c8c0b) 2020-06-29 Ovidiu Sas * [7e0a86b6e] : 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 ... (cherry picked from commit b1bf482df43320cae37207bf7975215785e825ab) 2020-06-29 Liviu Chircu * [617d8c836] : 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! (cherry picked from commit 84bea49d7e4392a23526790d135fbff816081ec3) 2020-06-27 OpenSIPS * [0d832f508] : Rebuild documentation 2020-06-27 Aron Podrigal * [dc0a33472] : 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-25 Liviu Chircu * [e3ca95ecd] : 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! 2020-06-25 Liviu Chircu * [96517d486] : TLS: Refresh expired default certificates ... and also extend their lifetime from 1 year -> 10 years 2020-06-25 Liviu Chircu * [5d1ebf82b] : Fix various typos, phrases & small issues (cherry picked from commit 86f6e0c3038025bfc53243a27cb0fe76869c324e) (cherry picked from commit 55ebe7b72f5619b4dbf1ebe86585d1599ca53295) 2020-06-25 Bogdan-Andrei Iancu * [08f729ea3] : Fix wrong inheriting of Contact-Length hdr. When moving from multi part to single part, do not inherite the Ct-len hdr of the part. Fixes #1990 (cherry picked from commit 7dd1151341b8229cd30e335b246e56938551f6bd) 2020-06-25 Bogdan-Andrei Iancu * [d643cbd27] : Proper detection/skipping of EOH in multipart. Do not assume a len of 2 (not even checking the content). OpenSIPS accepts (for hdrs) a single \n or \r as EOH (cherry picked from commit 3ec9d1b25430715f2b800c455c8518104a243f49) 2020-06-24 Bogdan-Andrei Iancu * [899f65c8f] : Fix test of recognizing SCTP as UDP-based protocol ...and allow per-socket/listener definition of number of workers/processes Closes #2125 (cherry picked from commit 749685c7ab6e7baa6562f9803bc52f2fc89ea82b) 2020-06-24 Bogdan-Andrei Iancu * [6022968fa] : Delete expired subscription only with active tags In clustering setup, the DB rutine handling subsscription should delete from DB and run the del handler only if the subscription has an active sharing tag. Fixes #1848 (cherry picked from commit 929ab4d43c0ad1878d60d3ef27f2a71f905b80f0) 2020-06-24 Liviu Chircu * [91cee5b18] : 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 :) (cherry picked from commit 1f2c8c4854f9494ff7b712be3dc1eba87cba57f7) 2020-06-24 Bogdan-Andrei Iancu * [23e098f0e] : 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. 2020-06-23 Razvan Crainea * [7b728a1ce] : 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. (cherry picked from commit a69e6ada6f57989e7a3af940e75d3b99ca8bced3) 2020-06-23 Razvan Crainea * [bd49bfe9b] : 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 (cherry picked from commit b4cd132731f8e2fc0a949ea52b22952879b345ca) 2020-06-22 Bogdan-Andrei Iancu * [54e380d4b] : The main process (attendant) is no longer running the child_init() The main proc must stay free of any db connections, so it can later fork and child_init() other procs (due auto_scaling). For the modules which were keeping a DB conn open in main proc for later usage, during module destroy, the new approach is to open the conn, on the spot, in the destroy handler. Related to #2003 (cherry picked from commit 3a8f6f1375dc3e3dc8a4a786ee642d4a5fe61069) 2020-06-22 Vlad Patrascu * [66c2c4d43] : rest_client: complete fix in commit c4b84f7 Related to #2115 (cherry picked from commit 31104219475b94b864c126f42f1e5abba8e41148) 2020-06-20 OpenSIPS * [93efeed29] : Rebuild documentation 2020-06-17 Vlad Patrascu * [c4b84f7a5] : rest_client: fix crash when loading module along with tls_mgm Closes #2115 (cherry picked from commit f4227fa77a22e3439718fb9fe4b8077ea6fc659a) 2020-06-16 Razvan Crainea * [37a6b59e5] : dialog: clarify usage scope of $DLG_dir Reported by @imdrpn in #2132 (cherry picked from commit 896be267dba83b2e45d4b246a37c2de1dde5d6d1) 2020-06-15 Razvan Crainea * [f241a1909] : 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 (cherry picked from commit b150486a6944f684b238a62dc2d2dc9e307dd007) 2020-06-15 Razvan Crainea * [4b184e67b] : 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 (cherry picked from commit 3e862f0e34ab9fa7065e6132935ab7c429c730bb) 2020-06-13 OpenSIPS * [f6aa864ae] : Rebuild documentation 2020-06-13 Vlad Patrascu * [7c093df1a] : cachedb_mongodb: complete fix in commit 4dfa0ba for openssl < 1.1.0 (cherry picked from commit 9f454463e42f2148990bd5f307eeff0acecb18bb) 2020-06-12 Vlad Patrascu * [4dfa0bab8] : 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 * [e86525c2f] : tls_mgm: fix a cleanup crash when failing to create a SSL_CTX (cherry picked from commit c6ac01258b61608b06ca400815e3b89302724107) 2020-06-11 Bogdan-Andrei Iancu * [a61b0d621] : Fixed 3 x htons(), reducing to one :) (cherry picked from commit 1856155a6c2093efae7448fce80371e97eedd42a) 2020-06-11 Bogdan-Andrei Iancu * [a90bf74a4] : Fix the src/dest info for the HEP "log" packages This fixes the way the logs are displayed in the call flow of Homer (cherry picked from commit 98c39776965527a4d91c25755239369029a5e023) 2020-06-11 Bogdan-Andrei Iancu * [185870ed6] : Fixed the HEP type for the logs Credits go to @bibace Closes #2137 (cherry picked from commit 7b36e441a6314fbd54745d8084aa5cfe88c341d7) 2020-06-09 Bogdan-Andrei Iancu * [c6b5552e4] : Fix crash in tracing xlogs from routes without SIP msg (cherry picked from commit b0a63d96ca16a26b3b4a623484ff2359d5533811) 2020-06-05 Liviu Chircu * [d58bf02ae] : Module dependencies: Improve debug log text Suggested by Mark Farmer (cherry picked from commit 128c545677bfa7a8bdfd27b4d4ac399937df7bc2) 2020-05-30 OpenSIPS * [f92527d13] : Rebuild documentation 2020-05-30 Liviu Chircu * [267cb1fa6] : db_perlvdb: Fix incorrect integer downcast Credits to Aaron Meriwether for spotting the bug and suggesting the fix Fixes #1952 (cherry picked from commit 3e83412d50b0d8dd5b8a0f7498fb8b66e96ef353) 2020-05-28 Nick Altmann * [3a0a8e64f] : RPM spec: don't build cachedb_mongodb for centos-8 because of removed libzstd, fix perl build deps 2020-05-26 Bogdan-Andrei Iancu * [c744fae37] : EXpire the WAIT type subscriptions also (produced by async wait_for_event()) Credits go to @liviuchircu Closes #2054 (cherry picked from commit fe9bfd9c9e17d9ec069b9b98010a151800d30d83) 2020-05-26 Bogdan-Andrei Iancu * [873246125] : Skip the disabled GWs when using route_to_gw() Closes #2072 (cherry picked from commit d0d05907099add7666e31820b4b9ecd2d4c85e7e) (cherry picked from commit a43ee8d78f8596e7f6fbf2d9fb154a879042c660) 2020-05-23 OpenSIPS * [35618da91] : Rebuild documentation 2020-05-23 OpenSIPS * [424b20711] : Rebuild documentation 2020-05-22 Liviu Chircu * [f8e19b62a] : signal_pkg_status(): Fix un-initialized pt entry detection otherwise, OpenSIPS may do a kill(-1, SIGUSR2), which terminates all processes of the current user... (sometimes this includes the entire X session :-) ) 2020-05-22 Liviu Chircu * [35501e709] : Fix compilation with non-HP_MALLOC and -DUNIT_TESTS 2020-05-17 OpenSIPS * [3580ba495] : Rebuild documentation 2020-05-13 Liviu Chircu * [1e7b0394d] : dispatcher: Fix missing "tmb" definition (cherry picked from commit afbf2871a144466a16534db8c86d7d0377077e17) Fixes #2110 (cherry picked from commit c9e61269f360de6e91fae54f8b6a92964e5f00a3) 2020-05-11 Walter Doekes * [a9b4c1927] : proto_hep: Fix HEPv3 IPv6 destination contents (send DST not SRC addr) (cherry picked from commit 7667483bbfb43017ccdfc8929ffe91a37c10c71f) 2020-05-11 Liviu Chircu * [25e471eb3] : Fix more "-fno-common" gcc warnings 2020-05-11 Liviu Chircu * [be2ab8166] : HP_MALLOC tests: Fix unused function warning 2020-05-11 Liviu Chircu * [85a9f8416] : make: Prepare for upcoming gcc 10 (use -fno-common) Per https://gcc.gnu.org/gcc-10/porting_to.html#common, -fno-common will become a default in gcc 10, so variables defined within .h files will no longer be allowed! Thanks to Peter Lemenkov for the suggestion! (cherry picked from commit b864b2915551fc25509a54eaf30df0cedbe1643f) 2020-05-11 Peter Lemenkov * [00435eedd] : rtpengine: Remove unused struct fields These two fields were copied directly from rtpproxy module but never used by this module. (cherry picked from commit fd8262cee78a67e1dcca7f487f919239d0f13f33) 2020-05-11 Peter Lemenkov * [488ee61e4] : Fix building with gcc 10 GCC 10 started to use -no-common by default. Here is an official explanation: * https://gcc.gnu.org/gcc-10/porting_to.html#common We have to mark all the declarations of global variables with extern keyword and put the definitions into a proper file. (cherry picked from commit 7b59ee14e95ea3500dd8c3368b081404b9731c9b) 2020-05-11 Peter Lemenkov * [86a5ad16e] : Add missing typedef keyword Without this keyword these struct definitions are considered by GCC as a variable definition. This was catched because there is a more strict check about these variable definitions since GCC 10: * https://gcc.gnu.org/gcc-10/porting_to.html#common (cherry picked from commit 242903711399ccb4eafeac614129424ffddb0e1b) 2020-05-03 OpenSIPS * [3b2db9764] : Rebuild documentation 2020-04-28 Liviu Chircu * [c147d16a1] : drouting: Fix segfault during dr API reloads (fraud_detection) (cherry picked from commit 362f8ffa49f2a1070ac16f5021a81871f568f4af) 2020-04-27 Liviu Chircu * [6e2f1d2e2] : Core: Add an HP_MALLOC stress testing suite Fixes #2089 2020-04-27 Liviu Chircu * [4b8ad9689] : HP_MALLOC: Aggregate SHM statistic updates It is better to update the stats with a diff of the attached/detached/split/merged fragment changes. Updating the stats in a "step by step" manner has the side-effect of creating temporarily bogus values. (i.e. negative "used" and/or "real_used") 2020-04-27 Liviu Chircu * [25eec9f5f] : HP_MALLOC: Add "re-scanning" logic Given that HP_MALLOC has fine-grained locking, if the big fragment shifts down from hash bucket N to bucket N-1 due to another process performing the allocation, we may actually "lose" it during our own scan, since bucket N-1 was empty and we're now waiting for bucket N to unlock. When it does unlock, it will also be empty. As a solution: retry the scan up to N times, as long as it's feasible! 2020-04-27 Liviu Chircu * [1531f5661] : HP_MALLOC: Fix computation of PKG stats 2020-04-27 Liviu Chircu * [3803441bb] : HP_MALLOC: Dramatically reduce memory fragmentation For HP_MALLOC to offer optimal parallel allocation performance, it needs the memory to be fragmented: the more available chunks, the better its performance. However, there needs to be some coalescing as well, otherwise variable-length allocations past the 10K range will quickly deplete (fragment) even SHM pools of 10+ GB. This patch adds the following heuristics to HP_MALLOC and HP_MALLOC_DBG: * shm_malloc(): only split a fragment if the resulting chunk is at least MIN_SPLIT_SIZE bytes (default 256 for PKG, 4096 for SHM) * shm_free(): try to coalesce the next fragment (enough to fix all fragmentation issues) 2020-04-27 Liviu Chircu * [ee2912bad] : fraud_detection: Fix bad test in e1767c80 2020-04-27 Liviu Chircu * [e1767c80d] : fraud_detection: Avoid random str_strcmp() error logs 2020-04-26 OpenSIPS * [ceb2aae1e] : Rebuild documentation 2020-04-22 Liviu Chircu * [a627750df] : async statement: Improve error log when tm is missing (cherry picked from commit afb721ed164206855130202cf5b0ff4c83bf2394) 2020-04-22 Liviu Chircu * [f46afc50a] : rest_client: Disable "Expect: 100-continue" by default Although the "100 Continue" flow sometimes saves bandwidth when the server replies with an error response, it also has some drawbacks: * extra roundtrips, adding latency and complicating the async handling * the client body upload and server body download must be performed within the same curl_multi_perform() loop, during the async resume callback, limiting the amount of parallelism that can be obtained when compared to the simple flow From now on, the "100 Continue" flow for POST/PUT requests with bodies larger than 1024 bytes is disabled by default. Developers may enable it using a new, backwards-compatible, "enable_expect_100" module parameter. Fixes #2081 2020-04-20 Bogdan Andrei IANCU * [169aefef5] : Merge pull request #2037 from l2dy/tracer tracer: fix null pointer dereference (cherry picked from commit d59715ec3614c5c9d5afb40aa17704d86fca6021) 2020-04-19 OpenSIPS * [40c5c4880] : Rebuild documentation 2020-04-17 Vlad Patrascu * [90e06c664] : xml: allow access to nodes with undefined namespace prefixes Related to #1988 (cherry picked from commit 17b44ea1f2270be8e59b893ab70b3aac8d5a3826) 2020-04-16 Liviu Chircu * [e38af9e78] : proto2a(): Do not segfault on PROTO_NONE (0) (cherry picked from commit 54064b4614d42164b49105b43f9a5dc1ce308a92) 2020-04-16 Bogdan-Andrei Iancu * [52d957a20] : [exec] improve docs on exec async + launch Related to #2049 (cherry picked from commit bb7afdc2dc4363f24d8e28e00ab337c7c174d1e5) 2020-04-16 Bogdan-Andrei Iancu * [0dc4efdcc] : Removed extra space (cherry picked from commit b47d7a617cd8384f2929655f497f3b52c554028d) 2020-04-16 Bogdan-Andrei Iancu * [08523266d] : Merge branch 'master' of https://github.com/robdyck/opensips into robdyck-master (cherry picked from commit 4558e7af66240a2e359a1ffbeee114bad3b4f71d) 2020-04-14 Bogdan Andrei IANCU * [1df57e94c] : Merge pull request #2074 from besser82/topic/besser82/json_c_014_so_5 Add support for upcoming json-c 0.14.0. (cherry picked from commit fe24824e042486575daa01e20df2c8380b9e0b07) 2020-04-13 Bogdan-Andrei Iancu * [ef3ffb0f3] : Improve canceling of transactions doing only t_wait_for_new_branches(). If a transaction has no real signalling branch, but only doing t_wait_for_new_branches(), upon caller cancel inject a 487 reply on the phony/waiting branch in order to terminate the transaction on the spot. The provious behavior was to wait (even after the cancel) for the phony/waiting branch timeout (fr_inv_timeout) and to generate an 408 timeout. Now, there is no useless waiting and a proper 487 is generated. (cherry picked from commit 8af80a40bb9877b91380da670353a68c53f0a36b) 2020-04-13 Bogdan-Andrei Iancu * [1bbe7ab88] : Fix un-released transaction upon t_wait_for_new_branches + cancel. If t_wait_for_new_branches() is used and no real signaling branch is added, the caller canceling must not be ignored upon branch selection. The injected 408 timeout on the phony branch must be considered, leading the transaction termination. Thanks to Chris Maciejewski for reporting and providing troubleshooting info. Also thanks to Razvan Crainea ( @razvancrainea ) for investigating and reproducing the problem. (cherry picked from commit 7221b984d555cb68fd07e1bfb502607446345d42) 2020-04-13 Liviu Chircu * [2ee910093] : Fix compilation warnings with -DUSE_FUTEX It seems that whenever "time.h" is included without first enabling _GNU_SOURCE, including "unistd.h" afterwards will leave the "syscall" function undeclared, regardless whether _GNU_SOURCE is defined or not. ../../parser/../mem/../futex_lock.h: In function ‘get_lock’: ../../parser/../mem/../futex_lock.h:78:31: warning: implicit declaration of function ‘syscall’; did you mean ‘sysconf’? [-Wimplicit-function-declaration] #define futex_wait(lock, val) syscall(SYS_futex, lock, FUTEX_WAIT, val, 0, 0, 0) ^ ../../parser/../mem/../futex_lock.h:268:4: note: in expansion of macro ‘futex_wait’ futex_wait(lock, 2); ^~~~~~~~~~ (cherry picked from commit fa4e4fa70085db9da4dc72f856e0648341b0f5a6) 2020-04-05 OpenSIPS * [495b98030] : Rebuild documentation 2020-04-03 Zero King * [a28d270fd] : db_virtual: check NULL before log (cherry picked from commit bbbe695ea8d64efe8a6152ed69aca88896d7a3dc) (cherry picked from commit 39a3a06fd2486848d7e22736182602a741d42f5d) 2020-04-03 Zero King * [f11aa6303] : rtpengine: check NULL before assignment (cherry picked from commit f33f1d839102a24342a91f15a6902c05ee90ea45) (cherry picked from commit b428f119fb179d00f47d1917362b33484ebaf4b1) 2020-04-03 Zero King * [2534ee9f9] : exec: fix NULL check after malloc hf->next_other should be checked instead. (cherry picked from commit 8d7e2f310d7f43535dea1dff6b6889df02d95c02) (cherry picked from commit bcd723680b506f6ac0a6ec095e3920777bcb6b65) 2020-04-03 Zero King * [3cae597de] : exec: fix potential use of uninitialized pointer (cherry picked from commit 9da92ced576d18e5487cf5dfa584ee638c170520) (cherry picked from commit a4da730c13d52b494f834fdd5c7ff5d61a17937f) 2020-04-03 Zero King * [fedd1f732] : osp: actually fix potential use of uninitialized pointer If OSPPTransactionNew() failed, callids[0] is still uninitialized. (cherry picked from commit c8a99ad3d1dea71ddaa73ed4cac42f4c56b49a38) (cherry picked from commit 8a6d458ec72243c667b39ac1f97cfe7e7e98d1ec) 2020-03-29 OpenSIPS * [f2d6e7b5c] : Rebuild documentation 2020-03-27 Bogdan-Andrei Iancu * [9c6664a3b] : Fix param order in goes_to_gw_1 without partitions Credits go to @zhouboyong 2020-03-24 Liviu Chircu * [9523af586] : acc: Improve oom handling Do not populate bogus str values (e.g. {NULL, 3}) when out of SHM and setting $acc_extra. (cherry picked from commit 86ef10af2cbaad475dd92d41be64873af40e716e) 2020-03-22 OpenSIPS * [923ba6219] : Rebuild documentation 2020-03-20 Razvan Crainea * [5d6b98e64] : tls_mgm: enforce at least TLSv1 when SSLv2.3 is used Starting with Debian 10 (buster), the OpenSSL library is compiled with TLSv1.2 as the minimum TLS version. Therefore, when specifying SSLv2.3, basically only TLSv1.2 and TLSv1.3 can be used. This commit sets the minimum version to TLSv1, since SSLv2.3 will soon be deprecated. Thanks go to @telematico for reporting this issue Close #1986 2020-03-19 Razvan Crainea * [4eaba78ca] : parser/content: handle \r for Accept folding lines When receiving a heeader with folding lines, we also need to skip '\r' when parsing the new lines. This way we can accept headers such as: Accept: application/sdp, application/isup, multipart/mixed, application/dtmf, application/dtmf-relay Thanks go to 46Labs for reporting this (cherry picked from commit f7efd44c9e796e941452d2c173bac6aec4342bb3) 2020-03-16 Zero King * [8322b64a9] : auth: return -1 on error in auth_get_ha1() (cherry picked from commit 96fcb5f9fd95796e11ec00a8246426d6dfe11a58) (cherry picked from commit 9578c7fef7f54000b9e38c5b248302649a739d06) 2020-03-16 Zero King * [eae7bf93b] : Revert "auth: fix error check" This reverts commit b7772a087e4bf5c57fa4655d9fd53e074ca4247e. (cherry picked from commit d8ec4f3b05f2c4b21fe3363b3e146c1811ccf870) (cherry picked from commit 72a3f08a96149ebd7a18d8338d86fe587d4ab669) 2020-03-16 Liviu Chircu * [932fa3ecb] : proto_help: Fix broken doc build (cherry picked from commit b9a6292e9de47c02a9e5ae1dcc540c888f90be8a) 2020-03-13 Zero King * [8f229b118] : pua: fix bitmask check (cherry picked from commit cd7dec8af8f71fa1024b69fb66e8f02ef3d43278) 2020-03-12 Zero King * [bd00d6bfe] : b2b_logic: fix checking potentially uninitialized pointer (cherry picked from commit fefd32149a97cdd2ad1b1ea0f19a4eeaa0809375) (cherry picked from commit 081b654024ea627f479c9137414b108db85004d9) 2020-03-12 Zero King * [f114852aa] : osp: fix use of uninitialized pointer (cherry picked from commit fc5b59ea3eeeabac4e0a28302b5d0b0d1b5f507d) (cherry picked from commit 451fe196826ead159e0ddda34719b1f9948c0bad) 2020-03-12 Zero King * [fc815811d] : msilo: fix excessive check (cherry picked from commit 71b6088d888af32609b7dad87f0e250580c6c7ff) (cherry picked from commit 222a80153abed8fd731a623aa371861ea4f4a006) 2020-03-12 Zero King * [b0b82f902] : xsnprintf.c: fix excessive expression (cherry picked from commit 99d35618a22daa7bed3d426cdb9db7eb87d507df) (cherry picked from commit d3ba9c451e07ebc91f9036f7f2468a6ea1ccf1e2) 2020-03-12 Zero King * [0386da9de] : dialplan: fix null printf (cherry picked from commit b04d537723f5254476fc5011ef5458ff865d2563) (cherry picked from commit c27a528b4cd22af17d65f7fafb49739347f06e2f) 2020-03-12 Zero King * [90756ea15] : auth: fix error check auth_get_ha1() returns 1 on error. (cherry picked from commit b7772a087e4bf5c57fa4655d9fd53e074ca4247e) 2020-03-12 Zero King * [4d98bdbd4] : usrloc: fix malloc size (cherry picked from commit eecb094adfda7381fa67c6bc10316879d37fabdb) 2020-03-12 Zero King * [9e510b728] : osp: fix NULL pointer dereference (cherry picked from commit 4fbb4529ac943c3d18ab8819299a28f3c58f5746) 2020-03-12 Zero King * [8611f5893] : dialplan: fix insert error condition (cherry picked from commit 67b1f6445aa2db1d5df6b76a0436a0c17054be4e) 2020-03-12 Zero King * [28b4fb098] : osp: remove unused variable (cherry picked from commit 6e062e6c6a5d88c2c4c75e5eb596d71c900ed3de) 2020-03-12 Zero King * [1b4f75a7a] : presence_xml: fix typo in NULL check (cherry picked from commit 7bc6526a6107cf551044468db3c855fc3af2a925) 2020-03-12 Zero King * [e79c3fe77] : osp: fix errorcode in log (cherry picked from commit 73b6ba0a8a2dc56ce2f5090fadc4692f5510365c) 2020-03-12 Zero King * [691b87ad1] : compression: remove redundant check (cherry picked from commit 921080e75cf3ef1c30acbf05f712cd86d923437f) 2020-03-12 Zero King * [5cdd7f42a] : ldap: fix letter check (cherry picked from commit 601091dad5e518ad2c6a224d3d35e5bcad304ab8) 2020-03-12 Zero King * [c935785ab] : msg_translator: fix indentation (cherry picked from commit d13318eac5238c540d651da4d60a907fbcfe8ea8) (cherry picked from commit bdf0916f9cb9e88cdfca2a64f7b2cb5ab61f0f95) 2020-03-12 Zero King * [50f8fc298] : osp: remove obsolete callback type check TMCB_ON_FAILURE_RO was removed but the corresponding debug check is kept, overriding TMCB_ON_FAILURE. See commit 2adbeacd3c7055f949048e793fa193119f3a6873. (cherry picked from commit b3dc69206329e5ac8e98d3343c274ebd8cd85fb7) (cherry picked from commit 58fe893814e9535417ca3c257df7e6e164a0479b) 2020-03-12 Zero King * [5cc616c97] : osp: fix pointer null check (cherry picked from commit 5f1068c146460d795e6d7b24ceaea1883fd72215) (cherry picked from commit 053d70c0b2e0cf9ab2290a5155ef24261fdb2a73) 2020-03-11 Zero King * [40c8c5388] : Fix homepage URLs (cherry picked from commit 94406117a406c3d98df5c71cdfa8fdcb301101ad) (cherry picked from commit 38afc33573851934c2da33ab7718b7eb5a8f83dd) 2020-03-11 Jasper Hafkenscheid * [255b7bb48] : Fixed titles of some code examples in nathelper docs. (cherry picked from commit cea688535fc7dc355ac78dc57613f3686f1c85fe) 2020-03-10 Liviu Chircu * [2091b2972] : Complete previous commit (0105ab4397e) (cherry picked from commit 9056759bb9c6eb8d59ceb4c0028653968098b5d4) 2020-03-10 Liviu Chircu * [59ec83a63] : db_mysql/avpops: Properly return DOUBLE/DECIMAL values This patch fixes avp_db_query() calls which fetch data from DOUBLE columns in MySQL, which would otherwise return some strange errors. Many thanks to Calvin Ellison and Brett Nemeroff for the report and helping come up with the final fix! (cherry picked from commit 0105ab4397efded8d5a3009d09de20d122aaa9f0) 2020-03-10 Zero King * [91288106b] : sipcapture: remove duplicate assignment (cherry picked from commit 53ff949b8cdf9d32a94f0974bdd331881e939054) 2020-03-10 Liviu Chircu * [763b416a9] : registrar: Fix segfault within debug log Many thanks to Robert Dyck for the report! (cherry picked from commit a2edd0d179204ac708304fc1d870db8dfadf2be5) 2020-03-09 Zero King * [c149bf4f5] : usrloc: fix typos (cherry picked from commit 8dcf840ce00c57df85fa17327687b86b9b6660cb) 2020-03-09 Zero King * [25310320d] : Fix time comparison ?: has lower precedence than +. (cherry picked from commit 0720c5e2b24223b53933b2e18482e2960d4fa381) (cherry picked from commit 1751a6ace1463960e5f1559a8090e1fa7ef05119) 2020-03-09 Zero King * [e054ffa29] : Remove dead code (cherry picked from commit 64daab83292a569cbab3cba216925fa27b9801bd) (cherry picked from commit 472cf2128690e2a735b206e7665c74dd7932b267) 2020-03-05 Razvan Crainea * [b60dd3755] : proto_hep: clarify homer5_on parameter doc Thanks go to Shaun for reporting this on the mailing list (cherry picked from commit 194398342ebee54cde9a642c0a7e5eb1ce8ca2df) 2020-03-04 Razvan Crainea * [466139752] : tm: fix t_reply_with_body doc - cannot be run from failure_route (cherry picked from commit eae2a86eed9ee52605ca110467b8a40ee82bff00) 2020-03-04 Razvan Crainea * [d1befcb95] : Revert "tm: Allow t_reply_with_body() from failure route" This reverts commit c3d04debbe72b5d57641e57b5dd31c9d7eb59278. 2020-03-02 Liviu Chircu * [c3d04debb] : tm: Allow t_reply_with_body() from failure route This now also matches the docs, similarly to t_reply(). Credits to Nick Altmann (cherry picked from commit b3da92d6b3ecf281976ad8a5e262cfb1aadf30ad) 2020-03-01 OpenSIPS * [b1a397d60] : Rebuild documentation 2020-02-27 Liviu Chircu * [87d5f9537] : cachedb_mongodb: Fix memory leak in cache_raw_query() Thanks to @ycxwoo for spotting this issue! Fixes #1985 (cherry picked from commit e818ac259362fd5627d9234e8afb1e7ba3462783) 2020-02-27 Liviu Chircu * [64faa1675] : cachedb_mongodb: Fix possible off-by-one error (cherry picked from commit b0d65e9af1146c2764b43f4038922f0c7f9ec27b) 2020-02-27 Liviu Chircu * [3211f4048] : mid_registrar: Remove copy-pasted docs Closes #1984 (cherry picked from commit b4fac39b57d4feacc5c26b3b732cb74c456fd3b8) 2020-02-26 Liviu Chircu * [a4880e89f] : dialog: Fix some locking corner-cases * in parallel forking: [READER] dlg_onreq_out() (read dlg->legs) vs. [WRITER] push_reply_in_dialog() (write dlg->legs) (may happen if concurrently processing 200 OK from branch X) * DB load: to be 100% accurate, do not use ref_unsafe(), as we don't hold the lock -- use the safe version instead! (cherry picked from commit b9511b91f1aea8b9f83da41cd18fd43ce6bc3092) 2020-02-24 Razvan Crainea * [0f7cd0a7d] : rtpengine: always learn process local pid Always learn the local process pid, even though there are no rtpengine sockets loaded from either script or database - they might appear later after an MI reload. Reported in sipwise/rtpengine#935 by @MarcoHierl (cherry picked from commit da636430df1335c2c2c59a1c053ff85ee21ef003) 2020-02-23 OpenSIPS * [faca0dd2a] : Rebuild documentation 2020-02-20 Razvan Crainea * [a55f48457] : siprec: reflect media_ip in o=line Close #1979 (cherry picked from commit f1a2979b5be7f17300e35d984624167820f1c11b) 2020-02-19 Razvan Crainea * [f86167dbe] : b2b_entities: don't try to insert in db nonprintable param The b2b_entities module expects that the parameter provided during entity registrations to be a string. It stores this string in the database. However, there are cases where modules (such as siprec) force their parameter to be a pointer to a structure, therefore the string becomes non-printable. This breaks certain entities insertion in the database. This commit prevents the module from inserting a key that's not printable. In the case of siprec this is not a problem, since the module does not rely on the value that's stored in the parameter for restart - it rebuilds the value anyway. This is a temorary fix - ideally, the parameter should be able to be serialized before written in the database; although this is not possible now, it will be possible starting with 3.1. Hence this temporary fix. (cherry picked from commit 0bd7fbe7d5568f45ffbde7dd5a669fce2993b30f) 2020-02-19 Dan Pascu * [7038dc9bb] : Fixed crashes and memory leaks due to improper memory cleanup (cherry picked from commit d8c15f8a318640c75fedb0d76bc3829210f8c1fb) 2020-02-19 Dan Pascu * [9a7c1df25] : Fixed log message (cherry picked from commit 9c6931bff2df8fb29d45ff986bad310bdfb95438) 2020-02-19 Dan Pascu * [4b8bc3b70] : Fixed crash caused by invalid memory free (fixes #1974) (cherry picked from commit 4432711762e8882583e376991d8e11f0297d4820) 2020-02-19 Razvan Crainea * [e70e42023] : siprec: start recording as soon as we have 2-way audio Engage recording even for 180/183 provisional replies, not only for 200. Reported by @MikhailKalashnikov in ticket #1970 (cherry picked from commit d9245d223e7bea5edc9705a6e8b511ee769c1086) 2020-02-19 Liviu Chircu * [124b5d0a9] : tm + subscribers: Fix possible SHM leaks around tmb.t_req_within The severity is medium, however, as these leaks would only occur once the SHM pool is near depletion. (cherry picked from commit 80bd901aa247287a5d6d2e4f8fcba27f97a0d524) 2020-02-18 Bogdan-Andrei Iancu * [18612ded4] : Fix computing the cseq for a branch. Instead of assuming a +1 increment (to the cseq from request), better copy the cseq from the received reply. Thanks to @razvancrainea for the brainstorming. (cherry picked from commit b7b22d6e3f54711d64ecd4731a40bfa55211e9d6) 2020-02-18 Bogdan-Andrei Iancu * [48d6f6c8e] : In UAS replies, preserve the CSEQ from the UAS request Instead of computing the cseq for the forwarded replied, better use the cseq value from the original requests (like restoring). Thanks to @razvancrainea for the brainstorming on the issue. Fixes #1969 (cherry picked from commit 0200c0e1424c1a2b993cd3545507f2ccaf6c573a) 2020-02-16 OpenSIPS * [57e4dee5b] : Rebuild documentation 2020-02-07 Razvan Crainea * [d2f6529b4] : core: fix string2hex returned length Reported by @johandeclercqdemocon in Ticket #1957 (cherry picked from commit 01e0ff99f4f80cf7dc9e0d8ec45362810b624c5b) (cherry picked from commit 3f3f496cf883ea6ceb9c1e406fac243a219c74af) 2020-02-06 Razvan Crainea * [c55868250] : net: call initialize proto function for all connections This code fixes proto ws and wss, by calling the `conn_init` function even for connections that are not sent back to main. Reported by @suharik71 in #1956 (cherry picked from commit 6c9c6efa8e668ad361e7a75b645951dc2c86e8b2) 2020-02-04 Razvan Crainea * [c221d8425] : hp_malloc: run check_double_free() under lock (cherry picked from commit 41714f134943f76adb1dae43d8a3c9365924352e) 2020-02-04 Razvan Crainea * [971a7341a] : hp_malloc: populate DBG info for hp_free* (cherry picked from commit 410c664c953f409b2c8143b1d46cc7fc28deac63) 2020-02-04 Liviu Chircu * [ce3c4c553] : HP_MALLOC: Fix a shm_realloc() concurrency issue On a fragment shrink operation, we must also grab the lock on the resulting fragment before inserting it (this cannot be an _unsafe operation!) Many thanks to 46Labs and Răzvan Crainea for helping troubleshoot this (cherry picked from commit ff7ba6e2dd05fbc4989561d7a4582cb11cbb01ba) 2020-02-02 OpenSIPS * [30b204ec5] : Rebuild documentation 2020-02-02 Razvan Crainea * [352a4bb5c] : tls: fix the length of masker key (cherry picked from commit df3f537d70f64ecd0de0881e6fb39b75c50a16bc) 2020-01-30 Razvan Crainea * [8e455efbb] : tls: make sure crypto rand functions are reentrant Reported by @fgast in #1953 (cherry picked from commit af5ba52055af860723fe554e9069d4c9142f82af) 2020-01-30 Fabian Gast * [0ba3a17a7] : fixes #1954 - change return value if we can not add crl files (cherry picked from commit 7a84935b5cd2c4f2f2d21c3c9d978999f1697dd5) =========================== Release 2.4.7 ============================== 2020-01-28 Razvan Crainea * [3dbe88eca] : Bump version to 2.4.7 2020-01-28 Vlad Patrascu * [94a9b7da7] : perl: improve docs regarding the return value of perl_exec() (cherry picked from commit 286ab285de555d631a45846a14f7daa1001ac84b) 2020-01-28 Razvan Crainea * [dda911950] : dialog: remove unused update_contact() function 2020-01-28 Razvan Crainea * [9f463855b] : dialog: update contact only on 200OK replies 2020-01-28 Razvan Crainea * [040e21304] : dialog: fix updating contact after fix_nated_contact on seq 2020-01-28 Bogdan-Andrei Iancu * [291d3e5e9] : Fix db backend init for trace_id's Do not perform DB queries during cfg parsing, but only at mod_init stage, as some DB backends (like db_text) may not be initialized before mod_init. Closes #1947 (cherry picked from commit b4fce7b66d8478c6b3dc5684f2533140b88dc078) 2020-01-27 Bogdan Andrei IANCU * [ae90fca96] : Merge pull request #1949 from fgast/perl_newline Add missing newline (cherry picked from commit 7e16079fc94700327162a86ff0367731975d484f) 2020-01-26 OpenSIPS * [632619ada] : Rebuild documentation 2020-01-23 Liviu Chircu * [c2e060333] : uac: Fix regression in de7606dfb2 In restore_mode == auto, the To/From URI restoration for upstream sequential requests was affected, as < and > were now always removed when restoring the header back to the upstream side. Credits to Vitalii Aleksandrov for the report & debugging data 2020-01-22 Liviu Chircu * [9e7d1f143] : cJSON library: Improve precision for myfloor() Fixes a bug where large MI tree integers would get printed as: { "shmem:total_size": 2.147484e+09, ... } ... due to lack of precision. (cherry picked from commit abbb728f6b52bb3dd633ab3644709badf80986fe) 2020-01-22 Liviu Chircu * [de7606dfb] : uac: Force URI enclosing for sequential requests This is a continuation of commit a75b2369b15972c, where we do the same thing for sequential requests as well, avoiding any ambiguous resulting headers, such as: ACK To: "Alice" sip:sipp;p1=yes@10.0.0.10:5060;p2=yes;tag=abcde ... which we now disambiguate as follows: ACK To: "Alice" ;tag=abcde Sponsored by 46Labs (cherry picked from commit b2191bb695859a10188757662dc77708a41ada73) 2020-01-21 Vlad Patrascu * [4cdc993c6] : event_flatstore: handle oom errors on pkg allocations (cherry picked from commit a4e94de60252d70635707ede5b7d6795430380d8) 2020-01-21 Liviu Chircu * [d27f7cc29] : sipmsgops: Fix docs for sipmsg_validate() (cherry picked from commit d618825234078bc25917cfb74e53bbbeb33b2fc8) (cherry picked from commit 070f8b7c523b6f8fbe110c3c29c4d9e16b31cb47) 2020-01-20 Vlad Patrascu * [59417a935] : event_flatstore: improve handling of multiple subscriptions for the same file Use the same internal shm struct corresponding to a file for each evi subscription for that file. This fixes an issue with the 'evi_flat_rotate' MI command not properly "rotating" multiple subscriptions to the new file. Besides, a file is now opened only once regardless of how many subscribtions there are for the same file. Also, do not reuse an old 'evi_reply_sock' structure for a new subscription for the same file (if the file corresponding to an old subscription was not yet closed by all processes). This led to incorrect expire times for new subscriptions. Fixes #1933 (cherry picked from commit a2f4f80fdf34ec18eb1b6499d512609085115e72) 2020-01-19 OpenSIPS * [95ae82fdf] : Rebuild documentation 2020-01-17 Liviu Chircu * [f71e5bb21] : Fix improperly initialized str modparams Fixes #1427 (cherry picked from commit 7abd824a33b198d9adc844e62e475918e366db8c) (cherry picked from commit 028183b8f275a0d60e820cc8c0fe967f7cda51b0) 2020-01-16 Razvan Crainea * [2c681aa47] : tls_mgm: remove SSLv2 and SSLv3 from documentation (cherry picked from commit 7261f1271af843577969910123025fc18449532d) 2020-01-16 Razvan Crainea * [a83750d3c] : exec: fix assinging int val to environment values (cherry picked from commit c37badde03bd0467c0194d16626d7b98f1fb6a06) 2020-01-16 Razvan Crainea * [9e32008ea] : tls: protect openssl rand functions with lock 2020-01-16 Razvan Crainea * [c8e6ff620] : net: initialize connection extra data in workers 2020-01-16 Razvan Crainea * [c283e2aae] : tls_mgm: create tls domain per process 2020-01-16 Razvan Crainea * [0d43214d0] : pt: add process count function 2020-01-16 Razvan Crainea * [7de3b8a44] : tls_mgm: use the new threadid interface for ssl 1.x.x 2020-01-15 Liviu Chircu * [50992ba69] : cachedb_mongodb SQL adapter: Dup all string columns The strings provided by bson_iter_utf8() and bson_iter_binary() are ephemeral. We must duplicate them as soon as possible, to prevent invalid memory pointers within the result set as multiple rows get processed. Fixes #1903 2020-01-15 Razvan Crainea * [7de09fb15] : cfgutils: fix check_time_rec() leak and mem access 1. The timerec parsing modifies the buffer, therefore it is a good idea to always duplicate the timerec buffer pkg 2. The timerec parsing relies on the fact that the string is null terminated - however the module interface does not guarantee the string will be null terminated if it comes from a pseudo-variable 3. The timerec should be allocated in pkg memory, there's no reason why it should be shared 4. After checking the timerec, the function needs to release the memory 2020-01-14 Liviu Chircu * [057468a5e] : HP_MALLOC: Fix the memory warming feature As some initial SHM allocations are done, the large chunk of memory tends to move towards the end of the list, so we must properly locate it before we are able to chop it up. Fixes #1638 (cherry picked from commit 368e3699e60365c09902ceb26ba0251be9864a85) 2020-01-14 Razvan Crainea * [2bc0946f7] : cfgutils: fix parsing error printing Close #1777 2020-01-14 Bogdan-Andrei Iancu * [f2120f439] : Proper inheriting of advertised address/port during dns based failover. As the DNS based failover has to create a new branch as a perfect copy of the failed branch (as branch attributes), use the per-UAC advertised address and ports rather than the the per-MSG values. (cherry picked from commit 0390ec9dce7eab7da6bb6b952ef4766698a1a967) 2020-01-14 Bogdan-Andrei Iancu * [cc62f7df7] : Proper inheriting of branch attributes during DNS-based failover. When creating a fake request based on an existing UAC entity, use the DST_URI and PATH_VEC specific to that UAC entity and not the per-message values. This will correctly preserve the DST_URI and PATH_VEC during a DNS based failover, where the new branch must be a perfect copy of the original failed branch. (cherry picked from commit 09473b34d94014f3279a3ff53e593bc7d9ba0a41) 2020-01-14 Bogdan-Andrei Iancu * [cdaf4e354] : Fix inheriting branch specific attributes while forking via failure route. The path vector and Q value are per-branch values and they must not be inherited while creating new branches from failure route. Closes #1887 (cherry picked from commit 4d8d9ca902475a9eaaa759c3d4c75f8ae4ba348e) 2020-01-14 Vlad Patrascu * [1a3cffe95] : sql_cacher: fix a 'cache_table' modparam parsing bug Fixes #1900 (cherry picked from commit 49d01575cf7c05e7b73e751965dc546a3785743f) 2020-01-13 Razvan Crainea * [774b3fcbd] : tls: use is_peer_verified for both TLS and WSS Close #1765 (cherry picked from commit 4e5ac0d3094552ebaa76d183b74c9d0356f30547) 2020-01-13 Vlad Patrascu * [bfe9bdb69] : dialog: fix double decrement issue with cachedb shared profiles If dialog replication is enabled and a dialog expires, the cachedb counter will now only be decremented if the sharing tag is active. Fixes #1937 (cherry picked from commit 19bbf8ca08638d938c32ebf467207357dcb95425) 2020-01-13 Liviu Chircu * [8ea7c00fe] : usrloc: Disambiguate ul_flush / ul_sync docs (cherry picked from commit 3a2e07380323ac5f84536d57cdcb69cda98f1fc0) 2020-01-12 OpenSIPS * [1ff4ebcf1] : Rebuild documentation 2020-01-10 Razvan Crainea * [c921ac5a2] : menuconfig: more verbose output in case of error Close #1242 (cherry picked from commit 014f5d2773a6b86f027bf7aa893078de8079d155) 2020-01-10 Bogdan-Andrei Iancu * [d7849e457] : Improve/clean logging on expire notifications Credits go to @wdoekes / Walter Doekes Related to #1722 (cherry picked from commit f12a53907d9829a949a9ca62a5a6d0e63695d2e9) (cherry picked from commit 0260c9b32b95c83c0c03892cbdb95a8701cca98c) 2020-01-10 Bogdan-Andrei Iancu * [29f8b303d] : Proper handling of subscription session overlapping 1) be sure we send back a 500 reply in all error cases 2) detect the cases of subscription session overlapping (see #1722) Similar to 4918544248c495b1099a54326f97a82df97bbe76 (cherry picked from commit 8f3e58938568d18a375e1eacba608795f7df59dd) 2020-01-10 Bogdan-Andrei Iancu * [ed455e2ea] : Proper error handling in handle_subscribe 1) be sure we send back a 500 reply in all error cases 2) detect the cases of subscription session overlapping (see #1722) This is based on ec1889638a9d43280ba1362f6108a175efd4a854, with the update of the generation of the To-tag before the subscription check/reply (cherry picked from commit 4918544248c495b1099a54326f97a82df97bbe76) (cherry picked from commit b4facfbec60783ac313c3c099451f4a850f315b4) 2020-01-10 Bogdan-Andrei Iancu * [3e8b549d7] : Refactor signaling, sl & tm APIs to add gen_totag() This is a new function to generate the To-tag (which is msg specific and computed in a deterministic way) whitout actually sending a reply. First stage of a fix for #1722 (cherry picked from commit 666e811eb42d367d823e252f329d89eb58fab822) 2020-01-09 Razvan Crainea * [8179e1f8d] : event_route: initialize childs only in external process This commit fixes 59400f778b633d43d6d9e7d33fba4658c9c7f4fd Close #1932 2020-01-09 Razvan Crainea * [f12ce6860] : Revert "event_route: init child for async process" This reverts commit 59400f778b633d43d6d9e7d33fba4658c9c7f4fd. 2020-01-08 Bogdan-Andrei Iancu * [dd2071032] : Fix overflow when using large number of GW per rule Instead of fix-size internal buffer, user self-scaling buffers for handling/sorting the destinations/gateways in rules and carriers. Fixes #1910 Cherry pick from e5991e1af5ca6eeb92940334da0a1cc31993ea7d 2020-01-08 Liviu Chircu * [d5ed44c00] : mid_registrar: Add request retransmission detection Instead of leaking shared memory on scripts which do not properly call t_check_trans() beforehand, mid_registrar_save() will now act as a t_check_trans() call and perform a default processing of the retransmission. Fixes #1907 (cherry picked from commit 2a4290d66b29e82da6ac13eae0da62df58d1a6ce) 2020-01-08 Vlad Patrascu * [445f9aeb1] : dialog: fix a crash when receiving an unknown replicated profile Reported by SamyGo on the mailing list. (cherry picked from commit 89bbb67e349acb172949beda1f80b07ec1dc9d3b) 2020-01-08 Razvan Crainea * [59400f778] : event_route: init child for async process In case the route is ran asynchronous, the extra process does not have DB connections, or rest client handlers. This commit runs the children initialization functions to make sure the rest client extra process also has these connectors initialized. Possible related to #1897 2020-01-08 Razvan Crainea * [fb847ba44] : proto_ws: decline Sec-WebSocket-Key keys that are not 24 bytes In case the key is not 24 bytes, the some internal buffers might be overwritten, resulting in malformed/bad Sec-WebSocket-Accept generation. And since the RFC requires the key to be random 16-bytes-base64 encoding, the length should always be 24 bytes. Thanks go to @hafkensite for reporting it on GitHub and to @wdoekes for profiving the fix. Close #1928 (cherry picked from commit 6f24b26205d11a3500f86113cf74f7f7f4ec95e8) 2020-01-08 Liviu Chircu * [0c8a7d730] : Status pipe reporting: Do not log errno on success ... as this may cause bogus debug logs, such as "Bad file descriptor" on 100% successful operations. (cherry picked from commit 6862850851c0597e70c79926d2266e43eef97dd4) 2020-01-08 Liviu Chircu * [51e240d6e] : Timer process counting: Drop obsolete code The timer counting and timer status code reporting logic was reworked in caabbe53229bde (from N timer processes to 1+1, later 1+1+1), so the "init_timer_no" shared integer logic is no longer needed. (cherry picked from commit ed905d1a36fd0d7fb5b6461433f00c53e69c87cd) 2020-01-07 Liviu Chircu * [65e83b017] : cachedb_redis: Improve reconnect logging * lower failed query log severity from ERROR -> INFO * make sure to log query recovery after a reconnect (cherry picked from commit ac153f449f6fcc978148ff8b6c8c940ec0776423) 2020-01-07 Bogdan-Andrei Iancu * [a303241a7] : Document the limitations of the FEEDBACK alg Closes #1915. (cherry picked from commit 5fb57167b1b2b7734542205e4019277f1ffe5013) 2020-01-05 OpenSIPS * [682fa0b2f] : Rebuild documentation 2020-01-05 Nick Altmann * [cac700f3f] : RPM spec: fix rhel8 condition 2020-01-04 Nick Altmann * [87a151b61] : RPM spec: support for rhel8 2020-01-04 Bogdan-Andrei Iancu * [477b6c391] : Improve docs on loose_route() and strict versus loose routing (cherry picked from commit 682e96d24949356e60a371c4e5b95b5833703bef) 2020-01-04 Bogdan-Andrei Iancu * [6d9438c4e] : Fix missing `my_bool` for mysql version higher than 80000 (cherry picked from commit c28876540fe447063db349932a36b655f5fe00f1) 2020-01-04 Bogdan-Andrei Iancu * [25ff84b8d] : Fix flags for event backend to avoid conflicts with event_flatstore (cherry picked from commit 638160496d0863bf506c01c714812f2ea5206767) 2020-01-03 Nick Altmann * [f747df86e] : Disable python module for fedora >= 31 2019-12-29 OpenSIPS * [31c9403c0] : Rebuild documentation 2019-12-23 Bogdan-Andrei Iancu * [55fe1546b] : Fix locking when flushing state to DB Indeed there was no data locking when the flushing the destination's state to DB. Closes #1911 (cherry picked from commit 43c7d916d8a807d00021818f1a120284cb08b50f) 2019-12-22 OpenSIPS * [bb2c62f10] : Rebuild documentation 2019-12-19 Bogdan-Andrei Iancu * [88104cd29] : Fix wrong HTTP path to online module docs 2019-12-18 Răzvan Crainea * [6c8f7ed01] : Merge pull request #1918 from Ozzyboshi/master Wrong log message (params in wrong order) 2019-12-16 Razvan Crainea * [5c01c0e6f] : topology_hiding: prevent module for engaging twice Prevent the module from engaging TH callbacks twice, in case topology_hiding() was called twice; however, do append the new flags to the dialog module flags. (cherry picked from commit 5843679566327c2df3b93e74bf3a1c7914f6530b) 2019-12-08 OpenSIPS * [a5f981589] : Rebuild documentation 2019-12-06 Liviu Chircu * [984468f84] : dialplan: Fix misleading 'dp_reload' docs and logs 2019-12-03 Vlad Paiu * [3a24c870d] : Fixed long select queries reporting 0 rows instead of ERROR if mysql_store_result throws an empty result set, first check mysql_errno and if that is ok, only then assume the result set is empty (cherry picked from commit ef33057a21860c9acea31da8d44bd9d730cae4cd) 2019-12-01 OpenSIPS * [59a08bf2c] : Rebuild documentation 2019-11-26 Razvan Crainea * [aa6f4b46d] : b2b_entities: remove bogus content length check (cherry picked from commit b411063f172868a1e058f24d21cff40f7b881518) 2019-11-26 Liviu Chircu * [f32fa99ad] : mid_registrar: Fix mishandled corner-cases * avoid extraneous "udomain unlock" operations on some error cases (cherry picked from commit b3bdf7ce29dfe359b041ee0e59472a872bff1268) (cherry picked from commit e3d7b599284140d2c7c729c5d43ebd9f529fb6f3) 2019-11-26 Razvan Crainea * [198a6dbe6] : registrant: document password format in db schema The format of the password is actually driven by the format of the `credential` parameter in the uac_auth module. Closes #1817 (cherry picked from commit fe844ad49bc5eaada0b1edf318b3f9327149bdc1) 2019-11-26 Alessio Garzi * [8b79354e3] : Memory leak fix for mongodb module-reply not freed (cherry picked from commit 4e0d8ffd2c5d1f1a110fb503567f664dbe889544) 2019-11-26 Razvan Crainea * [b1c3b7618] : dialog: build the ACK with full route set for re-INVITE When the dialog module was sending re-INVITEs, the ACK to those re-INVITEs was generated by the TM, thus was lacking a valid Route set. This commit prevents the TM from generating the ACK, having the dialog module sending it, with the learned Route set. Thanks go to 46Labs for reporting and testing this! (cherry picked from commit c914f15001a9d5d3afa659d26a2f22ad76ce4632) 2019-11-24 OpenSIPS * [b53542a80] : Rebuild documentation 2019-11-22 Liviu Chircu * [c8cf3f733] : usrloc: Fix incomplete docs on 'cluster_mode' Thanks go to Bogdan for the catch! (cherry picked from commit e9e6f40427385b72638b45e3a3e8b72b9fd9b294) 2019-11-22 Liviu Chircu * [b0d05ced9] : pua_usrloc: Do not crash during usrloc sync ... on the backup box, due to `current_processing_context` being NULL. Thanks to Pete Kelly for reporting and testing! (cherry picked from commit be5c5e50b9bb7b4d97bbf0a0b248b92c52cf2675) 2019-11-21 Razvan Crainea * [aa89b8764] : rest_client: initialize cURL library in mod_init() This fix prevents crashes generated by rest_client trying to initialize the SSL library from multiple processes in parallel, without any locking mechanism on the internal shared objects. Many thanks to Clif Jones and Ben Newlin for reporting and providing plentora of logs and configurations that replicate this issue. Without their help I couldn't have figured this out. Close #1771 2019-11-20 Liviu Chircu * [ecea9aa90] : dialog clustering: Fix a rare deadlock 2019-11-20 Liviu Chircu * [87c7e54d5] : dialog clustering: Fix a rare deadlock 2019-11-20 Razvan Crainea * [e02f55b8c] : dialog: improve $DLG_dir docs (cherry picked from commit e2e2c8a922892c49a040301cb4e07e52ac5cc625) 2019-11-18 Bogdan-Andrei Iancu * [c35696650] : Removed useless SQL condition The contact_id is an unique ID of the contact, so using the callid (as part of the query key) is redundant and useless (probabaly a leftover from the code re-factoring when the contact_id concept was introduced) (cherry picked from commit 312cad88869c84d98307b800975ba41b5e5b65d5) 2019-11-18 Bogdan-Andrei Iancu * [76dfead30] : Fixed handling of signed numbers as script route params 2019-11-17 OpenSIPS * [acc2b510d] : Rebuild documentation 2019-11-13 Liviu Chircu * [486f06851] : Makefile: Re-order deps to fix parallel `make install` `make -j install` is now fully functional Fixes #892 2019-11-13 Liviu Chircu * [654e868e1] : mid_registrar: Fix possible crash on shutdown Since the TMCB_TRANS_DELETED callback _may get called after_ the module destroy() phase, the udomain_t structure attached to the callback must not be accessed anymore if OpenSIPS is shutting down, as the usrloc module may have already freed most of its data structures. Fixes #1641 (cherry picked from commit 1fbe9a66c57ea35eb73661c528d5a5dbc77f5858) 2019-11-13 Vlad Patrascu * [221359da8] : lua: complete the fix in commit 9849db3 2019-11-13 Vlad Patrascu * [9849db382] : lua: fix lua_reload MI command Closes #1745 2019-11-13 Bogdan-Andrei Iancu * [501c89389] : Proper free and reset of dummy SIP msg after running HEP route 2019-11-13 Bogdan-Andrei Iancu * [cff73d685] : Avoid mem leak when running the check trace route for TCP. Do proper free of the summy SIP msg after each run. 2019-11-13 Bogdan-Andrei Iancu * [2c1999bc8] : Proper dummy sip msg cleanup after running startup route 2019-11-13 Bogdan-Andrei Iancu * [b3dc0f706] : Proper reset of the sip_msg struct after each run of timer route. Some cleanup of the free_sip_msg() function. This function is suppose to only free the attached content of a SIP msg, but without doing any kind of reset of the subfields. Closes #1878 2019-11-13 Liviu Chircu * [81a098344] : struct hist API: Add rotating log list support The struct hist debugging support now also offers rotating logging lists with capped sizes. Whenever the "flush" condition occurs, the new sh_list_flush() function can be invoked in order to dump the currently held logs to disk. Inspired by #1580 (cherry picked from commit 1fa98a977d532931d3834b52e47d4598e9fab2ad) 2019-11-13 Bogdan-Andrei Iancu * [f1857c8b3] : Fix crash of list_hdr_add_option() on an empty body hdr Reported by Elliot Journeaux. 2019-11-12 Liviu Chircu * [92c785e95] : build-contrib.sh: Add new contributors (cherry picked from commit b01fea26391538e152f6eddca148a49a82038d15) (cherry picked from commit e12d49d569a57d99011ff65f6d832351883ca608) 2019-11-12 Liviu Chircu * [e59b0d4c9] : clusterer: Improve doc for 'seed_fallback_interval' (cherry picked from commit 152e0f97cc69451e5834503c0fe172f1dca8b493) (cherry picked from commit 1348c9d6e099827822f9a30bbfe589d66b0aac5a) 2019-11-12 Liviu Chircu * [88a350482] : clusterer API: Refactor the "require_sync" parameter Rename to "startup_sync", which better reflects its actual behavior. (cherry picked from commit a8b85870374fae038770919f5593e30a16949b78) (cherry picked from commit 68eefbf3986ae2bf45e8c12f9eeebf315a635e20) 2019-11-12 Liviu Chircu * [248544a03] : Fix various typos & minor doc/code shortcomings (cherry picked from commit b7db8e6753c67767a1ec50f2ec44ef5c99eafc6a) (cherry picked from commit 9b28a8f92486721a0a19208aa8d78f8d60f4ac05) 2019-11-12 Razvan Crainea * [50e21b27b] : drouting: fix type crash for goes_to_gw() When goes_to_gw() was not called with type parameter, OpenSIPS was crashing, due to the fact that it was dereffering -1. This bug was introduced in 568675291e and f37527dcf 2019-11-11 Liviu Chircu * [4a639db5b] : launch() statement: Fix an AVP list management bug Whenever a launch() operation gets executed inline (thanks to some favorable conditions), two things must happen: * no AVP from the message execution context should leak into the report route execution context * the AVPs from the message execution context must be restored after running the report route. They _must not_ be destroyed, as message processing will continue afterwards! Many thanks to Alexey Vasilyev for some valuable troubleshooting info Fixes #1580 2019-11-11 Razvan Crainea * [0c508828f] : siprec: fix unref mechanism Fix unref mechanism to prevent it from unlocking an already freed session (cherry picked from commit be8596544e84f8115c28826810ee342d35105963) 2019-11-11 Razvan Crainea * [02a99a319] : ratelimit: allow traffic if NETWORKING stat not updated Adresses issue #1882 reportd by Ben Newlin (cherry picked from commit af6be0a44f1dc24326f3a7d251c95f31495dbb61) 2019-11-10 OpenSIPS * [126bf7647] : Rebuild documentation 2019-11-08 Alexey Vasilyev * [513a6bc5a] : Use word64encoding for $TH_callee_callid like in PR #1448 (cherry picked from commit 3c74e41f7b9ea6c541b3baafef357ce901132885) 2019-11-08 Vlad Patrascu * [542f1ef26] : tls_mgm docs: improve modparam descriptions for the default domain 2019-11-08 Liviu Chircu * [0f68f1407] : mid_registrar: Remove Path when forwarding REGISTERs Regardless of its working mode, the mid-registrar always rewrites the Contact header to point to itself, so it stays in the path of future calls. Consequently, when relaying REGISTERs, it MUST no longer include the Path header(s) built by the upstream elements, as this will break call routing. (cherry picked from commit a97ca66a21df52967b799239a63acf9ba041332b) 2019-11-08 Liviu Chircu * [e24ea9443] : usrloc: Avoid locking issues on shutdown At mod_destroy, there is no need to lock the hash anymore. (same reason as the one behind 160b42410) (cherry picked from commit b0ac52b2fe0bf331556fa278fd535720b40fb0c1) 2019-11-08 Liviu Chircu * [553a99a48] : registrar: Fix a rare "max_contacts" bug When registering 2+ contacts in a single REGISTER, on an AoR with at least 1 registered contact, the "max_contacts" feature would not work properly anymore. (cherry picked from commit 7ff8b476fd19e25bb98b52c30c303a8bd6ba44b8) 2019-11-08 Bogdan-Andrei Iancu * [ad1736243] : Fixed typos 2019-11-08 Bogdan-Andrei Iancu * [4e7a0f177] : Add safey test for prev commit Helper for #1848 2019-11-08 Bogdan-Andrei Iancu * [9c603b84b] : Expose sharing_tag while listing subscriptions Helper for #1848 2019-11-07 Bogdan-Andrei Iancu * [c33fe4654] : Check for RAW_QUERY support if DB_ONLY Fix for initial problem on #1877 (cherry picked from commit f8e4072b9c59c88d8cd63da6e3dfda491de4e49a) 2019-11-07 Bogdan-Andrei Iancu * [847dc7267] : Proper unlock on RADIUS AVP failure DO not forget to release the ACC data lock if the operation of adding new RADIUS AVP fails. Reported by Richard Revels Closes #1864 (cherry picked from commit 1ed25cc505fda8c07e7dccf1642770b43f183a46) 2019-11-06 Vlad Patrascu * [9ab3d0cbc] : tls_mgm docs: add missing CRL related modparams Also improve the description of the 'ca_dir' modparam. (cherry picked from commit 9d76d4ea92e40e774cddfe4307d0437005090697) 2019-11-06 Vlad Patrascu * [850e2bdd4] : acc docs: add 'ms_duration' param for E_ACC_CDR event (cherry picked from commit 40923a75ad239f93c4f3c2e15bddff9f2ea29882) 2019-11-03 OpenSIPS * [47b87582b] : Rebuild documentation 2019-11-01 Razvan Crainea * [e37bf42b5] : ratelimit: make rl_feedback_limit extern Make sure `rl_feedback_limit` is properly alocated for the entire module, not only for the current object. Fixes the crash reported by Ben Newlin. Close #1882 (cherry picked from commit 8f26f5aa501dfad69e50c2bedcd4325afe7b1508) 2019-11-01 Razvan Crainea * [9d2ba82b6] : net: handle CONN_ERROR2 on main (cherry picked from commit 4ffbeee5d6addde9548bb1bc102fe327cb546754) 2019-10-29 Vlad Patrascu * [3ff0d36ad] : sql_cacher: fix concurrent use of $sql_cached_value For example, this fixes issues when calling a script function with multiple $sql_cached_value params as PV specs. The function would get the same static buffer that would be progressively extended and overwritten. (cherry picked from commit cefc071606b52aefffa2967adf8b5846878c3296) 2019-10-20 OpenSIPS * [0a33e8b00] : Rebuild documentation 2019-10-17 Liviu Chircu * [0db946724] : struct hist API: Fix possible crashes; Improve API Commit a74fff149a introduced a race condition on this logic: lock_get(&sh->shlist->wlock); sh_unref_unsafe(sh); lock_release(&sh->shlist->wlock); , where "sh" must no longer be read following the unref operation. This commit fixes this issue, along with: * fix crash with -DSTRUCT_HIST but no -DDBG_TCPCON * speed optimizations: eliminate memset() operations (not needed) * make sh_push() more flexible (extra ref counts from outside) * code: hide structs, so importing struct_hist.h doesn't conflict with mysql.h's own "struct list_head" 2019-10-16 Liviu Chircu * [cf117186a] : assert() statement: Fix crash on startup The asserted expression must be ran through the fixup logic before it can be fully usable. For example, this fixes: assert($var(x) =~ "X", "test-op-match-1"); 2019-10-16 Liviu Chircu * [62eb40f40] : scripting operators: Fix some bugs with "" comparisons The =~ and !~ operators were misbehaving when an empty string ("") was present on the LHS, and were always returning `False`. A similar fix was done in dfd795fea, for OpenSIPS 3.0+. Fixes #1860 2019-10-15 Liviu Chircu * [7b52ab668] : presence: Document sharing tag MI commands 2019-10-15 Liviu Chircu * [edefd1073] : usrloc docs: Fix misleading info on timer behavior (cherry picked from commit 755defe07c743407be61326c5e3a568e26ffce86) 2019-10-13 OpenSIPS * [07f7f8695] : Rebuild documentation 2019-10-09 Razvan Crainea * [58ee9e622] : mathops: allow math operations from any route Reported by Nick Altmann, close #1850 (cherry picked from commit e4c629c80c56e42eae82cff6e5c87f57f02661c2) 2019-10-08 Razvan Crainea * [372bda45c] : siprec: fix deserialization of siprec session (cherry picked from commit 59ce4d28443316ccea882181ff4f009c6870c6ec) 2019-10-07 Bogdan-Andrei Iancu * [a169b494a] : [cfgutils] Downgrade polluting INFO log to DBG (cherry picked from commit 304314ff9ee9ff5ea0f4cfae263e45ed851b79b1) 2019-10-07 Bogdan-Andrei Iancu * [f33d56e05] : Fix type in doc example Reported by Ognjen Šešlija 2019-10-07 Razvan Crainea * [8707f768b] : Makefile: remove DEBIAN_VERSION Thanks go to Ken Rice for pointing this out! (cherry picked from commit d9435208b5dd41990bb51efe5254cc83504e7899) 2019-10-06 OpenSIPS * [b5022ba65] : Rebuild documentation 2019-10-04 Liviu Chircu * [9c49b09c1] : Module deps: Fix a corner-case leading to a crash When setting a dependency-inducing modparam multiple times (e.g. avpops db_url) while having loaded no further dependency-inducing modules, OpenSIPS would crash on startup. Thanks to Xiao Huang for the report and fix Fixes #1843 2019-10-02 Razvan Crainea * [7d3344f00] : Makefile.json: change json library based on include if we are going to include json-c header, than we shall use the json-c library, instead of json (cherry picked from commit 0d981b8f8b3466368cae2849f7912f3148ab7e4c) 2019-10-01 Vlad Patrascu * [e4ee1784c] : event_virtual: improve the behaviour of the FAILOVER policy A previously failed subscriber is now skipped for further notifications for a configurable interval (via the new "failover_timeout" modparam). This is useful when the actual event backend blocks for a considerable amount of time when rasing the event. This commit greatly decreases the overall amount of time OpeSIPS processes remain stuck when a subscriber is unresponsive. Related to #1836 (cherry picked from commit 4dde71c13aaf5860472273c81bed7fec44e48723) 2019-10-01 Vlad Patrascu * [3fdc9976e] : event_rabbitmq: don't block indefinitely on connect The connection timeout is configurable via a new module parameter. Related to #1836 (cherry picked from commit fec5b51a0b4980b519904308b6297cd17d3b0ba6) 2019-10-01 Razvan Crainea * [b86d5be41] : tls_mgm: don't run ATEXIT openssl callbacks for 1.1.1b The NO_ATEXIT flag was added in openssl 1.1.1b, not 1.1.1 Credits go to Nick Altmann for reporting this (cherry picked from commit d2e6874f3e8c7919cf5efb68c7a2eb80ebec636f) 2019-10-01 Razvan Crainea * [4ba2af467] : rtpengine: enhance symmetric documentation Close #1841 (cherry picked from commit 5d177ba9fd9a3234e21188e3964fc1083cc81f3f) 2019-10-01 Razvan Crainea * [f75fdece5] : tls_mgm: don't run atexit callbacks at shutdown prevent OpenSIPS from crashing during shutdown due to bogus atexit() `OPENSSL_cleanup()` routine, that is ran after the SHM memory is destroyed, thus crashing during shm memory release. (cherry picked from commit 3d30217a8d86696e69c0e6ca2005a723401d1e90) 2019-09-30 Liviu Chircu * [074f06538] : dialog: Safeguard R/W access to SDP strings Access to SDP-related strings (e.g. the dlg->legs->adv_sdp "str" field) must be done in a guarded manner, otherwise the shared memory could get corrupted. Many thanks to 46Labs for supporting this fix 2019-09-30 Liviu Chircu * [561392279] : dialog: Fix unsafe profile list iteration The dialog->profile_links list _must always_ be walked after first grabbing the dialog's lock, regardless of the current ref count. Failing to do so may lead to invalid memory access, as the list elements may get freed from other processes. Many thanks to 46Labs for supporting this fix 2019-09-30 Liviu Chircu * [e79df4b0f] : dialog: Fix possible deadlocks with pinging + HA The pinging (both OPTIONS and Re-INVITE) + replicated dialog creation routines were sufferring from a possible AB/BA deadlock, as they were both attempting to grab the dialog and the ping timer list locks, but in differring order. 2019-09-30 Razvan Crainea * [174309019] : tm: dup in pkg the faked msg headers before this commit, the faked reqests were having the headers fields stored in shm_mem and shared with the tm request uas. Thus, during concurrent accesses to one of the headers' `parsed` field, the first process would have parsed the field in pkg memory, and the second process would have found that header already parsed. However, it couldn't read the other's process memory, resulting in an invalid access. Moving the headers in a private area for the faked request solves this issue, as each process will have its own `parsed` field in pkg memory. Credits go to Rizwan Syed and Jonathan Hulme from Connex CS for reporting and supporting the testing and fixing of this issue. This issue has also been reported in ticket #1808 (cherry picked from commit a48aeca2d29f0ae04f3393ddb32bcf70b2be2795) 2019-09-30 Dan Pascu * [1c24f3b60] : Removed leftover code after pthread overwrite fix (cherry picked from commit 3febdf5ded03992be39b38b4c3bb97bc2bb47c27) 2019-09-30 Dan Pascu * [a944b5a61] : Fixed overwriting pthread locking functions (cherry picked from commit 92d7188b2a6ad805df10c63bf716c02f90c444ab) 2019-09-30 Liviu Chircu * [f4f5f8d08] : Transformations: Fix a series of buffer overrun bugs This patch adds several buffers, on two layers, such that the following operations are no longer broken (i.e. leading to buffer overruns and incorrect results): * putting together any kind of transformation chain without the risk of reading and writing into the same transformation buffer * passing multiple transformation-enabled variables with arbitrary chaining lengths to a script function without the risk of any two of them making use of the same buffer Many thanks to Răzvan Crainea for some timely tips! Fixes #1572 2019-09-30 Liviu Chircu * [a29218454] : cfg language: Fix binary string comparisons When dealing with binary strings (e.g. the ones produced by {ip.pton}), some of the string comparison operators were broken, such as: !=, >=, >, <= and <. Completes dee8a6a375 2019-09-29 OpenSIPS * [8dd6ee52f] : Rebuild documentation 2019-09-28 Liviu Chircu * [551ad7d10] : pi_http: Fix undefined 'PROC_BIN' reference (cherry picked from commit c7013403fe9dd58c5883b328bcbbbb4e21731481) 2019-09-27 Bogdan-Andrei Iancu * [838349d58] : Remove old, unused reference to PROC_BIN 2019-09-27 Bogdan-Andrei Iancu * [d5be677e7] : [droutoing] fix typo in comment 2019-09-27 Bogdan-Andrei Iancu * [d262c5ae0] : [clusterer] third param of 'cluster_broadcast_mi' is optional 2019-09-27 Bogdan-Andrei Iancu * [146bcee04] : [uac] force enclosing of the newly added URI As the new URI may contain URI params, to be sure we are not mixing them with hdr params, we enclose the new URI (if not already). Closes #1741 2019-09-27 Bogdan-Andrei Iancu * [57f3619ff] : Loop and wait for multiple terminted processes. If you have a bunch of exec() calls (translated into a bunch of additional processes created), upon their termiantion OpenSIPS will get a cascade of SIGCHLD signals - as the kernel does not guarantee the delivery of the signals (like mergining similar multiple signal triggers), we will not have a 1-to-1 between terminated processes and received signals. So, let's do our best and upon a single SIGCHLD we will try to "catch" as many terminated processes as possible/available. Closes #1773 2019-09-27 Vlad Patrascu * [18de241af] : clusterer: select the proper send socket for multiple bin listeners Fixes #1671 (cherry picked from commit e5e249b4d646ea838060f3835190042cde85db90) 2019-09-27 Liviu Chircu * [082329764] : dialog: Optimize link_dlg_profile() Reduce the number of pointer de-reference operations performed, be it under lock or not (from 8-9 de-references down to just 1). 2019-09-27 Bogdan-Andrei Iancu * [e2c07915d] : [dispatcher] proper triggering of state events Trigger the event ONLY when the status of the destination changes. Close #1816 2019-09-27 Liviu Chircu * [43a733bee] : dialog: Various small code/performance improvements * remove redundant "is_replicated" function parameter * speed up profile hash computation (size is always 2^N, see new_dlg_profile() -> we can do bit AND) * shorten cookie-cutter code with add_last() and str_cpy() * fix over-complicated if condition * do not leak PKG memory on some error case * remove useless comment 2019-09-26 Liviu Chircu * [d4be27178] : dialog: Fix a very rare race condition A dlg->h_id with value 0 is perfectly possible, see link_dlg_unsafe(): dlg->h_id = d_entry->next_id++; It should not be treated as some special case. 2019-09-26 Liviu Chircu * [ddbff5003] : dialog: Fix unsafe profile linker handling Once a profile linker is attached to dlg->profile_links, it _must not_ be touched anymore, as it can be freed at any moment (e.g. within a simultaneous processing of dialog CREATE + DELETE bin packets). Many thanks to 46Labs for uncovering this bug and for supporting the fix 2019-09-26 Bogdan-Andrei Iancu * [cb005bb26] : Properly pass the advertise options when expanding interfaces. Closes #1837 2019-09-26 Vlad Patrascu * [b0760cd10] : acc: fix bad event parameter values for evi accounting All dialog specific accounting fields were incorectly pushed as event parameters for E_ACC_EVENT and E_ACC_MISSED_EVENT. This would result in bogus values, possibly set by previous triggerings of E_ACC_CDR_EVENT. This commit also fixes a type conversion bug causing the 'setuptime' and 'created' parameters of E_ACC_MISSED_EVENT to be improperly set. Closes #1786 2019-09-25 Liviu Chircu * [0b55ca32e] : usrloc: Fix some incorrect startup checks On some misconfigured scripts (e.g. DB usrloc + db_url modparam, but without any SQL DB module loaded), the module would report some strange errors, instead of the more intuitive: WARNING:core:solve_module_dependencies: module usrloc depends on an sqldb module due to modparam working_mode_preset, but none was loaded! ERROR:core:main: failed to solve module dependencies Thanks to Vlad Pătrașcu for the catch! 2019-09-25 Bogdan-Andrei Iancu * [149d41c5e] : [acc] added loose dependency to dialog module We need to be sure that dialog module is init before acc (if dialog is loaded), to prevent any crashes when acc registers the DLGCB_LOADED callback in dialog (the registraion of the callback will try to run the callback on any pre-existing dialogs, so the hash table for the dialogs must be created/init). It is a loose dependency as it does not require the dialog module to be loaded. But if loaded, it must be init before ACC module. Fixes #1833 (cherry picked from commit 3c18dbfc198d7bece144e708762ea35299bdc8b5) (cherry picked from commit 7ade34c578e9219e66472e213f8ae70ec915dfbb) 2019-09-23 Liviu Chircu * [3e42262b3] : fraud_detection DB schema: Fix missing default values 2019-09-23 Liviu Chircu * [f36341f59] : fraud_detection: Various small improvements * refactor unreadable/unmaintainable code * fix bad hash sizes, leading to unused buckets * improve some key errors reported to the users 2019-09-23 Liviu Chircu * [3ac00a6dd] : fraud_detection: Fix a seq calls computation bug The sequential calls of a user should be counted using the dialed numbers, NOT the matched fraud rule prefixes (which are almost always shorter). Reported by Benjamin Pasquet from OpenIP 2019-09-23 Liviu Chircu * [118a35268] : fraud_detection: Fix a dangling SHM access bug This patch fixes a race condition where a fraud_detection reload could free the global SHM "threshold" objects which are still being referenced N times (once for each ongoing dialog -- callback is invoked on termination). The solution is to simply store the integer values of the thresholds into the callback data, and avoid storing any SHM pointers which have no lifetime guarantees. 2019-09-23 Liviu Chircu * [d0b6e60bb] : fraud_detection: Fix incomplete locking logic The get_item() function results were insufficiently guarded, such that the SIP workers may concurrently perform insert operations on the same map object, possibly leading to shm corruption. Fixes #1389 2019-09-22 OpenSIPS * [4612e5568] : Rebuild documentation 2019-09-20 Liviu Chircu * [6f8c1b40a] : sql_cacher: Fix a series of memcmp() bugs This patch fixes a series of string comparison bugs, which would have lead to either false positives or invalid memory access. Credits to Răzvan Crainea for the report (cherry picked from commit abf3e32f944976e5f16e712cc0d10e01e73816ff) 2019-09-20 Bogdan-Andrei Iancu * [822f9542e] : Fix missing alias ports in TCP conn description The alias ports of a TCP connections are essential information when debugging issues related to the TCP conn re-usages. 2019-09-19 Razvan Crainea * [24ce6919e] : Rename the mod_exports dependencies function to preinit Commit b29931e4f added a new function in `mod_exports`, sadly named `dependency` function. This created a confusion with the existing dependency mechanism. This commit changes renames the newly added function to `preinit`. Kudos to Liviu Chircu and Vlad Patrascu for arguing about this. (cherry picked from commit fed5bade4ee435a0431efbb224ba21291c708467) 2019-09-19 Razvan Crainea * [9092269cb] : acc: store ctx in dialog when starting accounting (cherry picked from commit a105be21ba27d9e796e6a158b30278777c656ca8) 2019-09-19 Razvan Crainea * [3234f69ec] : acc: register DLGCB_LOADED callback in mod init Move the registration from the dependencies function, because at that point the dialog module does not have anything loaded. (cherry picked from commit 68a764c06785c5fdf7904920cbc7ae0aedcf817b) 2019-09-19 Razvan Crainea * [79773e234] : acc: always try to load dialog module In case the `cdr` flag is used as variable, we can not figure out during startup parsing whether the dialog module should be loaded or not. Therefore we always try to load the dialog module, and in case we can't and the `cdr` flag is used, we trigger a warning. (cherry picked from commit f54e3fd767a6906df260f810baf62cdd04b2e42a) 2019-09-19 Liviu Chircu * [bbf0de979] : acc: Fix segmentation fault on startup Reported by Dan Pascu (cherry picked from commit af1e442551b9d1c949ce879cc72f870a95f011ab) 2019-09-19 Razvan Crainea * [a4f0d8623] : acc: use the dependencies function to register dlg ctx This is a temporary fix, until we figure out a way of registering the dlg ctx index only if cdr is used. (cherry picked from commit 3aa5596c5584141f0256959f18b606c256a48092) 2019-09-19 Razvan Crainea * [dc6bdb6c9] : add dependencies function in module_exports Add a new function in module_exports that is run to determine what kind of dependencies (of other modules) a module has. This function is ran before running the initialization phase of the module. (cherry picked from commit b29931e4fb1ae528fd896d68038cf5ad4395c4cf) 2019-09-18 Liviu Chircu * [22273d9c8] : usrloc: Be more strict with bad modparams Do not attempt to auto-fix invalid modparam values and throw a warning, because some users may skip reading the logs on a "succesful" startup! (cherry picked from commit e5dad693a3c6ba74c8de1b69e479a449dfe0669e) (cherry picked from commit b64ea1760f95de72b7d9e48325e98944a07935ef) 2019-09-15 OpenSIPS * [7a244e01b] : Rebuild documentation 2019-09-12 Liviu Chircu * [85e6d44ba] : federated usrloc + Cassandra: Fix metadata deletion Due to the fact that the key/value cachedb API often uses hardcoded key names in each backend implementation (e.g. "opensipskey"), usrloc AoR metadata delete operations were not working with Cassandra, as usrloc asks the API to delete the "id" key. (cherry picked from commit 8862524164a30acd1a3840059474e85800f0efe3) 2019-09-11 Liviu Chircu * [d75e6767f] : usrloc: Undo removed condition in da1dac8f Credits to Vlad Pătrașcu for the catch! (cherry picked from commit c21c0944d899968835df0cffb88dc7c6636070d3) 2019-09-11 Liviu Chircu * [34ee436f2] : usrloc: Fix a replicated AoR label matching bug This patch makes it so the AoR label gets included in the "AoR created" replication packets and mirrored in the receiver instance. This prevents a series of bugs where the usrloc API fails to match a contact by its contact ID, e.g.: * nathelper being unable to delete dead TCP/TLS contacts after a restart + usrloc cluster sync * mid-registrar (mode 1) being unable to look up a contact by contact ID after a restart + usrloc cluster sync Reported by @vasilevalex Fixes #1492 (cherry picked from commit da1dac8f41b199dae0028546bd1e547e8ddef922) 2019-09-11 Razvan Crainea * [e3a2d4cb9] : obsolete/seas: revert bug introduced in commit fa0bcd201a Many thanks to Walter Doekes (wdoekes on GitHub) for reporting this in ticket #1828 (cherry picked from commit fc73c9fb26ff5f6af316cd47f00e670900acff1b) 2019-09-10 Liviu Chircu * [ad9ff9a27] : mid_registrar: Improve throttling performance (modes 0 and 1) This patch fixes a bug with UACs that send expiration values which are _beyond_ the configured "outgoing_expires" value. In this case, the throttling logic would only keep absorbing REGISTERs up to "outgoing_expires" seconds, and would disregard the actual value returned by the main registrar. 2019-09-09 Liviu Chircu * [6094710be] : mid_registrar: Fix unsafe aor->contacts access In modes 0 and 1, the aor->contacts list was accessed in an unsafe manner, as the AoR lock would be relinquished too early. This could lead to a crash in rare cases. (cherry picked from commit 66f99833fbddd7c4ca12b7616356a59647e8b592) 2019-09-09 Aron Podrigal * [eb625f24e] : Fix #1804 - mid_registrar_save() should save new contact from register following an unregister. When using `sql_mode` is set to `SQL_WRITE_BACK` and `rr_persist` is `RRP_LOAD_FROM_SQL` contacts are not immediately deleted from memory, contacts are marked `expires = UL_EXPIRED_TIME`. So when a `REGISTER` request is received following an UNREGISTER, do not return the previous contact marked for deletion. Returning the previous contact record, could have potentially lead to a crash, if opensips would free the contact record while mid_registrar would retreive that using `get_ucontact()`. (cherry picked from commit 98636d41de9ee631e838df348c9ea2a0735cd1c2) 2019-09-09 Razvan Crainea * [4b2b20be0] : travis: replace libradiusclient-ng-dev libradcli-dev (cherry picked from commit d8beff877b8094798581589cd374466e7b26a6c1) 2019-09-09 Liviu Chircu * [be0d2863e] : sipcapture: Run child_init() during startup This allows, among others, sending HTTP requests from the script, as the rest_client module needs to initialize its state before it can be used. Reported by @hydrosine Fixes #1818 (cherry picked from commit 2db8c1715f209f9ec3d55405a8bfaf7cbda6a7ea) 2019-09-08 OpenSIPS * [88c00106f] : Rebuild documentation 2019-09-03 Liviu Chircu * [25f9070ab] : textops: Fix bad subst_body() example 2019-09-02 Razvan Crainea * [7646a9edb] : tm: fix avp add error check (cherry picked from commit abe988a2df61dc8deaae18e9fbfedc12f0c806a7) 2019-09-02 Liviu Chircu * [bebad9f23] : path: Do not omit ";received=" when merging Path headers If "enable_double_path" is on and the inbound and outbound sockets match, the second Path header would not be added anymore (good!), thus skipping the ";received=" parameter completely (bad!). The above behavior is actually a regression, introduced in 71c7d75f66c Many thanks to Pete Kelly and Bogdan Iancu for spotting the problem! (cherry picked from commit 8070dac142fc6506429314371f04372b5ce4a5b6) 2019-09-01 OpenSIPS * [9282adada] : Rebuild documentation 2019-08-29 Vlad Paiu * [901cb359b] : RFC 5389 : "Defined a generic padding mechanism that changes the interpretation of the length attribute. This would, in theory, break backwards compatibility" Skip the new padding, also skip non-mandatory attributes (cherry picked from commit d26b998000022e9417c0894535edf7b0ba6772f0) 2019-08-28 Vlad Patrascu * [3d761ec9b] : dialog: do not replicate 0 profile counter under lock (cherry picked from commit 4129583965e171160137a077cf37ca08df7d1e5d) 2019-08-26 Liviu Chircu * [910596168] : dialog: Add optional ref troubleshooting support (cherry picked from commit 21e33d0ae1afdd409c9c707132e263c74fe4ee95) (cherry picked from commit fd46af53bc1edc6c7dd0e7d8b2ca1c0d60f9cb1a) 2019-08-26 Liviu Chircu * [14873a4ef] : struct hist debugging: Enhance the API * add the possibility to disable auto-logging. Previously, each debugged entity would periodically dump logs to disk as it accumulated logs. Disabling auto logging is especially useful when troubleshooting code in high-throughput environments. * sh_log() is now a macro, which will additionally print the FILE / FUNC / LINE of the calling code, offering more troubleshooting insights and reducing the amount of code written * simplify sh_unref(), the 2nd parameter was unnecessary (cherry picked from commit deb03fe86a8d0134526c86e62183cb80887b09c9) (cherry picked from commit a74fff149a19c51ad333342c9a33357d3385f05b) 2019-08-25 OpenSIPS * [95555a70f] : Rebuild documentation 2019-08-23 Dan Pascu * [8b0284e82] : Fixed potential illegal memory access to freed structure (adapted from master) 2019-08-22 Vlad Patrascu * [a16d0b380] : dialog: discard a replicated update for a deleted dialog A race between the processing of a dialog update and delete replication packets can lead to an incorrect dialog state and bogus unrefs. (cherry picked from commit c0697b9ad7269d84dbac63162879a903cc6b1ac4) 2019-08-22 Bogdan-Andrei Iancu * [a3d422e4e] : [registrar] Fix wrong doc on is_contact_registered() 2019-08-21 Bogdan-Andrei Iancu * [b97015920] : [tm] fixed regression on cancelling empty branches upon timeout While adding support for Content-Disposition: no-cancel (see 4747da559f4df161441be8373488dee9fd16c282), a regression was made, allowing TM to send out cancel (upon internal 408 timeout) to branches with no incoming replies. Only this cancelling scenaio was affected (internal 408 timeout). The cancelling upon 200OK or incoming cancel were not affected. Thanks to Richard Revels for spotting and reporting this. (cherry picked from commit f1a6d0d8e46c4aff9f203f2eb7e85a2b1e40cf92) 2019-08-21 Vlad Patrascu * [b2d59f9f5] : clusterer: fix possible crash when sending a bin packet This commit fixes a crash caused by a race condition when computing the next hop for a destination before sending a bin packet. The actual 'next_hop' field from the 'node_info_t' struct may be changed by another process after getting the return code from the 'get_next_hop_2()' function. (cherry picked from commit 5386bb7a48cc62b7930788471b82756a6e2aea3d) 2019-08-18 OpenSIPS * [ab1e3cbee] : Rebuild documentation 2019-08-16 Liviu Chircu * [5dbc4a385] : registrar: Fix a ";received=" Path parsing bug with save("v") Commit 71c7d75 introduced a parsing bug causing the ";received=" info to not get stored into usrloc, as well as the NAT flag. If we're saving these contacts with save("v") instead of save("p1v"), we cannot route to them anymore (the latter version fully stores the Path, so the front-end LB is still able to route back to the devices). Credits to John Burke for the accurate report Fixes #1809 (cherry picked from commit 45dd0e5600506c140cc7bbc1485f6c567c43e27e) 2019-08-14 Bogdan-Andrei Iancu * [11d7dcc28] : [proto_hep] Fix mem leaks upon errors. If resolving the destination fails, do not forget to free the so far allocated memory. Closes #1782 2019-08-14 Alessio Garzi * [fb84a30ee] : Indentation fix 2 on urecord One line was missing tab indentation (cherry picked from commit 61efba2e5a18481e4b92acd860aa7ae88db04164) 2019-08-14 Alessio Garzi * [0662d9482] : Better indentation on switch case inside urecord Just indentation fixes (cherry picked from commit 5d1678a37618d697c7c9a6346c0846d01404a142) 2019-08-14 Alessio Garzi * [e15ec5fd9] : matching_mode honored in cachedbs Function cdb_add_ct_update ignores matching modes set on opensips.cfg, this result in an unexpected behaviour if the user sets matching_mode=0 since multiple records with same contact (but different callid) are stored in the cache database. This fix checks, before getting the base64 hash, if matching mode is contact only, if yes, the callid string is not included in the resulted base64 hash. If matching mode is CONTACT_CALLID, this function behaves like before, and the hash is calcuated using contact:callid. (cherry picked from commit db7eca79a181ceb3406463aad7ab56162247104d) 2019-08-14 Vlad Patrascu * [e8255c83a] : clusterer: fix crash when loading null string columns from DB The bug was introduced in commit: 66ae3ac 2019-08-14 Razvan Crainea * [b0a313771] : dialog: fix double lock get on replication update When a replicated packet was received due to a timeout update, the dialog was refferenced with the lock already acquired, resulting in a deadlock. This fix refferences the dialog in an "unsafe" way, without trying to acquire the lock, since it is already acquired. (cherry picked from commit 6b0da180ab8ee33ac0eb784127e7738b90b4517e) 2019-08-12 Liviu Chircu * [0e85dd69f] : dialog: Fix two referencing issues * an unsafe referencing bug, introduced in 65a9f51f1ee. As long as the dialog is not locked, we _must not_ call ref_dlg_unsafe(). This unsafe increment operation could lead to occasionally missing references, possibly even a crash. * a long-standing bug, where read_dialog_profiles() is invoked on replicated create/update events with a dialog that has no extra reference, so it could very well be a lingering/freed pointer. Under the right conditions, this too could lead to a crash. 2019-08-11 OpenSIPS * [364c2c9f9] : Rebuild documentation 2019-08-09 Vlad Patrascu * [66ae3ac13] : clusterer: fix bad parsing of node specification modparams Multiple string properties in 'my_node_info' and 'neighbor_node_info' modparams would not be parsed correctly. Fixes #1775 (cherry picked from commit c26bea063ec7e86c6552857180eba06861d6ad50) 2019-08-07 Liviu Chircu * [4072d9e54] : CSV parser: Relax the RFC 4180 implementation Do not implement RFC 4180 down to the letter (e.g. double-quotes are ONLY allowed within a field if they are escaped using another double-quote). Rather, only follow this rule if a field _begins_ with a quote. This helps maintain backwards-compatibility with the previous OpenSIPS CSV parser, and is also desirable in many situations (e.g. parsing a WWW-Authenticate header). Fixes #1794 2019-08-04 OpenSIPS * [6fa40aa12] : Rebuild documentation 2019-08-01 Bogdan-Andrei Iancu * [49b1efcee] : [sql_cacher] Proper handling of empty tables if there are no records in the table (after a reload on a fully cached table), do not consider it an error and (even more important) take care and do the version change on the keys (to remove the old values). Closes #1784 Credits go to @clifjones for the patch (cherry picked from commit 9198eccbd2dc1d147d7c1ccf8696dbb80b5935ee) 2019-08-01 Liviu Chircu * [4ef52dcb6] : clusterer: Log all major sync stages at INFO level Motivation: these logs are not spammy at all, yet very useful/reassuring to see in production after issuing data sync commands. (cherry picked from commit 8e391c2f80d9c76dc9369ed20701469a5b2c5740) (cherry picked from commit f589f6c80e16e3fd6cca84377540aa8eb214ef26) 2019-08-01 Bogdan-Andrei Iancu * [6357a1a5f] : Fixed the stats for counting transaction based on the final reply code The fix consist of counting only ONCE each transaction (for the xxx_transaction statistics), disregarding its retransmissions, multiple 200OK replies or final code override (like 200 after a negative reply). Closes #1636 Many thanks to @bcnewlin for his testing and validation of the fix. (cherry picked from commit 68bedfee4fbf3f99b92249b8d8887921d8d80c2f) 2019-08-01 Liviu Chircu * [de942ddfa] : compression: Do not strip "a=rtpmap" lines with types 96-97 According to the IANA RTP payload types register, the dynamic payload types (custom-defined, for which the "a=rtpmap" lines are mandatory and cannot be stripped) begin at 96, not at 98. Reported by JP Hindin (cherry picked from commit f4015c8543e67540166f802f34c6ebf8c7d14c14) 2019-07-31 Liviu Chircu * [05d4a9a11] : dialog profiles: Fix deadlock during startup This updates commit b26d59e30c2c, which introduced a deadlock while loading dialogs from DB which also contain profiles. (cherry picked from commit 57cf12dfa75a27a25f6c1dd50daa0cbb662e2ef0) 2019-07-31 Liviu Chircu * [509e18113] : dialog sync: Fix some subtle backup box restart bugs In an HA setup, following a restart of the backup box, there would be: * an extra ref for dialogs loaded from DB but not confirmed through sync, leading to a few hanging state 5 dialogs (added in 51b5ec3b) * too little 'active_dlgs' stat decrements during the above corner-cases, since update_dlg_stats() ignores state 5 dialogs 2019-07-30 Liviu Chircu * [66f3d97ce] : dialog replication: Fix a re-INVITE pinging shm leak In commit 65a9f51f1ee, we must make sure not to overwrite any already existing SDP/contact pointers in each leg. 2019-07-30 Liviu Chircu * [3b1c49fdf] : Merge branch 'bugfix/fix-dialog-sync-bugs' into 2.4 2019-07-30 Liviu Chircu * [65a9f51f1] : dialog: Fix broken re-INVITE pinging after failover The mandatory re-INVITE pinging data (SDP1, SDP2, ct1, ct2) was not included in the BIN replication packets, so the pinging would stop working once we'd failover to the backup box, in an active/backup HA scenario. 2019-07-30 Liviu Chircu * [51b5ec3ba] : dialog sync: Fix ref miscount during post-sync cleanup The hash reference must only be decremented a single time during the lifetime of a dialog. Given that multiple pieces of code may attempt to delete a dialog concurrently (e.g. a BIN "delete" packet and the post-sync cleanup routine), the only way to guarantee a single decrement of the hash ref is by using the dialog state machine transition. Iff we're the ones to transition from ACK -> DELETED, we can (and MUST) also decrement the hash reference. 2019-07-30 Liviu Chircu * [f88c41064] : dialog: Decrement dialog stats during post-sync cleanup After a sync completes, it proceeds to clean up all dialogs loaded from DB which did not match the data received via sync. However, make sure to also decrement the 'active' / 'early' dialog stats on each delete! 2019-07-30 Liviu Chircu * [aa93d0fbf] : dialog: Fix data reload race conditions on startup Since loading the data on child_init(), the load_dialog_info_from_db() routines and rcv_cluster_event() routines could run in parallel, without any synchronization on the dialog table, which could lead to duplicate dialogs in the hash. 2019-07-29 Liviu Chircu * [b8bde2f01] : dialog sync: Do not include early or ended dialogs 2019-07-29 Liviu Chircu * [e33565342] : dialog replication: Revert the sync packet alignment code ... since now it is unnecessary, thanks to the sync layer enhancements. 2019-07-29 Liviu Chircu * [a20a0acb5] : clusterer: Enhance the versioning of sync packets This commit adds an additional "version" field for the sync packets, which are more complex than the other ones. Since they contain serialization logic from two different layers (clusterer + data module), they should also contain two version fields, to allow each module to discard data coming from an OpenSIPS donor node running on a differing binary version. 2019-07-29 Liviu Chircu * [0b3ad435b] : clusterer: Make the data sync interface more robust This patch improves the data sync interface so that during a sync, modules are no longer forced to micro-manage the data packets they are receiving from the interface. They can now freely abort the processing of a sync chunk at any time, without disrupting the processing of the entire sync packet (composed of many more of such data chunks). Additionally, since the sync packet format has changed (an extra integer is needed for each chunk in order to allow the "skip" mechanism), the sync packet version is now bumped from 1 -> 2, in order to prevent any compatibility issues with OpenSIPS nodes without this patch. 2019-07-28 OpenSIPS * [ade908fba] : Rebuild documentation 2019-07-25 Vlad Patrascu * [0dd8d90f3] : dialog: fix memory leak in unset_dlg_profile() (cherry picked from commit ca0ea3f7fb5849f208d6a685739fdbae567caed3) 2019-07-24 Liviu Chircu * [ac4b46965] : usrloc shutdown: Destroy the CDB conn _after_ cleanup This fixes a possible crash on shutdown whenever a contact expires during the shutdown and needs to be flushed. Credits to @bogdan-iancu for the accurate report (cherry picked from commit 94bbbebbcf99843baa5b6d60e699a466c9adc3d2) 2019-07-22 Liviu Chircu * [9c3a93201] : cachedb_mongodb: Add support for TIMESTAMP and BINARY types (cherry picked from commit aafbb85ce6ce6d46c2cc25770e52cc012c4d4ac1) This fixes some warnings when doing cache_raw_query() UPDATE operations: WARNING:cachedb_mongodb:bson_to_json_generic: Unsupported type 17 for key clusterTime - skipping WARNING:cachedb_mongodb:bson_to_json_generic: Unsupported type 5 for key hash - skipping (cherry picked from commit d7d74d62c1f29ab8e6f4b34fd6b82c6befe2f499) 2019-07-21 OpenSIPS * [8ef5d8e67] : Rebuild documentation 2019-07-18 Razvan Crainea * [2e1d01fb3] : tm: check branches that should be cancelled under lock This fix avoids race condition between a CANCEL message and replies that are coming in the same time. Thanks go to Tommy Brecher for reprting this and offering extensive logs to debug the issue in ticket #1759. Credits for the fix are shared with Bogdan Iancu for the brainstoring. (cherry picked from commit 6e39385233543ee9583469c55d3d3d1738917fb7) 2019-07-14 OpenSIPS * [50a37b3a2] : Rebuild documentation 2019-07-12 Vlad Patrascu * [5acb9ac7d] : sql_cacher: don't query the SQL DB under lock when reloading Previously, retrieving any key from the cache during a reload would blocked until the SQL DB query completed. Suggested by Ben Newlin in #1760 (cherry picked from commit 642271cf43ae005e81125bc98fcabc6700e46aca) 2019-07-12 Razvan Crainea * [8e80335f3] : dialog: run loaded callback for dialogs loaded from db Fixes a bug introduced in commit 8c8f27f that was relying on the fact that dialogs were loaded from db *before* registering the loaded callback, due to the dependencies mechanism. Thus the loaded callback was ran on the spot, when the it was registered. However, this is not entirely correct, since there are modules (such as acc module) that do not have dialog dependencies, but still register LOADED dialogs - in these cases, if dialog was loaded (in script) after the module itself, the callback was never run. This behavior was amplified by commit 3ddae43, which was basically never loading the dialogs before registering the callback, thus the loaded callbacks were never ran. The purpose of this commit is to fix this issue, reported in #1754 Thanks go to Liviu Chircu for reporting the issue and providing the fix (cherry picked from commit 6638b06f3ffa1fbc8d19f0532879e2c6c77a76d0) 2019-07-11 Vlad Patrascu * [da31a162f] : sql_cacher: properly increment relod version on timer reloads Reported by Ben Newlin in #1760 (cherry picked from commit f6232b068e0e4d423747299be2f69ee011004733) 2019-07-11 Vlad Patrascu * [0ffa4f329] : sql_cacher: fix a memory leak in case of a failed SQL query Reported by Ben Newlin in #1760 (cherry picked from commit aa38fb1fba6b51c6e27e4d8f87ae10c032700282) 2019-07-11 Vlad Patrascu * [3892fa74a] : sql_cacher: fix several possible deadlocks in case of errors Reported by Ben Newlin in #1760 (cherry picked from commit dea97be92d71514da6705e53a5265564902fc21f) 2019-07-11 Liviu Chircu * [76625354c] : rest_client: Let libcurl use the system malloc functions The fact that libcurl spawns a thread in order to perform each transfer is well known. Also known was the fact that by instructing libcurl to use the pkg_*alloc() functions, an OpenSIPS worker must synchronize with the libcurl thread before they can both manipulate the PKG pool. Commit 900f6c996c697b was an attempt to solve this, however the fix DOES NOT hold, as it was implemented in that commit (the curl thread is aware of the thread lock while the original process ignores it...). The only way we can make libcurl use the opensips pkg mem allocation functions is by changing pkg_malloc() itself to also grab a thread lock. And this is already too much, as it would unnecessarily slow down the pkg allocator, while the benefits are minimal anyway: what do we stand to gain if libcurl uses our mem pool? Close to nothing. We just let libcurl use the system memory manager (along with as much memory as it wants) and we're done with this issue for good. Fixes #1546 (cherry picked from commit 3b2586d64828e89525ae050897c8bd62a9c9ce92) 2019-07-11 Liviu Chircu * [a442811d1] : rest_client: Make async(rest_put()) do a PUT, not a POST (cherry picked from commit 04a56fbd7d51b7aee5ff8a838b1e2a83094c1c92) 2019-07-11 Bogdan-Andrei Iancu * [2c7449091] : Fix leak due bad free of temporary parsed RR hdr Free the list (of RR body) starting from the original RR body, not from the iterator value (which will be NULL all the time) 2019-07-10 Bogdan-Andrei Iancu * [55233a9f4] : Fixed un-init dst_leg before get_dlg() In order to return a valid value in dst_leg after get_dlg(), the dst_leg must be initialized to -1. 2019-07-09 Vlad Patrascu * [b976e2279] : tls_mgm: improve docs for the verify_cert and require_cert modparams (cherry picked from commit d15c80e49c71a62a3df995cd2d5a747b7c75fc02) 2019-07-08 Vlad Patrascu * [8f0cb97e5] : clusterer: improve the seed node mechanism The "seed" node will now revert to a "synced" state after a configurable interval instead of directly form startup. Closes #1591 (cherry picked from commit 66969bfcd214388c53005928505124367a9255d4) 2019-07-08 Dan Pascu * [6b9decce7] : rls: Cleanup spacing (cherry picked from commit be0d3b7bb3b2e956b783623df417f48582aadc5a) 2019-07-08 Dan Pascu * [8d0923531] : rls: Report the actual code that was used in reply (cherry picked from commit a72132832f0835d815fdc9488d80df684eb2dbde) 2019-07-08 Dan Pascu * [39a1ab266] : rls: Fixed memory leak in rls_handle_subscribe (cherry picked from commit 5692501f8ce3eda41872e4d5996d701bc804408e) 2019-07-08 Dan Pascu * [f90f19ab5] : Properly set the SI_IS_LO flag on interfaces specified using IPs/hostnames (cherry picked from commit 36b4be98794bfac120c345f70db3ad8a94a8ffef) 2019-07-07 OpenSIPS * [e02dd3a79] : Rebuild documentation 2019-07-05 Liviu Chircu * [989106ec1] : cachedb_local: Improve 'cache_collections' parser The 'cache_collections' modparam parser is now fully tolerant to any kind of whitespace present in the string. Fixes #1424 (cherry picked from commit ca81c501f7fcaca32fae6235b2489933f2efefd3) 2019-07-05 Liviu Chircu * [600df4c92] : {csv.} transformation: Use the lib/csv.h parser Fixes #1220 Closes #1416 (cherry picked from commit 394f57a8da54de0161eafee643e7def4db2d74ed) 2019-07-05 Liviu Chircu * [b31872339] : lib/csv.h: Full unit test coverage (cherry picked from commit 769ddedf3990028f8650d436798f9a52e1d8883b) 2019-07-05 Liviu Chircu * [8177e21d0] : lib/csv.h: Add an RFC 4180 CSV parser * also invert the CSV_SIMPLE flag into CSV_RFC_4180 * adjust all calling code to use the new set of parsing flags (cherry picked from commit 477d0f67861a6f494902846a574507d9087e87b4) 2019-07-04 Liviu Chircu * [190e1d3ff] : dialog: Fix broken stats after a restart+reload * the "active_dialogs" and "early_dialogs" stats were broken along with the data reloading move to child_init() * the global helper counters, "active_dlgs_cnt" and "early_dlgs_cnt" are no longer needed (cherry picked from commit aa2f534e18dc0830a160bb90d4cc3a116386953d) 2019-07-04 Bogdan-Andrei Iancu * [28bd16d92] : [pua_dialoginfo] fix docs for nopublish_flag (cherry picked from commit d949a7a7be402ae9505483322cde27a54f25d163) 2019-07-04 Razvan Crainea * [45ea33422] : dialog: fix broken error check in load_dlg_db (cherry picked from commit c29a0d09eefc6aec34b838028a7ae5d328ff18b3) 2019-07-04 Vlad Patrascu * [b46fd5224] : bin interface: lower level of irrelevant log message to DBG (cherry picked from commit 668fcbd8c085cac0afa714353d61f825b74afd31) 2019-07-04 Bogdan-Andrei Iancu * [b02f5d12b] : Fixed missing error reporting. (cherry picked from commit 18c7aad4accbc4801fdea443747227274eb11bc3) 2019-07-04 Bogdan-Andrei Iancu * [a34243576] : [pua_dialoginfo] Fixed nopublish_flag modparam It seems the parameter (a msg flag) was not migrated to string format. 2019-07-04 Razvan Crainea * [44afc4a15] : cgrates: allow setting NULL variables Close #1750 Thanks go to Vasilios Tzanoudakis for reporting this! 2019-07-03 Nick Altmann * [47907930a] : Merge pull request #1751 from razvancrainea/master redhat_fedora: specify cfg_target when installing Thanks Razvan Crainea for patch 2019-07-03 Razvan Crainea * [66fdb79e5] : sql_cacher: nr_columns limitation is 64, not 8 Fix limitation when the number of columns was wrongfuly limited to 8, instead of 64, preventing loading more than 8 columns Thanks go to Bogdan Iancu for spotting this and suggesting the fix (cherry picked from commit b07a82d62e500c3b28016842100f0c0210fb1a96) 2019-07-03 Razvan Crainea * [2279c1cf3] : just include ipc header, as rpc_dispatch exists 2019-07-03 Razvan Crainea * [04cc11297] : Revert "dialog: fix rpc dispatching for 2.4" This reverts commit 8e9a47293762c793284e673fc9b562a677983618. 2019-07-03 Razvan Crainea * [8e9a47293] : dialog: fix rpc dispatching for 2.4 2019-07-03 Razvan Crainea * [a98ee6294] : dialog: load dialogs on child init 2019-07-03 Razvan Crainea * [483faf834] : acc: fix leak generated by dialog replicated update 2019-07-02 Bogdan-Andrei Iancu * [88b84e901] : Fixed missing reset of current transaction holder The missing reset could lead to wrong access to old transactions when running more than one notification route, one after each other. Credits for reporting and helping with testing go to Ivailo Dobrev 2019-06-30 OpenSIPS * [7daac5ca0] : Rebuild documentation 2019-06-28 Dan Pascu * [6e434f989] : Fixed handling depth issue for certificate chains that are too long (cherry picked from commit fa2ceb52b5b2513bedf16df6eaedec7cb1e34755) 2019-06-28 Bogdan Andrei IANCU * [08d869bf8] : Merge pull request #1738 from varghesepaul/2.4 Do not simply link the buffered lumps, but better clone them -> this … 2019-06-28 Bogdan-Andrei Iancu * [68aaa2011] : [b2b_entitites] Fix crash on empty To display name. As the To display name may be empty and the DB does not enforce a not NULL, better be ready to read a NULL. This happens when using db_cachedb + cachedb_mongodb as backend Closes #1606 2019-06-27 Liviu Chircu * [8ee21e3b7] : rest_client: Document the TCP connection reusage behavior (cherry picked from commit 71d40f9198f83b6f310dcd9e9c5dc11a0b085a3b) 2019-06-26 Bogdan-Andrei Iancu * [4e258b17f] : Merge pull request #1744 from rrb3942/nofork_daemon_error Only report status if in forking daemon mode (cherry picked from commit a4dfbf5a9aa9b3ea9d256ceb34620e2e6411a3ae) 2019-06-26 Razvan Crainea * [714afb97f] : tm: add cid to messages generated by OpenSIPS Add cid for CANCEL messages. Thanks go to Andrey Faizullaev from 46Labs (cherry picked from commit a857ef10105f43b330a648715a70d905efc503c1) 2019-06-25 Vlad Patrascu * [ab7e93128] : sql_cacher: fix crashes when failing to validate db connections Fixes: #1734 (cherry picked from commit 82c446d2922fca59942e8b7835516486d8771fb4) 2019-06-25 Razvan Crainea * [6f0fa6d28] : net: handle new WRITE_ASYNC2 in main as well (cherry picked from commit d27a802f7b681fae3ebba0d643d7aa5f623b84b7) 2019-06-24 Vlad Patrascu * [361d242ef] : event_virtual: improve docs regarding the failover policy Closes #1510 (cherry picked from commit f682abe5308d631ce58337fba45cd3108bad1425) 2019-06-23 OpenSIPS * [f57dcaedc] : Rebuild documentation 2019-06-21 Liviu Chircu * [d34d7eb57] : DB URL parser: Avoid double free on missing URL DB On URLs such as: mysql://opensips:opensipsrw@master.naudb.service.consul ... the DB URL parser would perform a double free within the error handling code. Reported by Kirill Galinurov (cherry picked from commit cba99632f18259f8e194246678793fa6e1723c3f) 2019-06-21 Liviu Chircu * [590308e5d] : Script: Fix binary string comparisons Addresses the following: $var(ip_1_s) = "[2001:6c8:5e00:1::249]"; $var(ip_1_b) = $(var(ip_1_s){ip.pton}); # Save binary IP to variable $var(ip_2_s) = "[2001:6c8:5e00:1::24a]"; $var(ip_2_b) = $(var(ip_2_s){ip.pton}); # Save binary IP to variable if ($var(ip_1_b) == $var(ip_2_b)) { xlog("Variable saved Binary addresses are EQUAL"); } else { xlog("Variable saved Binary addresses are DIFFERENT"); } Correct result: DIFFERENT. Maybe this should be a unit test somehow. Reported by @vasilevalex Related to #1568 (cherry picked from commit dee8a6a37577a5aa1c1621ba66acebfe7f47e3f4) 2019-06-20 Razvan Crainea * [afcfc0547] : acc: update dialog vars on DLGCB_PROCESS_VARS callback Make sure all variables are updated when a replicated dlg UPDATE packet is received (cherry picked from commit 8eb71e89743ca878b13326b99eca87c1ace88b61) 2019-06-20 Razvan Crainea * [aaa3fcf58] : dialog: add DLGCB_PROCESS_VARS callback This callback shall be called every time a replicated packet that includes dialog variables is received. (cherry picked from commit b3e3eec97c108d357e2be5d58f5fc80edaa2dd90) 2019-06-20 Razvan Crainea * [e452d16ed] : acc: move ctx in dlg ctx, instead of dlg val (cherry picked from commit efc8d6cc2a6057b86685911b725a22bd82766b92) 2019-06-20 Razvan Crainea * [a6df522fe] : dialog: fix ctx funcs prototype load (cherry picked from commit 31ce92b40b652e6d579188b26d7cc21f6566dd86) 2019-06-20 Razvan Crainea * [8b165e1bd] : dialog: add ctx functions (cherry picked from commit 4feaca2b00a86639fd0b973155a8e9f0dfe79845) 2019-06-20 Razvan Crainea * [87193522e] : dialog: add context (cherry picked from commit 0b3ca526c75ecdb993c3e0ca8a006c7da8a4e9e9) 2019-06-19 Varghese Paul * [c263182ee] : Do not simply link the buffered lumps, but better clone them -> this will avoid a mixage of lump types (shm versus pkg) when using async() 2019-06-18 Vlad Patrascu * [e85aa14b9] : dialog: fix processing of sync packets containing known dialogs 2019-06-16 OpenSIPS * [b58436836] : Rebuild documentation 2019-06-13 Liviu Chircu * [072b7a678] : dialog: Do not replicate CSeq changes w/o a cluster (cherry picked from commit 65ae04c892d2869be4a56049adcea70666e97dc8) =========================== Release 2.4.6 ============================== 2019-06-11 Razvan Crainea * [fb6af78d4] : Bump version to 2.4.6 2019-06-11 Bogdan-Andrei Iancu * [fdbdcf13e] : Expose the real ports (src/dst) used by TC-based write op As src/dst ports may be ephemeral, expose (via holders in socket_info struct) the real used ports during the last write operation Related to #1692 (cherry picked from commit 9dde6d5f00626ac78cec948c84443b2caea33013) 2019-06-11 Bogdan-Andrei Iancu * [d698b42e9] : Trace the real ports (from IP level) instead of SIP level ports As the TCP based ops may report different ports at IP level versus SIP level, trace (if available) the IP level information. Related to #1692 (cherry picked from commit d6a663f9b9b33205120519b85135fe4bc34b852d) 2019-06-11 Bogdan-Andrei Iancu * [1bdf0b90f] : Store in TCP conns the real ephemeral port and not the listening port Related to #1692 (cherry picked from commit 929c854b084cdbf9c6cf8e253f9fa60fcdec3c18) 2019-06-11 Bogdan-Andrei Iancu * [06178ac5b] : Accept BIGINT also for table version (cherry picked from commit dafa8f6a50958e1c6905621cceb2457f94163cc5) 2019-06-11 Razvan Crainea * [d589855ea] : dialog: unref dialog after updating cseq (cherry picked from commit 56c4b09640f2dcd54964fd7e87cdcdfd64e90866) 2019-06-11 Razvan Crainea * [1b3ff7be4] : dialog: add replication for cseq updates (cherry picked from commit 130e70421274c1e8ec716604372bc974d978556b) 2019-06-10 Liviu Chircu * [b4631d7b6] : mathops: Allow negative operands in math_rpn() (cherry picked from commit c0fe97a0e9b980327033e4bdf667106e51462288) 2019-06-10 Razvan Crainea * [12335f727] : proto_hep: fix off by one comparison (cherry picked from commit 4703d29da294433968547adf54b1ea0585b94359) 2019-06-09 OpenSIPS * [a6bd89e44] : Rebuild documentation 2019-06-05 Vlad Patrascu * [c6ddf07e2] : clusterer: complete fix in commit 69aaa19 (cherry picked from commit 033ef1c00cbf1acd40e2f12f2ad144437b1b113c) 2019-06-04 Vlad Patrascu * [3f5444bef] : clusterer: fix incorrect link state due to pinging race conditions This fix addresses possible races between setting the appropriate link state after sending a ping and receiving the reply. If the reply is received before the pinging process manages to change the link state, we might get stuck in a 'probing' state for the respective node. (cherry picked from commit 69aaa1904de891ebd6a809442c868ac44376b8b6) 2019-06-04 Bogdan-Andrei Iancu * [a9d8d4372] : Fix collision in local To-tag generation. Use MD5 on 128 (instead of CRC on 16 bits) for a better dispersion of the To-tag values. Solves problem (1) in #1662 (cherry picked from commit db8a522aacbe9e6b6ce2b0e0b37186f875ca0c73) (cherry picked from commit 2a8679089c5de91f91339fd2253271902aa3c465) 2019-06-03 Razvan Crainea * [af600d61e] : tm: add anycast cid for locally generated msgs Reported by suharik71 on GitHub Close #1721 (cherry picked from commit 8ecd8b3801266671582b51f8c269d5f940cba8b8) 2019-06-03 Razvan Crainea * [d35d2eec1] : dialog: prevent dlg_onreq from crashing Check if current_context_ptr exists before trying to fetch the dialog Fixes #1719 (cherry picked from commit 5e4a99ee6f9abdf18f58697fabd141036096ab3e) 2019-06-03 Razvan Crainea * [1d359ce18] : siprec: reverse the order of t= and c= lines Reported by michaeljdresser on GitHub Close #1720 (cherry picked from commit e50a3d3cdcefd747abc6c3ead520877501a01400) 2019-06-02 OpenSIPS * [7a342463c] : Rebuild documentation 2019-05-31 Razvan Crainea * [ddafbc452] : dialog: prevent crash when running in auto-CANCEL mode When auto-CANCEL mode is enabled, the node that receives the replicated CANCEL does not have a processing context, since it is running out of the script context. This patch prevents OpenSIPS from crashing. Reported by Pasan Meemaduma (pasanmdev on GitHub) in #1719 (cherry picked from commit 603a493488d767757ee2122d8d03a555df883b71) 2019-05-31 Liviu Chircu * [60097425d] : load statistics: Fix a bunch of integer overflow bugs Most of the summed up load statistics were skewed by a factor of 10, due to a series of integer multiplications which was overflowing the 32-bit result holder. load, load1m, load10m before this patch (16 processes, 3 fully loaded): 12 99 9 12 99 9 12 101 10 13 103 10 13 104 10 12 106 10 ... and after: 12 9 0 11 10 1 12 10 1 13 10 1 Fixes #1650 (cherry picked from commit 7f14b6a30a79e6156ae732d1cbb8f1e3f102e3d3) (cherry picked from commit 319b1ba229dc25ec3ac903d3659a8e98dd85a0a2) 2019-05-31 Liviu Chircu * [96199dd55] : load statistics: Fix an unsigned integer underflow bug This integer subtraction bug was leading to occasional, seamlessly random load1m and load10m statistic spikes, for example: 4 2 0 4 2 0 4 3 59 4 3 0 5 3 0 (cherry picked from commit 0e40f6d46a635eae7b9587d71c49041802d6cc4b) (cherry picked from commit 9abf9fcf24fbb393a524f0288234c86fedb52a45) 2019-05-29 Liviu Chircu * [1b970d85e] : Fix various documentation typos or shortcomings (cherry picked from commit 59f8505d3597c2848ca05f64879d97a8748997ea) 2019-05-29 Razvan Crainea * [121618821] : cgrates: fix resuming function for cgrates_cmd() Reported by Vasilios Tzanoudakis #1713 (cherry picked from commit 80ec779e004fd69f343a56deab18c98c1e3079f3) 2019-05-29 Razvan Crainea * [85c95231c] : cgrates: handle inter-mixing of requests and events In case when OpenSIPS sends a request, but before receiving the reply on the same connection, it receives an event, we need to make sure the reply is not marked as completed. Before this fix, when the actual reply was coming back, we no longer had a reply handler, therefore OpenSIPS was crashing. Reported by Vasilios Tzanoudakis (vtzan on GitHub) in ticket #1713 (cherry picked from commit c90d251cef30fb6a991b859652a3ba7bcb32c37c) 2019-05-29 Bogdan-Andrei Iancu * [71983858d] : [sms] Fixed compiler warning. Even if harmless, make the code consistent and avoid warnings - if using null-terimated functions, be sure you have the space for the the ending NULL. Reported by Dan Pascu ( @danpascu ) (cherry picked from commit cbe2c6509ee4ffc518b5feed26dd4375e4bae9f0) 2019-05-29 Liviu Chircu * [c5d44aa4e] : rest_client: Fix string truncation compiler warnings Reported by Dan Pascu (cherry picked from commit a64d411d92a55b9348f9a3cfe98e08afbf4a6ec0) (cherry picked from commit 9fa666c5e7c3ea384508228faa6b6017e66889f9) 2019-05-29 Liviu Chircu * [7305fae08] : freeswitch ESL: Fix string truncation compiler warnings esl/src/esl.c: In function ‘esl_recv_event’: esl/src/esl.c:1406:4: warning: ‘strncpy’ specified bound 1024 equals destination size [-Wstringop-truncation] strncpy(handle->last_reply, hval, sizeof(handle->last_reply)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function ‘esl_send_recv_timed.part.6’, inlined from ‘esl_send_recv_timed’ at esl/src/esl.c:1537:27: esl/src/esl.c:1604:5: warning: ‘strncpy’ specified bound 1024 equals destination size [-Wstringop-truncation] strncpy(handle->last_sr_reply, hval, sizeof(handle->last_sr_reply)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from esl/src/esl_config.c:34: esl/src/esl_config.c: In function ‘esl_config_open_file’: esl/src/include/esl.h:43:37: warning: ‘strncpy’ output may be truncated copying 511 bytes from a string of length 1023 [-Wstringop-truncation] #define esl_copy_string(_x, _y, _z) strncpy(_x, _y, _z - 1) ^~~~~~~~~~~~~~~~~~~~~~~ esl/src/include/esl.h:44:32: note: in expansion of macro ‘esl_copy_string’ #define esl_set_string(_x, _y) esl_copy_string(_x, _y, sizeof(_x)) ^~~~~~~~~~~~~~~ esl/src/esl_config.c:72:4: note: in expansion of macro ‘esl_set_string’ esl_set_string(cfg->path, path); ^~~~~~~~~~~~~~ Reported by Dan Pascu (cherry picked from commit d20f163f3bceb213e4a7937a43074bf106ad9aaf) 2019-05-29 Bogdan-Andrei Iancu * [f8e0cbbec] : [utils] Fixed compiler warning Even if harmless, make the code consistent and avoid warnings - if using null-termiated functions, be sure you have the space for the the ending NULL. Reported by Dan Pascu ( @danpascu ) (cherry picked from commit decbd1bddee7a77194fcc989f12b587e1b7ee548) 2019-05-29 Bogdan-Andrei Iancu * [82f12d0d9] : [jabber] Fixed compiler warning. Even if harmless, make the code consistent and avoid warnings - if using null-terimated functions, be sure you have the space for the the ending NULL. Reported by Dan Pascu ( @danpascu ) (cherry picked from commit 73c2fe907e59cb6ce79c7c4fef1caf68cc954aff) 2019-05-29 Razvan Crainea * [87748b750] : usrloc: fix warnings from casting pointers to uint64 This warning is raised on 32-bits systems Reported by Dan Pascu (cherry picked from commit 266a2cf7705870765e27f7e628d5d61ad4cb6493) 2019-05-29 Razvan Crainea * [9ba0ec5b3] : rtpproxy: fix ipv6 handling of timeout socket Reported by Dan Pascu on mailing list (cherry picked from commit 3e2aed097518ca37862638d6dd7fe2b4ee3e583a) 2019-05-29 Alexey Vasilyev * [7fd38342b] : Load chain of certificates and all CA certificates from DB (cherry picked from commit ad159240835932e5ea53dc5df914df44f1414e6a) 2019-05-29 Razvan Crainea * [37a0d1132] : tls_mgm: make unused functions inline (cherry picked from commit b1b6f814e5589dc1a52b5486f05a017666fba1cd) 2019-05-28 Bogdan Andrei IANCU * [2ce502c12] : Merge pull request #1208 from dronord/ora_bigint db_ora: dont trim VAL_BIGINT (cherry picked from commit 3ddbbf6275b381a8bee0f45a856595304a26d1ce) 2019-05-28 Bogdan Andrei IANCU * [ad91916e0] : Merge pull request #1207 from dronord/ora_fetch fix and optimize oracle fetch (cherry picked from commit f7e45ba6e02cb1b130d5eef4285aadf879e948f8) 2019-05-28 Bogdan Andrei IANCU * [55d95ecae] : Merge pull request #1701 from vitalikvoip/2.4_fix_tcpchild_busy_counter Fix TCP connections load balancing to use all TCP workers evenly 2019-05-28 Bogdan Andrei IANCU * [7ab1776f6] : Merge pull request #1239 from dronord/ora_integer Oracle NUMBER not NUM in application (cherry picked from commit a6c9376e7514bb0e7c4a7061057d1a59a2e421c1) 2019-05-28 Vlad Patrascu * [9b30d717e] : dialog: complete the fix in commit: c6d31e3 2019-05-28 Vlad Patrascu * [c6d31e34a] : dialog: fix a crash when unrefing dialog Caused by accesing dialog through dangling pointer after it was freed. 2019-05-28 Razvan Crainea * [2234a4530] : tls_mgm: increase ca_list size Thanks go to Alexey Vasilyev (vasilevalex on GitHub) for reporting it Close #1709 (cherry picked from commit 154a1560c84dace2661c61101038878cf6d8eeab) 2019-05-28 Razvan Crainea * [1c383047a] : pi_http: fix LONGBLOB specification (cherry picked from commit d3fa736c0fef59a5da069220efba0eacdfeaf467) 2019-05-28 Razvan Crainea * [164cb4930] : usrloc: fix next hop compute for usrloc with DB Thanks go to Jasper Hafkenscheid (hafkensite on GitHub) for reporting it Close #1710 (cherry picked from commit 0300eb1d5986a86bc6062dfb2b7b00a50eaad25d) 2019-05-28 Razvan Crainea * [3d9132e72] : tls_mgm: make sure pthread locking has SHARED support Prevent system lock when using openssl 1.1, that is using phreads as syncrhonizing mechanisms. Close #1590 (cherry picked from commit 149e69e3f67013884623e7986c47742aad787ece) 2019-05-27 Razvan Crainea * [1b624d2d4] : tls_mgm: initialize mem functions asap Initialize the memory functions as soon as possible to prevent any other module that uses openssl to use the default ones. Fix #1114 #21 #1708 (cherry picked from commit 1880111a33beed6ba87d64fb2700a22e71dc0184) (cherry picked from commit 5ff0afeea8de63c5c2c57cd6a225c0b7e0fb7605) 2019-05-27 Razvan Crainea * [66b6d7b66] : mi_json,uri: add null load function complete 42b33c4c80733bec05f2f15a623214b6a74eef9b 2019-05-27 Razvan Crainea * [42b33c4c8] : add function that is ran after loading a module (cherry picked from commit c6fb6c96093ff2e81dda5746755594a64b5764ee) 2019-05-26 OpenSIPS * [5dbd97e8b] : Rebuild documentation 2019-05-24 Liviu Chircu * [285b49e1d] : packaging: Allow specifying custom options with Debian systemd Additionally, use the "$OPTIONS" during the script startup checks! 2019-05-23 Razvan Crainea * [7d53b5176] : proto_ws: build GET Host header based on destination IP and port Thanks go to Bogdan Iancu for spotting this (cherry picked from commit a3eda1b1393c7eb0475b41b4db1a51d86eb0882f) 2019-05-23 Razvan Crainea * [6257ce4fd] : siprec: fix documentation to align with b6f2f84baa In commit b6f2f84baa58e15baee43879308458bf38165b64 the signature of the `siprec_start_recording` function was changed - instead of specifying the rtpproxy set, now the function receives the rtpproxy node used for that call. This commit fixes the documentation for that. Thanks go to solarmon(GitHub) for reporting this in ticket #1664 (cherry picked from commit ba81966851cd4e10961b4d2c05c899b2c952872e) 2019-05-23 Bogdan-Andrei Iancu * [260574a3e] : Better naming of attributes in tcp_list_conns output Replace Source/Destination with Remote/Local, to be easier to understand Cherry pick from dbdf02fc1be0fe62ad4a7863447d4a1493322e4e 2019-05-23 Bogdan-Andrei Iancu * [7dc25e07b] : Be consistente - take IP and Port from the same structure. As we replicate the socket, take the listening port from the socket. The DST port should reflect the IP layer, where you may have an ephemer port. (cherry picked from commit a7791a6d838d757a5faa43175aa319daadc56c86) 2019-05-23 Bogdan-Andrei Iancu * [d5bb7ab40] : Fix choosing the IP:port to used when building PAI Instead of searching by port (which mya trigger false positive), better use the bind interface used for receiving the request (cherry picked from commit af2bd1db8848d1a925680baa1ff2c57ec4ffc21b) 2019-05-22 Vlad Patrascu * [405bcd513] : dialog: fix behavior of is_in_profile() if no value is passed The function should also return true when a dialog does belong to a profile with values but no value is passed to reinforce the check. (cherry picked from commit d3bc0e256f925ee2c25aea483e14afca8dfcdbbe) 2019-05-22 Razvan Crainea * [ce93ed5b8] : rtpproxy: engage late negociation even after call is established Thanks go to spacetourist(GitHub)/Callum Guy for reporting this Close #1702 (cherry picked from commit 295a5842dee444a1f26b8eb5af539e58e4db8d44) 2019-05-21 Bogdan-Andrei Iancu * [4bca4792d] : Fix usage of buffered RR lumps Do not simply link the buffered lumps, but better clone them -> this will avoid a mixage of lump types (shm versus pkg) when using async() Fix for #1683 2019-05-21 Bogdan Andrei IANCU * [2dd76a784] : Merge pull request #1699 from taozhiying/patch-1 LB will always to one dst when use lb_next 2019-05-21 Razvan Crainea * [7d24077f9] : tm: run TMCB_REQUEST_BUILT before sending msg Althought this was initially documented as being ran before sending the message out, this callback has been moved *after* the message is sent. Therefore it can generate some concurrency issues in the dialog, when a reply is received faster than the outgoing leg would have been updated. (cherry picked from commit ef680f665066dabf2d99d616976ba7126092f124) 2019-05-21 Razvan Crainea * [5af9289d3] : dialog: prevent src_leg from remaining dangling 2019-05-21 Razvan Crainea * [25665122b] : tm: specify sent buffer for TMCB_PRE_SEND_BUFFER Make sure we have access to the sent buffer in the TMCB_PRE_SEND_BUFFER tm callback. (cherry picked from commit 815601872cca5debd4b6f7e9ff4956bfdceaec51) 2019-05-21 Bogdan-Andrei Iancu * [af4d8479d] : Fixed bogus "return" in LOAD computing macro This affected only the 1 minute statistic. 2019-05-21 Bogdan-Andrei Iancu * [7e24e5a9d] : Fix incomplete interation Do not abort the interation on error, but skip and continue with the next elements / subscriptions. (cherry picked from commit d4c46def9155c89c3dce3e1b74a93a05448b6fa3) 2019-05-20 Liviu Chircu * [82440f6b8] : cachedb_redis: Do not leak pkg mem on exceptional cases In case the driver returned unexpected data, the Redis raw query function would leak pkg memory. (cherry picked from commit 6bf972ce5876fc15999a4bcc2e3e29596b2dc0ae) 2019-05-20 Liviu Chircu * [169d4bd2d] : cachedb: Improve variable naming Make it more obvious that we're dealing with a rows x columns matrix. (cherry picked from commit 499f0f3219fe0391e013b8c901983990013669bd) 2019-05-20 Vlad Patrascu * [f112620c6] : cachedb_cassandra: use extensible buffers for query strings This fixes errors caused by queries being truncated becuase of the small static buffers that were previously used. Closes #1696 (cherry picked from commit ad1232d211ab97b4367c1f22fbb2828df6b534d1) 2019-05-20 Liviu Chircu * [4a1390b8e] : AVP printing: Properly print NULL AVP fields AVPs such as ["foo", NULL, "bar"], which are only made possible by a few select modules (e.g. Redis) were crashing in $(avp(foo)[*]). (cherry picked from commit e66486fbd2398fbf81b893b727ebb03074f23ab0) 2019-05-19 OpenSIPS * [7fb724b6a] : Rebuild documentation 2019-05-17 Liviu Chircu * [47749bbbb] : statistics: Improve iteration example Clarify a hidden gotcha: the stat name iterator does not include the stat group! (cherry picked from commit 0dcbf9eed63873aeeb5f636fb418918a640c58b8) 2019-05-16 Bogdan-Andrei Iancu * [6731e05e2] : Do Trasaction post script updates only if method matches A translation of PR #1678 done by @rrb3942 Closes #1678 Closes #1669 (cherry picked from commit 9c960bba41216359786cfe8d382b639cc5bf020c) 2019-05-16 Vlad Patrascu * [113c02b54] : dialog: fix a deadlock introduced in commit df90f8d 2019-05-15 Vitalii Aleksandrov * [d604cdeda] : net: do not decrement tcp_c->busy counter for connections previously acquired by tcp_conn_get() 2019-05-15 Vlad Patrascu * [9afa2c5f0] : dialog: do not accept replicated counters for local profiles (cherry picked from commit c5638e9bb58d6db6b428c3cd65502513b28817a5) 2019-05-15 TaoZhiying * [793959e14] : LB will always to one dst when use lb_next The current dst is not a larger load. When skipping, the index of the bitmask does not move. 2019-05-14 Vlad Patrascu * [df90f8dc7] : dialog: improve performance of replicated profiles Improve the performance of operations with replicated profiles (increment/decrement, get count) by avoiding the traversal of a list of counters proportional with the number of dialogs. This patch mostly impacts profiles with value. (cherry picked from commit 40ccbf9cabad05b4cfd264cefeb113187131dd43) 2019-05-14 Razvan Crainea * [a4b209583] : dialog: improve error report on sockets mismatch Report socket that was not found during dialog replication. (cherry picked from commit 00f6d2314c68c568729d846d76415d7bc6694ffd) 2019-05-13 Ovidiu Sas * [1bb93819c] : db_text: avoid buffer overflow for large names and/or values in db_text files (cherry picked from commit 9d7ac44d9eee7dc7eeca14c7bf4e12202715a429) 2019-05-13 Vlad Patrascu * [0357a6336] : dialog: fix a crash when removing dialog from profile Do replicate counter structure deletion if the profile is not shared. (cherry picked from commit d721a94237c48343b2bcab16bd2a84f3dd618d69) 2019-05-12 OpenSIPS * [db80b0fb2] : Rebuild documentation 2019-05-12 Razvan Crainea * [214ba300e] : dbtext: use python2 explicit shebang This is needed for Fedora 30. Reported by Nick Altmann (cherry picked from commit ce7df8ac697cab164cf027f2cb7ef1784a08029f) 2019-05-09 Razvan Crainea * [3a994ceea] : tm: prevent concurrency between different cleanup This fixes a problem that was happening when having a transaction that wasn't fully updated, for example in a Push Nofitication scenario where no t_relay() was made, multiple messages may have reached the do_t_cleanup() function in parallel, both updating the transaction. Reported by 46Labs (cherry picked from commit deafdb7f4b474701289a8086fbf44a05e19feca6) 2019-05-09 Vlad Patrascu * [8c9ee6d8d] : dialog: extend the fix in commit 3abb14d to profiles without value (cherry picked from commit 3d081c88f4515ac0ed5424f43e6b5304b095ab85) 2019-05-09 Liviu Chircu * [a1357f482] : systemd: Inherit default settings when checking config This prevents oom errors when starting the service with some heavy-duty scripts which load lots of modules / have lots of startup logic and demand a bit more memory than the binary's defaults provide. Reported by Ken Rice. 2019-05-08 Vlad Patrascu * [de02435ba] : Complete the fix in commit: 3abb14d (cherry picked from commit 0256fadcc11f91781113980b867599e844acfe8b) 2019-05-08 Vlad Patrascu * [2eac15f5c] : dialog: fix a bug in local profiles counting Fix the counting of local profiles with value when profile replication is active. Altough the /b profiles were counted correctly, the same mechanism would be aplied also for other profiles that were not shared, resulting in a bad value. (cherry picked from commit 3abb14d6e629db0625cb0fe9f360d10eee07d00e) 2019-05-07 Liviu Chircu * [f10d00d7d] : transformations: Fix noisy log 2019-04-28 OpenSIPS * [da679456d] : Rebuild documentation 2019-04-26 Razvan Crainea * [a135cec5b] : tm: proper return code for replicated CANCEL Thanks go to 46Labs for reporting this (cherry picked from commit 5c7dd8ab8ea7fe378204d33dafe14434412404b5) 2019-04-26 Razvan Crainea * [3fbd3ef21] : tm: fix CANCEL replication when CANCEL is malformed Thanks fo to 46Labs for reporting this (cherry picked from commit 9f050c95f66ff44fd657a7266ce4acaad572e5c6) 2019-04-24 Liviu Chircu * [7a8ec4ad6] : TCP: Fix confusing log on connect timeout (cherry picked from commit b7af3d764118218e88e59aa56d4da8c1de7a4d21) 2019-04-24 Liviu Chircu * [37e732d52] : Merge pull request #1675 from wdoekes/fix-compiler-warnings-2.4 Work around a few poor compiler warnings (2.4 branch) 2019-04-23 Liviu Chircu * [f1c5a7ea3] : cachedb URLs: Complete commit 887f9f0e032 * do not parse "schema://host:port/" as "" database (keep it NULL) (otherwise, this breaks Redis) * do not treat similar URLs with differing options as the same URL * pkg_free() the options chunks at shutdown Reported by Ryan Bullock Fixes #1677 2019-04-23 Walter Doekes * [70ca1636b] : Work around a few poor compiler warnings Like: dlist.c: In function ‘get_all_ucontacts’: dlist.c:759:37: error: ‘next_hop_host’ may be used uninitialized in this function [-Werror=maybe-uninitialized] And: In function ‘memcpy’, inlined from ‘get_domain_db_ucontacts’ at dlist.c:294:4: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: error: ‘__builtin_memcpy’: specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] And one probable bug: b2b_logic.c: In function ‘mi_b2b_list’: b2b_logic.c:1548:10: error: ‘server_item’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ^- should be client_item (cherry-picked from 94c50b781) 2019-04-23 Liviu Chircu * [ed08dabf6] : usrloc: Fix compiler warning dlist.c: In function ‘get_all_ucontacts’: dlist.c:750:37: error: ‘next_hop_host’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ((struct proxy_l *)cp)->name.s = next_hop_host; ^ (cherry picked from commit 95edbd2c8cd8ed208248b8f47805654a41e5e129) 2019-04-23 Liviu Chircu * [bbd9950c2] : cachedb_mongodb: Improve connection string examples * give a "connecting to a replica set" example * better highlight the "engine:group://" syntax (cherry picked from commit 28a31887b286cb981b5f5c1798fad1d2519ad6ae) 2019-04-23 Bogdan-Andrei Iancu * [c15abd769] : Fixed copy paste error in DB schema section name 2019-04-23 Bogdan-Andrei Iancu * [3099040e1] : Updated copyright years 2019-04-23 Bogdan-Andrei Iancu * [116860e45] : Removed empty DB schema section Related to #1672 2019-04-21 OpenSIPS * [3af7d0fe8] : Rebuild documentation 2019-04-19 Liviu Chircu * [887f9f0e0] : cachedb_mongodb: Allow specifying URL options This patch allows script writers to append essential connect string options near the end of a cachedb_mongodb URL, such as: * ?replSet=mongo-set-1 * ?readConcernLevel=local Consult the MongoDB connect string docs for a full listing of available URL options. Reported by Vasilios Tzanoudakis Fixes #1656 2019-04-15 Razvan Crainea * [c82972d78] : dialog: fix mem leak generated by missing replies When cseq was to change generated replies, if those replies were never generated (due to missing replies from UAC), the callback was leaking. (cherry picked from commit 13bceaf647b2cd885f516bb61e2dd04da964d1a4) 2019-04-14 OpenSIPS * [22465c6a4] : Rebuild documentation 2019-04-08 Bogdan-Andrei Iancu * [d0156db0a] : Fix missing escaping in JSON output via mi_json TAB, Back Space, Form Feed, New Line and Carriage Return must be escaped in the values returned by mi_json. 2019-04-08 Bogdan-Andrei Iancu * [b8b835200] : Name the MI nodes in t_uac_dlg reply Without names, the reply will be inconsistent in JSON format 2019-04-07 OpenSIPS * [6332aa9b2] : Rebuild documentation 2019-04-03 Bogdan-Andrei Iancu * [e1004f864] : Fix concurrent parsing over samed shm message. As print_rr_body() may be called from different processes but over the same shm request, the performed parsing may lead to conflicts (different procs will fight one each other in setting the "parsed" field of the hdr_field in shm. This will easily lead to memory corruption and crashes. As real case, different replies to the same request may trigger print_rr_body in topology_hiding(), over the same shm cloned request. The newly added paramter (no_change) will instruct print_rr_body() to do its job but without changing anything in the inout set of RR hdrs. 2019-04-03 Bogdan-Andrei Iancu * [2b6b00030] : Fix dangling path vector in shm cloned request. When doing save() on reply, be sure you free whatever path_vec may be attached via save_aux() in pkg. Keep in mind that the request is a cloned request in shm. Closes #1640. May thanks to @netaskd for his help in troubleshooting this issue. 2019-04-02 Bogdan-Andrei Iancu * [79a9daf65] : Fix replicating wrong event with BLF & mix_dialog_presence If mix_dialog_presence is enabled for BLF, the wrong event is replicated (presence instead of dialog) due some hackish code. Better restore the correct event after forcing the handling of the BLF publish as presence, so the clustering layer will see the corrent event type. 2019-04-02 Liviu Chircu * [1c3c4a1a1] : Update contributors file (cherry picked from commit dac6ef8a98af1aad01c0e68ea9d3254cb0c7c2b3) 2019-03-31 OpenSIPS * [22fe15c1b] : Rebuild documentation 2019-03-29 Razvan Crainea * [b7570319e] : usrloc: make next_hop point within the shared buffer Before this commit, the `next_hop` fields returned by `get_domain_*_ucontacts()` were pointing to a shared memory, that might dissapear when the contact is gone, resulting in a crash. This patch re-points the `next_hop.name` field within the buffer. Crash reported in ticket #1652 (cherry picked from commit e162f5f1024f8dad4bf5554600aa25183fcf92fc) 2019-03-29 Liviu Chircu * [cd5fe0b08] : Normalize free(NULL) logging across all allocators Many thanks to Ryan Bullock for reporting! Fixes #1646 2019-03-26 Gohar Ahmed * [2f8301336] : Fixed bug where any addr get positive match in config if cluster_id is invalid or Invalid IP addr is given to cluster_check_addr() (cherry picked from commit b8cf9336dd9885e2bcc5472d8a06684cc63dfc52) 2019-03-26 Bogdan Andrei IANCU * [f137771f6] : Merge pull request #1643 from rrb3942/postgresql_bulk_fix db_postgres: Fix errors on bulk insert after delete/update (cherry picked from commit b931ffe57d207f99f831a19a2a571e29ed0d3279) 2019-03-26 Razvan Crainea * [56f9a8bf2] : dispatcher: add partition support to ds_list MI cmd 2019-03-26 Bogdan-Andrei Iancu * [bf25311d9] : Fix AVP context over sending requests via local route. Be sure the internally expose the same AVP list for running the local route and sending the request out. Fixes #1642 2019-03-24 OpenSIPS * [29cb099a7] : Rebuild documentation 2019-03-22 Liviu Chircu * [e6412b149] : mid_registrar: Fix poorly handled lifetime reductions If the downstream registrar reduces the lifetime of the contacts we advertise to it, we (the mid-registrar) should properly adhere to the change, and not utterly ignore it. This bug was only present in modes 0 and 1. Thanks to Jeff Pyle for the report! (cherry picked from commit e5fd28efa238b5d25b5ebbce81d0a6421b04f1b8) 2019-03-20 Liviu Chircu * [181c2d22f] : mid_registrar: Fix possible crash in mode == 2 It seems commit d8fe587cef17 broke the handling for non-star de-registrations which remove the last standing contact, causing replies from the main registrar to not include a "Contact" header field. The latter, in itself, is perfectly fine -- however, it must be handled properly. (cherry picked from commit d4f023e8da8fc6bda92b4d4aa8e58cde0282ee67) 2019-03-20 Liviu Chircu * [d87169c7a] : pua_dialoginfo: Fix pkg memleak 2019-03-19 Liviu Chircu * [541f80864] : Red Hat init.d: Adjust stop command to 2.4 shutdown behavior The default `killproc` timeout of 3 seconds is too short, causing it to incorrectly SIGKILL the attendant before it gets a chance to properly finish the shutdown sequence: * broadcast graceful termination jobs * wait up to 5 sec * forcefully kill all workers * commit seppuku (cherry picked from commit 158f98e93fcd8dfe719d76ed632686e75a74d8cc) 2019-03-19 Liviu Chircu * [47b960d9a] : clusterer: Fix missing lock_release() calls (cherry picked from commit a2a305fc2e5e56b2ce17c1ed6c25c0b2c561c5f1) 2019-03-17 OpenSIPS * [dfbab5d08] : Rebuild documentation 2019-03-14 Liviu Chircu * [3a566f156] : rest_client: Explicitly set retcode_pv to 0 on error This avoids any scripting mistakes where: * the user does not init $var(http_rc) to 0 prior to rest_get() * rest_get() fails (e.g. connection timeout -- web server is down) * $var(http_rc) is untouched, yet mistakenly holds 200 from a previous (successful) run of the same process (cherry picked from commit 9e842178d6c3d96143f4d1881bb57cdd180153f6) 2019-03-13 Bogdan Andrei IANCU * [faa2b2793] : Merge pull request #1635 from rrb3942/compact_session_expires Add Session-Expires header to compact_form_hdrs (cherry picked from commit 18a4b9024d9e6864693f27830d86e7ead4c77e3e) 2019-03-12 Bogdan-Andrei Iancu * [f5ffb1a13] : Fix useless/bogus pointer reset Related to previos commit (cherry picked from commit 0c80bcaf68b34c99a8b62b2e3c88bae43df97ff8) 2019-03-12 Bogdan-Andrei Iancu * [3bc72d493] : Small fix in test during blacklist name parsing Related to d11ba50413b53e2c0dafa091de98b6bb8bd5b972 (cherry picked from commit 71120b601371bf7d49e49ed4eb9f0e11f284b0b3) 2019-03-12 Bogdan-Andrei Iancu * [0bc8bf3a7] : Fix building blacklist's name when using partitions Do not include the partition name in the name of the blacklist (cherry picked from commit d11ba50413b53e2c0dafa091de98b6bb8bd5b972) 2019-03-12 Bogdan-Andrei Iancu * [11aebdeb9] : Avoid warnings when duplicates found in blacklists. 2019-03-12 Bogdan-Andrei Iancu * [176721030] : Removed bogus critical logs. Do not report errors if data does not exists - we may end up in such a cleanup situation during a failed startup (with no data loaded). (cherry picked from commit 427affcf474d62305ddbe5a8616944a61ee69d80) 2019-03-12 Bogdan-Andrei Iancu * [2c7ebe6de] : Improve docs on "define_blacklist" param 2019-03-12 Bogdan-Andrei Iancu * [16b47f04f] : Fix t_reply_with_body() when called after t_newtran() Force an update of the cloned request (from transaction) with info from the real request before internally running t_reply_with_body(). As t_reply_with_body() works with the cloned request, we need to be sure it is up-2-date; and t_newtran() does a partial cloning of the requests - so, if the transaction already exists better update its cloned request to be sure it has all data. Credits for detailed reporting to @rrb3942 Closes #1632 (cherry picked from commit 00a3ab348b0400fc63d25f742916ec65602f7e3f) 2019-03-11 Bogdan-Andrei Iancu * [f31de6d6d] : Fixed $log_level for returning negative values Use signed function to covert from int to str, as log_leve may be negative (-1==ERR). (cherry picked from commit 0b465a386b4759dfb51b6265484deb5d9dd7710e) 2019-03-10 OpenSIPS * [431c8f82f] : Rebuild documentation 2019-03-08 Liviu Chircu * [5cd2afae6] : registrar: Clarify the 'm' lookup() flag (cherry picked from commit aa276bff046246f3d5fba8ec8161968119f7c44d) =========================== Release 2.4.5 ============================== 2019-03-07 Razvan Crainea * [b9eaf7dd2] : Bump version to 2.4.5 2019-03-07 Razvan Crainea * [0d752142d] : b2b_entities: don't unref UNDEFINED tm Close #1629 (cherry picked from commit e6f181e26129cf1ad64071723c0c2456bac60bb7) 2019-03-07 Liviu Chircu * [b92203da3] : mid_registrar: Fix unnecessary error log Thanks to @StellaTeam for the report! Fixes #1620 (cherry picked from commit d8ad6551c0cfbebc18995cfc79e40a7f38b0ea59) 2019-03-07 Liviu Chircu * [303b00dec] : mid_registrar: Do not ignore "advertised address" Whenever the send socket address is overridden, in decreasing precedence order, through either: * listen = AS * set_advertised_address() script function * advertised_address = global parameter ... the mid-registrar will now properly take this into account and include the advertised address in all REGISTER Contacts header fields it relays. Many thanks to Italo Rossi (@italorossi) for reporting this issue. Fixes #1619 (cherry picked from commit 5c893731666ff374e9cc3183d3358f195dd7087d) 2019-03-07 Bogdan-Andrei Iancu * [732038b6d] : Fixed access to acc vars in failure route during internally generated final replies(408) Register the internal TM callback for FAILURE all the time, as it will be responsible for populating the acc context in Transaction when handling an internally generated final reply (408). Credits for reporting and identifing the issue to @rrb3942 Closes #1602 2019-03-06 Liviu Chircu * [d25602ba4] : clusterer: Fix missing lock_release() (cherry picked from commit 1e14a83cbeb0f7f8e814037601ad65a693c7e52f) 2019-03-06 Razvan Crainea * [a127598bb] : dialog: proper parsing of serialized dlg vals Before this fix, if a value was having more than two "legitimate" `\` (ascii 92) chars inside the value, OpenSIPS would have crashed. Credits go to 46Labs for reporting! (cherry picked from commit 9c4bb36bcb7938409e317b2227e917150bb24855) 2019-03-06 Răzvan Crainea * [87cc072ea] : Merge pull request #1594 from vasilevalex/validate_ipv6 Allow IPv6 address in hostname (cherry picked from commit 873bd820cb1770b048435dc5bb7a7b99a156539e) 2019-03-05 Vlad Patrascu * [67e346d3d] : dialog: fix processes serialization when fetching sharing tag state High contention on a RW lock aquired for switchable reading has the same downsides as direclty aquring it for writing. This commit improves this by switching from read to write in separate steps, with basic rw lock ops (start/stop read/write). 2019-03-05 Bogdan-Andrei Iancu * [0b1cc464a] : Remove some extensive logging (needed only for dev) (cherry picked from commit 60024ad92931054104b88dce4a0ca04935cb76e5) 2019-03-05 Bogdan-Andrei Iancu * [7664d24d5] : Fix cps counting for the SBT algorithm Credits shared with @razvancrainea for sorting out the issue and reworking the alg implementation. (cherry picked from commit 732e3d6157f92f22ab8ad83d1e87d8beb4aa838e) 2019-03-05 Bogdan-Andrei Iancu * [0c64403e7] : Fix the parsing of $rl_count name (cherry picked from commit d7224382be37821026643e753de68c17b24307c3) 2019-03-03 OpenSIPS * [bbd6eb84c] : Rebuild documentation 2019-03-01 Razvan Crainea * [637604dfd] : dialog: init ret value to skip warnings 2019-03-01 Razvan Crainea * [a93800952] : dialog: replicate profiles outside lock (cherry picked from commit fdefec49d0415be9b499bb857e4b076d71729e78) 2019-02-28 Liviu Chircu * [6c6c513f2] : dialog: Propagate new $DLG_timeout values to DB/BIN Make sure to store/replicate the new value, not the old one! Credits to Vlad Patrascu for helping track this down (cherry picked from commit d948aa037b04bbfa37581876655edd7fcd26570e) 2019-02-27 Di-Shi Sun * [0101343ee] : Updated OSP Toolkit project repository. 2019-02-26 Razvan Crainea * [922e188c1] : dialog: prevent bin buffer double release (cherry picked from commit 738905d2fc735e82043335d51ff23f714e2306b8) 2019-02-24 OpenSIPS * [e64b11799] : Rebuild documentation 2019-02-22 Liviu Chircu * [0de94a899] : rr: Fix a buffer mgm bug during strict routing callbacks While doing strict routing (e.g. the R-URI host is a local domain) and executing the module callbacks, the rr module would provide some bogus memory pointer as the result of the rr_api.get_route_param() function. Although opensips would not crash due to the dangling pointer residing in pkg memory, some callbacks would misbehave (e.g. uac_auth() would fail to adjust the outbound ACK CSeq, since it cannot locate the ";aci" Route header field parameter within the dangling pkg area). Related to #1613 (cherry picked from commit ec89b78667430da51e4146bc7f2514f68e9d21a9) 2019-02-17 OpenSIPS * [498aec2a3] : Rebuild documentation 2019-02-15 Razvan Crainea * [5f30be420] : siprec: fix socket enforce (cherry picked from commit a7a65d39566ba4eec5d639b01909fad97a9c6586) 2019-02-12 Liviu Chircu * [71cb2b015] : mid_registrar: Improve ';ctid= not found' error logs (cherry picked from commit b830a2f32b145d32e7f85cd41dd4848211e27c11) 2019-02-12 Bogdan Andrei IANCU * [a7eeaf187] : Merge pull request #1614 from wdoekes/wjd-correct-presence-list-mi-flush-2.4 Correct presence list MI flush in OpenSIPS 2.4 2019-02-12 Walter Doekes * [fd75d765e] : mi_datagram: Correct leftover bytes count Before this fix, a flush_mi_tree without new data would decrement the bytes-left for no reason, and after a bunch of these, we'd run out of space. Errors like these would flood the logs: failed to write -line too long! failed to write - EOC does not fit in! Additionally, mi_datagram_write_node would decrease the length by more than necessary, causing less than half the full size to fit in the response. (dtgram->len is "bytes left", not "total length") 2019-02-12 Walter Doekes * [fd3a6e4a7] : presence: MI flush subs_phtable_list only if there is data Also flush pres_phtable_list after more than 50 entries. Corrects problem with (soon to be removed) mi-datagram where flushing after 0 bytes creates a negative response. 2019-02-11 Răzvan Crainea * [d57ce2d41] : Merge pull request #1601 from rrb3942/rtpproxy_socket_clipping Don't clip notify socket to older rtpproxies when using unix sockets (cherry picked from commit 9f6b15e2895260f6537d57f16575ff96955dba6a) 2019-02-10 OpenSIPS * [168466166] : Rebuild documentation 2019-02-08 Razvan Crainea * [e563f7dbd] : net/tcp: save fd before sending the conn to main Save local fd of the connection before sending it to TCP main, to make sure we it won't get overwritten by main, and we close somebody else's file descriptor. (cherry picked from commit ed4e862db1dbeefd6db8559425c2da26fa239dd9) 2019-02-08 Bogdan-Andrei Iancu * [eb07ae953] : Remove double free on bad input Credits for the fix go to @rrb3942 Closes pull request #1599 2019-02-07 Vlad Patrascu * [765dba5c4] : dialog: fix some profile replication locking issues * fix an extra relase instead of acquire for the received counters lock * fix an unrelased profiles lock in case of error 2019-02-05 Vlad Patrascu * [a6790d5bd] : dialog: also include sdp body when replicating dialogs (cherry picked from commit c8907aa3d61955f76887e32e75666468ab856f1f) 2019-02-05 Bogdan-Andrei Iancu * [945c2eccf] : Fixed over/undeflow due signed/unsigned differences Introduced with the last commit f8b7e9c 2019-02-05 Bogdan-Andrei Iancu * [f8b7e9c8d] : Fixed calculating the ovrall load stats Correlate the summed used processing time with the number of summed processes, not total processes. (cherry picked from commit bf2e51cfbe16262a29f0f52c83532c55cdb43e67) (cherry picked from commit 3354d87807e3298cfea2e0dc3f471af3538b2b0f) 2019-02-03 OpenSIPS * [45c5200e8] : Rebuild documentation 2019-02-02 Bogdan-Andrei Iancu * [033db9fd0] : Fixed uninit len for th_contact_encode_passwd param. As the used len was all the time 10 (the len of the default passwd), if you have set a shorter one, the actual used passwd has some trailing memory garbage (up to 10 char len). This grabage could be (99.999%) constant during runtime, but 100% different after a restart. Shorly, the decoding on ongoing contact would have failed after a restart. (cherry picked from commit 4a17a828861feb6be07f67103ad352e7d8c817f6) 2019-02-01 Liviu Chircu * [b6e6d4fc1] : freeswitch_scripting: Remove dead code (cherry picked from commit 13d77ed4bdccdf77d0142900d43b76d490faf4c4) 2019-02-01 Liviu Chircu * [76c02314b] : freeswitch_scripting: Fix startup crash with no modparams Thanks to Bogdan for catching this one (cherry picked from commit fd35cfd400348b30d89608f4ca700c3e8c526ec6) 2019-02-01 Vlad Patrascu * [2a05d560e] : clusterer: fix description of 'state' column in db schema Closes #1595 (cherry picked from commit 7aed4c179146140c055ecb34c190f176030766c0) 2019-01-30 Liviu Chircu * [f67f8d6cf] : Avoid errors on "$rU = ;" statements (cherry picked from commit 94d2f05940e7078d1acf485ea848eb9e5f34b00f) 2019-01-29 Vlad Patrascu * [e9d75edfe] : clusterer: complete previous fix (cherry picked from commit ad8d40c3bfa0d4d2aa095c12507295049685c12a) 2019-01-29 Vlad Patrascu * [d083b74cb] : clusterer: fix crash introduced in previous commit Also do not reset the capabailities states after running 'clusterer_reload'. (cherry picked from commit a3d5a798498cfd3552c328c4040098d86b4bcafd) 2019-01-29 Vlad Patrascu * [190ba59ac] : clusterer: fix loss of capabilities when doing clusterer_reload (cherry picked from commit 0dc0ee54317de5f663703000e374aa9ad92c0fe9) 2019-01-27 OpenSIPS * [542c7a66b] : Rebuild documentation 2019-01-23 Liviu Chircu * [d1055351a] : avpops: Make an empty avp_print() more obvious (cherry picked from commit f9a4874f6710099b293229c679ce79bc34a99a74) 2019-01-23 Liviu Chircu * [c43ee631a] : doc/build-contrib.sh: Add new contributors (cherry picked from commit 9569c2c8e0a974438b954c6a1fa721048c9b7b2c) 2019-01-23 Liviu Chircu * [dd013d010] : clusterer: Do not segfault on failed OpenSIPS startup (cherry picked from commit 00504b1a85d969a16a516fa73eafb23f6b66a18c) 2019-01-23 Liviu Chircu * [52ff74af8] : Fix poorly managed route param recursion level on an error state (cherry picked from commit b491999b2449b0f22d57dd92ce53e0b4f51a35de) 2019-01-20 OpenSIPS * [c3b087f44] : Rebuild documentation 2019-01-18 Liviu Chircu * [7b61a7e9e] : registrar: Fix incomplete commit d2a958dca Many thanks to @fedorna for catching this one! Fixes #1588 (cherry picked from commit d47b51604604431a0390cd1ecc4514e0e0fe195b) 2019-01-18 Liviu Chircu * [8d28ab639] : usrloc: Fix "shared_pinging" docs to match the code Thanks to John Quick for reporting this issue 2019-01-18 Liviu Chircu * [b600b23bb] : nathelper: Fix segfault while interpreting the branch value (cherry picked from commit 81f6ac78649d17372d6183a97403514281c537e0) 2019-01-17 Razvan Crainea * [c1403a1d9] : clusterer: initialize db connections in mod init Prevent the module from using a single DB connection from all processes, because it leads to commands responses overlaps. Close #1579 (cherry picked from commit 4c29eedc3dbdd9e74781cd81f626b64c71a4e16d) 2019-01-13 OpenSIPS * [b0a3a3d23] : Rebuild documentation 2019-01-10 Razvan Crainea * [1f8facec9] : tm/cluster: don't send replies for transactions not found (cherry picked from commit 1e0349ff2e217fcccc6b9c66549c799163b50395) 2019-01-09 Ovidiu Sas * [698caac79] : httpd: Handle Content-Type: text/html and enhance some err logs (cherry picked from commit 7829916b8505b6425cdf2b7dc6a25b0604a91bb5) 2019-01-09 Bogdan-Andrei Iancu * [6fc556c46] : [mi_xmlrpc_ng] Fix methodResponse XMLRPC formating The 'struct' tag must be enclosed in a 'value' tag. Fixes #1499 (cherry picked from commit c1cfba8806e64158942a13e062bfdf2611d76f21) 2019-01-08 Bogdan-Andrei Iancu * [ff21cea19] : [MI] Fix missing/wrong Content Type in HTTP responses When registering a callback to the HTTP server, let it also know what will be the Content Type for the returned data. Fixes #1509 (cherry picked from commit b3e0f6cc9c3e04f986f00919778b92c1f6839104) 2019-01-06 OpenSIPS * [1fcca4aeb] : Rebuild documentation 2019-01-04 Bogdan-Andrei Iancu * [87a59ea47] : [registrar] Fix 'contact' matching in remove() Deal with the 'contact' parameter as a string and to a string matching against the registered contacts. Fix for #1569 Cherry-pick from 2e1e1e98318bede41737945395a8b24366130c9c 2019-01-04 Liviu Chircu * [8b0b7f3db] : mid_registrar: Fix incorrect error log (cherry picked from commit 0062ef0842c36fcd32942f53800401505354d1dd) 2018-12-23 OpenSIPS * [184adb83e] : Rebuild documentation 2018-12-22 Razvan * [6fcc6005f] : cgrates: don't serialize dlg vals for deleted dlgs (cherry picked from commit effaf925c2a3e40990521d495edce8f18aee68a9) 2018-12-21 Razvan Crainea * [32b4af7e5] : compression: re-compute the uri after rebuilding the buffer When freeing the buffer in be3b603667, the URI in transaction remained pointing to the old buffer. Therefore when building local ACK or CANCEL, URI was having garbage. Fixes #1575 Many thanks to Jock McKechnie for reporing it and offering testing support (cherry picked from commit d87766364096e567dbd15f9d8ff1dd2b6082703e) 2018-12-20 Razvan Crainea * [ee932827f] : dialog: do not replicate update messages on early This suppresses some errors generated by incomplete replicate messages (missing callee socket, tags, etc.) (cherry picked from commit 7dd023c2501579adb287506aa59c32801e57b1cc) 2018-12-19 Alexey Vasilyev * [4c08620d6] : db: correct parsing ipv6 address for host (cherry picked from commit bfbfa83ba860aead9d6d7b1c91f08185ee4425e1) 2018-12-19 Alexey Vasilyev * [07a4390eb] : cachedb: correct parsing ipv6 address for host (cherry picked from commit 084ab2c38667a71120552d933ffa901fdbf5b9dc) 2018-12-18 Liviu Chircu * [714cddc17] : Fix more bad "method ==" examples Completes 8370a8d7 (cherry picked from commit 4b697f37538a60f0d0f2404a45172fa5d0f11ec9) 2018-12-18 Bogdan-Andrei Iancu * [04c1bc8cf] : Fix example in module docs. The 'method' keyword is obsolete and replaced with is_method() Reported by VozToVoice Net. (cherry picked from commit 8370a8d7f6919ad621f7123b405bc023434c5123) =========================== Release 2.4.4 ============================== 2018-12-18 Razvan Crainea * [d0252793f] : Bump version to 2.4.4 2018-12-18 Bogdan-Andrei Iancu * [4fa79d546] : Fix parsing SIP buffer when needed HDR is last. Be sure and not not include the HDR to BODY separator as part of the last hdr. Fixes #1555. (cherry picked from commit 24ebbbe42bb1a888b0a06b08dd5c6a280e4ec2c6) 2018-12-18 Liviu Chircu * [4253767be] : registrar / mid_registrar: Fix lookup() with a custom AoR Thanks to Antonis Psaras (@apsaras) for reporting! Fixes #1571 (cherry picked from commit d2a958dcad300ba4dd9e63e8a4ccbc2da6d60224) 2018-12-18 Vlad Patrascu * [0b7ced846] : mmgeoip: fix gcc compile warning (cherry picked from commit 88ef1217067f08998ff4d5f28dcd4aabfc677a23) 2018-12-18 Vlad Patrascu * [6dabe1546] : mmgeoip: update driver to support GeoIP2 Closes #1362 (cherry picked from commit 4272fcee0a18fec577f2e1438909dcfdb1b4418d) 2018-12-17 Razvan Crainea * [3dab82938] : cgrates: serialize variables in a different var This prevents ongoing sessions from being overwritten by the serialized value. (cherry picked from commit ae10e1aab24f7d1a3988790c7e5d9a907f2e967b) 2018-12-17 Razvan Crainea * [6d1eda3ed] : compression: do not free buf for stateless The callback frees them for you, resulting in a double free. Bug introduced in be3b6036. Reported by Ryan Bullock on GitHub. (cherry picked from commit 57f142bdeda5dd7ad4406cab184ab7a2668e32a1) 2018-12-16 OpenSIPS * [413aa5b7c] : Rebuild documentation 2018-12-13 Razvan Crainea * [a2662be82] : rtpengine: fix possible crash in via-branch Before this fix, if one was asking for a via branch id that was not available, OpenSIPS was crashing. Fixes #1556 (cherry picked from commit 624317765d4ad49e0a3dd31b563b0c3c91657959) 2018-12-12 Razvan Crainea * [13589ff3a] : tm: t_check_trans() return -2 for end-to-end ACKs Using this return code we can detect end-to-end ACKs in script. (cherry picked from commit 97dda5bb74f9229063955154ec2cc6bde484bd0c) 2018-12-11 Liviu Chircu * [416a87122] : seas: Fix compile error 2018-12-11 Bogdan-Andrei Iancu * [c4578e150] : Fixed compile warning (include file missing) Related to b90a34c54bf747958544c66502f406cc4b935fb6 2018-12-11 Liviu Chircu * [99f306a5d] : dialog: Fix compile errors 2018-12-11 Bogdan-Andrei Iancu * [b90a34c54] : Remove circular include. Reported by Peter Lemenkov (@lemenkov) Addresses #1562 2018-12-09 OpenSIPS * [9b4ee034a] : Rebuild documentation 2018-12-03 Bogdan-Andrei Iancu * [5f1ec371b] : Fixed cloning of hostend structs. The h_addr is only a #define to h_addr_list[0], leading to overwriting the new h_addr_list[0] with the old (src) value. Credits to Dan Pascu (@danpascu) for reporting and assisting with the troubleshooting. 2018-12-03 Liviu Chircu * [c24a099fd] : Fix possible pkg buffer overflow in all {sdp.*} transformations Thanks to Bogdan for directing the troubleshooting of this bug. Thanks to 46Labs for providing extensive troubleshooting information. (cherry picked from commit 52e3ada3ab649875e9a8f5e62a2c927ed8858d76) 2018-12-03 Razvan Crainea * [a1fdfcb0e] : event_jsonrpc: fix yet busy flag value This time the flag was overlapping with event_flatstore one. More details in #1533 (cherry picked from commit 84bf5f3b055de4c849c2406171be55442ca83a7f) 2018-12-02 OpenSIPS * [f9fc9c905] : Rebuild documentation 2018-11-29 Dan Pascu * [797af7239] : Fixed segfault when resource list document is not found 2018-11-28 Razvan Crainea * [9d32492f1] : mongodb: remove deprecated is_error() in json-c 0.13 (cherry picked from commit 0d819747817b90d05610e57a1168ce56b0610c09) 2018-11-27 Razvan Crainea * [5cf1811aa] : rtpengine: fix checking "cached" stats Credits go to Nick Altman for reporting this in ticket #1500 (cherry picked from commit e7fa92cc2c8124f40240deecdc56ad2f258ff21a) 2018-11-27 Razvan Crainea * [d7f636733] : compression: fix leaks when message was rebuilt When the initial buffer had to be changed, the previous one was no longer released, resulting in a memleak. Credits go to Jock McKechnie for reporting and providing testing env! (cherry picked from commit be3b60366763c3c0390f20be590420440c834204) 2018-11-27 Bogdan-Andrei Iancu * [7c785fc4d] : Correct parsing IPv6 address Manual backport of 7b2a296daa1fee0c9a6c7cd2f0be2bfde25e0e0b 2018-11-27 Bogdan-Andrei Iancu * [e6aead732] : Improve docs A bit more details on handling GRUU. Thanks to Robert Dyck for contributing on this. (cherry picked from commit 2fa7389b973360c12c46963ec6cef9bb038e3b0d) 2018-11-26 Liviu Chircu * [4aec0b238] : Logging: Fix missing '\n' endings (cherry picked from commit 3f698a26c816d8b14530da65f208f417845d0852) Conflicts: modules/cachedb_cassandra/cachedb_cassandra_dbase.c modules/dialog/dialog.c modules/tls_mgm/tls_mgm.c modules/uri/db_checks.c 2018-11-26 Liviu Chircu * [f82c49eb9] : acc/dialog: Drop redundant operations (cherry picked from commit 770ff565f99554dedc606c98f1d31c1947a07470) 2018-11-26 Liviu Chircu * [59667fb08] : registrar: Fix a flag parsing limitation Once again allow the "i" and "e" flags to be given before or after the regexp following the "u" flag. Many thanks to @ivanoff946 for reporting! Fixes #1545 (cherry picked from commit 20f13a53d5460ef610bb784734e093cfd43ff218) 2018-11-26 Razvan Crainea * [156cc6f0b] : b2b_logic: use late negociation for last ACK using MI bridge (cherry picked from commit 25fb33ee7f562b1f2b7a4001d9c6460ba3199a04) 2018-11-26 Vlad Paiu * [471be6300] : Fixed dr_number_routing crash with empty partition (cherry picked from commit b0bf9270729b0de5f7894688411353e1c5738be3) 2018-11-26 Bogdan-Andrei Iancu * [e2d1a67ab] : Fix formating floats in SQL queries. Force POSIX locale for LC_NUMERIC to be sure that the dot separater is used when using floats in SQL queries (some locales are using the comma for that, breaking the SQL syntax). Closes #1538 (cherry picked from commit 0ccda2e249890238f94736dfd8b179c359afa8f0) 2018-11-25 OpenSIPS * [24dbe1d01] : Rebuild documentation 2018-11-22 Liviu Chircu * [405d2889b] : acc: Fix buffer overflow The set_dlg_value() code would initialize the buffer to STRING_INIT_SIZE (128) bytes but then immediately proceed to using it without any more length checks, thus corrupting the memory any time it is run with larger than 128-byte acc_extra values. 2018-11-22 Aron Podrigal * [1d9e1f36d] : Fixed what was missed out in 6bc2a94 refs #1537 (cherry picked from commit 3462e8906c878f779ba696db29b3610606f0d9f5) 2018-11-22 Bogdan-Andrei Iancu * [b4f7ad3a2] : Fix nested triggers of local route. Use a dynamically allocated sip_msg struct rather than a static one. Credits go to Aron Podrigal to spot and report the problem. Addresses #1537 (cherry picked from commit 6bc2a94c85d61c61f50ed5fc63e626a23a63258e) 2018-11-22 Razvan Crainea * [4b5e254a2] : net/tcp: listen for read events after async connect After an async connect succeeds, the fd should also be added in reactor for read events, otherwise these will be lost. Many thanks go to Pete Kelly for reporting and testing! (cherry picked from commit ca643dee0f8851be7c1756bd270f168e41fb053c) 2018-11-22 Bogdan-Andrei Iancu * [95bf163ae] : Fix setting loop params during fallback. While doing a prefixless rule matching, reset the rule_idx to be sure we break the fallback looping. Addresses #1536 2018-11-19 Liviu Chircu * [e25895624] : acc: Do not dereference NULL dialog contexts This bug could be triggered in failover scenarios, where the accounting context would be created and cleaned up at least once before actually calling do_accounting(). One way to trigger it would be: * create_dialog(); * $acc_extra(foo) = "bar"; # create a dialog-stored acc context * t_relay(); exit; # msg is relayed, but ctx is unused => the code frees it and leaves a NULL dialog value marker. * inside failure_route, do: $acc_extra(foo) = "bar". We fetch the NULL context stored inside dialog, dereference it and crash. Many thanks to 46Labs for reporting this issue, as well as providing extensive troubleshooting information. (cherry picked from commit 6eb14f6a3d23bb6a646aa414907755ea9b381511) 2018-11-19 Fabian Gast * [ce6512a4e] : Fix changed iana url (cherry picked from commit 97dbc56a44b0cbfd7321cc03adc9a0f4ba044632) 2018-11-18 OpenSIPS * [c6d75e7b8] : Rebuild documentation 2018-11-16 Liviu Chircu * [0f075233e] : tm: Properly re-init branches after t_relay("0x02") fails A t_relay("0x02") failure would do the required t->uac[] array element buffer cleanups (good!) but then have these elements completely zeroized (bad!). These entries must additionally be initialized afterwards, similarly to how init_branches() leaves them after a new transaction is built. Many thanks to Debasis Das from Twilio for reporting this bug. (cherry picked from commit 853755f11d372c29866bed948796320314540084) 2018-11-15 Razvan Crainea * [3fe6c3804] : event_jsonrpc: use an unique flag for declaring events (cherry picked from commit 8bbc185888730fc1c49a8b3f3fec1550afbf4a74) 2018-11-14 Liviu Chircu * [fb2aaf65e] : rest_client: Fix swapped parameters Affected functions: async rest_post() and async rest_put(). Reported by Ben Newlin. (cherry picked from commit 8f73149b26a142b2511804b9c7385babc916874b) 2018-11-14 Razvan Crainea * [c940412bb] : rtpengine: reconnect socket in case of bad fds (cherry picked from commit 2bee3c6df0a4a1c6ffde7556c95c7ee88b923b6f) 2018-11-13 Bogdan-Andrei Iancu * [bc859828a] : Fix annoying bogus error log (cherry picked from commit 42934c42400842a2e72e6766e040037f366643f4) 2018-11-12 Liviu Chircu * [7730f225b] : dialog: Fix outdated warning (cherry picked from commit ae32d8e487e37955be7e594dd439eb03f3554dfc) 2018-11-11 OpenSIPS * [8d3d8b8a4] : Rebuild documentation 2018-11-11 Liviu Chircu * [d6a6e8d68] : build-contrib.sh: Fix a counting bug with renamed modules The "pre-rename" documentation-related commits were being skipped when dealing with renamed modules. 2018-11-10 Liviu Chircu * [30a7d8773] : Improve documentation * sql_cacher: fix grammar * usrloc: fix out-of-date explanations; improve wording * rtpproxy: improve function signatures (each param is optional) * acc: Add $acc_leg examples (negative index); Add links * fix typos (cherry picked from commit 03c910bdf36a5740ee0f79b146ad46895d2ecda9) 2018-11-09 Vlad Patrascu * [3d23d0fcf] : sql_cacher: small doc improvement regarding delimiter parameters (cherry picked from commit 3b1c13a749328a9f3e341d942ca2a990e95ae877) =========================== Release 2.4.3 ============================== 2018-11-08 Razvan Crainea * [7704abb72] : Bump version to 2.4.3 2018-11-08 Razvan Crainea * [a67387f3a] : tls_mgm: fix tls_method for openssl >= 1.1.0 Reported by netaskd(GitHub) in #1517 (cherry picked from commit c5d6c087268c09d0acd0fa7bd3cdb321207c1536) 2018-11-08 Bogdan-Andrei Iancu * [a9eba1f38] : Fix INT only restriction on integer columns in DR The mysql views report any static integer as DB_BIGINT, makeing it impossible to be used with drouting. 2018-11-08 Bogdan-Andrei Iancu * [6a11f68cb] : Fix too script restrictions on allowed types of routes for runing certain functions. 2018-11-08 Razvan Crainea * [7943ae41d] : registrar: fix contacts re-alloc issue When more than 20 contacts were serialized in a buffer, the realloc was not allocating enough space for the buffer to hold all entries. This lead to a memory corruption and further to a crash. (cherry picked from commit 54ca97b50ad0f52d43a5b6819ce7f42ea019ecc6) 2018-11-07 Liviu Chircu * [a9b916954] : opensipsctl trap: Be quiet if opensips is not running (cherry picked from commit 5dee6cd8e13ba7c8442db833c8eb7ef4e8163413) 2018-11-05 Liviu Chircu * [489de02c4] : usrloc: Fix a replication bug of commit 7c13f2e7d8 Do not overwrite the K/V storage buffer while reading additional data from the received update packet. Reported by @sekil75 Fixes #1523 (cherry picked from commit 41fd98ea2025fdce0e9d031a91b27b052bc851e9) 2018-11-05 Liviu Chircu * [ab005ac75] : usrloc: Fix possible crash in federation mode (cherry picked from commit 3650af33bf4a45d0f783375878bf4921a2b823bc) 2018-11-05 Liviu Chircu * [98706f3c3] : rest_client: Fix warnings with clang 5.0 (cherry picked from commit 6126c2039e9ed6d2820e1dd3a66c97af4087da08) 2018-11-05 Liviu Chircu * [f3e73546b] : rest_client: Update documentation (cherry picked from commit 59da2616ada4457447a5f816b1620e59577fffad) 2018-11-05 Liviu Chircu * [8e480668e] : rest_client: Add new error return codes for all transfers 1: success -1: connection refused -2: connection timeout (i.e. 'connection_timeout' was hit) -3: transfer timeout (i.e. 'curl_timeout' was hit) -10: internal error (i.e. "I hope OpenSIPS is still running") This patch also includes additional fixes related to error handling: * fix undetected error conditions on "async-but-blocking" transfers (these transfers happen once you hit 'max_async_transfers') * fix a bunch of code paths where the rest_() functions return success despite not being able to set one or more output pvars * never abort(), regardless of what libcurl says (cherry picked from commit 04e2ef3d091bba7a237589be03f53f27deabf413) 2018-11-04 OpenSIPS * [1fd7e2eb0] : Rebuild documentation 2018-11-02 Vlad Patrascu * [82f0d7587] : dialog: complete the fix in commit 596c39d9 This commit improves the previous fix that was incorrectly allowing DLGCB_EXPIRED callbacks registered by other modules than acc and cgrates to be run. (cherry picked from commit 3642e3f9e8eb70bce3793c0216bec63518bfc8be) 2018-11-02 Razvan Crainea * [cbb888a07] : dialog: enhance LOADED and EXPIRED callbacs docs (cherry picked from commit 37c56cf3973611a19e52aa13abd3616d2f4148a4) 2018-11-02 Fabian Gast * [35252a877] : fix quotes in clusterer documentation (cherry picked from commit af8c95bfa80fe5597522771f8268925533d4209a) 2018-11-02 Vlad Patrascu * [c60b94958] : dialog: do not unnecessarily fetch sharing tag state (cherry picked from commit f511f1c73dcdd64fdebe71205f5009ebf2da149e) 2018-11-02 Vlad Patrascu * [c037e104f] : dialog: fix behavior of backup node when replicating dialogs The node that has a backup state for the sharing tag of a dialog was incorrectly: * skipping the replication of all dialog events * bypassing all registered DLGCB_TERMINATED and DLGCB_EXPIRED callbacks This behavior was causing issues when replies and sequential requests did arrive on the backup node. Eg. unable to match and fix the BYE for an existing topology hiding dialog. After this fix, only the acc and cgrates modules will skip all actions in the above mentioned callbacks if the sharing tag is backup. (cherry picked from commit 596c39d905dec66c87cf04ac43cac63921c1b7b8) 2018-11-01 Razvan Crainea * [1cd794c4d] : usrloc: use contact id in update replicated msg This commit also sends the contact_id in a replicated update packet. This is useful when the instance that receives the replicated update does not have the actual contact (it previously expired), and needs to treat the update as an insert - before this patch insert would have generated a new contact_id, possibly overlapping with another one generated by the primary server. (cherry picked from commit 7c13f2e7d89a8e5f297f0d29faa047b1b1a5cb04) 2018-11-01 Bogdan-Andrei Iancu * [e3dca71ee] : Fix delete query for expired presentities. Set the table to be used again before the delete (even if already set before the select), as other called functions like publ_notify() may change the table. Reported by Dan Pascu. 2018-11-01 Liviu Chircu * [ede4db8ce] : HP_MALLOC: Recover from double pointer free Similar idea to commit 2254d00115. Related to #1518. (cherry picked from commit 9094b55152423617d9c4455ae9513b881616eaff) 2018-10-31 Razvan Crainea * [c76ce3913] : stun: prevent buffer overflow on error (cherry picked from commit dca22b0484725ddbbbb7d8acd1e0faf57f278e38) 2018-10-30 Razvan Crainea * [bad974abe] : trans/sdp: fix detection of first line (cherry picked from commit b8e3f61a7b1b95cc8f8e0cece789271e2867cd7d) 2018-10-29 Liviu Chircu * [0a357a93a] : mid_registrar: Do not panic on 200 OK with external contacts It is fine for 200 OK registration replies to occasionally include extraneous contacts which did not register through the mid-registrar (i.e. they are missing the ";ctid=" Contact URI parameter). Reported by Jeff Pyle Fixes #1516 (cherry picked from commit 20082b28fe95a4f0ad2eba9832f21b7c1f2778bf) 2018-10-29 Bogdan-Andrei Iancu * [9641eb0ac] : Fixed missing etag condition in DB query. After refactoring the code to enable clustering in 2.4, some of the DB queries for updating / deleting the presentity records were missing the etag condition. As a result you may have experienced records leaking in DB or strange errors about unique key violation. Many thanks for helping with the troubleshooting to Dan Pascu @ AG Projects and to Ognjen Šešlija. Closes #1422 Closes #1378 (cherry picked from commit 1ac9010f4fb8fff513ce25e06fdf210412c4a39b) 2018-10-29 Razvan Crainea * [c0355560c] : menuconfig: add stdio header (cherry picked from commit 0f939682e89caa188aad53c9f4cb4051bd6f45ad) 2018-10-28 OpenSIPS * [893bd0418] : Rebuild documentation 2018-10-27 Liviu Chircu * [4f017ec93] : rest_client: Plug pkg leak on failed async transfers (cherry picked from commit fe5e1b8da01ba0e5698e080c27726cf2abb74249) 2018-10-27 Liviu Chircu * [d3011e374] : rest_client: Refactor duplicate code (cherry picked from commit 10d9b42c2a702751781f2856f71aaca86bb70a79) 2018-10-27 Liviu Chircu * [a78121039] : rest_client: Repair poor timeout settings at startup (cherry picked from commit a2a8dc78d2a78676ce1f5b8c9b8f31ef27cb1906) 2018-10-26 Bogdan-Andrei Iancu * [5fa431eb2] : Fixed crash in starting with HP_MALLOC The HP allocator seems to init its stats after the statistics collector starts, so any malloc operatation translates into a crash (before init'ing the stats colector). Move the first shm malloc after the the collector init. Reported by Nick Altmann 2018-10-26 Razvan Crainea * [cdb82ba0f] : tcp: init tcp req even for CRLF pingpong Before this commit, the TCP request was not released for ping-ping constructed using multiple packets. This lead to an unknown state in the TCP parser, hence an abort() was triggered. (cherry picked from commit c20181fa36de2d96d6dd9e8dbc533bcc6b95d8a8) 2018-10-26 Razvan Crainea * [bfa40859f] : bin: fix invalid memory access Inspired from a3a260d7d45868382d00ee366e00000e7badd36a (cherry picked from commit 63f0ad718861870a1ba6d931db573ab6e98627a3) 2018-10-26 Razvan Crainea * [f32e9cbdd] : net: reset msg attempts every time a msg is fully processed (cherry picked from commit 6a4bf36ca3524e0211a874c9d5e62c65b33cb28e) 2018-10-26 Razvan Crainea * [cf1c7ece5] : proto_hep: reset msg attempts when request is completed (cherry picked from commit bf74fccad45e85869f1fb73d47787c7c661bfeff) 2018-10-26 Bogdan-Andrei Iancu * [9da632181] : Fixed wrong error messages. Reported by Nick Altmann (cherry picked from commit 40c73fc1bada8fea20b0408186da2ed15eb8c285) 2018-10-23 Liviu Chircu * [0cbcdf97a] : drouting doc: Fix bad examples and descriptions * dr_is_gw() works fine with any pvar * is_from_gw(): clarify that it matches IP + port * improve example quality (cherry picked from commit 8c4ac521bfeaddb68ff9a9dd96f556e3d8c38b0d) 2018-10-22 Razvan Crainea * [d4ae514a7] : rtp*: add errno in error output (cherry picked from commit 36e6c87f0e8acff7da43d7838cb5067174f956ac) 2018-10-22 Razvan Crainea * [a36c93e30] : debian: add python module (cherry picked from commit bd86da3db984ff024abb467d809e51fe88f89a45) 2018-10-22 Razvan Crainea * [aecf13b51] : dialog: release bin packet on prof replicate error If the profile cannot be replicated, release the bin packet to prevent pkg memory leak. (cherry picked from commit 4032ef0ed9ddb45b3cd66e49511a689b4555e508) 2018-10-22 OpenSIPS * [ac0cc156b] : Rebuild documentation 2018-10-19 Liviu Chircu * [026ec3dc3] : clusterer: Improve handling for NULL sip_addr A NULL sip_addr field should result in a false sip_addr matching with any other node. This prevents unnecessary error logs in simple federated usrloc setups (no HA) where we don't necessarily need to fill in a "sip_addr" field for each node. (cherry picked from commit 0cf846a1e1e7fb76960598bb1738033aa9597343) 2018-10-16 Bogdan-Andrei Iancu * [f98a70187] : Improve docs Add external reference to the advanced ACC tutorial (cherry picked from commit 3f04700e329f19c4024bb4cc1e2d70d3558cbd39) 2018-10-16 Dan Pascu * [2ab5efed1] : Fixed memory leaks when freeing socket_info 2018-10-16 Dan Pascu * [e80f2fc8f] : Fixed illegal memory access after being freed 2018-10-16 Liviu Chircu * [6be7190f3] : siptrace/script_helper: Fix crashes with missing headers Thanks to Ben Newlin and Jon Abrams for spotting this issue! (cherry picked from commit b14f1435e0a3da22ab4fded86aeb4d94a050f775) 2018-10-15 Liviu Chircu * [4726deab2] : db_postgres: Fix doc build (cherry picked from commit b8b33e9a4e56301e89d439135c312daf4cd8d0b0) 2018-10-15 Liviu Chircu * [4deea5a25] : dialog: Fix a decrement bug with shared profiles Thanks to Vlad Pătrașcu for helping troubleshoot this one! (cherry picked from commit 681155e4baef0075dbbf573b3c367efff34d0648) 2018-10-11 Razvan Crainea * [957fcf03c] : acc: fix leak when registering missed 2nd time When calling do_accounting() twice, and the second time was containing the "missed" flag, the actual acc context was leaking due to an extra ref. This commit unrefs the context at the end of transaction. Many thanks to Arto Kuiri for reporting this and for providing valuable debugging information! Close #1489 (cherry picked from commit 741c6f346b6b5e94f7991ab41c1bf9a9e89473af) 2018-10-09 Vlad Patrascu * [263aaff08] : Fix detection of the $json pseudo variable type This fixes incorrectly thrown parsing errors for the json_link() module function and also when using $json iterators in foreach statements. (cherry picked from commit dfa727713195e8a1a83cd4bf4f144793b7f28e86) 2018-10-09 Bogdan-Andrei Iancu * [1d958112c] : Revert "Merge pull request #1485 from vasilevalex/drouting_sock" This reverts commit f5f666b4e8014b299bf1996b42aab720c1d2054c, reversing changes made to 989b7b939c1f88e4ba6fe18e44ec640ca2f9a467. 2018-10-09 Bogdan Andrei IANCU * [f5f666b4e] : Merge pull request #1485 from vasilevalex/drouting_sock Drouting module probing socket parameter 2018-10-08 Alexey Vasilyev * [17e607092] : Docs for probing_socket parameter in drouting module 2018-10-08 Alexey Vasilyev * [ec1b4835b] : Added probing_socket parameter for drouting module 2018-10-08 Razvan Crainea * [989b7b939] : async: fix fd leaking and invalid memory overwrite Also simplify the async interface to prevent dereferencing the fd. This commit combines the following master commits: 9b45482861c53d79718f4eeff57a25b278964c5f 2b264d0b8c0b8f25d1e895247a1f0f8697ae34e5 ac549a0d5f3a084cd7034bf45b603f95c64025af Kudos to Liviu Chircu for brainstorming and optimizing the initial fix. 2018-10-08 Razvan Crainea * [e2761e0f7] : db_mysql: add support for mysql 8.0 Fix includes path to prevent adding mysql from source code. no longer define bool for libmysql > 8.0 Credits go to KetanKothari(IRC) for reporting this. Close #1456 (cherry picked from commit 13c6bbbf7bdefeb314ba3624b311684c366c33bc) 2018-10-03 Liviu Chircu * [8024abdeb] : str_strstr(): Fix unnecessary error log (cherry picked from commit 640263ded013767b25a19eea8bf1276a5f6be5b0) 2018-10-03 Bogdan-Andrei Iancu * [d3e0a86b9] : Fix error logs in terms of missing newline or formating (cherry picked from commit 76cf8f4513b0de4353ee52dec5e4df00f23dc493) 2018-10-03 Bogdan-Andrei Iancu * [6c6e271ce] : Properly set the custome values for the dr tables. IF set via modparam, be sure we recalculate the len of the new table name BEFORE we start using it :) Thanks to @nikbyte and @kertor for report and help. Closes #1479 (cherry picked from commit a9cd32d75530b79a365f9262f0f919285048cbf7) 2018-10-02 Bogdan-Andrei Iancu * [87376b703] : Move initial data load post-startup sequance Instead of loading the DB data during the startup sequance via init_child (and potentially blocking/delaying the oveall OpenSIPS startup), do the data load via IPV job after the startup. (cherry picked from commit 32cba1d751ee5a5b705da97ac4333fcad3d67728) 2018-10-02 Bogdan-Andrei Iancu * [1d9fa68ff] : Do not print error if the tm API is not available 2018-10-02 Bogdan-Andrei Iancu * [c0fd2f810] : Fixed crashes and mis-behavior in tracing * do not crash if siptrace loaded but not sip_trace() done from the script * do not crash when using sip_trace() without the tracing scope (m,t,d) * properly enable dialog/transaction tracing (best effort depending on the loaded modules) when using sip_trace() without the tracing scope (m,t,d) 2018-10-02 Liviu Chircu * [0a062411a] : dispatcher: Do not start without any partitions (cherry picked from commit a1b1f38088a0306310dfeffc189dd813015a93bd) 2018-10-02 Razvan Crainea * [935add78b] : compression: fix memory in mc_compact() The function was not releasing the parsed bodies for known headers Reported by Jock McKechnie on mailing list (cherry picked from commit 3fef51da747721895fe418987dd8c5db025d478a) 2018-10-01 Di-Shi Sun * [fd4c9ef41] : Bug fix Fixed memory leak for 6xx. Fixed memory leak for cancel call scenario. Fixed memory leak issue for P-Charging-Vector. Fixed SDP error messages for without SDP. Fixed UTF-8 issue. Fixed crash caused by without calling number. Fixed retcode issue. Fixed From header URI otg parameter parse issue. Added q parameter for Contact in SIP 3xx. Added np export order option. Added string trim function. Updated STIR implementation. 2018-10-01 Liviu Chircu * [8462580ef] : Fix compile error on the Travis environment (cherry picked from commit cfc0259886e1a1b0724bf7066e42c0532534cbca) 2018-10-01 Liviu Chircu * [a73128fd5] : acc: Fix constant-sized pkg leak on startup (cherry picked from commit 1c60e0e49fd1f53c316fc8affd296f99fa83d39f) 2018-10-01 Liviu Chircu * [91320f767] : mid_registrar: Fix segfault on invalid AoR parameter How to reproduce: mid_registrar_save("location", , "3600"); (misplaced parameter: we actually provide a bad AoR SIP URI!) (cherry picked from commit f24351189abb9acc4da1f0485c173f8f02fded3b) 2018-10-01 Liviu Chircu * [cd597cb0a] : acc: Inherit db_default_url if db_url is not set (cherry picked from commit e4747712bc99b6fedf3f2ec35ebf71198466ca35) 2018-10-01 Liviu Chircu * [d8c5ccc7c] : dialog: Remove unused function and parameter (cherry picked from commit bc840ad7bd2dc4cc785abd0b4df8c06790e2b09e) 2018-10-01 Liviu Chircu * [f574ae9ec] : dialog: Document the callbacks (cherry picked from commit 849ca807c7792a0598d53907328044718845f282) 2018-10-01 Liviu Chircu * [51d56f529] : acc: Improve code quality (part 2) * avoid cryptic str concat macros; just use init_str() * set_dlg_value(): truncate bogus strings before realloc'ing buffer * allow any whitespace chars while parsing type/flags (why not?) * remove extraneous function parameters * remove redundant conditions * improve some error logs * rename acc_dlg_ctx_cb() -> acc_merge_contexts() * rename acc_dlg_callback() -> acc_dlg_ended() (cherry picked from commit fc48765ad3c0d72f1a39583970e440343248c69e) 2018-10-01 Liviu Chircu * [386bc61a0] : acc: Improve code quality * rename expand_legs() -> push_leg() (self-explanatory) * do not use non-paranthesized macros as functions * simplify store_acc_table() and avoid shm_realloc() leak on oom * do not pass redundant function parameters * remove redundant ACC_PUT_CTX() calls * use str_strcmp() for added readability * acc_onreply_in(): improve readability (cherry picked from commit 13c8244691db9541c92e45ab74d1e0a57cdbdf63) 2018-10-01 Liviu Chircu * [75426ed8a] : context API: Inline all getter/setter functions (cherry picked from commit d41b5da71db487410c7dbae68be100e4fe1a94ca) 2018-10-01 Razvan Crainea * [280a4dafc] : db_postgres: add timeout parameter Prevent db_postgres from getting OpenSIPS stuck trying to connect to an unreachable PostgreSQL server. Credits go to Andrew(kertor) for reporting this. Close #1443 (cherry picked from commit c7e91f5356c9888c7d9c171cb12bd27a1412922d) 2018-10-01 OpenSIPS * [b8559535d] : Rebuild documentation 2018-09-27 Liviu Chircu * [4290b2334] : topology_hiding: Fix possible startup crash How to reproduce: loadmodule "topology_hiding.so" loadmodule "dialog.so" ... without enabling "force_dialog". Alternative, temporary fix (until you update your binaries): loadmodule "dialog.so" loadmodule "topology_hiding.so" (cherry picked from commit d837021b1558da7a147197e60e2d6d61570dc978) 2018-09-27 Liviu Chircu * [bf7a5a729] : ip_addr2a(): Improve error handling Do not return a NULL pointer when attempting to print an unknown address family, rather an empty string. Reported by @danceinrain Fixes #1478 (cherry picked from commit a5a3644a4bef21f0fc042d92d4e0166bb94a9ffa) 2018-09-27 Liviu Chircu * [01151f5e7] : Fix some JSON-incompatible MI replies (cherry picked from commit c658e07b07f63e17535ecac998bf30ff02f0ad78) 2018-09-26 Liviu Chircu * [cb43020ee] : rest_client: Fix some POST/PUT corner-cases This patch addresses two rare bugs such that they may now only occur with old curl versions (pre 7.17.1, that's pre 2007). When calling rest_post() or rest_put(), assuming we're fetching the request body buffer into "req_body" via fixup_get_svalue(): 1. since req_body->s is not dup'ed and may point to a PV buf, the next SIP message may impact the currently "just launched" async transfer by overriding the value stored in the PV buffer before libcurl fully reads it 2. req_body->s is provided by a PV which does not NULL-terminate strings (e.g. $du), thus curl's strlen() may overflow or crash (cherry picked from commit c2c7b052b4b4d05abde20520098acc68f8cd3ed0) 2018-09-26 Razvan Crainea * [d764955ee] : rest_client: prevent overflow in Content-Type (cherry picked from commit c92794e1899ca5fbfc8e9ad488026cc5f344e68a) 2018-09-24 OpenSIPS * [19f01bb60] : Rebuild documentation 2018-09-20 Nick Altmann * [d7bac87b3] : RPM spec: fix scenario_callcenter.xml file 2018-09-20 Razvan Crainea * [32d3679f7] : call_center: deploy scenario file at install Deploy the scenario_callcenter.xml b2b scenario file at install. Thanks go to cleberb on GitHub for reporting this! Close #1464 (cherry picked from commit a6d681c89a583cbeec372b90ca25a8ccc09cffe0) 2018-09-20 Liviu Chircu * [7dbaa1aa3] : Change source file mode to 644 (cherry picked from commit ac91f3cda4e6b194dc8284128bf9e903df875f12) 2018-09-20 Peter Lemenkov * [25ebc3caf] : Change file mode to 644 (cherry picked from commit 029d2cf72ca792ceb874f400c432466238438fa5) 2018-09-18 Razvan Crainea * [e7003dfb0] : fix possible crash introduced in 6fcbcc8 (cherry picked from commit af98f58a4c30f19af2b2f7da99f389b9f9c252d7) 2018-09-17 Liviu Chircu * [d8e37cbb4] : sql_cacher: Fix invalid memory access Similar to commit a223c82024. Avoid returning a pointer to a freed pkg memory area. (cherry picked from commit 313a3438717f8cb790aec9703037b82a66db3f4f) 2018-09-17 Liviu Chircu * [9ad56bc53] : core: Fix poor oom handling When nearing oom, any failed branch buffer allocations could lead to a crash due to a lingering freed pointer. Thanks to Răzvan for helping catch this one! (cherry picked from commit c2f8b9807837bd8dd143a33cb555b050fb7a8d72) 2018-09-17 Liviu Chircu * [2c79c8b85] : sql_cacher: Minor optimization Optimize the number of buffer realloc operations when fetching cached values. (cherry picked from commit 5516398fc63567ec13cb443c5009ad13473ac096) 2018-09-17 Liviu Chircu * [631b05be3] : sql_cacher: Fix possible invalid memory access This patch ensures that we properly duplicate (and later free) any strings contained in SQL DB results before freeing these results and returning the strings to the calling layers. We also add the is_str_column() macro, which improves code readability. (cherry picked from commit a223c820247398bc54f38aea5f6a9461d8500980) 2018-09-17 Liviu Chircu * [f74a57d32] : sql_cacher: Improve on_demand_load() * while loop: rewrite so we reduce indentation by 1 level * remove redundant code -- "if (!it) {" condition (this also drops code indentation by 1 level! yay!) * fix pkg mem leak on NULL column or bad res type (cherry picked from commit 827cee77b566f5d304b3bfeb9bd284cb770b8914) 2018-09-17 Liviu Chircu * [7b8205e3f] : sql_cacher: Fix several memleaks insert_in_cachedb(): * fix pkg leak on failed CacheDB set * fix pkg leak when running oom load_key(): * [!] fix pkg leak on successful case (return 0) * fix two pkg leaks on failed CacheDB operation * fix pkg leak on bad table name mi_reload(): * fix pkg leak on failed CacheDB add (cherry picked from commit 449e0371e7890ab4fb355586fec2e13c3f8c3db3) 2018-09-17 Bogdan-Andrei Iancu * [113973a7b] : Rebuild DB schema 2018-09-17 Bogdan-Andrei Iancu * [03c852303] : Fix URI_LEN defintion 256 was a typo, 255 is the max len for a varchar in mysql Thanks again to Brandon Lee @palmtown Related to #1462 (cherry picked from commit 2f5e5ffa7ffc272283aba919e112140085c94279) 2018-09-17 OpenSIPS * [b8791ebd6] : Rebuild documentation 2018-09-14 Alexey Vasilyev * [1de41bc85] : Correct example in docs for t_add_cancel_reason (cherry picked from commit 224ae25a451e43a2c694aa99dbe62a9456425df2) 2018-09-14 Razvan Crainea * [ba4c2537a] : dialog: fix deadlock when freeing a cell on timer When freeing a dialog on timer, sequential destroy callbacks might try to fetch the dialog lock, resulting in a deadlock. The spotted backtrace is dialog_update_db -> destroy_dlg -> free_dlg_dlg -> destroy_dlg_callbacks_list -> unref_acc_ctx -> free_acc_ctx -> store_dlg_value Thanks go to Jonathan Hulme for spotting this and offering testing (cherry picked from commit 6fcbcc816b6d8224ed97f14cec74181c0fe6423f) 2018-09-14 Liviu Chircu * [6f03fd6a7] : opensipsctl: Loosen lockfile permissions This allows opensipsctl to be run from a non-privileged user after it is run from a privileged (root) user. Thanks to Răzvan Crainea for spotting this issue! (cherry picked from commit ca788dcba0143cc790aa28312216804ef673db30) 2018-09-14 Razvan Crainea * [87c5f96d8] : dialog: fix leak of 0-lenght frags in dlg profiles In case a dialog does not have any profiles, the previous code was leaking 0-length fragments. Thanks go to Nick Altman for reporting this. (cherry picked from commit 8c6bbd261338b01e3f49b3b8c741c85719a37c9a) 2018-09-13 Vlad Patrascu * [35e5d67b0] : rest_client: fix uninitialized warning 2018-09-13 Vlad Patrascu * [514ba0313] : db_mysql: fix uninitialized warning 2018-09-13 Vlad Patrascu * [cbff0c006] : tls_mgm: fix IPv6 support in TLS domain definition 2018-09-13 Bogdan-Andrei Iancu * [c8f94f5cc] : Regenerate DB schema 2018-09-13 Bogdan-Andrei Iancu * [6614f3a47] : Fixed len for the username column (cherry picked from commit b66851b9eab4f1d5685dea19e3c38e74405c5abc) 2018-09-13 Bogdan-Andrei Iancu * [c73a9ca3d] : Fix IPv6 related storage capacity. Extand SIP_URI from 128 to 256 to be sure that IPv6 containing URIs (especially SIP contact URIs) to fit. Closes #1462 (cherry picked from commit 6c8370be3da4b32240a4cd12fd71436ab9de78d7) 2018-09-13 Bogdan-Andrei Iancu * [beaace466] : Fix IPv6 support in lb_is_destination() and lb_count_call(). (cherry picked from commit c4505fadb1c4cd1207b489103a909d46a4acb262) 2018-09-13 Bogdan-Andrei Iancu * [ddc5d21e4] : Fix IPv6 support in ds_is_in_list(). Closes #1459 (cherry picked from commit 774c22d83eace7b7e0d37f503f8759ffffdf5f9a) 2018-09-12 Dan Pascu * [b43be4477] : Improved log message 2018-09-12 Dan Pascu * [96b0f9118] : Adjusted logging of private memory used based on its configured type 2018-09-12 Dan Pascu * [791af6f6e] : Adjust the reactor size in accordance to the type of memory being used 2018-09-12 Dan Pascu * [4bedd3aeb] : Fixed displaying the memory size 2018-09-11 Dan Pascu * [9b1af1d03] : Fixed segmenation fault caused by accessing deallocated memory 2018-09-10 OpenSIPS * [870cb2d16] : Rebuild documentation 2018-09-04 Vlad Patrascu * [e046d9495] : cachedb_cassandra: update documentation (cherry picked from commit f85724f9b229548542ccfa6b5a157ad3d7b534bd) 2018-09-04 Vlad Patrascu * [c749b1bfe] : cachedb_cassandra: check if counters table exists before using it (cherry picked from commit a81860e6050a70afcd6da18d9b75be02ebaf1af4) 2018-09-04 Vlad Patrascu * [59683463c] : cachedb_cassandra: use quoted identifiers in queries (cherry picked from commit c58945b324281a3a243e97300dffd5ca2755c26f) 2018-09-04 Vlad Patrascu * [606871f85] : cachedb_cassandra: change the separator in the URL database to '.' (cherry picked from commit 37d240643301053a0f6ba9f2558a3e8e60500556) 2018-09-04 Vlad Patrascu * [c069db079] : cachedb_cassandra: update driver Update the OpenSIPS Cassandra driver from the deprecated Thrift based implementation to the newer DataStax C/C++ driver that uses Cassandra's native transport protocol and the Cassandra Query Language. Closes #1117 (cherry picked from commit 6f873a7fb98e0a2a53e098976a83037390d13efc) 2018-09-04 Vlad Patrascu * [37c12e12e] : Fix OpenSIPS shutdown when running unit tests (cherry picked from commit 52804385100eed36f7a4398df0eec28305f3464d) 2018-09-02 OpenSIPS * [acc45d195] : Rebuild documentation 2018-08-31 Bogdan-Andrei Iancu * [a4605fc22] : Fixed raw query for getting all contact in DB_ONLY mode Following the change of the "expires" column from datetime to int (unix timestamp) - see commit 78e8bea12f023de3fd861ffc297c34b77caafe30 -, the raw query used in DB_ONLY mode to fetch all contacts from DB was not properly migrated. Reported by Adrien Martin ( @adrien-martin ) Closes #1446 2018-08-31 Bogdan Andrei IANCU * [aa1c800b6] : Merge pull request #1448 from vasilevalex/topo_hide_rfc Change topology hiding Contact header to fit RFC 3261 2018-08-31 Razvan Crainea * [7da66308e] : dialog: fix unset_dlg_profile() linkers deletion This commit fixes the following bugs introduced in commit 00cddf7: 1. when it was called, it was removing all the linkers of a dialog 2. it was not removing the actual linker it was called for, causing constant increase in size for that specific profile (and leak) 3. when temporary copying the profiles list, the values were not copied, thus they might have dissapeared when the actual cleanup was done. Many thanks to Jonathan Hulme for reporting the issue and providing testing framework for detecting the bug and testing the fix! (cherry picked from commit 1f350f4bf88d1fbb67bf30d17fd74231417a5fa2) 2018-08-31 Alexey Vasilyev * [d7cb72458] : Change topology hiding Contact header to fit RFC 3261 2018-08-26 OpenSIPS * [8b6830cdd] : Rebuild documentation 2018-08-23 Liviu Chircu * [011f7dddd] : make test: Improve usage * avoid compiling the yacc / lexer code * do not corrupt Makefile.conf if it's missing the ending newline (cherry picked from commit 2504fbd87a52a404b9c32e7b7f46110e8ef4f825) 2018-08-23 Liviu Chircu * [ab06f3959] : mid_registrar: Fix a bug which leads to empty, dangling AoRs In mirror/ct throttling modes, when the downstream element does not reply at all, we must also make sure to properly un-reference the AoR. Reported by @viperlong Fixes #1449 (cherry picked from commit 4d0fbf528042e1e9d94769ec32019a9124d59fff) 2018-08-19 OpenSIPS * [a84e02942] : Rebuild documentation 2018-08-17 Liviu Chircu * [482caf7a9] : core: Fix possible crash with some VPN clients As stated in the man page, when listing the current interfaces, getifaddrs() may return a NULL pointer for the addr->ifa_addr field. (cherry picked from commit 9e8f475e53ed7283de20d91d61e6bb8cd11a2158) 2018-08-16 Razvan Crainea * [344ee0692] : tm: fix preserving CANCEL reason for for t_relay() Thanks to Alexei Vasilyev for reporting it on the mailing list. (cherry picked from commit deb05da54efb247a472fb315974ea37a51516628) =========================== Release 2.4.2 ============================== 2018-08-14 Razvan Crainea * [63a9d0190] : Bump version to 2.4.2 2018-08-14 Bogdan-Andrei Iancu * [9b4e3b877] : Fixed freeing NULL rpl from REDIS server. Reported by @mrmeyers99 Closes #1442 (cherry picked from commit b33b7a7e71ce0b76a80c3abf430f572074869e22) 2018-08-14 Bogdan-Andrei Iancu * [f6219b732] : Fixed reporting the correct query retcode via db_virtual There are mainly 2 fixes here: - correct iteration in the list of connection when failed conns are found or detected - correct aggregation of the retcode, based on all performed queries in the list (cherry picked from commit 8369c3191ed0f355eaf8087767ea113861101a81) 2018-08-14 Liviu Chircu * [2ef4b5d66] : mid_registrar: Update documentation (cherry picked from commit daf2c6d48bcf35fdb72eeb3c7f1d9b6e281085a1) 2018-08-14 Liviu Chircu * [2b78f1746] : mid_registrar: Add the "global lookup" flag Fixes #1431 (cherry picked from commit 20b063f9bf781c569cf8fba8dad9367c7bb9f726) 2018-08-14 Liviu Chircu * [5e259756b] : mid_registrar: Fix broken AoR throttling with use_domain = 1 Enabling both usrloc's "use_domain" and mid-registrar's AoR throttling mode would cause broken advertised Contact header field URIs such as: sip:alice@atlanta.com@10.0.0.10:5060 This patch fixes this issue such that the mid-registrar advertises: sip:alice%40atlanta.com@10.0.0.10:5060 Fixes half of issue #1431 (cherry picked from commit 1d6733cb42ea1a6505486bc02266bf418b97207f) 2018-08-14 Razvan Crainea * [e4f409e2f] : msg_translator: adjust the lumps len with the useful part of the body Discard the extra bytes in the body that are not contained by the Content-Length. (cherry picked from commit ded172901d5d06436034fed9272d29adb37c2985) 2018-08-14 Razvan Crainea * [914049371] : Revert "msg: remove extra bytes from malformed bodies" This reverts commit fecb4b244c3cf84435af03db88bfd88002a69177. (cherry picked from commit ac715eec93a017ca8e42401ddf2678256d225ccf) 2018-08-14 Vlad Patrascu * [1cec6f7d1] : proto_tls: fix crash when tracing an outgoing connection This was caused by attempting to send tracing data that was not ready yet. Thanks to Razvan for reporting and help in debugging. 2018-08-14 Bogdan-Andrei Iancu * [cf88b4b26] : Fix memory leak on redis cache misses Closes #1441 Credits go to @mrmeyers99 2018-08-14 Bogdan-Andrei Iancu * [02b515d76] : Fix wrong chapter'ing in docs (cherry picked from commit 0e978c907d58a868e6c81f4685c1e46189910fc1) 2018-08-14 Liviu Chircu * [d4c065253] : dialog: Complete commit 4ba14e51cbbb Commit 4ba14e51cb did not actually change anything, as the runtime environment was also hardcoded to only write to AVPs / pseudo-vars. We now fix get_profile_size(), as well as fetch_dlg_value() such that they properly write to any writable pvar at runtime. (cherry picked from commit 005b89eed94f207047be8c7a424618b650cd3042) 2018-08-13 Vlad Patrascu * [4a76c0822] : sql_cacher: fix error message when key not found (cherry picked from commit d12c695874f0b52e5d48c427eaa5b6f0082054a4) 2018-08-13 Bogdan-Andrei Iancu * [3475c4a58] : Fix cases in db_url parameter examples (cherry picked from commit 550e8cb8a75dd193ada51fc102e4573c2be862af) 2018-08-12 OpenSIPS * [0191c73d3] : Rebuild documentation 2018-08-10 Liviu Chircu * [a6332fe63] : acc: Fix trivial crash on non-CDR accounting (cherry picked from commit f76cc0eaaad9c6ddb4efd609b9b9bac59b69b941) 2018-08-10 Liviu Chircu * [8df477dc8] : core: Properly handle pre-fork segfaults (prevent attendant from infinite looping in case an early crash occurs) Thanks to Bogdan for catching this one! (cherry picked from commit 1dd17e93b587cbb6c829b942df4d3b100713b178) 2018-08-10 Bogdan-Andrei Iancu * [c3972e1f4] : Suppressed too verbous dbg messages (cherry picked from commit ae6e9665ec8c0585c40abcb51b5ba138e5721423) 2018-08-10 Bogdan-Andrei Iancu * [abc17e9f6] : Fix crash when using an undefined db virtual set (cherry picked from commit c288a1c1ab49b3b40bbb5efa8dd629383b2e34b6) 2018-08-10 Vlad Patrascu * [e45702f5d] : sql_cacher: fix an error message (cherry picked from commit 98662b927bc67b9c9f113e853176f499cd732354) 2018-08-10 Vlad Patrascu * [29b04376e] : sql_cacher: fix db handlers for multiple caching entries 2018-08-10 Bogdan-Andrei Iancu * [a71e41a13] : Fix cases in db_urls parameter doc. (cherry picked from commit ea78949ff7f9725d4a6f278c3d646dacace2d11a) 2018-08-10 Razvan Crainea * [cf0b324ad] : dialog: fix MI profile_end_dlgs return to 200 OK Before this change the command was returning 400 OK on success (cherry picked from commit 3c7f8943aa70f6871a934e450b8e4fffe71b9ddd) 2018-08-09 Vlad Patrascu * [b4da1dcc0] : usrloc: improve docs regarding cluster syncing (cherry picked from commit d82288e8df1fdd30c8326ab202a89370349eca71) 2018-08-09 Bogdan-Andrei Iancu * [ec33af350] : Fix wrong condition in detecting the pass-thorugh body Completes/superfixes 953490775b82f2244eb3b0bcba6232d3d2af4484 2018-08-09 Razvan Crainea * [3582c6e0d] : etc/tls: remove passphrase (cherry picked from commit 7bd8f1dd77352ffde1c8c7721172816aa25149c8) 2018-08-08 Bogdan-Andrei Iancu * [953490775] : Fixed pass-through multi-part body with a single part Previously the code was trying to convert the multi-part with a single part to a uni-part body, but this was incomplet as the Content-type was not updated and the per-part headers were lost. So, a better approach is to keep it as it is (as packing). 2018-08-08 Bogdan-Andrei Iancu * [df9e5a849] : Fixed dynamic dependency on an SQL module Reported by Callum Guy 2018-08-06 Razvan Crainea * [53f40afa3] : db_mysql: re-try query in case of a server deadlock 2018-08-06 Razvan Crainea * [d45194dcd] : acc: rework ref logic for acc ctx This commit tries to fix some invalid memory accesses experienced in high traffic platforms. Credits go to 46 Labs for reporting the issue, providing logs and tests (cherry picked from commit 056d7b95dc29b961c1e41b9fe495574da8b0436d) 2018-08-05 OpenSIPS * [e88114395] : Rebuild documentation 2018-08-04 Liviu Chircu * [bb811b391] : Module doc: Fix missing section IDs (cherry picked from commit 1832dd0735d21e19d950efb2f48019b5cd13cf64) 2018-08-04 Liviu Chircu * [d24efb2b1] : Module doc: Normalize section names (cherry picked from commit b4295bc23a68d78c3ab45ea7c878e901a7d434a5) 2018-08-04 Liviu Chircu * [d79850377] : Improve documentation * tm: - t_relay() "0x02" flag - t_newtran() * acc: $acc_current_leg * registrar: $avp(attr) * dialog: match_dialog() (cherry picked from commit bc0855275ebde456eb0cfd7682774fc316a41dc8) 2018-08-04 Liviu Chircu * [ac12fc933] : Codebase improvements (cherry picked from commit 81771e7c53de6cf85b96f55fbcbd1d9591ca42a8) 2018-08-04 Liviu Chircu * [59231f41c] : Fix typos (cherry picked from commit b93a79e31a79b13fe06ab6a0b89fb3f7f20399e6) 2018-08-04 Liviu Chircu * [efba6a239] : doc/build-contrib.sh: Improve locale management (cherry picked from commit ae97cea6b5354b68659c87396b1ef852f98f115f) 2018-08-02 Liviu Chircu * [61ef877c5] : cachedb_mongodb: Fix modparam typo (cherry picked from commit deb76e340a8322aa7a1eea0d73f40e00867d1c47) 2018-08-02 Bogdan-Andrei Iancu * [9cd488ede] : Allow TEST to be preset as env variable (cherry picked from commit da50df0c8c517d8f2852db32cc7a6f3679582c6b) 2018-08-02 Bogdan-Andrei Iancu * [97061ab10] : Added rtpengine table to default table. This will automatically create the table via "opensipsdbctl create" (cherry picked from commit e3852e9373b5b0d6005111ec78fb5509f0228b8f) 2018-08-02 Liviu Chircu * [e1346ce9f] : dialog: Make get_profile_size() less restrictive Allow any writable pvar to be given for the 'size' output parameter. 2018-07-31 Vlad Patrascu * [67efdb9a8] : tm: add examples for MI commands docs (cherry picked from commit 5f17ed5edead1090007c993da2407a5e72ce7eeb) 2018-07-31 Vlad Patrascu * [0bd252c9d] : dialog: document dlg_cluster_sync MI command (cherry picked from commit 6fcda64a3ea78a5f07b9cf7db65527373b209b51) 2018-07-31 Vlad Patrascu * [2aef25189] : dialog: improve docs regarding profile replication (cherry picked from commit d00f84631cc433554282abef611509e0c81bfc94) 2018-07-31 Bogdan-Andrei Iancu * [04fe5ab6a] : Fix wrong section enclosing for functions. (cherry picked from commit 6ba2a41991d5ba67065b8d13d05c0ced929c448c) 2018-07-30 Liviu Chircu * [b1b706e51] : doc/build-contrib: Simplify external scripting (cherry picked from commit dce68e49123974ab0cc563d0e5ed528d67337a61) 2018-07-26 Bogdan Andrei IANCU * [0e23b77a6] : Merge pull request #1421 from pasanmdev/2.3 * fixed msg payload content to be string rather than binary data (cherry picked from commit fd8c0401d472f35884d70b3bd2d327799275447d) 2018-07-26 Liviu Chircu * [c81c0712b] : auth_db: Fix forced SQL DB dependency Thanks to Michael Mavroudis for discovering this bug. (cherry picked from commit e7c3733cbd5bd4abfd5991ab6d93ba86d0882dfb) 2018-07-24 OpenSIPS * [9c0e0b7e8] : Readme files regenerated 2018-07-24 OpenSIPS * [faad98c0d] : Generated and imported the per-module contri files 2018-07-24 Bogdan-Andrei Iancu * [355c5071b] : Remove the extra '\n' returned by ctime(). Reported by Kirill Galinurov. (cherry picked from commit 01f8f0867431ddb9e085f4cee460e3e748314887) 2018-07-23 Liviu Chircu * [198a9a157] : opensipsctl: Improve the "trap" command * prevent "trap" from failing if the FIFO process is deadlocked * add possibility of trapping input pids by setting TRAP_PIDS= * use the proper binary for each trapped pid * all gdb processes now run in parallel, instead of serially (cherry picked from commit 5fe1878ee5d06ce1cecc12fe64db459422c184d8) 2018-07-23 Liviu Chircu * [ebd9b3570] : systemd: Properly shut down OpenSIPS 2.4+ instances OpenSIPS 2.4 is meant to be shut down gracefully, in order to minimize any form of data corruption caused by partial processing of SIP messages. Running "killall opensips" has a good chance of deadlocking OpenSIPS for the next 45 seconds, especially if it's doing a lot of logging. This is often the case with the current systemd logic. This patch updates the opensips systemd service files so they only deliver SIGTERM to the attendant process. (cherry picked from commit 5e154cb8f9ccb5b1ac4679d8342eb9718a636cf4) 2018-07-23 Liviu Chircu * [82b14ed05] : core: Greatly reduce chance of truncated corefiles Before commit 8073d4de8ed, the SIGTERM signal delivered by the attendant process to a process who had already crashed and would be dumping its memory inside the SIGSEGV handler would stay queued and not disrupt the generation of the corefile. At worst, corefile generation would take above "shutdown_time" seconds (60), and OpenSIPS would SIGKILL its entire process group and definitively terminate. Now, OpenSIPS behavior has changed to: * attendant broadcasts a graceful IPC shutdown job * attendant gives _everyone_ a grand total of 5 seconds to finish * if not ready -> SIGKILL the entire instance This behavior is too restrictive for the average spinning disk performance. Coupled with the fact that SHM pools of 2+ GB are common nowadays AND the fact that, occasionally, corefiles come in multiples, 5 seconds is not a lot of time. This patch fixes the behavior to: * attendant broadcasts a graceful IPC shutdown job * attendant gives non-crashed processes 5 seconds to obey * if not ready -> SIGKILL any processes which are still running * perform cleanup(60 sec) (leave the core-dumping processes alone) * exit or abort cleanup (leave the core-dumping processes alone) Thanks to Bogdan for significantly directing the design of this patch (cherry picked from commit 9c5b1b9503af2e1b76ca9e8f4c5b9b187697e895) 2018-07-23 Liviu Chircu * [0d5864c24] : core: Clean up outdated SIGKILL-based shutdown code When not in "debug" mode (i.e. when opensips successfully daemonizes), the kill_all_children(SIGKILL) function will actually send SIGKILL to the entire process group ID, including its owner. In this case, all code that follows after it is _dead_ code. This includes the final cleanup() sequence, which would be desirable to run even during an emergency shutdown (e.g. OpenSIPS deadlocked, SIGKILL'ed all its children, yet managed to do a last-second DB dump of all dialogs and contacts). This patch fixes the following: * rewrite kill_all_children() to actually do what it says: "only kill the children". No need to send kill() to the pgid. * remove the alarm()+wait() logic around kill_all_children(SIGKILL). Even if opensips is not daemonized (so the SIGKILL only gets sent to each enumerated process), if, by absurd, we failed to count all processes within the for() loop of the first call, installing a signal handler for yet another kill_all_children(SIGKILL) call is pretty much useless -- we will still stay stuck in while(wait()). * remove the "now unused" sig_alarm_kill() function * improve function docs (cherry picked from commit 28e00f74ffde8ec855c27abac2d41e2d40cc5e61) 2018-07-23 Razvan Crainea * [5529dfafc] : proto_tcp/bin/hep: fix deadlock when delaying writes (cherry picked from commit 058cc22cb55dce9b890308b9f83a42a88691f2c8) 2018-07-18 Liviu Chircu * [52016c07f] : Module doc: Add an auto-generated "contributors" chapter Each module will additionally contain an auto-generated doc/contributors.xml file. To generate a contributors.xml file: * git fetch origin 'refs/replace/*:refs/replace/*' (pull the entire SER/OpenSER/OpenSIPS history tree) * make modules-contrib [modules=modules/] Follow the comments in doc/build-contrib.sh for more info. 2018-07-17 Italo Rossi * [5e9bd4294] : Parsing Call-ID before looking up for contact_id (cherry picked from commit 222125a3b3668fc618bec46dc30debaabf77fc4f) 2018-07-17 Razvan Crainea * [e1934f888] : debian: prevent opensips from starting at install It's not a good idea to start after installing opensips, because it hasn't been configured yet (cherry picked from commit b25ed33237220f52d3b02bc37945519f2caf0509) 2018-07-17 Razvan Crainea * [eb7c4f3ff] : fix several typos (cherry picked from commit 98851096b3f9d3f1059b6de38c3b64e4913194b3) 2018-07-17 Razvan Crainea * [4f2cb7121] : packaging/debian: add man page for opensips-m4cfg (cherry picked from commit 945e9143dd57eb1c437056b7fcbfacd62f633e85) 2018-07-17 Razvan Crainea * [efa16e81d] : packaging/debian: add #DEBHELPER# token to preinst (cherry picked from commit 682177a967e65bf31d629206743f725c4d725799) 2018-07-17 Vlad Patrascu * [d7a653190] : Regenerate default TLS user certificate and rootCA (cherry picked from commit 9ee39b75fe1296820d70a86a2e2343b46a01fcbc) 2018-07-17 Vlad Patrascu * [7e3254d50] : usrloc: replace deprecated 'db_mode' modparam from default script (cherry picked from commit 34ffa870183a82c803ed0bdff611ab19ebe3fe6f) 2018-07-13 Vlad Patrascu * [c34d126af] : usrloc: fix a regression bug introduced by the k/v storage replication Closes #1423 (cherry picked from commit c2a11864ebf744bdb232caf8480eafc18d3af8af) 2018-07-13 Liviu Chircu * [e9088f67c] : rest_client: Clean up extraneous code (initial TLS client cert implementation, which was not fully cleaned up) (cherry picked from commit 766cc8c907b69f26c483e71cf0873d9c60c00b07) 2018-07-13 Razvan Crainea * [c8a6dbb5e] : dialog: fix dialog_table param (cherry picked from commit b81be8ec8c43b426b3432fa6aa023128a926c053) 2018-07-13 Razvan Crainea * [adc2f7e8b] : cgrates: verify the return type Prevent opensips from crashing when using with an old verison of cgrates and not setting the compat mode (cherry picked from commit 7d07bf013b795b3da8f5d4ddbaee48ac77a6fc32) 2018-07-11 Liviu Chircu * [a4a35d36f] : shm_nt_str_dup(): Improve error handling Do not report (-1: out of memory) on NULL input strings (cherry picked from commit e4fb2866a407c9ce96442ed6aa05d8629672f7a6) 2018-07-06 Razvan Crainea * [07aa6765e] : cgrates: fix invalid memory access after release (cherry picked from commit fe18cc1243b13a55ce2adaffbcb75d2132bfbf19) 2018-07-05 Liviu Chircu * [2982f1991] : usrloc: Improve "db_mode" documentation Better explain the implications of setting this parameter. (cherry picked from commit 9ebade34c90b6dec74240ab26a3a214bac4f99b4) 2018-07-05 Razvan Crainea * [a403d99de] : usrloc: suppress unneccessary oom error (cherry picked from commit 7bc46387237b03610a0e079b397b15e7742429c1) 2018-07-05 Bogdan-Andrei Iancu * [fbbd1445b] : Fixed accepting (again) the comma char inside URI. Fixes #1385 This issue was introduced with commit the a7e724a commit, starting 2.4 (cherry picked from commit 1e74986285035e29b49017a38d95cbdf8c57b485) 2018-07-05 Razvan Crainea * [53505fcc8] : db_mysql: doc: clarifying max_db_queries meaning (cherry picked from commit 75be0c227d57fe5c96b0819ca993e6e906e3ffb2) 2018-07-04 Vlad Patrascu * [f981d0372] : dialog: fix a bug when removing a dialog with no profile links (cherry picked from commit 9e26e9e0d8f2d7bd30d7c1274d19524eec7c991b) 2018-07-04 Vlad Patrascu * [5196c4d58] : dialog: fix a bug when destroying profile linkers (cherry picked from commit 948e7da262df5e20551bd1e30d04740806092fa6) 2018-07-04 Vlad Patrascu * [5ba510c18] : dialog: refactor some names in the profile replication code (cherry picked from commit a4bc298bc515006da65257a416cef6a1305d34fd) 2018-07-04 Vlad Patrascu * [c052bb428] : dialog: fix initialization for profiles without values (cherry picked from commit f939d6a3d592ffea1e3a0098b7a43f1aa5b12413) 2018-07-04 Vlad Patrascu * [d2328489a] : dialog: fix deadlock when replicating both profiles and dialogs (cherry picked from commit 00cddf7634052f50a489e29ffea4ca5a592f7ee2) 2018-07-04 Vlad Patrascu * [407efce36] : dialog: fix counting when replicating both profiles and dialogs (cherry picked from commit cc1fe0f8b06427646383e37980db0df668772cd8) 2018-07-04 Vlad Patrascu * [f4e41259f] : AVL map: handle oom error when duplicating key in map_get() (cherry picked from commit 85de3a9f716b6b9150a98214f3673100c07ed82f) 2018-07-04 Vlad Patrascu * [6baf5c280] : dialog: handle oom error when linking dialog into profile (cherry picked from commit 4478fe15790fb28d10a63d932c07300577544e04) 2018-06-30 Liviu Chircu * [77e8c637d] : registrar: Avoid a redundant NoSQL query In federation clustering, do not uselessly load the NoSQL records during simple lookups. (cherry picked from commit f7be418bd30d2d42b44df24c84c05b316a503cbc) 2018-06-29 Bogdan-Andrei Iancu * [48674c64a] : Fixed typo in documentation. Reported by Alexey Kazantsev (cherry picked from commit 48f82e2bfd04a0bec5c6690dad34c43c199c8fdf) 2018-06-29 Vlad Patrascu * [eee4c9db2] : dialog: fix crash in profile counting The issue manifests after a dialog is deleted(and removed from the profile), when both the dialog and profile replication are enabled. (cherry picked from commit dfd6d6826467b9fc27163346ee3f7564f570c04d) 2018-06-29 Vlad Patrascu * [577fb1197] : dialog: fix deadlocks when removing dialogs from profiles The issues manifest when both the dialog and profile replication are enabled. (cherry picked from commit 014c650e97e5879a0415b3fa3002084071c10556) 2018-06-28 Bogdan-Andrei Iancu * [5f87a677f] : Fix bogus data access. Access data after the NULL test and after the lock is taken. Reported by Nick Altmann (@nikbyte) (cherry picked from commit 2300e4504f1d9282fed98de8bebd1bc1750306c1) 2018-06-28 Bogdan-Andrei Iancu * [c05768deb] : Fixed wrong return without locl release. Reported by Nick Altmann (@nikbyte) Closes #1409 (cherry picked from commit 9cc75c0ac3155f5d5c55643123e906f347e93e41) 2018-06-28 Bogdan-Andrei Iancu * [9a84bd0ff] : Fixed error message for rmrule cmd (cherry picked from commit 2ee9ba5d6f2e587d74766f0c7feab0a68e3e5e13) 2018-06-28 Bogdan-Andrei Iancu * [102098311] : Fixed wrong example The correct cmd is "rmrule", nu "rmgrule". Started from a report by @willyrgf Closes #1412 (cherry picked from commit 76e90cf571a1155753a04edeb36dbfec1cf65345) 2018-06-28 Fabian Gast * [1f27af33c] : switch / case skips the "default" statement during fall-through fixes #1371 (cherry picked from commit 0d57cdcf1f33778587898b1f646e494202a61b32) 2018-06-26 Razvan Crainea * [85428d631] : rtpengine: fix rtpengine_manage() parameters fixup Fix the way rtpengine_manage() function parses the received parameters. Make the parsing similar to rtpengine_offer(). Credits go to Carlos Oliva for reporting this. Closes #1410 (cherry picked from commit e1e407fb1dfa2aa272cb4964f482428bde8280d5) 2018-06-25 Bogdan-Andrei Iancu * [57e59cb24] : Fix checking PAI/PPI hdr with multi hdrs According to RFC, the multi value/body for PAI / PPI hdrs may be spread across multiple header instances, not necessarily merged into a single hdr. Fixes #1386 (cherry picked from commit aec863871824e1d60fc23744d5b776e3f95e4340) 2018-06-22 Vlad Patrascu * [ff10f7871] : dialog: check if replication is enabled in clustering related MI commands Fixes #1406 (cherry picked from commit a3f8a9cdf8b9bb6fdff89175d348598c7b58f293) 2018-06-22 Liviu Chircu * [d63ce2978] : dialog: Do some code maintenance * add macro for reinvite pinging detection * fix clang compile warnings (cherry picked from commit cabac7d4add383114176fd9581a01177fd20e7e8) 2018-06-22 Liviu Chircu * [b1cf4a32e] : dialog: Properly store all downstream forked legs Commit a03ed4e1a36 over-simplified the downstream leg identification, assuming that there is a 1:1 correspondence between outgoing branches and unique replies to them. This is not the case: as a proxy, we may receive multiple responses (read: "To" tags) for each individual branch we fork out. This misconception would also cause SHM to leak. We fix the above limitation by cloning a new dialog leg each time we detect downstream forking of our outgoing branches. Thanks to Bogdan for pointing out this problem (cherry picked from commit 67b29011127a53fe53c8bd19efc2373b2978f4f2) 2018-06-22 Liviu Chircu * [816cf6e07] : dialog: Refactor dlg_leg.sdp and dlg_leg.th_sent_contact These fields are only relevant for dialog pinging and they behave similarly, so their naming should reflect this. (cherry picked from commit 287ce6f545e342d9239359eb78834c9272b80e26) 2018-06-21 Vlad Patrascu * [cfc9efec6] : sip_i: fix error handling when PAI number is too long When mapping parameters to ISUP by default, a P-Asserted-Identity number longer than 15 digits would cause an infinite loop in the worker process until running out of memory. Also raised the logging level(to INFO) of some useful messages when unable to map ISUP parameters by default. Thanks to Rinor Hoxha for reporting. Closes #1390 2018-06-21 Liviu Chircu * [fc2d03d75] : mid_registrar: Properly handle empty K/V store in AoR throttling mode This state may be reached with initially replicated AoRs (so empty K/V storage) on passive nodes which become active. We handle the issue by simply forwarding the request and fixing the storage. Credits to Alex Vasilev for reporting (cherry picked from commit 1dd0e0eabdbb7b094e9fe5c0edcbe0d328e46c3d) 2018-06-21 Liviu Chircu * [70426b1db] : usrloc: Fix "DB only" mode selection Reported by Jonathan Hulme. Fixes #1403 (cherry picked from commit d6e9817a190bdbb2c47e7986f1eea9fcc89f45f3) 2018-06-21 Liviu Chircu * [b742b741f] : usrloc: Do not pretty-print the "KV-Store" MI output (cherry picked from commit 20480ee080eb07fd93279b2033221f57c74e50fe) 2018-06-21 Liviu Chircu * [9c53126d5] : usrloc: Document "mi_dump_kv_store" (cherry picked from commit fe782c210c4d19eebeeb79365d2b39fb72764757) 2018-06-21 Liviu Chircu * [7c217d5a7] : usrloc: Fix pinging with simple active/backup clusters In these types of setups, partitioning the pings across the cluster is incorrect, as the active node must send all pings. This patch adds the "shared_pinging" module parameter in order to fix the pinging behavior for these scenarios. (cherry picked from commit bafdb8b6a00f697f08f03fb73d3b1f78ed9b8eef) 2018-06-21 Liviu Chircu * [54cf22977] : mid_registrar: Do not drop registrations on empty K/V store Simply forward them and populate the values. (cherry picked from commit 78902eb60698ac0a9a5a4ae0a6cd37845687c5f4) 2018-06-21 Liviu Chircu * [2023dcbbd] : usrloc: Also binary-replicate the k/v storage This allows us to also cluster the mid-registrar (not only registrar!). (cherry picked from commit d8fe587cef17421ebbbd4cc0d4c688bcf83b3f5a) 2018-06-21 Bogdan Andrei IANCU * [0ba498098] : Merge pull request #1394 from lemenkov/improve_docs Improve docs (cherry picked from commit 7a6e93f0a77d8b1ef907603ba60bd07e4e46759b) 2018-06-20 Vlad Patrascu * [f2c06267e] : sip_i: fix country_code modparam length check Closes #1395 (cherry picked from commit da0475972cbbfd2bd4f85a4755f9691721598599) 2018-06-20 Vlad Patrascu * [04c47430d] : sip_i: add oom check when allocating optional param in PV set function Closes #1396 (cherry picked from commit ae826b9de59687409611493ba53ea03a9a81d68f) 2018-06-19 Callum Guy * [90874b85c] : revised timeout value information (cherry picked from commit b73991a90737f54eee1ac0c65c31014ca43c4667) 2018-06-19 Bogdan-Andrei Iancu * [2f7dd8320] : Fixed missing locking when checking gws Closes #1373. 2018-06-15 Liviu Chircu * [cd1cfbdd4] : module stats: Improve module name matching regex Reported by @cbsergiocf Fixes #1392 (cherry picked from commit bbcfcb334262d5d5ba12828cfca313f01a3cce82) 2018-06-15 Liviu Chircu * [06824f9a6] : sngtc docs: Fix outdated links (cherry picked from commit 14ad190473b4082e3048c957222c7d04f37c5136) 2018-06-15 Liviu Chircu * [ec1ede28b] : sngtc: Fix bad string math ^ This was only detected by clang. Also fix a compile warning. (cherry picked from commit ba3e74d6e3a78a71deb7c91fe8d84fbe00a3d8a9) 2018-06-15 Liviu Chircu * [3deb0c2f1] : sngtc: Fix compile errors Reported by @cbsergiocf Fixes #1392 (cherry picked from commit 61a5a673ff361943bb099c6553b55bf13b8c1fe3) 2018-06-15 Liviu Chircu * [f77ad26d1] : fraud_detection: Fix badly handled corner cases * do not segfault on oom (get_stats() returns NULL) * do not deadlock when failing to fetch the time * do not segfault when failing to create a dialog * do not return success on failed allocations + logic * do not leak memory on oom failures (cherry picked from commit 375e9d4f0eba9ad2197ebf5da6c6e974bc7954ea) 2018-06-14 Vlad Patrascu * [c7e912bee] : Handle oom when allocating message body in add_body_part() (cherry picked from commit 844dbcb2bc0c53e0b61554e740bff7034243eac6) 2018-06-14 Bogdan-Andrei Iancu * [5f2c1612b] : Fix adding "socket" nodes under "set" node in MI show command 2018-06-13 Liviu Chircu * [0e7918505] : cachedb_mongodb: Fix a MongoDB URI building bug When a username/password was supplied, the resulting URI would also include the collection (e.g. "/opensipsDB.dialog"), which is not supported by the more recent libmongoc releases anymore. Reported by Vladimir Kuzmenok (cherry picked from commit e4f98a6d4c830ee1f3d9b5ac5299146b005953e5) 2018-06-13 Razvan Crainea * [91b1197a7] : rtpproxy: fix adding the nortpproxy string hack to properly add the nortpproxy string at the end of the body (cherry picked from commit 79698b90d9a425e4460ea60647482348ba34cdce) 2018-06-08 Liviu Chircu * [5d34c945c] : cachedb_mongodb: Improve docs for the URL "multiple hosts" feature Suggested by @volga629 (cherry picked from commit 931fbc5e34ebbf2f6f5fd86e6903fdeaf3b148de) 2018-06-07 Liviu Chircu * [079f0dbd7] : usrloc doc: Add tutorial page references (cherry picked from commit 64172a95b0d44de469a673652a8bfd208ac6d489) 2018-06-07 Liviu Chircu * [163b9e1e5] : registrar: Fix uninitialized stack variable Reported by @sekil75 Fixes #1377 (cherry picked from commit 4deac1f08dd2fdbff1a6f945bd78d83438f521e3) 2018-06-06 Vlad Patrascu * [2da3504da] : dialog: improve docs regarding clustering (cherry picked from commit 0056d768c607b92cff0ecb4f0191160e5c394046) 2018-06-06 Liviu Chircu * [27b0a140a] : DB modules: Improve error logs on failed conversions (cherry picked from commit 0819301305df44d9c719d595bc96e7baeea4c2ca) 2018-06-04 Razvan Crainea * [72a8bc942] : proto_*: check returned events from poll Inspired from ticket #1374 (cherry picked from commit 52e54daa0ff989537d2381c905744b1b898387ad) 2018-06-04 Răzvan Crainea * [548df1b98] : Merge pull request #1374 from Vonage/bugfix/tcp_send_poll_revents Fix bug which will cause processes to get stuck in tcp send loops. (cherry picked from commit a5633eab0c7c0d20698908dad83c781e403998ac) 2018-05-30 Razvan Crainea * [ae78b129d] : acc: fix possible deadlock when evi set is faulty this error is very unlikely to trigger (cherry picked from commit b044f11ee1a45d2696c5d03ece4a524b1e9861c9) 2018-05-25 Vlad Patrascu * [2304d33f3] : clusterer: decrease risk of bogus provisioning of your own node ID Setting your own node ID is now possible in both current_info and current_id parameters. Also throw more errors on inconsistent provisioning of these parameters. (cherry picked from commit ea3745a7fd2e9ff068b7110c431948a26be068ab) 2018-05-25 Vlad Patrascu * [600748bb0] : clusterer docs: reorder module parameters (cherry picked from commit 0e96bedc9ea890c2e529ee2c6b14081488a67c06) 2018-05-25 Liviu Chircu * [9ea5ddbad] : path: Fix buffer overflow with use_path_received + IPv6 Introduced in commit b3bf15646a (cherry picked from commit 636a7420072b90c21bd3073b2c2bad6b375284ea) =========================== Release 2.4.1 ============================== 2018-05-24 Razvan Crainea * [adc93740e] : Bump version to 2.4.1 2018-05-24 Liviu Chircu * [0d75d93ed] : path: Fix leak-on-error (cherry picked from commit 7911d636171f251b18a7d735d8baa9e15474b696) 2018-05-24 Liviu Chircu * [045eea09b] : path: Fix "use_path_received" in double-Path scenarios Due to the fact that run_rr_callbacks() returns the 2nd Route (Path) header field value when previously having done protocol switching (thus having inserted two Path headers), the "use_path_received" feature of the path module would not work -- it wouldn't set the $du at all. The reason for this is that add_path_received() appends its ";received=" to inside Path #1 (the outbound path of the registration / the inbound path of future requests) when doing double-Path recording. This patch simply moves the ";received=" append operation performed by add_path_received() into Path #2 (inbound path of registration / outbound path of future requests), and adapts other code that needs it (e.g. save("location", "p1v")) to properly be able to fetch it. Reported by @futsystems Fixes #1358 (cherry picked from commit 71c7d75f66c8f0dc4ce411fd97d2dc867b39ce8d) 2018-05-24 Liviu Chircu * [0e60448cb] : path: Add escaping logic for add_path_received() Simply dumping a SIP URI as a ";received=" Path header field parameter value is problematic and leads to two kinds of issues: a. invalid SIP URIs, where the ";transport=" is specified twice: Path: b. in double Path scenarios (e.g. when switching protocols from, say, TCP -> UDP), since the ";received=" is inserted as the inbound Path header field value, this can lead to a strange "protocol conversion" effect: Path: Path: ^ notice how the inbound Path intended to advertise an UDP URI, but the add_path_received() managed to "convert" it into a TCP URI because of its inability to escape its token. nathelper is an easy first victim of this conversion, as it will attempt to send pings using the incorrect transport after reading the topmost Path (Route) header. This patch adds escaping/unescaping logic for the ";received=" feature of add_path_received() along with any code that makes use of this feature. Example resulting URI for the above example: Path: (cherry picked from commit b3bf15646affe981d4b266381d59f210e6e882fd) 2018-05-24 Bogdan-Andrei Iancu * [9a46432a0] : Fixed replication of sharing TAGS. Reported by Ognjen Seslija (sekil on IRC) Thanks to Vlad Patrascu in troubleshooting (cherry picked from commit 9059325241658c56cb759f17160c869b4e9def2b) 2018-05-24 Bogdan-Andrei Iancu * [93c2cea6c] : Fix consistency of extra/leg values in acc module. If values are set before the dialog is matched, rather than simply discarding the setings done on the extra/leg values, better migrate the changes over the acc set stored in dialog. (cherry picked from commit 60b1e7005b22eedd1ed604ffc21054e91b7f404b) 2018-05-24 Bogdan-Andrei Iancu * [bdac5e61a] : Fix memory leak in using extra accounting. If setting $acc_extra() for a sequential request, before being matched against the dialog, the values will result in a leak. Ideally, the acc_extra set in the processing context should be merged with the acc_extra fetched after dialog matching. (cherry picked from commit 19305deaa6f89d3c3030f67e68f79c69116501f2) 2018-05-24 Vlad Patrascu * [40222f493] : clusterer: several doc fixes and improvements 2018-05-24 Liviu Chircu * [6c5b6e44d] : registrar: Fix pkg leak / broken logic in remove() Also enhance its documentation (cherry picked from commit 62bf36dac2f0f90ad58b60f6fc1036934276fc9c) 2018-05-23 Liviu Chircu * [98de68dac] : clusterer: Do not log errors when broadcasting to 0 nodes Reported by Xiao Huang Fixes #1369 (cherry picked from commit c7cae9be6ad812f1a686e7529275f92194515ab1) 2018-05-23 Bogdan-Andrei Iancu * [e5f3b79cd] : Fix delete query in watchers table. The watcher's table has no sharing tags. Reported by Ognjen Seslija (sekil on IRC) (cherry picked from commit 2b28b213167dcfa132d1a3045a3a1b532874e4d9) 2018-05-22 Bogdan-Andrei Iancu * [cd3134187] : Fixed URI comparing when usernames are empty (cherry picked from commit a69c8541b08eb171f24eca55444e777a3b527509) 2018-05-22 Liviu Chircu * [15fb59f8a] : usrloc/nathelper: Improve function naming/docs (cherry picked from commit 45ea9087d74cd8db5f8d27829296ede1d8b74e09) 2018-05-22 Liviu Chircu * [21301982e] : usrloc: Make the timer cleanup routine cluster-aware Reported by Xiao Huang Fixes #1367 (cherry picked from commit fa4bf3c67fe7d8f3fcf88bcca12fa5fa09a4ebe0) 2018-05-22 Bogdan-Andrei Iancu * [4ee26e325] : A worker process wil ignore any SIGTERM if not in shutdwon sequance. (cherry picked from commit 41f3fd580b86dea700185b76f7c60ad4590e1e02) 2018-05-22 Bogdan-Andrei Iancu * [c00e9282f] : Downgrade log from INFO to DBG (cherry picked from commit f39174c6bed6f636e658dc254d7457062ddff291) 2018-05-22 Bogdan-Andrei Iancu * [602089bbc] : Avoid signal "leaking" and use KILL instead of TERM. When we want to force the termination of the unresponsive processes, better use Kill than TERM - TERM, if previosly delivered may be queued and lost. (cherry picked from commit 8073d4de8edfab88a60c869b24df0cd3e74342d6) 2018-05-21 Vlad Patrascu * [0d1580702] : mi_xmlrpc_ng: fix system memory leaks when parsing xml Closes #1359 (cherry picked from commit 06a1b186c9d8eba35e3f7bbff83f41325c60ac24) 2018-05-21 Răzvan Crainea * [13489b996] : Merge pull request #1366 from ryan-esty/2.3 added rtcp-mux-require Close #1364 (cherry picked from commit c9a7552ce3c9f0dfd9b80c242a03ce27a744cfe5) 2018-05-18 Liviu Chircu * [2020d6078] : acc: Fix $acc_extra so it accepts integer constants (cherry picked from commit 5f42814228cf52414a65bf859dffe10fb45ff94f) 2018-05-17 Bogdan-Andrei Iancu * [bcad20098] : Fixed wrong DB result free in case of error. 2018-05-17 Razvan Crainea * [c19f0f0c6] : dialog: reset locked process only if you locked it Make sure that when callbacks are run only the proces that has the callbacks locked resets the locked_by field - if someone else does it, it might run into a deadlock. Thanks go to 46Labs for reporting this! (cherry picked from commit e35595e8596e6dd0bedb0b96cadd226c52417243) 2018-05-17 Vlad Patrascu * [d2c626166] : clusterer: allow spaces in the format of "current_info" and "neighbor_info" (cherry picked from commit b10f0e3f96a2173a868b395b6267646ef7c3f13c) 2018-05-16 Liviu Chircu * [e7c4de709] : rest_client: Improve tracing robustness at startup Even if we're somehow called from startup route with a fake SIP message, deal with it and do not segfault. (cherry picked from commit 5f83153c6eac1042221e9b2bc48d11f8be148ea8) 2018-05-16 Liviu Chircu * [436c68957] : siptrace: Fix broken trace tests during startup_route (cherry picked from commit 1c07c9254d6840e4d8a10226bd196661b6a667b4) 2018-05-16 Liviu Chircu * [a8ee28c46] : transformations: Fix parsing of nested transformations We once again allow multiple levels of nested transformations, e.g.: $(var(tu){s.substr,$(var(tu){s.substr,$(var(idx){s.int}),1}{s.int}),0}) (example of three-level nesting of tranformations) (cherry picked from commit 61dec8937bd65f0848413e988b0f77cd924b362f) 2018-05-16 Liviu Chircu * [c0bf5a059] : acc: Eat leading whitespace in "extra_fields" This allows readable formatting such as: modparam("acc", "extra_fields", " db: account_id; provider_id; account_card_id; ") (cherry picked from commit f757ce4143cc7943adc872e6a7fc0bd3b3cc2a38) 2018-05-14 Razvan Crainea * [467df134f] : proto_hep: prevent memleak when using correlation when not using homer5 and adding correlation to rest and xlog queries, the correlation string was never freed, generating a memory leak. also prevent opensips from crashing when running out of pkg memory. (cherry picked from commit 8904319909cd6618d4ce06148a25937738a90a37) 2018-05-11 Liviu Chircu * [bfac3e854] : dialog: Always match dialogs using dlg_match_mode This patch changes the default behavior of match_dialog() and topology_hiding_match(), where they would both forcibly use DID_FALLBACK matching, regardless of the value of the "dlg_match_mode" modparam. Starting with 2.4, we change this behavior such that they default to simply playing along with "dlg_match_mode", which is a lot more intuitive from a script writing perspective. If need be, a specific dialog matching behavior may be enforced for certain types of traffic using the newly added optional parameters of match_dialog() and topology_hiding_match(). (cherry picked from commit 61829d66321e8c37dbfeff36a25bfb95fcead866) 2018-05-10 Liviu Chircu * [718cf732c] : dialog/topology_hiding: Update docs (cherry picked from commit 362e65d28ac6409d66d48bea4a735c1558dd6993) 2018-05-10 Liviu Chircu * [2ddb4d10c] : dialog: Fix dialog matching bugs in looping + TH scenarios This patch adds an extra control parameter to topology_hiding_match() and match_dialog() which allows the script writer to disable the current behavior of forcefully imposing the "DID_FALLBACK" dialog matching mode. In looping scenarios, performing SIP-wise dialog matching may be out of the question, as we may randomly match one of multiple dialogs with identical SIP coordinates. (cherry picked from commit deb3ee457b1f64a169b61751e6490c7049f1493e) 2018-05-10 Liviu Chircu * [44af51b1a] : dialog: Document re-INVITE pinging interval restrictions (cherry picked from commit 4b59ffc0c65dca11a043faf61eb2987555192603) 2018-05-10 Liviu Chircu * [430039fd8] : dialog: Fix re-INVITE pinging SDPs after on-hold/resume (cherry picked from commit 1d1f3d04d75b3c2a46444d7a6d57348ce85543a9) 2018-05-10 Liviu Chircu * [123255c3e] : dialog: Fix unnecessary errors on DB load Affects DB-persistent dialogs w/o reinvite pinging. This regression was introduced by commit 9521770e. (cherry picked from commit 200a5563b227fc8c231e82f3d42e3c8528358fa2) 2018-05-10 Liviu Chircu * [fd854b778] : dialog: Improve fetch_dlg_value() signature & docs (cherry picked from commit f2626d471d6c1d1b58c2d4a27eee13f96203c24f) 2018-05-10 Liviu Chircu * [7d0f6bc0e] : dialog: Fix Re-INVITE pinging after restarts The current solution is to persist the SDPs/Contacts of the caller side and the winning callee side into dialog var storage, which is restart persistent ("vars" column). Fixes #1342 (cherry picked from commit 9521770efccd385fafdb2c58ff365627e0d65fef) 2018-05-10 Liviu Chircu * [7d887fb4e] : dialog: Fix pkg memleak in commit a03ed4e1a3 The auto-generated CANCEL messages were leaking the parsed Via header. Reported by Nick Altmann (cherry picked from commit 34960b140f81adca25bf9ad84ac2bc078732421e) 2018-05-10 Liviu Chircu * [67b2bf382] : dialog: Fix regression in commit a03ed4e1a3 Commit a03ed4e1a3 may have fixed the create_dialog("Rr") scenarios, but it also broke the simpler ones, which rely on create_dialog(). Reported by Nick Altmann (cherry picked from commit b45ee74f5994ffdca12ccc8b6df0bcb33ca4c0b5) 2018-05-10 Liviu Chircu * [6fa390bde] : dialog: Clarify the new meaning of dlg_leg.sdp (cherry picked from commit bf2ae315609b1224338273a059b5f760b961b89f) 2018-05-10 Liviu Chircu * [fba65033e] : dialog: Fix Re-INVITE pinging issues with parallel forking The Re-INVITE pinging code would always leak both SDP and contact buffers when parallel forking. Moreover, depending on which branch answered the call, in some cases OpenSIPS would only Re-INVITE ping one of the parties involved, even if both "Rr" create_dialog() flags are set. This patch fixes the above issues by storing the SDPs of each forked branch into the "callee" leg array. Each call leg gets created before the INVITE branch is sent out, rather than only getting created upon matching a 200 OK reply. When matching a reply, the corresponding leg becomes 1 + the Via branch idx, which added by tm. (0, 1, 2, ...) Remaining issue: Proper handling for the multi-200 OK scenario, as we currently still overwrite the callee SDP at each 200 OK. (cherry picked from commit a03ed4e1a366807df3a89efada59df0d07f4d361) 2018-05-09 Liviu Chircu * [ea3559717] : freeswitch: Force event re-subscribes after a disconnect Credits to Ken Rice for reporting this issue (cherry picked from commit a2934c79ed80401387e0e889293ab89d106922ef) 2018-05-09 Liviu Chircu * [aa37c2caf] : freeswitch: Fix ESL handle and file descriptor leaks Thanks to Ken Rice for reporting, providing a testing environment and helping troubleshoot these bugs. (cherry picked from commit 9fe0201819653bd47f3638e8c161a946fa71b738) 2018-05-09 Bogdan-Andrei Iancu * [187f7d08e] : Fixed empty socket info in DB during reload The insert subscription code may push an empty string for the socket info, so the DB reload code must cope with this without error. Also relax the reloading sequence - ignore broken subscription records rather than stopping the entire reload and breaking the startup sequence. (cherry picked from commit ea647c59aeaea6c8abfc910a8c6bbb31e0f552eb) 2018-05-09 Liviu Chircu * [31fba7d0f] : usrloc: Fix possible crash during contact pinging This patch fixes a bug introduced in commit 02e6a641292, where the output buffer does not contain a leading "0000" marker despite the "ul.get_all_contacts()" function returning a 0 ("all contacts have been dumped, the buffer is properly formatted"). Reported by @thesipguy Credits to Răzvan Crainea for spotting the bug Fixes #1352 (cherry picked from commit 2bb11c599095fbef90706bad9e314feba80d107f) 2018-05-08 Vlad Patrascu * [4592fde0f] : xmpp: fix uninitialized warning 2018-05-08 Vlad Patrascu * [1b69af067] : sip_i docs: fix subfield value 2018-05-07 Vlad Patrascu * [1ee6c85b6] : sip_i: fix crash for numbers longer than 15 digits Mapping the Called Party number or Calling Party number for IAM by default could cause a stack smashing for numbers longer than 15 digits (E.164 limit). Fixes #1348 (cherry picked from commit 47e5c47d3bb2ad7999a14b80d6412866d90493c9) 2018-05-07 Liviu Chircu * [e0e927cae] : acc: Fix "ms_duration" computation Reported by John Quick (cherry picked from commit f2c86ed3fa19d256c1a2c5ae5b246871ccc8b312) 2018-05-02 Liviu Chircu * [ba005ae89] : registrar: Fix expires handling on 200 OK save() Silently use the default_expires, similarly to the behavior during a standard save() on a REGISTER, without throwing warnings. Credits to Norman Brandinger for providing the patch. (cherry picked from commit bbfdbaf9d69ef39160459b6f5f81e5a2e9344cdc) 2018-04-30 Razvan Crainea * [048b54559] : rtpengine: fix created missing initializer 2018-04-30 Liviu Chircu * [c9c4d3d80] : nathelper: Fix uninitialized warning 2018-04-30 Vlad Patrascu * [811e360c7] : clusterer: fix uninitialized warning (cherry picked from commit 5ad8600be1f547b303ba71c7ff270535e7b9a317) 2018-04-30 Liviu Chircu * [2f828f9e4] : Fix compile warning on older gcc (4.8.4) (cherry picked from commit 2faf78c318e19052835e01ea6bc4f1ce2d3ad07f) 2018-04-30 Razvan Crainea * [5ed57b4ed] : Update ChangeLog for 2.4 final release =========================== Release 2.4.0 ============================== 2018-04-30 Razvan Crainea * [57483fcac] : update compile flags for final release 2018-04-30 Liviu Chircu * [7bb0dba89] : usrloc: Fix uninitialized variables 2018-04-30 wuhanck * [ba99a4f32] : Use ip_addr2a. Remove unused str_ip. (cherry picked from commit c60b4b5ffd39082ec1563852912daeac42ab5f69) 2018-04-30 wuhanck * [b31656829] : Use json_object_object_get_ex. (cherry picked from commit 8490397f5de665b79f6e207b6930f0618fccaccf) 2018-04-30 Liviu Chircu * [48093886b] : core: Fix $branch(flags) manipulation It now accepts and prints a space-separated list of branch flags. Fixes #1341 (cherry picked from commit e2fd262f368928c8d71ec386c724de7025d6191a) 2018-03-28 Razvan Crainea * [6fcc108be] : Bump version to 2.4.0-beta 2018-03-28 Razvan Crainea * [eaafa8c4d] : Updates CREDITS for 2.4 2018-03-28 Liviu Chircu * [c9478d410] : registrar: Add latency-based filtering flags * "yXXXXX" lookup() flag - discard contacts beyond a certain latency * "Y" lookup() flag - sort branches by ascending latency order 2018-03-28 Liviu Chircu * [928eebc46] : usrloc: Add latency event triggering thresholds 2018-03-28 Liviu Chircu * [1d0d28874] : usrloc: Optionally include the k/v storage in MI output This helps achieve features such as #1319 without additional C code. 2018-03-28 Liviu Chircu * [e00445096] : rest_client: Update docs 2018-03-28 Liviu Chircu * [aa7bfeb07] : rest_client: Allow all functions to be called from any route 2018-03-28 Liviu Chircu * [48794722e] : rest_client: Add possibility to force TLS client certs Individual TLS client cert/key pairs may be forced for each HTTPS transfer by calling rest_init_client_tls(tls_client_domain) beforehand. The default behavior remains the same: libcurl will fully take care of client certificates when HTTPS is employed. Fixes #1260 2018-03-28 Bogdan-Andrei Iancu * [b17e0f46f] : Small adjustements to the balancer template (mainly text formating) 2018-03-28 Bogdan-Andrei Iancu * [975c852ad] : Small adjustements to the trunking template (mainly text formating) 2018-03-28 Bogdan-Andrei Iancu * [03816202f] : Regenerate the default cfg based on residential scenario 2018-03-28 Bogdan-Andrei Iancu * [65edc1d65] : Small adjustements to the residential template (mainly text formating) 2018-03-28 Bogdan-Andrei Iancu * [111871e16] : Added DB migration for the emergency table 2018-03-28 Bogdan-Andrei Iancu * [25682e29e] : Added DB migration for the fraud_detection table 2018-03-28 Bogdan-Andrei Iancu * [95d834d80] : Added DB migration for the tls_mgm table 2018-03-28 Nick Altmann * [012a90659] : rpm packaging: add new modules to changelog 2018-03-28 Razvan Crainea * [82796a5d0] : jsonrpc: remove useless function Just to make clang and travis happy 2018-03-28 Nick Altmann * [9eb19f861] : rpm packaging: support for event_jsonrpc and jsonrpc modules 2018-03-28 Razvan Crainea * [98754e716] : cgrates: deprecate $cgrret + replace with $cgr_ret 2018-03-28 Bogdan-Andrei Iancu * [1f679cd54] : Deactivate USRLOC based aliases in osipsconsol 2018-03-28 Bogdan-Andrei Iancu * [823e83bd6] : Remove opensipsctl provisioning for usrloc aliases 2018-03-28 Bogdan-Andrei Iancu * [4dd815dcd] : Dropped the "aliases" table This table was used to implement as pseudo aliasing by abusing a "location" like table. It was an old approach (prior to db_aliases), not in use anymore. 2018-03-28 Bogdan-Andrei Iancu * [7b2594119] : Updated the migration for sip_trace and clusterer tables 2018-03-28 Liviu Chircu * [c6a5c251c] : opensipsdbctl migrate: Improve wording for initial warning 2018-03-28 Razvan Crainea * [a006a48dc] : jsonrpc: fix link commands in README 2018-03-28 Razvan Crainea * [ab97c5bf9] : add new jsonrpc module Send JSON-RPC commands to a JSON-RPC server and optionally receive replies 2018-03-28 Liviu Chircu * [dd622e751] : main(): Avoid duplicate getopt() strings Suggested by Răzvan Crainea . 2018-03-28 Liviu Chircu * [13475f6c9] : usrloc/registrar: Improve documentation * add URL anchors for modparams, functions, MI commands, etc. * fix some incorrect preset strings 2018-03-28 Razvan Crainea * [b7b183620] : event_jsonrpc: consider timeout as milliseconds 2018-03-28 Razvan Crainea * [fe84e85e9] : net: expose tcp_connect_blocking with timeout 2018-03-28 Razvan Crainea * [ce80769b4] : event_jsonrpc: update README with transport proto 2018-03-28 Razvan Crainea * [8d6bf2dfd] : event_jsonrpc: remove useless shm for msg building 2018-03-28 Liviu Chircu * [b009644c4] : Merge branch 'feature/usrloc-clustering' 2018-03-28 Liviu Chircu * [522a8491b] : registrar: Add the "l" (local-only) lookup() flag 2018-03-28 Liviu Chircu * [ceaaa9495] : usrloc: Document the clustering features 2018-03-28 Liviu Chircu * [494810e60] : usrloc: Properly handle bad clutering presets on startup 2018-03-28 Liviu Chircu * [9966a002f] : usrloc: Fix NULL dereference 2018-03-28 Liviu Chircu * [a69dea972] : usrloc: Align some clustering modes to global naming This makes the modes easier to digest, as they now have similar naming with other clustered code, such as presence clusters. 2018-03-28 Liviu Chircu * [48129c321] : usrloc/registrar: Implement cachedb federation clustering The "federation-cachedb" clustering revolves around the following three metadata-related operations: - on AoR save: ensure the following NoSQL key/multi-value is present: { pk: , aor: , home_ip: }. This advertises the AoR's presence in our location to other PoPs. - on AoR lookup: fetch all values of , add as call branches of the current INVITE, on top of any existing local contact branches - on AoR remove: delete our from NoSQL, as well as the AoR from local storage. 2018-03-28 Liviu Chircu * [3976161c7] : registrar: Simplify usrloc binding at mod_init() 2018-03-28 Liviu Chircu * [2cd3f0ba3] : clusterer: Add api.get_my_sip_addr() Self-explanatory: fetch the current node's "sip_addr" column value. 2018-03-28 Liviu Chircu * [24c793c2d] : branch engine: Improve code consistency 2018-03-28 Liviu Chircu * [ce5a8e65c] : cachedb: Refactor some dict-related code Prefix all functions with "cdb_", for consistency. 2018-03-28 Liviu Chircu * [e76465017] : usrloc: Fix bad flags/cflags documentation 2018-03-28 Liviu Chircu * [e92f79a29] : usrloc: Improve clustering mode nomenclature 2018-03-28 Liviu Chircu * [5486cd024] : Minor code improvements * fix redundant write ops in get_cluster() / get_node() * zeroize the API, just in case * fix ambiguous var name * use static where needed 2018-03-28 Liviu Chircu * [76ddf7ab8] : clusterer: Add api.send_all_having() function The idea is to be able to broadcast a message within a cluster while skipping nodes which do not match a given node filter. 2018-03-28 Liviu Chircu * [4cd6a5ed2] : dialog/usrloc: Refactor clusterer deps Reuse definition from commit 9a6eba7e18cb9f 2018-03-28 Liviu Chircu * [00295831a] : usrloc: Improve some log messages 2018-03-28 Liviu Chircu * [5e45e3797] : usrloc, core-cluster: Fix timer-based contact cleanups 2018-03-28 Liviu Chircu * [509b6aef1] : usrloc, core-cachedb-only: Fix "sip_instance" updates 2018-03-28 Liviu Chircu * [154abf97c] : nathelper: Complete commit 4957cc3eff0 Properly null-terminate the array... 2018-03-28 Liviu Chircu * [d20864854] : registrar lib: Fix confusing variable name 2018-03-28 Liviu Chircu * [b7934ad82] : nathelper/usrloc: Fix shm memleak 2018-03-28 Liviu Chircu * [ff939860b] : nathelper: Add "sipping_ignore_rpl_codes" CSV modparam This is useful when an OpenSIPS ping originator node is front-ended by some other SIP entity of the platform. When contacts are unreachable, the front-end will still respond to the pings (e.g. 408 Request Timeout), which we would rather ignore and get closer to removing the offline contacts. 2018-03-28 Liviu Chircu * [02e6a6412] : usrloc/nathelper: Implement pinging/timeouts in cachedb-only mode 2018-03-28 Liviu Chircu * [aaf884b01] : str.h: Fix doc line wrapping 2018-03-28 Liviu Chircu * [8c470422c] : clusterer: Minor improvements * get_my_index(): return a 1-indexed "nr_nodes" value * get_my_index(): release "cl_list_lock" earliest possible * add useful startup logging lines 2018-03-28 Liviu Chircu * [484655a42] : cachedb: Rename some filter operators 2018-03-28 Liviu Chircu * [44794f6e9] : cachedb_mongodb: Fix memory corruption on api.update() bson_reinit() must not be called on a bson_destroy()'ed bson. 2018-03-28 Liviu Chircu * [4c98b4335] : usrloc/nathelper: Refactor code for cachedb-only pinging 2018-03-28 Liviu Chircu * [bf16d0a36] : cachedb_mongodb: Add bson debugging logs in old API 2018-03-28 Liviu Chircu * [3dba1ccfa] : registrar: Fix remove() with "*db-only" usrloc modes 2018-03-28 Liviu Chircu * [f043f5fe3] : usrloc "core-cachedb-only": Fix remaining lookup issues * fix "methods" field * avoid "NO-OP" update queries 2018-03-28 Liviu Chircu * [f05bf6d26] : usrloc: Expose struct debugging functions to upper modules 2018-03-28 Liviu Chircu * [5579f6eac] : usrloc: Do not pollute "usrloc.h" with internal vars 2018-03-28 Liviu Chircu * [e996667c0] : cachedb: Elaborate key naming restrictions 2018-03-28 Liviu Chircu * [bfe1fdc98] : usrloc core cachedb cluster: Fix some left-over issues * base64 encode all contact keys (".", for example, breaks MongoDB) * do not pkg_free() SHM strings during cleanup * add useful dict/BSON debugging lines * improve coding style 2018-03-28 Liviu Chircu * [c4de5ef9e] : clusterer: Abort startup when 'db_url' is mandatory 2018-03-28 Liviu Chircu * [e4ba61d27] : usrloc: Fix some startup issues * proper module deps for the cache URL * fix some trivial modparam bugs 2018-03-28 Liviu Chircu * [5a2d87b1d] : usrloc: Refactor all code using "db_mode" 2018-03-28 Liviu Chircu * [2134189ca] : usrloc: Implement "core cluster" urecord handling 2018-03-28 Liviu Chircu * [d3236fa3c] : cachedb_mongodb: Adapt filters to libmongoc 1.5.0+ 2018-03-28 Liviu Chircu * [37c9d7222] : cachedb: Add easy-to-use dict append primitives 2018-03-28 Liviu Chircu * [48e543c49] : usrloc & cachedb: Document and check some return codes 2018-03-28 Liviu Chircu * [d510cdc76] : usrloc: Implement the NoSQL version of get_urecord() 2018-03-28 Liviu Chircu * [9df50cb5d] : usrloc: Add support for "cache DB" URLs 2018-03-28 Liviu Chircu * [9b9c6345c] : usrloc: Refactor modparams to fit upcoming additions 2018-03-27 Bogdan-Andrei Iancu * [71ee024e5] : Fixed etag replication when the etag is re-generated during each Publish. We need to replicate both the old (received) and new (generated) etag via the cluster, so the receiving nodes can properly identity the presentity to be updated. 2018-03-27 Vlad Patrascu * [cde77b0cc] : ratelimit: allow specification of pipe limit per interval Closes #1130 2018-03-27 Razvan Crainea * [d0fc9692a] : event_jsonrpc: add readme Closes #1297 2018-03-27 Razvan Crainea * [03a75293d] : add new event_jsonrpc module 2018-03-27 Razvan Crainea * [63e789f12] : rtpengine: also add db schema 2018-03-27 Vlad Patrascu * [2d921e77e] : tm: fix clusterer capability registration 2018-03-27 Vlad Patrascu * [09ae07f99] : presence: fix clusterer capability registration 2018-03-27 Vlad Patrascu * [5f6115875] : dialog: rename "replication" tags to "sharing" tags 2018-03-27 Vlad Patrascu * [10977d86f] : dialog: document replication tag related param, MI cmd and script function 2018-03-27 Vlad Patrascu * [879c4d4c6] : clusterer: add option for capabilities to be in OK state without data sync Specify at registration time if data sync is required for a certain capability in order to be in the OK state. 2018-03-27 Vlad Patrascu * [c23a4ce84] : clusterer: add MI command that lists capabilities 2018-03-27 Vlad Patrascu * [86626f64a] : dialog: add MI command that lists replication tags 2018-03-27 Vlad Patrascu * [93724475a] : dialog: don't update DB when replication tag is backup 2018-03-27 Vlad Patrascu * [fab763321] : dialog: also set replication tag state through modparam 2018-03-27 Vlad Patrascu * [7c8495515] : dialog: suppress in-dialog pinging when replication tag is backup 2018-03-27 Vlad Patrascu * [ffb2e526b] : dialog: don't run TERMINATED and EXPIRED DLGCBs when replication tag is backup 2018-03-27 Vlad Patrascu * [9b2e917af] : dialog: don't throw error if dialog from deleted replication packet is not found 2018-03-27 Vlad Patrascu * [5319d592f] : dialog: don't replicate dialog events when tag is backup Don't send create/update/delete messages when replication tag is backup. 2018-03-27 Vlad Patrascu * [fc32d57f8] : dialog: don't report error if replication tag is not set 2018-03-27 Vlad Patrascu * [c9e68f92b] : dialog: prevent BYEs on dialog expiration when replication tag is backup 2018-03-27 Vlad Patrascu * [5fdbce418] : dialog: forbid terminating dialogs via MI when replication tag is backup 2018-03-27 Vlad Patrascu * [91b92591e] : dialog: add mechanism that allows tagging dialogs when replicating Dialogs can be labeled from the the script using the set_dlg_repl_tag() function and each tag has a state(active/backup) which can be set via the "set_repl_tag_active" MI cmd. The tags and their states are shared in the cluster and nodes automatically go to the backup state when another node is set to active. 2018-03-27 Vlad Patrascu * [db592fd07] : dialog: sync dialogs from another node at startup The node to sync the dialogs from is chosen by the clusterer module. Syncing is also possible at runtime through an MI command. 2018-03-27 Bogdan-Andrei Iancu * [edd206497] : Fix wrong naming of internal flags. Not sure why the flags used by t_relay() are named TM_T_REPLY_xxxxxx :D... Moved to TM_T_RELAY_xxxxx 2018-03-27 Bogdan-Andrei Iancu * [18bf21a2c] : Docs updated for t_relay() 2018-03-27 Bogdan-Andrei Iancu * [4747da559] : Added support for Content-Disposition: no-cancel As per RFC3841, section 9.1, the TM module may be instructed not to cancel all ongoing branches when a 2xx reply is received. It will keep the pending branches ongoing until (1) all branches will receive a final reply or (2) the transactionhits the timeout. This is work sponsored by Harris Corporation (https://www.harris.com) 2018-03-27 Bogdan-Andrei Iancu * [5bb438ad3] : Documentation updated with the latest clustering params 2018-03-27 Bogdan-Andrei Iancu * [a90396919] : Simply renamed MI functions 2018-03-26 Bogdan-Andrei Iancu * [c0762189f] : Added full data sharing across presence cluster. Data (watchers and presentites) may be are shared via the SQL DB; a new tagging mechanism adds the ownership concepts (over watchers/subscribers) to avoid multiple NOTIFY'es being trigger by all the nodes when a presentity expires. Added "federation" mode parameter to enable / disable the federation-like bahvior when comes to data sharing - federating/partioning data across nodes. 2018-03-26 Vlad Patrascu * [002ea071a] : sip_i: fix doc example for isup_msg_type PV 2018-03-26 Vlad Patrascu * [ac50be197] : dialog: add callid, from-tag, to-tag params to E_DLG_STATE_CHANGED Closes #1126 2018-03-26 Vlad Patrascu * [4c5dc148a] : dialog: accept variables for profile name in script functions Closes #1279 2018-03-23 Razvan Crainea * [faea40201] : cgrates: fix documentation section name 2018-03-23 Razvan Crainea * [53f16a088] : cgrates: add attributes parsing example 2018-03-23 Razvan Crainea * [0fab92da3] : presence: fix query column out of array 2018-03-23 Razvan Crainea * [6918e1ab2] : rtpengine: document database support 2018-03-23 Razvan Crainea * [094c850dd] : rtpengine: add database support shamelessly copy db support from rtpengine Closes #1092 2018-03-23 Razvan Crainea * [aca09b485] : rtpengine: make sure second call does not crash 2018-03-23 Bogdan-Andrei Iancu * [583a65172] : Added missing files from previous commit 2018-03-23 Bogdan-Andrei Iancu * [f7bed45a4] : Added support for sharding/partitioning cluster. A sharding clustering is a presence cluster where each node keeps its own set of watchers and presentities of an interest. Any new Published presentity is replicated to all the cluster nodes, but stored only by nodes interested in it (if there are watchers for that presentity). For initial subscriptions, there is quering mechnism inside the cluster - to try to fetch the presentity data from any other node. 2018-03-22 Razvan Crainea * [a196fb876] : cgrates: properly handle returned values 2018-03-22 Razvan Crainea * [7f89ea301] : Merge branch 'feature/cgrates-ng' 2018-03-22 Razvan Crainea * [033773e72] : cgrates: allow SessionSv1.DisconnectSession rpc 2018-03-22 Dan Pascu * [85c4e28a7] : Use consistent spacing in xml schema 2018-03-22 Razvan Crainea * [7f7ca1f8c] : cgrates: allow seting NULL to variables 2018-03-22 Dan Pascu * [a7fee1a72] : Fixed building release dependent debian packages on debian unstable/sid 2018-03-22 Dan Pascu * [960eac268] : Strip PATH from opensipsdbctl too for debian package 2018-03-22 Dan Pascu * [a55702e66] : Use consistent spacing in debian rules 2018-03-22 Dan Pascu * [de9df1c80] : Fixed typo in debian rules 2018-03-22 Razvan Crainea * [654418d9e] : cgrates: adjust auth documentation 2018-03-22 Dan Pascu * [28b4783dc] : rtpengine: Fixed compilation when PKG_MALLOC is not defined 2018-03-22 Razvan Crainea * [3c7ac2d99] : cgrates: add support for SessionSv1 accounting 2018-03-22 Razvan Crainea * [69b89c3c4] : cgrates: save reply objs for cgrates_cmd() 2018-03-21 Razvan Crainea * [51c91da19] : cgrates: MaxUsage is a float now 2018-03-21 Razvan Crainea * [6325370e8] : cgrates: document the new $cgrret(name) usage 2018-03-21 Razvan Crainea * [2bfd0a315] : cgrates: add names for the $cgrret var 2018-03-20 Bogdan-Andrei Iancu * [1e61bdc5b] : Removed bogus destroy function The data freed in destroy callback actually resides in pkg and not shm memory - this is the original bug. Now that the data is pkg, makes no sense to free it from the attendant process. 2018-03-20 Bogdan-Andrei Iancu * [08ba76be3] : Fix double CT header when a single body part is left The previous commit introduced a bug resulting in a double (identical) Content Type header when, after removing a part, you are left with a single part body. 2018-03-20 Razvan Crainea * [e49ec9512] : tm: add documentation for anycast support 2018-03-20 Razvan Crainea * [8e87181a3] : tm: add support for auto-cancel 2018-03-20 Razvan Crainea * [4c2625d26] : tm: init msg before parsing 2018-03-20 Razvan Crainea * [f86b1b31c] : tm: reset cancelled_T before searching for transaction 2018-03-20 Razvan Crainea * [ba8829f07] : tm: also replicate message index 2018-03-20 Razvan Crainea * [7621de6fa] : tm: add debugging for non-matched transaction 2018-03-20 Razvan Crainea * [6236c95fb] : bin: fix bin_extend() usage 2018-03-20 Razvan Crainea * [fc0dc0759] : tm: add incoming auto-cancel 2018-03-20 Razvan Crainea * [928531272] : tm: properly detect if transaction is local 2018-03-20 Razvan Crainea * [ce43f8982] : tm: remove TODO for replicated messages 2018-03-20 Razvan Crainea * [e38b71bdb] : receive_msg: receive custom message flags 2018-03-20 Razvan Crainea * [f59716f54] : tm: add support for ACK and CANCEL replication 2018-03-20 Razvan Crainea * [e96acb9dc] : add is_anycast() macro 2018-03-20 Razvan Crainea * [54c90dc54] : tm: add message replication support 2018-03-20 Razvan Crainea * [88b4e2db2] : tm: port cluster to new interface 2018-03-20 Razvan Crainea * [247834ac4] : net: indicate an interface is anycast IP 2018-03-20 Razvan Crainea * [fbda182e0] : [WIP] tm: add cid parameter for cluster support 2018-03-20 Razvan Crainea * [c7a06fb12] : msg: provide via_parameter from outside the message 2018-03-20 Razvan Crainea * [9a6eba7e1] : clusterer: use a single get_deps_clusterer impl 2018-03-20 Bogdan-Andrei Iancu * [4feff3ea6] : Added support for extra headers per body part. When adding a body part (directly via sipmsgops module or indirectly via sip_i module), you can specify an optional list of SIP headers (fully formated, including the header terminator) to be pushed into the part next to the Content-Type header. The specific changes: * in sipmsgops module, the add_body_part() takes a third optional parameter for extra headers to be pushed into the part; * in sip_i module, the add_isup_part() funtion takes a second optional parameter for defining a custom set of extra headers; * in sip_i_module, a new module parameter "default_part_headers" can be used to define the default set of headers to be automatically pushed into the ISUP parts. 2018-03-19 Ovidiu Sas * [730149884] : httpd: allocate http reply buffer in sys mem instead of pkg mem - buffer size no loger restricted pkg mem size 2018-03-15 Razvan Crainea * [b0aeb0aef] : [WIP] cgrates: parse values back for Auth 2018-03-15 Razvan Crainea * [4aa8568ad] : rtpengine: improve MOS stats documentation 2018-03-15 Razvan Crainea * [a2baf94fb] : rtpengine: add more RTP statistics 2018-03-15 Razvan Crainea * [439c4f8dc] : rtpengine: add support for average MOS 2018-03-15 Razvan Crainea * [fdcbb715b] : rtpengine: provide a generic way of using reply This commit returns the reply of the RTPEngine server in a JSON format, so that the script writer can extract any information from it. 2018-03-14 Liviu Chircu * [4f8eba7b8] : freeswitch_scripting: Add proper credits for the module idea 2018-03-14 Liviu Chircu * [e0fe570fe] : usrloc/nathelper: Compute and report ping latencies This patch adds a new nathelper branch flag, "sipping_latency_flag", to enable ping latency computation. Also, a new usrloc event is now available, E_UL_LATENCY_UPDATE. All contact-related usrloc events now include a new parameter, "latency", which holds the latency of the last successful ping if any, or 0 otherwise. If available, the ping latency can also be accessed via MI, using the "Ping-Latency" key of the contact data. Credits for the idea and an initial version of this patch go to Shlomi Gutman . 2018-03-14 Bogdan-Andrei Iancu * [5cd8e0ece] : Removed bogus debug log 2018-03-14 Razvan Crainea * [373c59828] : rtpengine: add transcoding documentation 2018-03-14 Razvan Crainea * [a12f6a84d] : rtpengine: fix params passing doc 2018-03-13 Bogdan-Andrei Iancu * [4c0c761ce] : Fixed update the len of the parameter strs. 2018-03-13 Razvan Crainea * [3419f9333] : [WIP] cgrates: add compat_mode parameter and $cgr_opt() 2018-03-13 Vlad Paiu * [7844aaba9] : Also flush carrier id AVPs when initiating a new routing Fixed cases where do_routing() followed by route_to_carrier() would report the wrong carrier id 2018-03-12 Liviu Chircu * [fab66fd32] : cachedb: Make tests more robust to error conditions i.e. do not segfault if the driver is bad 2018-03-12 Liviu Chircu * [3db8e8cd7] : make test: Properly append "-DUNIT_TESTS" if needed The previous logic wouldn't work with an old Makefile.conf 2018-03-12 Liviu Chircu * [dec80542e] : cachedb: Clean up redundant typedefs 2018-03-12 Liviu Chircu * [1237eabd0] : cachedb_mongodb: Fix compile warning with libmongoc 1.7 2018-03-10 Liviu Chircu * [79418dce9] : build system: Add special handling for gcc 7.2 It appears that gcc's "-dumpversion" behaves differently in 7.2 than in previous versions, due to "-dumpfullversion" being introduced. $ gcc -dumpversion 7 $ gcc -dumpfullversion 7.2.0 This breaks compilation on systems such as Xubuntu 17.10 with: Makefile.defs:930: You are using an old and unsupported gcc version (7), compile at your own risk! This backwards-incompatible change seems to have been reverted in 7.3+, though, where the full version is once again being dumped: $ gcc -dumpversion 7.3.0 $ gcc -dumpfullversion 7.3.0 2018-03-07 Razvan Crainea * [8d68f03c4] : acc: fix leak when assinging empty string to extra Many thanks to Pete Kelly for reporting and offering testing environment for this bug! 2018-03-06 Razvan Crainea * [06aa1ed8c] : ratelimit: fix documentation Properly document which routes the functions are allowed to run into. 2018-03-06 Razvan Crainea * [f2f88f1bd] : cgrates: allow cgrates_cmd() from any route 2018-03-06 Razvan Crainea * [28254a2aa] : topo_hiding: do not delete shm lumps from add_rm list These lumps can point somewhere in the middle of a shm lumps chunk, thus will result in a memory corruption error. Many thanks to Jonathan Hulme for providing testing environment! 2018-03-06 Razvan Crainea * [0c0679bd2] : httpd: make buffer a quarter of the pkg memory Exactly as it is described in the documentation. 2018-03-06 Bogdan-Andrei Iancu * [aa6132600] : Removed wrong error message. If the counter does not exist, simply print NULL, do not throw an error 2018-03-05 Liviu Chircu * [0fd818b5e] : usrloc: Fix broken DB_ONLY mode The recently introduced k/v support had not been tested with this mode yet... 2018-03-02 Bogdan-Andrei Iancu * [5b0bc1e30] : Fixed DB URL escaping. The ability to escape/encode DB URLs using %xy became a must with the auto generated user and passwords in the cloud envs. 2018-03-02 Bogdan-Andrei Iancu * [f14801795] : Added new set of load statistics for extra procs. The "load" set of stats (rt, 1m, 10m) covers now only the OpenSIPS core processes (it does not count the load for the extra processes forked by the modules). The new "load-all" set will count the load for *all* OpenSIPS procs, core or module. 2018-03-02 Bogdan-Andrei Iancu * [f06624568] : Added more flags when forking internal processes. Two new flags were added : * NO_LOAD - the process should not be counted when calculated the load * IS_EXTRA - this is an EXTRA process requests by a module (it is not an OpenSIPS core process) 2018-03-02 Liviu Chircu * [dc51ee60f] : Revert "travis: compile mongodb module" This reverts commit 9d30f94dc45a4e99f42d1fd22e8a96273e6d3c29. Since "libmongo-client" is a completely different codebase (https://github.com/algernon/libmongo-client) from the official "mongo-c-driver" project and "libmongoc" package (https://github.com/mongodb/mongo-c-driver), we have to disable it from Travis momentarily. The "libmongoc-dev" package has yet to arrive on Ubuntu 14.05, which is the current Travis build environment. 2018-03-02 Liviu Chircu * [234cf3967] : F_MALLOC: Fix "last free" line reports when debugging If -DBG_MALLOC is in use, double free operations would report the "first free" to actually be the malloc operation, which is incorrect. 2018-03-02 Liviu Chircu * [9e9221802] : F_MALLOC: Improve double free error reporting 2018-03-02 Liviu Chircu * [d98f115ec] : cachedb_mongodb: Fix clang warning 'cursor' is used uninitialized... 2018-03-02 Razvan Crainea * [9d30f94dc] : travis: compile mongodb module 2018-03-01 Vlad Patrascu * [1378b51bc] : sql_cacher: fix supported column types to include blob 2018-03-01 Liviu Chircu * [c1ebfe55e] : siptrace: Clean up duplicate code 2018-03-01 Liviu Chircu * [ccb696ecd] : ut.h: Document recently added macros 2018-03-01 Liviu Chircu * [0f65dbfec] : cache_fetch: Fix MI tree format The MI "cache_fetch" command was building a poorly formatted MI tree (viz below). We fix the command tree format in order to make the resulting data easier to digest programatically. Old MI tree format visualization: 'NULL: "out_key: [out_value]"' New MI tree format visualization: '"key": "out_key", "value": "out_value"' Reported by Hamid Elaosta. Fixes #1298 2018-03-01 Razvan Crainea * [ca34b0d12] : tm: fix README typo 2018-02-28 Vlad Patrascu * [58b923f40] : sql_cacher: all keys in cache can now be invalidated in "on demand" mode Also fix a potential mem leak and improve coding style and some log messages. 2018-02-28 Liviu Chircu * [a74de586c] : cmdline parser: Fix left behind options The "-T" and "-S" options were left behind at some point, with the added bonus of summoning a corefile when used ("opensips -S" or "opensips -T"). 2018-02-28 Liviu Chircu * [784aa1311] : Merge branch 'feature/cachedb-column-oriented-api' 2018-02-28 Liviu Chircu * [89babc55f] : cachedb: Final code refactoring * cdb_kv_t -> cdb_pair_t (more suggestive) * move all dict primitives to cachedb/cachedb_dict.[ch] * fix some coding style issues 2018-02-28 Liviu Chircu * [52dffcfcf] : cachedb_mongodb: Fix last TODOs 2018-02-28 Liviu Chircu * [38975dfac] : cachedb_mongodb: Enable multi-row updates 2018-02-28 Liviu Chircu * [d82b3ceae] : cachedb: Add unit tests for column "unset" operations 2018-02-28 Liviu Chircu * [c209ccbe0] : cachedb_mongodb: Implement the multi-key "unset" API requirement 2018-02-28 Liviu Chircu * [ce54ac89d] : cachedb: Simplify the column-oriented API Since some NoSQL backends support upsert-enabled "set" and "unset" operations on multiple key/value pairs using a single query, we can merge the "set_cols()" and "unset_cols()" functions into a single one: "update()". Current backends known to support this are MongoDB and Cassandra. Any backends which do not support the above will have to implement the update() endpoint using two queries instead of one. 2018-02-28 Bogdan-Andrei Iancu * [f1ec655b0] : Fix extra 1 byte being copied after removing param. I have no clue why that "+1" was there :-|. Makes no sense. Reported by Ben Newlin 2018-02-28 Bogdan-Andrei Iancu * [b77c1823e] : Extend the test for re-using pre-compiled regexp. A failure in compiling a regexp may lead to an inconsistent state, where the buffer is correctly populated, but the regexp pointer is NULL -> on next usage, the code will attempt to directly used (as the regexp buffer matches) the NULL pointer and crash. Reported by Ben Newlin 2018-02-28 Liviu Chircu * [b45c1bd83] : cachedb: Fix cap detection 2018-02-27 Liviu Chircu * [2944ba83b] : ut.h: Remove redundant memset() 2018-02-27 Liviu Chircu * [5ec432c7f] : cachedb_mongodb: Fix missing primary key flag on "get rows" Also do some minor clean-ups 2018-02-27 Liviu Chircu * [7045fce0b] : cachedb: Refactor and finalize the "set cols" tests 2018-02-27 Liviu Chircu * [d5a0462ec] : cachedb: Add dict debugging primitives 2018-02-27 Bogdan-Andrei Iancu * [93cc34871] : Fix dangerous \0 adding outside the str buffer. It is bogus to write a 0 outside the str buffer as (1) the buffer may be in data zone (so read-only) or (2) it may be in shm memory and an overflow may corrupt the memory manager Reported by Ben Newlin 2018-02-27 Razvan Crainea * [bdeb8ff13] : net: only start TCP workers if there are listeners Credits goes to Xaled for reporting this on mailing list 2018-02-27 Bogdan-Andrei Iancu * [c9e7db08e] : Fix displaying the usrloc domains. Dropped the "records" parameters as there is no way to count in advance how many records we may have in a dynamic shared hash table. Renamed "table" attribute into "hash_size" as this what it display :P Related to #1265 2018-02-27 Razvan Crainea * [d24e85acf] : drop DYN_BUF variable It wasn't working properly anyway 2018-02-27 Bogdan-Andrei Iancu * [e472e5286] : Update the help messge. '-D' is not "do not fork" anymore, but enbles the "debug mode" Reported in #1295 2018-02-27 Bogdan-Andrei Iancu * [78e8bea12] : Migrate the "expires" column from DATETIME to INT. Instead of keeping a DATETIME which is impacted by TZ and DST changes, use UNIX timestamp Fixes #1196. 2018-02-27 Bogdan-Andrei Iancu * [ffa51f822] : Added docs for the probing_verbose module parameter. Reported via #1280 2018-02-27 Bogdan-Andrei Iancu * [fefc33f10] : Added doc node about usage across differen top routes. Related to #1277 report 2018-02-26 Liviu Chircu * [f402f6987] : cachedb_mongodb: Implement the "SET COLS" capability 2018-02-26 Liviu Chircu * [d683ae8d5] : cachedb: Add unit tests suite for "SET COLS" capability 2018-02-26 Liviu Chircu * [816db4ff5] : cachedb_mongodb: Add useful debugging macros 2018-02-26 Liviu Chircu * [612c8d8fa] : cachedb_mongodb: Improve filter construction For single filters, avoid using the $and operator 2018-02-26 Liviu Chircu * [34dd480d0] : cachedb: Add object management primitives i.e. for "cdb_kv_t" and "cdb_dict_t" objects 2018-02-26 Liviu Chircu * [458690a87] : cachedb_mongodb: Implement the "truncate" capability 2018-02-26 Liviu Chircu * [73e4f1423] : cachedb: Add the "truncate" capability 2018-02-23 Liviu Chircu * [7c7ea7c64] : cachedb: Fix memleak 2018-02-23 Liviu Chircu * [88ff10d45] : cachedb: Refactor the multi-set/multi-unset API * add support for primary keys (e.g. to fit with MongoDB) * add support for map-level TTLs (to exploit Cassandra's powerful TTLs) 2018-02-23 Razvan Crainea * [ff86066ea] : dialog: fix previous commit warning 2018-02-23 Razvan Crainea * [552bd4e7a] : dialog: fix reinvite pinging make sure that pinging is properly engaged Credits go to Jonathan Hulme Closes #1082 2018-02-22 Liviu Chircu * [5d0839cf8] : cachedb_mongodb: Fix a filtering operator bug 2018-02-22 Liviu Chircu * [d95187a8d] : cachedb: Add unit tests for multi-filtering 2018-02-22 Liviu Chircu * [5481bc3f8] : cachedb: Add a unit testing suite for the GET_ROWS capability 2018-02-22 Liviu Chircu * [8b70ec3b9] : cachedb_mongodb: Implement the GET_ROWS capability 2018-02-22 Liviu Chircu * [acf1afd4f] : cachedb: Add a filter management API 2018-02-22 Liviu Chircu * [3efcb9b28] : cachedb: Refactor the core data abstractions 2018-02-22 Liviu Chircu * [90b1840de] : core utils: Useful additions * str_cpy() - similar to strcpy(), but works with strs * macros for working with singly linked lists 2018-02-22 Bogdan-Andrei Iancu * [6bd6d7128] : Fixed return code in del_uri_param() function. Avoid returning 0 if the param is not found, as 0 terminates the whole script execution. Reported by Ben Newlin 2018-02-21 Bogdan-Andrei Iancu * [305a570f7] : Remove any capability constraints because of the used MODE. As we are not aware of the relation (if any) between the real DB URLs from the set, it is not correct to restrict DB capabilities based on the used MODE. Like if it is Round Robin, do not do UPDATE ever. Maybe the URLs point to the nodes of the same cluster. 2018-02-21 Razvan Crainea * [baf4af90f] : rtpengine: allow specifying 15 length options 2018-02-15 Liviu Chircu * [888d5e9b3] : rest_client: Fix a string handling bug in append_hf() Issue reported by Pasan Meemaduma 2018-02-15 Liviu Chircu * [2254d0011] : F_MALLOC: Recover from double pointer free This patch makes F_MALLOC more robust in production by avoiding memory corruption in case of double free operations. Previously, the hash state would immediately get corrupted on such operations, and it would only be a matter of time before the allocator would crash in some random place with a useless backtrace resembling: \#0 0x0000000000507209 in fm_remove_free (qm=0x7f7d578d2010, size=56) at mem/f_malloc.c:200 200 *pf=n->u.nxt_free; When DBG_MALLOC is defined, F_MALLOC will now abort() on a double free, similar to QM_MALLOC. 2018-02-15 Liviu Chircu * [c77dac54f] : module deps: Improve feedback on modparam errors 2018-02-15 Liviu Chircu * [56e8eb3ea] : cachedb_mongodb: Properly return "key not found" retcode 2018-02-14 Liviu Chircu * [e9846467d] : mid_registrar: Log the Call-ID on erroneous register forking 2018-02-14 Liviu Chircu * [0a08c9e16] : cachedb: Extend the headerfiles with dict-aware prototypes 2018-02-14 Liviu Chircu * [b3ef9c189] : core: Refactor the mpath-related code into a function 2018-02-14 Liviu Chircu * [2d3c0733d] : Add a basic unit testing framework Currently, this framework only supports writing unit tests for core code, but there are plans to expand it such that module tests can be easily written as well. The chosen C unit testing framework is libtap (https://github.com/zorgnax/libtap) - very lightweight and full of goodies. In order to write a core unit test, you should write the test file under a "test/" dir which resides right next to the tested file. The build system is smart enough to link any such test files placed in random test dirs all across the core codebase. Next, you enrol your test file to be init'ed and run in test/unit_tests.c, and you're done. To run the entire unit testing suite, just do "make test". You will have to type this command twice if you haven't enabled "-DUNIT_TESTS" under Makefile.conf beforehand. 2018-02-13 Liviu Chircu * [29f4cf48d] : Travis: Be less verbose on Slack 2018-02-13 Liviu Chircu * [7337b9abd] : dialog: Provide meaningful timer function names 2018-02-13 Dan Pascu * [4039f265d] : permissions: Handle integer columns of different sizes in tables/views 2018-02-13 Razvan Crainea * [25d6396ea] : fix passing NULL values for route param 2018-02-13 Liviu Chircu * [ac2f28ffa] : Fix a famous typo 2018-02-13 Bogdan-Andrei Iancu * [46e2dfa8d] : Fix pushing pure INT values into acc extra. Convert integer values to str if the val does not advertise any STR val. 2018-02-13 Razvan Crainea * [9924969bf] : siprec: fix uninitialized warning 2018-02-12 Vlad Patrascu * [c144e5f96] : siprec: allow custom XML values for caller/callee in siprec_start_recording() Closes #1263 2018-02-12 Dan Pascu * [73fb7cdbc] : Separate memory allocation from test 2018-02-12 Dan Pascu * [6753cf2ce] : Adjusted spacing 2018-02-12 Dan Pascu * [bcd551b29] : Be consistent with spacing, comments and NULL 2018-02-09 Vlad Patrascu * [fa94b5e7d] : siprec: add t= and c= lines in the sdp body The IP is taken from a new parameter for the siprec_start_recording() script function. Closes #1262 2018-02-07 Liviu Chircu * [8345ff29f] : cachedb_mongodb: Fix possible crash in counter add/sub 2018-02-07 Razvan Crainea * [d6933ad99] : ratelimit: create pipe in a generic manner Fix pipe init by merging the pipe create in a single, common function. 2018-02-06 Vlad Patrascu * [b0a55397d] : clusterer: fix table version in db schema 2018-02-06 Razvan Crainea * [d857d4b95] : cgrates: fix using $cgr without dialog Thanks go to Artem Chalkov for reporing on GitHub Fixes #1268 2018-02-05 Ovidiu Sas * [ebbe49c50] : rtpproxy: revert commit ee2731212303eb7055b3bd165464fe44fae05e7b - add comments to better explain logic behind code 2018-02-05 Ovidiu Sas * [ee2731212] : nathelper: complete revert commit 3c39167e333a8801772f49f8561a015bfa1836f1 2018-02-05 Ovidiu Sas * [06c6fa179] : nathelper: revert commit 3c39167e333a8801772f49f8561a015bfa1836f1 - add comments to better explain logic behind code 2018-02-05 Bogdan-Andrei Iancu * [1177d975f] : Fix handling of ECONNRESET. Instead of returning -1 (error), better propagate it as an EOF. The meaning (from our perspective) is more or less the same. 2018-02-05 Bogdan-Andrei Iancu * [293d87a28] : Migrated TCP reporting to RPC dispatching. Instead of passing the reporting to the last TCP worker (ugly hack with process_no-2), simply dispatch to any available work the job of pushing the TCP report to the HEP backend. Also fixed shmem leak with IPC jobs. 2018-02-05 Bogdan-Andrei Iancu * [a2e4e73ff] : Added ipc_dispatch_rpc() similar to ipc_dispatch_job() ipc_dispatch_rpc() will run the RPC function into any idle/available process 2018-02-05 Ovidiu Sas * [55e9479b3] : rtpproxy: fix test condition for altering IP in SDP while forcing RTP 2018-02-05 Ovidiu Sas * [3c39167e3] : nathelper: fix test condition for updateing IP for fix_nated_sdp() 2018-02-03 Ovidiu Sas * [61d1a7c9d] : nathelper: update documentation for fix_nated_sdp() 2018-02-03 Ovidiu Sas * [9af01763a] : nathelper: new flag for fix_nated_sdp to allow re-writing null IPs 2018-02-02 Ovidiu Sas * [69fdc76b2] : sipmsgops: documentation updated for is_audio_on_hold() 2018-02-02 Ovidiu Sas * [8a0b08f60] : sipmsgops: is_audio_on_hold() returns hold type 1 - RFC2543 hold type (the connection IP is set to null IP) 2 - RFC3264 hold type (inactive or sendonly attr) 2018-02-02 Ovidiu Sas * [12c21547f] : parser/sdp: distinguish between RFC2543 and RFC3264 media hold type 2018-02-02 Liviu Chircu * [fc2025d93] : mid_registrar: Update documentation 2018-02-02 Liviu Chircu * [075dc9ba8] : mid_registrar: Allow REGISTER failover This patch fixes mid-registrar's callback logic to properly work when a failure_route is in use. 2018-02-02 Liviu Chircu * [664aee60d] : ut.h: Minor additions * add shm_str_sync() and shm_str_clean() * improve robustness during error states * complete refactoring started in e94d90d165 2018-02-02 Liviu Chircu * [3c916efed] : tm: Improve callback documentation 2018-02-02 Vlad Patrascu * [47aa5f7a4] : event_flatstore: return proper error message for evi_flat_rotate 2018-02-02 Vlad Patrascu * [e340e70cf] : event_flatstore: fix some locking issues 2018-02-02 Vlad Patrascu * [c4d113a92] : event_flatstore: fix possible crash when subscribing 2018-02-01 Ovidiu Sas * [61521c713] : nathelper: update documentation for fix_nated_sdp() 2018-02-01 Ovidiu Sas * [ae1316628] : nathelper: fix_nated_sdp can add a new SDP field(s) - the SDP field(s) is/are added at the end of SDP - the SDP field(s) are provided as a thrd param to fix_nated_sdp() - each SDP field must be preceeded by "\r\n" 2018-02-01 Razvan Crainea * [bd60d31d8] : cfg: align parsing errors to a single format 2018-02-01 Razvan Crainea * [adfc62b55] : cfg: fix error reporting for unenclosed scriptvars 2018-02-01 Razvan Crainea * [08bc17915] : ratelimit: replicate the current counter for SBT 2018-01-31 Liviu Chircu * [2e24c55e9] : process load: Code refactoring * move stat building code into pt_load.c * avoid using "pid" in order to refer to "process_no" 2018-01-31 Liviu Chircu * [9c0bf6bbf] : process load: Fix some minor issues * fix possibly incorrect 1m window values during very active periods * fix possible zero activity reported during very active periods 2018-01-31 Razvan Crainea * [b7862ccdd] : pvar: fix $hdr() to allow variable headers 2018-01-31 Razvan Crainea * [c71021e84] : tls_mgm: fix doc for client_domain_avp 2018-01-31 Răzvan Crainea * [a94423dbc] : Merge pull request #1269 from netaskd/patch-1 tls_client_domain_avp mismatch in readme 2018-01-30 Razvan Crainea * [6243d57ba] : dialog: fix README to reflect actual event params 2018-01-30 netaskd * [8498dc894] : tls_client_domain_avp mismatch in readme Parameter must be not "tls_client_domain_avp" but "client_domain_avp" 2018-01-30 Bogdan-Andrei Iancu * [ed12eb97c] : Fix reverse_hex2int64() prototype As the computed value is an unsigned (as data size), it cannot be returned as int as it will overflow and get converted to a negative value. This will colide with the negative error ret code -1 2018-01-30 Bogdan-Andrei Iancu * [c1d46c187] : Avoid bool test on float values Trevis reported. 2018-01-30 Bogdan-Andrei Iancu * [a61fa8646] : Explicit reset of conn ID on error if reverse_hex2int fails, be sure the conn id stays 0. 2018-01-30 Bogdan-Andrei Iancu * [095dc5730] : Fix reverse_hex2int() prototype As the computed value is an unsigned (as data size), it cannot be returned as int as it will overflow and get converted to a negative value. This will colide with the negative error ret code -1 Reported by Daniel Zanutti. 2018-01-30 Bogdan-Andrei Iancu * [065a91776] : Avoid calling clusterer_api.request_sync if no cluster configured 2018-01-29 Bogdan-Andrei Iancu * [091149b07] : Added new load support based on active/idle time. The way the internal load is calculated and reported is radically changed. Instead of providing per-interface load and only for SIP related processing, the new "load" support calculates per process the amount of time spent in any processing (outside the I/O reactor) versus total time. The time granularity is 1us. This new system covers any kind of handling (SIP, timer, async, etc) inside a process. The TCP main and timer handler will also provide load information. In the future, the extra processes (per module) may easily record their load information. Each process (and globally) reports 3 load statistics: * realtime load, computed over the last 1s * last 1 minute load * last 10 minutes load Example via "opensipsctl fifo get_statistics load:" : load:load:: 24 load:load1m:: 19 load:load10m:: 1 load:load-proc-1:: 0 load:load1m-proc-1:: 0 load:load10m-proc-1:: 0 load:load-proc-2:: 0 load:load1m-proc-2:: 0 load:load10m-proc-2:: 0 load:load-proc-3:: 0 load:load1m-proc-3:: 0 load:load10m-proc-3:: 0 load:load-proc-4:: 67 load:load1m-proc-4:: 22 load:load10m-proc-4:: 2 load:load-proc-5:: 79 load:load1m-proc-5:: 24 load:load10m-proc-5:: 2 2018-01-29 rvlad-patrascu * [0ca2f0418] : Merge branch 'feature/clustering-enhancements' Conflicts: modules/usrloc/README 2018-01-26 rvlad-patrascu * [97380d905] : clusterer: automatically choose the node to sync data from Given a provisioned "seed" node that is considered from the start to have the complete data set, every other node in the cluster synchronizes data from an eligible node (synced successfuly itself / is seed). Also, the get_my_index() API function now operates on a pool of nodes which have the complete data set. 2018-01-25 Liviu Chircu * [2fe5dc355] : usrloc: Fix an off-by-one bug 2018-01-23 Liviu Chircu * [1ec407b82] : Merge branch 'feature/usrloc-kv-contact-storage' 2018-01-23 Liviu Chircu * [f7bf26857] : usrloc: Document the new "kv_store" column 2018-01-23 Liviu Chircu * [2333d0d0c] : usrloc: Fix SHM leaks in the K/V support 2018-01-23 rvlad-patrascu * [700422325] : mangler: accept variables for the public_ip parameter of encode_contact() 2018-01-19 Liviu Chircu * [2b2e2ad6d] : usrloc: Remove bogus "const" modifiers 2018-01-19 Liviu Chircu * [d17722d0d] : mid_registrar: Allow startup with DB-enabled usrloc Also swap the ordering of some usrloc API operations - this will help keep the DB in sync at runtime more often. 2018-01-19 Liviu Chircu * [ca0fc9321] : Update DB schema 2018-01-19 Liviu Chircu * [7f1bef2f4] : usrloc: Implement DB persistency for all K/V storage This patch adds a new location table column, named "kv_store". This column will hold any custom data that modules may intend to push into usrloc contact structures. Currently, only the mid_registrar module is making use of this feature. Moreover, the implementation also includes persistency for the record-level K/V storage. This is achieved with a special key, "_urec_kvs", that will only be present in one of the contacts' K/V store. 2018-01-19 Liviu Chircu * [b674aa264] : usrloc K/V store: Add serialize/deserialize functions 2018-01-19 Liviu Chircu * [908282992] : map.h: Refactor int flags into enum map_flags 2018-01-19 Liviu Chircu * [bcae687fd] : str.h: Add a quick str initialization function 2018-01-19 Liviu Chircu * [d2527e88d] : Improve the cJSON library * add a str-based appending function * avoid defining yet another pair of malloc/free funcs * fix the resetted allocation functions from glibc to PKG 2018-01-18 Liviu Chircu * [8d3daae21] : usrloc: Fix broken contact_id generation Commit b2554c3c3a actually broke contact_id generation during replicated usrloc contact inserts. We now ensure all registrar insert_ucontact() calling code passes on a zeroed "ucontact_info_t" struct, such that new contact_ids get properly generated with every call. Reported by @sekil on IRC 2018-01-18 Liviu Chircu * [daea4348e] : mid_registrar: Fix a bad startup check 2018-01-17 Liviu Chircu * [6a86d5443] : usrloc: Simplify the callback API The opaque buffer extension for the API (commit b0241c1318) is no longer needed, as the K/V usrloc extension completely replaces it. This commit also refactors the usrloc callback types as "ul_cb_type", thus making them easier to pick up / work with. 2018-01-17 Liviu Chircu * [7f71f3ff9] : mid_registrar: Refactor contact mirroring/throttling We now make use of usrloc's newly added k/v storage functions in order to store/retrieve the module data into/from each contact. 2018-01-17 Liviu Chircu * [e94d90d16] : Refactor shm_str_resize() into shm_str_extend() This hints better at what the function actually does (i.e. it will not shrink your buffers) 2018-01-17 Liviu Chircu * [cfa7be567] : mid_registrar: Refactor the AoR throttling implementation We now make use of usrloc's newly added k/v storage functions in order to store/retrieve the module data into/from each record. 2018-01-17 Liviu Chircu * [1fc88e8ba] : usrloc: K/V store - use map_find() instead of map_get() 2018-01-17 Liviu Chircu * [b2ac38d70] : usrloc: Add generic, record-level key-value storage Allows various usrloc-dependent modules to easily store data into or to retrieve data from each usrloc record / AOR. 2018-01-17 Liviu Chircu * [597daa366] : usrloc: Add generic, contact-level key-value storage Allows various usrloc-dependent modules to easily store data into or to retrieve data from each usrloc contact. 2018-01-17 Liviu Chircu * [e5b5cfc28] : freeswitch_scripting: Add table to opensipsdbctl installer Also rebuild the DB schema. 2018-01-17 Razvan Crainea * [151c1cf0e] : rtpengine: handle POLLHUP while draining Thanks go to Pete Kelly for reporting this 2018-01-17 rvlad-patrascu * [1134b2e37] : clusterer: fix mem leak when sending BIN packets from script Reported by Gohar Ahmed in #1254 2018-01-17 Liviu Chircu * [95ab8c05f] : xlog: Fix a series of issues * properly report xlog() success/failure at script level * differentiate between xlog errors (-1) and HEP errors (-2) * do not cancel logging because of HEP errors * remove bogus error log * hint at 'xlog_buf_size' if the print string is too large 2018-01-16 Razvan Crainea * [d33253b6b] : compression: fix memory leak due to whitelists Thanks go to Nick Altmann for reporting this Closes #1252 2018-01-16 Bogdan-Andrei Iancu * [c527146cd] : Fix RURI len calculation after removing param. Reported by Denis Lemire (cherry picked from commit 50735b93508d77b4e44223450f60ae43082b14bb) 2018-01-16 Razvan Crainea * [8c5651be2] : net_tcp: remove fd from reactor before cleaning up 2018-01-12 rvlad-patrascu * [86003da2d] : drouting: reduce the two replication module params into a single one 2018-01-12 rvlad-patrascu * [bb6e4f4d6] : load_balancer: reduce the two replication module params into a single one 2018-01-12 rvlad-patrascu * [1d8fb8156] : ratelimit: reduce the two replication module params into a single one 2018-01-12 rvlad-patrascu * [71c2353a6] : usrloc: reduce the two replication module params into a single one 2018-01-12 rvlad-patrascu * [f06f3aa25] : dialog: simplify replication related module parameters Replaced the dialog and profile replication module parameters (source and destination cluster ids) with a single one for each of these capabilites. Also update and improve docs regarding replication. 2018-01-12 rvlad-patrascu * [2f7a9555a] : clusterer: always check address of received BIN messages Always check if the IP of the received BIN packets belongs to one of the nodes in the cluster. Therefore also remove the "auth_check" module parameters for the modules registered to clusterer. 2018-01-12 rvlad-patrascu * [d6ee4c9a9] : usrloc: partition NAT pinging across the cluster when replicating contacts The node determines its pinging slice by performing an AOR hash modulo current_no_cluster_nodes. 2018-01-12 rvlad-patrascu * [a24695a64] : clusterer: faster pinging restart Restart own pinging immediately, instead of on timer, when receiving a ping from a failed node. 2018-01-12 rvlad-patrascu * [5e461c668] : clusterer: advertise links as directed in topology updates Links are now considered as bidirectional in each node's internal topology representation. This fixes some routing loops and inconsistencies during the convergence of the overall cluster topology. 2018-01-12 rvlad-patrascu * [d8df84780] : clusterer: fix deadlock when receiving a BIN packet on disabled node 2018-01-12 rvlad-patrascu * [006eea599] : usrloc: sync contacts from another node in the replication cluster Contacts are synchronized at startup or through an MI command. A valid source node is established by the clusterer module. 2018-01-12 rvlad-patrascu * [00172f42e] : clusterer: fix node availability events 2018-01-12 rvlad-patrascu * [9bf5efc0e] : clusterer: load info from DB at module init 2018-01-12 rvlad-patrascu * [326421930] : clusterer: add mechanism to synchronize data for a capability Implemented through separate API functions which allow a node to: * request to sync with another node * build and send BIN packets with delimited chunks of data * iterate through data chunks from the received sync packets Also, regular BIN packets received for the given capability are buffered until syncing is complete. 2018-01-12 rvlad-patrascu * [4ec8d9ba3] : clusterer: fix wrong capabilities for some clusterer messages 2018-01-12 rvlad-patrascu * [cfa7e31a7] : clusterer: clean up some leftover code 2018-01-12 rvlad-patrascu * [5b7bec8e9] : clusterer: add capabilities Modules now register "capabilities" to clusterer. Instead of a single callback, a module now registers callbacks for each capability. Also, nodes discover the capabilities of all the other instances in the cluster. 2018-01-11 rvlad-patrascu * [71960b917] : sql_cacher: do data loading for full caching in the first child process Speed up OpenSIPS starting sequence by doing the full caching data load in the first process, after child_init is done (via RPC), instead of during module init. 2018-01-11 rvlad-patrascu * [0b06e6ee3] : sip_i: small doc fix for add_isup_part function 2018-01-11 Razvan Crainea * [672929eed] : msg: properly compute the initial body size Also initialilize the body structure in case there is no body in the message. 2018-01-11 Razvan Crainea * [5773e65b9] : protos/tcp: respect async operations order In case there is a write request, before actually writing the data on the network, check if there are any async chunks left, and make sure they are sent before any other write happens. This is necessary to make sure the order of the packets is respected, otherwise we might end up with fragments of other packets in the stream. Thanks go to Vlad Patrascu for reporting and testing this. 2018-01-11 Bogdan-Andrei Iancu * [769fb3c59] : Fix TO parsing when there is a comma inside a quoted display/value This bug was introduced during the re-factoring of the TO parser to support multple body parts - see 908b9f190bff3b356f76ce8ca75d43a2c149a412 Reported by Tito Cumpen 2018-01-11 Bogdan-Andrei Iancu * [963f05169] : Fixed parameter passing for dr_is_gw(). If partitions are not used, do a logic shift for the parameters with one position to the left to compensate the missing partition param. Reported by Jonathan Hunter 2018-01-10 Liviu Chircu * [0d1bc4423] : mid_registrar: Fix an AoR throttling bug Do not apply min/max "expires" module limitations when computing the main registrar's contact expiration value. 2018-01-10 Bogdan-Andrei Iancu * [5d1670a4a] : Repaid the IPC support in the external proc of FS module Allow a module to inform the core if its additional processes are able or not to handle IPC jobs. New process flag (for the module interface) added - PROC_FLAG_HAS_IPC. 2018-01-09 Bogdan-Andrei Iancu * [19756d46c] : Added support for graceful shutdown. Graceful shutdown is based on IPC commands sent to worker processes, rather than terminating them by SIGTERM. This will allow the workers to complete on ongoing task and to terminate in a consistent state (as locking or data consistency). TO DO: * move PKG memory dumping and memory stats to IPC/RPC (versus signals) Nice to have: * child_destroy() functions to allow modules to do per-child/process cleanup (like closing DB conns, flushing, etc) 2018-01-09 Bogdan-Andrei Iancu * [405baf884] : Fine tunning of IPC support in internal_fork() * introduced "flags" to internal_fork() for various options * added OSS_FORK_NO_IPC to prevent the creation of IPC pipes during internal_fork - to be used when creating new processes without IPC support * replaced id_of_pid() with get_process_ID_by_PID() 2018-01-09 Razvan Crainea * [cf190a955] : pike: enforce remove latency to at least sampling_time_unit + 1 This prevents UNBLOCK events from being lost. 2018-01-09 Bogdan-Andrei Iancu * [719f62053] : Removed bogus connection close at shutdown There is not DB connection closed in proc MAIN (from dailplan) as the conn is closed in mod_init() after all the DB checks. 2018-01-09 Bogdan-Andrei Iancu * [1b9541432] : Small code cleanup 2018-01-09 Bogdan-Andrei Iancu * [a4dcbfc67] : Moved data loading outside child init Instead of loading the data in child_init routine, better fire a RPC to itself to perform the load after the child_init is done. This will speed up the OpenSIPS starting sequance, as we can complete the init part and daemonize without waiting for data loading. 2018-01-09 Bogdan-Andrei Iancu * [421d67004] : Moved data loading outside child init Instead of loading the data in child_init routine, better fire a RPC to itself to perform the load after the child_init is done. This will speed up the OpenSIPS starting sequance, as we can complete the init part and daemonize without waiting for data loading. 2018-01-09 Bogdan-Andrei Iancu * [35c432467] : Moved data loading outside child init Instead of loading the data in child_init routine, better fire a RPC to itself to perform the load after the child_init is done. This will speed up the OpenSIPS starting sequance, as we can complete the init part and daemonize without waiting for data loading. 2018-01-09 Bogdan-Andrei Iancu * [431638e58] : Added support for RCP via IPC RPC allows you to request another process to run a function of yours. 2018-01-09 Razvan Crainea * [85a2f8644] : mongo: replace deprecated bulk function replace mongoc_collection_create_bulk_operation() function from 1.8.0 with the newly added mongoc_collection_create_bulk_operation_with_opts() function in 1.9.0 2018-01-09 Razvan Crainea * [a63e7b24e] : perl*: enable optimizations if FORTIFY_SOURCE is used 2018-01-09 Razvan Crainea * [3ed75a854] : jabber: complete previous commit 2018-01-09 Razvan Crainea * [4c94c946a] : jabber & xmpp: fix bogus pointer checks 2018-01-09 Razvan Crainea * [fecb4b244] : msg: remove extra bytes from malformed bodies This commit fixes an abort() generated by the message builder when a malformed message is received that has a Content-Length lower than the actual body. Thanks go to Jon Hunter for reporting this issue and offering all necessary information for debugging it. Closes #1244 2018-01-07 Liviu Chircu * [14baedfbd] : mid_registrar: Fix unsafe strdup operation 2018-01-05 Bogdan-Andrei Iancu * [824e21c96] : Expose the ATTR field for event E_UL_CONTACT_INSERT. Extract the attr event field and expose it as "attr" atribute in the EBR resume route. 2018-01-05 Bogdan-Andrei Iancu * [3fb5817be] : The E_UL_CONTACT_INSERT event exposes the attr string. 2018-01-05 Bogdan-Andrei Iancu * [c6c937d1e] : Ignore tracing types which are not recognized. Instead of exiting with error and abording the whole tracing, better simple ignore the unrecognized tracing types. 2018-01-05 Liviu Chircu * [91d7e7f4b] : rest_client: Fix a rest_post() regression bug Commit c549e6ec added an unnecessary libcurl option which caused the HTTP headers to be logged into the output body pseudo-variable alongside the request body when performing a rest_post(). This patch disables the above-mentioned libcurl option (CURLOPT_HEADER). Reported by @goharahmed on GitHub. Fixes #1247. 2018-01-05 Bogdan-Andrei Iancu * [cec2d66b7] : Fixed expantion of shm_info() for HP_MALLOC Reported by Nick Altmann Closes #1240 2018-01-05 Liviu Chircu * [aab1ec7e0] : menuconfig: Fix a PREFIX handling bug This patch fixes a bug where menuconfig corrupts the Makefile.conf PREFIX variable value by incorrectly trimming the last char in an attempt to ensure that the value has a trailing '/' char. This would happen each time the user launches menuconfig and chooses "Exit & Save All Changes". Reported by @Jeffrey2019 on GitHub. Fixes #1248. 2018-01-05 Liviu Chircu * [468060b3e] : mid_registrar: Fix possible startup segfault If you don't set commit 34d0b1bc2's modparam, you win a corefile. 2018-01-05 Liviu Chircu * [c1df32786] : acc: Simplify some startup parsing code * use str_strcmp() more often * code only runs at startup, no need for static storage * remove redundant "inline" modifiers 2018-01-04 Liviu Chircu * [99c32a3e5] : mid_registrar: Update documentation 2018-01-04 Liviu Chircu * [34d0b1bc2] : mid_registrar: Add the "extra_ct_params_pvar" modparam Allows the script writer to append additional Contact URI parameters. 2018-01-04 Liviu Chircu * [7bafce982] : mid_registrar: Improve the advertised socket logic Instead of blindly advertising the first UDP interface in the self-generated, outgoing Contact URIs, the mid_registrar is now aware of the next SIP hop and properly advertises the actual sending interface which will be used. This includes any forced send socket logic at script level. 2018-01-04 Liviu Chircu * [3acaf2e92] : mid_registrar: Fix unused variable 2018-01-04 Liviu Chircu * [86628e6d4] : mid_registrar: Fix a PKG memory leak Although the TMCB_RESPONSE_IN callback provides a reference to the initial request during reply processing, this sip_msg must not be parsed (i.e. passed to parse_headers()), otherwise we leak PKG memory, since parsing is PKG-based, while the request buffer is copied in SHM. The current workaround for mid_registrar is to immediately duplicate all contact-related data we could possibly need, should the contact successfully register on the downstream registrar. This copying takes place during request processing. Once the reply arrives, we only make use of this info in order to store the contact in usrloc, and barely even use the "req" sip_msg provided by tm. 2018-01-04 Liviu Chircu * [a2dd10a49] : Add a "struct ucontact_info" logging function 2018-01-03 rvlad-patrascu * [bf4ce8e30] : dialog: fix a clusterer module registration bug Bad cluster id provided to the clusterer module when only the accept_replicated_profiles parameter was defined without accept_replicated_dialogs. Thanks go to Nick Altmann for reporting this. Closes #1243 2018-01-03 Bogdan-Andrei Iancu * [f7216003b] : Improve docs on db_url setting 2018-01-03 Liviu Chircu * [fa558c7c2] : Fix previous commit Avoid trapping the "EXIT" pseudo-signal altogether, as it may misbehave on some shells (hangs the console or does not trap anything at all). 2018-01-03 Liviu Chircu * [4489e307b] : opensipsctl improvements * use $CHROOT_DIR/tmp instead of /var/lock - the latter may be read-only * avoid dangling osips_rply_* files on error / SIGTERM 2018-01-03 Bogdan-Andrei Iancu * [b4d74ebd5] : Fixed handling of TTL 0 in DNS answers. RFC1035 states : "Zero TTL values are interpreted to mean that the RR can only be used for the transaction in progress, and should not be cached." Reported by Marcin Luczkiewicz @ Magrathea Telecom 2018-01-03 Razvan Crainea * [596271ae1] : json: add $json_pretty and $json_compact vars Credits go to Nick Altmann for providing the idea for this and a patch. 2017-12-22 Razvan Crainea * [d2c1c7838] : rtpproxy: store returned IP:port in pvar Closes #1233 2017-12-22 Razvan Crainea * [6b2ad1fe3] : dispatcher: restore URI headers check from prev. commit 2017-12-22 Razvan Crainea * [bf1376203] : dispatcher: add comment for uri vs dst_uri 2017-12-22 Razvan Crainea * [575a1b159] : dispatcher: fix TCP and TLS destinations Before this commit, the structures used internally to store the destinations URI were not storing the URI parameters - since these were dropped, URIs that contain TCP or TLS transport would be involuntary converted to UDP. This fix also stores the provisioned parameters in the dst_uri. Closes #1227 2017-12-21 Razvan Crainea * [e845b37a5] : dialog: don't mark new dialogs as deleted 2017-12-21 Liviu Chircu * [6c62d858f] : Fix some typos 2017-12-21 Nick Altmann * [e64b8eaf8] : YUM packaging: add freeswitch_scripting module 2017-12-21 Liviu Chircu * [9a19ff96a] : cache_counter_fetch(): Fix bogus error handling (looks like a copy-paste bug) 2017-12-21 Liviu Chircu * [1f3a0a335] : cachedb core: Fix a minor mem leak 2017-12-20 Liviu Chircu * [9ddb33ea0] : Merge branch 'feature/freeswitch-extended-integration' 2017-12-20 Liviu Chircu * [f33c145a5] : freeswitch: Lower default "esl_cmd_polling_itv" to 1ms 2017-12-20 Liviu Chircu * [ece4d1ebc] : freeswitch: Document newly added modparams 2017-12-20 Liviu Chircu * [a848555e0] : freeswitch: Fixes and minor improvements * free pending replies on socket cleanup * NULL-terminate some printed strings * remove unneeded fields * fix bad socket cleanup condition * add some useful debug logs 2017-12-20 Liviu Chircu * [b3b61f0fe] : freeswitch_scripting: Add documentation 2017-12-20 Liviu Chircu * [f571ed35e] : opensipsctl: Do not synchronize different instances Suggested by Răzvan Crainea 2017-12-20 Liviu Chircu * [978a6c384] : freeswitch_scripting: Fix GCC warning 2017-12-20 Liviu Chircu * [96289ccac] : opensipsctl: Add a critical section for FIFO writes 2017-12-20 Liviu Chircu * [5e4a6648f] : freeswitch_scripting: Add DB schema files 2017-12-20 Liviu Chircu * [d014fe5c7] : freeswitch_scripting: Add DB provisioning support 2017-12-20 Liviu Chircu * [9f3c3c3be] : freeswitch_scripting: Add "fs_list" MI command 2017-12-20 Liviu Chircu * [1b4381619] : lib/csv: Add some useful parsing flags * dup the parsed strings * do all allocations in SHM 2017-12-20 Liviu Chircu * [8b6884e98] : db: Fix a minor mem leak 2017-12-20 Liviu Chircu * [0bbc79a44] : freeswitch: Implement the JSON body event parameter 2017-12-20 Liviu Chircu * [b30abf8db] : freeswitch_scripting: Implement the E_FREESWITCH event This event has three parameters: * name * sender (FreeSWITCH host) * JSON body 2017-12-20 Liviu Chircu * [cdb104cb4] : freeswitch: Add WIP dereferenced socket cleanup logic The reactor needs refactoring before this feature can work. 2017-12-20 Liviu Chircu * [5c99644aa] : freeswitch_scripting: Improve MI feedback on oom 2017-12-20 Liviu Chircu * [8b3bafa91] : freeswitch_scripting: Implement sub/unsub MI commands 2017-12-20 Liviu Chircu * [e587188ce] : freeswitch: Fix event unsubscribing 2017-12-20 Liviu Chircu * [debf94dee] : freeswitch: Further implement generic event subscribing Currently, we can subscribe for generic FS events and they get fired into "freeswitch_scripting" via the shared IPC support. Patch summary: - add FS ESL command building logic - refactor the api->evs_sub() function to take an ipc_handler_type as parameter. - drop the freeswitch_scripting API. No longer needed. - simplify data structures 2017-12-20 Liviu Chircu * [8f16df247] : Fix the shared IPC support The initial implementation was incomplete 2017-12-20 Liviu Chircu * [6be577e6a] : freeswitch_scripting: Rename fs_cli() to freeswitch_esl() Also adapt to the new interface / IPC changes. 2017-12-20 Liviu Chircu * [6b29c9c04] : freeswitch: Implement the fs_esl() API command This API call allows execution of an arbitrary FreeSWITCH ESL command on an arbitrary FS interface. It has the following flow: 1. script worker - calls freeswitch_esl(), hence api->fs_esl() - fires an IPC job to the FS connection manager - busy-waits for an SHM response (with sleep()) 2. FS connection manager - receives the IPC job, runs the ESL command - places the reponse in SHM for the worker to find 3. script worker - finds the corresponding response, stores it in the output pvar (if provided) and resumes the OpenSIPS script 2017-12-20 Liviu Chircu * [7195d197b] : Improve LM_BUG() macro This allows syntax such as: if (foo) LM_BUG(""); else bar; We also drop the deprecated report_programming_bug() macro. 2017-12-20 Liviu Chircu * [bead98be0] : freeswitch: Improve logging 2017-12-20 Liviu Chircu * [2f50509e2] : freeswitch: Fix socket updating logic 2017-12-20 Liviu Chircu * [0d50eb923] : freeswitch_scripting: Implement the fs_cli() script function 2017-12-20 Liviu Chircu * [5f112a60a] : str.h: Add some handy zero-string test macros 2017-12-20 Liviu Chircu * [cccc6e65a] : freeswitch_scripting: Implement modparam subscriptions Also remove the "func" concept from the FS subscription API. It is no longer needed, as the IPC communication between the two modules takes care of providing this handler. 2017-12-20 Liviu Chircu * [0d57d6e55] : str_list: Add a doubly linked string list structure 2017-12-20 Liviu Chircu * [073a53aed] : Add a new "freeswitch_scripting" module With a basic structure: * MI function stubs * script function stubs * (hope)fully implemented IPC interaction with "freeswitch" Patch includes some "freeswitch" refactoring to get everything working. 2017-12-20 Liviu Chircu * [6aa157695] : ipc: Do not dispatch jobs to extra timer processes 2017-12-20 Liviu Chircu * [100d72aa5] : ipc: Add job dispatching support This patch adds support to dispatch a job to a currently available TCP, UDP or timer OpenSIPS worker. We also revert the incorrect function refactoring done in commit 69142efd59f. 2017-12-20 Liviu Chircu * [51a979f57] : freeswitch: Extend API / further implement logic * implement evs_sub() / evs_unsub() * extend API with fs_cli() function * new modparam: "esl_connect_timeout" Major refactoring of data structs and extra proc flow to support the above. 2017-12-20 Liviu Chircu * [e38b1b594] : reactor.h: Improve variable naming Easier to figure out the time measuring unit 2017-12-20 Liviu Chircu * [a1c4c2a39] : ipc: Improve and document the API 2017-12-20 Liviu Chircu * [ef5f2017a] : freeswitch: Implement get_evs() / put_evs() 2017-12-20 Liviu Chircu * [3db613e83] : freeswitch: Extend API with sub/unsub functions This makes the API more logical - easier to understand and use. 2017-12-20 Liviu Chircu * [ff83a31e4] : freeswitch: Refactor API * add generic FS event subscribe/unsubscribe function stubs * new modparam: "event_heartbeat_interval" * expose "event_heartbeat_interval" in API, use wherever needed * improve naming for stats-based socket API functions * remove the callback-based support for updating stats (this never worked anyway, ds/lb would always pull data) 2017-12-20 Liviu Chircu * [580fdb0a3] : lib/osips_malloc: Inline all functions 2017-12-20 Liviu Chircu * [341292012] : Code refactoring * expose tm's "struct str_list" as a core header * get rid of "struct csv_record", swap for "struct str_list" * refactor all code dependencies 2017-12-20 Liviu Chircu * [8ad49f52d] : lib/csv: Add some header docs 2017-12-20 Liviu Chircu * [94f2bcec2] : lib/url: Add some header documentation 2017-12-20 Liviu Chircu * [2d4ecdebc] : lib/url: Improve logging and robustness 2017-12-20 Liviu Chircu * [70f8a34d6] : util: Add str2short() 2017-12-20 Liviu Chircu * [530001539] : lib: Add generic URL parsing support Very re-usable (db/db.c, cachedb/cachedb_id.c, modules/freeswitch/fs_api.c, MongoDB, etc.). Importing code can easily customize their URLs by enforcing/relaxing: scheme part, user part, pass part, ports, database and extra hosts. This patch also adds a new URL extension: parameters! Syntax: scheme://...?foo=bar,foo Refer to lib/url.h for the full spec 2017-12-20 Liviu Chircu * [d3689b031] : lib: Add basic CSV line parsing primitives 2017-12-20 Bogdan-Andrei Iancu * [30d47e658] : Fixed error message. Properly report the hdr name (PAI or PPI) when hdr fields validation fails 2017-12-20 Bogdan-Andrei Iancu * [ef89e181f] : Remove some heavy log (instroduced with the prev commit). 2017-12-20 Bogdan-Andrei Iancu * [f78926432] : Use as OBP the first PATH URI. If PATH defined, when injecting a new branch, extract the first PATH URI and use it as destination. Reported by @futsystems in #1235 Fix for problem 1. 2017-12-20 Razvan Crainea * [28385b6de] : debian: let debuild figure out mysql dependencies Reported by Nick Altmann (cherry picked from commit 5916511339e638ff301ad7556c2ef8f4cb7f36bb) (cherry picked from commit b2ce0c2edc31c63d49d8eca685ab8ee9cfeeba6e) 2017-12-19 Bogdan-Andrei Iancu * [69ef92cd9] : Fix validation for PAI, PPI and Diversion headers These headers must be parsed as multu-field headers Also for PAI and PPI we apply extra checks as per RFC3325. Close #1134 Close #1228 2017-12-19 Bogdan-Andrei Iancu * [908b9f190] : Fix hdr parsing to accept multi-value bodies. The parser for Diversion, PAI and PPI use now the parse_multi_to() in order to handle multi name-addr/addr-spec hdr bodies. 2017-12-19 Bogdan-Andrei Iancu * [a7e724a09] : Refactor generic parse_to() to accept multi-value headers. New function parse_multi_to() added to allow parsing of multi-value (comma separated) name-addr/addr-spec headers (like Diversion, PAI, PPI). Changes are backward compatible in regards to original parse_to() function. 2017-12-19 Razvan Crainea * [1b9532cb8] : reactor: replace epoll_lt and epoll_et \w epoll Remove the epoll_lt and epoll_et keyworkds and make available only epoll, which behaves as epoll lt (Level Triggered) 2017-12-19 Razvan Crainea * [9f54480df] : deprecate epoll_et and use epoll_lt instead epoll_et needs draining the socket out of data, which behaves against our balancing mechanism. (cherry picked from commit cbfef48c726bd4679f7f63df83250523101068f6) 2017-12-19 Razvan Crainea * [a25019172] : acc: fix prepared statements for non-ctx records In case one is doing a "manual" acc_db_request() in local route, where you don't have a context, there are not extra values available, thus we need to use a different prepared statement. Credits go to Pete Kelly for reporting this 2017-12-19 Razvan Crainea * [001c42cfd] : ratelimit: improve expire_time parameter doc Kudos the Ecosmob team for reporting this! 2017-12-19 Razvan Crainea * [ba7c8e8e6] : ratelimit: improve documentation on rl_check() Consider using rl_dec_count() for declined calls. Credits go to Ecosmob for reporting this. 2017-12-19 Razvan Crainea * [a6528d8eb] : ratelimit: fix slot_period documentation slot_period should be expressed in milliseconds, not milliseconds Kudos to the Ecosmob team for reporting this! 2017-12-15 rvlad-patrascu * [5923267fb] : sql_cacher: complete mem leak fix from previous commit 2017-12-15 rvlad-patrascu * [5179bc2f9] : sql_cacher: fix memory leaks when loading from SQL on demand 2017-12-15 Bogdan-Andrei Iancu * [bbae925fe] : Added new set of functions for list headers. Functions for operating on headers having in body CSV lists of tokens (like the Supported, Require, Content-Dispsition headers) : * list_hdr_has_option(hdr_name,option) * list_hdr_add_option(hdr_name,option) * list_hdr_remove_option(hdr_name,option) 2017-12-15 Bogdan-Andrei Iancu * [43cdb2f24] : Added parser for list-like body headers. This parser can be used for hdr bodies holding list of options/tokens like Supported, Require, Content-Disposition, etc. Work in progress. 2017-12-15 rvlad-patrascu * [6aef8347b] : sql_cacher: fix possible crash when loading from SQL on demand Elements from the list of queries in progress are now properly removed. 2017-12-15 Liviu Chircu * [02b114902] : mid_registrar: Never parallel fork in "mode == 1" This patch fixes a subtle bug where a "mode == 1" mid-registrar would parallel fork to a random number of contacts by walking the remaining "->next" values of the currently looked up contact. 2017-12-13 Razvan Crainea * [49bb70dd1] : dialog: fix error typo 2017-12-13 Razvan Crainea * [3596efdc0] : disable EPOLLEXCLUSIVE due to bogus behavior 2017-12-13 Razvan Crainea * [e37be3ab2] : clang: fix blacklist bitwise check warnings 2017-12-13 Razvan Crainea * [9f89deb6d] : mongodb: use json common detection 2017-12-13 Razvan Crainea * [3e71fd6f7] : json: merge json detection into a common dir re-arrange code to be able to merge json(-c) library detection into a single common directory 2017-12-13 Răzvan Crainea * [4a511e459] : Merge pull request #1231 from besser82/enhancement/json_array_del modules/json: Improve readability 2017-12-13 Björn Esser * [5220f6ae2] : modules/json: Improve readability 2017-12-12 Bogdan-Andrei Iancu * [1906423bc] : Fix README file local:group2///collection2 Cache DB URL is broken in example. (cherry picked from commit ca96dd653c520cee044f72d1ac39970e830f19ba) 2017-12-12 Bogdan-Andrei Iancu * [69e514bfa] : Fix ambuguity in cache DB URL parser. Do not accept URLs like schema:group//.. ; Correct format is schema:group://.. or schema://.. (cherry picked from commit 87025cc925f5eadc87c9ee757326d6b5b9f5df87) 2017-12-12 Razvan Crainea * [250d31168] : Merge branch 'besser82-enhancement/json-c_013' 2017-12-12 Razvan Crainea * [d3def25ca] : json: rename some variables and change C99 comment 2017-12-12 Björn Esser * [57ae84b2d] : modules/json: Properly detect json-c version and adaptions for v0.13 2017-12-08 Razvan Crainea * [5ae5daecb] : rtpproxy/rtpengine: handle error while draining 2017-12-07 Razvan Crainea * [f0fcf326c] : ip.resolve: null terminate queried string Thanks go to Nick Altman for reporting this! 2017-12-07 Razvan Crainea * [6affbec7c] : Revert "ut: fix *_strdup() functions" This reverts commit 595c91590cbbb3eed3ba789d689281c7088f0ffe. 2017-12-07 Razvan Crainea * [595c91590] : ut: fix *_strdup() functions 2017-12-07 Liviu Chircu * [ec04149f2] : Fix unhandled compile flags combination Defining DBG_TCPCON without DBG_STRUCT_HIST would lead to a broken opensips binary, that always fails to start. We now throw a compilation warning on such flag combinations and ensure the resulting binary remains correct. Reported by SamyGo 2017-12-06 Razvan Crainea * [5291aef57] : choose non-loop default ipv6 interface 2017-12-04 Liviu Chircu * [fee1ccb72] : mid_registrar: Update docs 2017-12-04 Liviu Chircu * [67c31603e] : mid_registrar: Restore "default_expires" and "max_expires" These registrar modparams were left unmaintained / ignored during development. However, they are still valid and completely separate from "outgoing_expires". The former two params control ingress expirations, while the latter one controls egress expirations. To match the newly introduced defaults, we also increase the default "outgoing_expires" from 600s to 3600s. 2017-12-04 Liviu Chircu * [7bcf03233] : mid_registrar: Fix a CSeq bug in mode == 1 Contact updates would not also update the last cseq value. This, in turn, would lead to SIP-wise incorrect self-generated de-registrations. 2017-11-29 Razvan Crainea * [98921fb69] : avoid using "flagged" ipv6 interfaces 2017-11-29 Razvan Crainea * [3fbcf18c7] : remove useless family param to add_interfaces() 2017-11-29 Razvan Crainea * [ce6469911] : use getifaddrs API to fetch listening interfaces Closes #976 2017-11-29 Razvan Crainea * [4b39b578d] : add support for '*' keyword for listeners Using this feature you can specify opensips it should listen for a specific protocol on all interfaces. The syntax is: ``` listen = udp:*:5060 ``` 2017-11-29 Razvan Crainea * [4833fb88b] : net/trans: remove useless interface detection code 2017-11-29 Razvan Crainea * [27de19168] : add interface name only if specified 2017-11-27 Razvan Crainea * [d1a4419df] : rest: suppress coverity error 2017-11-27 Razvan Crainea * [fc9021784] : dialog: check return of dialog values Fix Coverity CID #167553 2017-11-27 Razvan Crainea * [7b186a0a5] : rtpproxy: add to_tag only if provisioned Fixes Coverity CID #180091 2017-11-27 Razvan Crainea * [0956518f4] : sip_i: proper test for parse_isup_body() return Fixes Coverity CID #180094 2017-11-27 Razvan Crainea * [83059b8d8] : mid_registrar: initialize regex earlier Fixes Coverity CID #180096 2017-11-27 Razvan Crainea * [5e86ac587] : rest: fix IP copying to tracing structures Fixes Coverity CID #180100 and #180098 2017-11-27 Razvan Crainea * [7ce8078ac] : httpd: fix address check Fixes Coverity CID #180102 2017-11-27 Razvan Crainea * [5d36fe328] : siprec: fix parse_to usage Fixes Coverity CID #180103 2017-11-27 Razvan Crainea * [96d59f39e] : seas: check tainted data Fixes Coverity CID #180104 and #180101 and #180099 and #180088 2017-11-27 Razvan Crainea * [602c44d70] : pvar: fix buffer overrun Fixes Coverity CID #180105 2017-11-27 Razvan Crainea * [1a8d6d93f] : clusterer: initialize new_info earlier This prevents bogus check during error Fixes Coverity issue #180106 2017-11-27 Razvan Crainea * [d4826a562] : siprec: make sure stream exists Fixes coverity issue #180110 2017-11-24 Liviu Chircu * [f298587d6] : mid_registrar: Restore reply contact mangling The contact rework commits have rendered the restore_reply_contacts() function obsolete, thus the contact headers were propagating upstream unchanged. We now rebuild the reply contact set in all modes by using build_contacts() Thanks to Răzvan Crainea for spotting the issue 2017-11-24 Liviu Chircu * [70eea5c61] : cachedb_mongodb: Start OpenSIPS if ":port" URL part is missing Reported by Răzvan Crainea 2017-11-24 Liviu Chircu * [0124344f9] : usrloc: Fix bad comparison Also complete commit d3790e6c Reported by Răzvan Crainea Fixes Coverity CID #180087 Fixes Coverity CID #180093 2017-11-24 Liviu Chircu * [d3790e6cd] : mid_registrar: Fix an AoR throttling corner-case If the main registrar omits the Contact in the 200 OK reply, it could possibly crash the mid registrar. Reported by Răzvan Crainea. Fixes Coverity CID #180107 2017-11-23 Razvan Crainea * [5e1568660] : rtpproxy: fix rtpproxy_stats() fixup for more params Thanks go to Lt-Flash(github) for reporting and providing the fix Closes #1219 2017-11-22 Razvan Crainea * [a41cf31d3] : README: add coverity status 2017-11-21 Razvan Crainea * [63042c922] : Merge branch 'lemenkov-mariadb_unnecessary_include' 2017-11-21 Razvan Crainea * [ec0acfba5] : Merge branch 'mariadb_unnecessary_include' of https://github.com/lemenkov/opensips into lemenkov-mariadb_unnecessary_include 2017-11-21 Razvan Crainea * [c23ad230a] : couchbase: fix multiple hosts usage Closes #1216 2017-11-21 Peter Lemenkov * [087b23ab5] : Don't include directly It seems that this header shouldn't be included directly. And sometimes it may cause compilation issues (depending on MariaDB/MySQL version, compiler, etc). See build log for the example: make[1]: Entering directory '/builddir/build/BUILD/opensips-2.2.5/modules/db_mysql' Compiling row.c gcc -fPIC -DPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fgnu89-inline -Wcast-align -DMOD_NAME='db_mysql' -I/usr/include/json-c -DPKG_MALLOC -DSHM_MMAP -DUSE_MCAST -DDISABLE_NAGLE -DSTATISTICS -DHAVE_RESOLV_RES -DF_MALLOC -DNAME='"opensips"' -DVERSION='"2.2.5"' -DARCH='"x86_64"' -DOS='"linux"' -DCOMPILER='"gcc 7"' -D__CPU_x86_64 -D__OS_linux -D__SMP_yes -DCFG_DIR='"/etc/opensips/"' -DUSE_FREERADIUS -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_EPOLL -DHAVE_SIGIO_RT -DHAVE_SELECT -I/usr/include -c row.c -o row.o Compiling my_con.c gcc -fPIC -DPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fgnu89-inline -Wcast-align -DMOD_NAME='db_mysql' -I/usr/include/json-c -DPKG_MALLOC -DSHM_MMAP -DUSE_MCAST -DDISABLE_NAGLE -DSTATISTICS -DHAVE_RESOLV_RES -DF_MALLOC -DNAME='"opensips"' -DVERSION='"2.2.5"' -DARCH='"x86_64"' -DOS='"linux"' -DCOMPILER='"gcc 7"' -D__CPU_x86_64 -D__OS_linux -D__SMP_yes -DCFG_DIR='"/etc/opensips/"' -DUSE_FREERADIUS -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_EPOLL -DHAVE_SIGIO_RT -DHAVE_SELECT -I/usr/include -c my_con.c -o my_con.o Compiling val.c gcc -fPIC -DPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fgnu89-inline -Wcast-align -DMOD_NAME='db_mysql' -I/usr/include/json-c -DPKG_MALLOC -DSHM_MMAP -DUSE_MCAST -DDISABLE_NAGLE -DSTATISTICS -DHAVE_RESOLV_RES -DF_MALLOC -DNAME='"opensips"' -DVERSION='"2.2.5"' -DARCH='"x86_64"' -DOS='"linux"' -DCOMPILER='"gcc 7"' -D__CPU_x86_64 -D__OS_linux -D__SMP_yes -DCFG_DIR='"/etc/opensips/"' -DUSE_FREERADIUS -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_EPOLL -DHAVE_SIGIO_RT -DHAVE_SELECT -I/usr/include -c val.c -o val.o In file included from my_con.c:25:0: /usr/include/mysql/mysql_version.h:3:2: warning: #warning This file should not be included by clients, include only [-Wcpp] #warning This file should not be included by clients, include only ^~~~~~~ /usr/include/mysql/mysql_version.h:5:10: fatal error: mariadb_version.h: No such file or directory #include ^~~~~~~~~~~~~~~~~~~ compilation terminated. make[1]: *** [../../Makefile.rules:25: my_con.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory '/builddir/build/BUILD/opensips-2.2.5/modules/db_mysql' make: *** [Makefile:201: modules] Error 2 See also kamailio/kamailio@c31535072a04273b52a5cbc015e7ed1423d5dc33 2017-11-21 Razvan Crainea * [56490e4e3] : couchbase: fix LIBS in Makefile 2017-11-20 Razvan Crainea * [ef82312cb] : packaging: sync debian and redhat_fedora service files Thanks to Nick Altman's suggestions 2017-11-17 Razvan Crainea * [f562251d9] : debian: add m4 support in systemctl 2017-11-17 Razvan Crainea * [f6845f26a] : debian: fix EXTRA_PATH specification 2017-11-17 Razvan Crainea * [9be7ffc06] : debian/init:remove bogus value for pathextra 2017-11-16 Liviu Chircu * [a644f1b37] : usrloc: Fix bad logical condition Reported by Răzvan Crainea. 2017-11-16 Liviu Chircu * [0498151bb] : Fix Clang warnings for excluded modules Completes commit 8bb5929d58 2017-11-15 Liviu Chircu * [8bb5929d5] : Fix Clang "unused function" warnings Also add a useful function/variable attribute, ALLOW_UNUSED. 2017-11-15 Liviu Chircu * [48cb7a789] : Merge branch 'bugfix/mid-registrar-store-contacts-as-aors' 2017-11-15 Liviu Chircu * [016da2f7f] : mid_registrar: Fix CSeq handling for De-REGISTERs Keep track of outgoing CSeq values and use this value during self-generated de-registrations, rather than using the tm's built-in default CSeq value of "13". 2017-11-15 Liviu Chircu * [7e190a8b1] : mid_registrar: Fix NAT issues in "contact" insertion mode This patch completely reworks the saving/matching logic with regards to the SIP contacts generated by the mid-registrar. It is only relevant to working modes "0" (mirror) and "1" (contact throttling). The former logic (encoding the requests's Contact as a URI parameter of the outgoing contact) was somewhat stateless, as it would forward requests to the mid-registrar's contacts directly to their actual Contact URIs (UA side). When NAT comes into play, this no longer works well. Fortunately, the user location already handles this problem. Thus, we change the mid-registrar to advertise contact IDs instead of the device's contact. As requests arrive for the contact IDs, we are easily able to look up their corresponding user location AoR, contact, along with any other useful information for NAT traversal. 2017-11-15 Liviu Chircu * [8c46ab3ca] : mid_registrar: Fix possible crash in mirror mode 2017-11-15 Liviu Chircu * [ad274fad9] : usrloc: Add urecord reference counting mechanism This mechanism is required by the mid-registrar, which needs to "reserve" contact IDs while the main registrar decides upon them. This means that a blank urecord structure must be kept alive during this process. By reference counting the blank urecord structures, we prevent them from being cleared by the timer before the outgoing registrations get a chance to receive a reply. 2017-11-15 Liviu Chircu * [7d4894943] : usrloc: Allow forced IDs during contact inserts 2017-11-15 Liviu Chircu * [15a5067b2] : usrloc: Add some useful API functions * get_ucontact_from_id() - fetch both ct and rec from an id * next_contact_id() - fetch and advance the current ct counter 2017-11-15 Liviu Chircu * [e9be01680] : Add str2int64() parsing function 2017-11-15 Liviu Chircu * [a5d633924] : Fix int2str() function signature Although implemented to be able to print 64-bit integers, int2str() downcasted all of its parameters to an "unsigned long" type, thus breaking behavior on 32-bit architectures. 2017-11-14 Liviu Chircu * [18a93c89a] : usrloc: Fix locking for contact_id-based deletion The delete_ucontact_from_id(), get_ucontact_from_id() pair of functions were masking possible code execution paths which would lead to unsafe memory access. This, in turn, would cause the ping_checker_timer() job of nathelper to occasionally crash and burn. Reported by solo@astercc.org. 2017-11-14 Liviu Chircu * [d4967201b] : usrloc API: Make get_urecord() more robust Zeroize the output pointer if record is not found. 2017-11-13 Liviu Chircu * [7585f88cc] : mod stats: Fix unhandled corner-case Do not crash on NULL pointer input. 2017-11-13 Liviu Chircu * [63c1a844b] : clang: Add "-Wall" flag 2017-11-09 Razvan Crainea * [d67fbb980] : rtpengine: do not use replace bson for delete Prevent the module for using replace-* attributes for any other operation than offer or answer. This allows you to use the rtpengine_manage() function easier. Reported by Edwin Hoff 2017-11-09 Razvan Crainea * [b9ca13a64] : db_sqlite: let the DB interface determine the capabilities This prevens the module from advertising bogus capabilities - in this case the sqlite module was saying that it has the ASYNC RAW queries support, although it didn't. Reported by Wilhelm Lundgren on list 2017-11-03 Bogdan-Andrei Iancu * [830d2b4f5] : Reduce char size to 255. Old 256 size is loo large for char and blob should be used. Reproted by @adivjoseph in the #8ce5a92 commit. 2017-11-01 Liviu Chircu * [18e95e6e9] : doc: Fix formulas for FS-driven routing Also add a useful example 2017-11-01 Razvan Crainea * [069a8f6d1] : debian: add lsb-release dependency Suggested by Nick Altmann to fix stretch and xenial build errros 2017-10-31 Razvan Crainea * [fe21351f3] : siprec: remove quotes if used 2017-10-31 Razvan Crainea * [d4fdc854f] : move all debian files in a single directory 2017-10-27 Liviu Chircu * [fbb54143e] : clusterer: Add "proto_bin" module dependency 2017-10-27 Bogdan-Andrei Iancu * [60d161d44] : Fix creating the profiles list in the dlg_list_ctx MI command The profiles are not array, but list as they have different names for the nodes.Reported by Vladimir Dubov (@vovad) Closes #1166 2017-10-27 Razvan Crainea * [19ceff23a] : sms: increase pin buffer to avoid warnings 2017-10-27 Razvan Crainea * [608433323] : debian: add libbson-dev dependency 2017-10-27 Razvan Crainea * [d19215dcb] : sst: fix MIN-SE header printing 2017-10-27 Razvan Crainea * [d0dc4ecbe] : mongodb: fix warning 2017-10-27 Razvan Crainea * [ca7164dea] : rtpproxy: fix uninitialzied warning 2017-10-27 Razvan Crainea * [ff9243c0e] : rtpengine: fix uninitialized warning 2017-10-26 Bogdan-Andrei Iancu * [97c299877] : Fixed trace URI identification for the non-SIP protos. In the e59a7399e982ef58a7a12ffb53d8aa8432f537ab commit, I broke the hash based matching logic, so tracing for non-sip (xlog, net, rest) was affected. 2017-10-26 Răzvan Crainea * [fe801ac5c] : Merge pull request #1159 from bradleyjokinen/add-cgrates-disconnect-cause cgrates: add DisconnectCause for CDRs 2017-10-25 Liviu Chircu * [3a1d80533] : mid_registrar: Add "next hop" awareness The mid_registrar must preserve the values of both $ru and $du, in order to replicate the same behavior for its De-REGISTER requests. 2017-10-25 Liviu Chircu * [fc5762694] : mid_registrar: Fix crash on missing Contact ";expires" Correctly process contact expirations on 200 OK replies in "db_mode = 1". Reported by Jim DeVito. 2017-10-24 Razvan Crainea * [ff458af3e] : travis: add slack notifications 2017-10-24 Razvan Crainea * [f53a74f5a] : db_virtual: fix previous commit 2017-10-24 Razvan Crainea * [4c7cbb7e0] : db_virtual: provide DELETE capabilities for ROUND mode 2017-10-24 Razvan Crainea * [052756097] : db: do not compute capabilities Do not compute capabilities for modules that pre-populate them. This fixes an issue where the db engine was overwriting the db capabilities of db_virtual. Thanks go to Jonathan Hulme for reporting and providing testing environment 2017-10-19 Bogdan-Andrei Iancu * [ec8d6a982] : Fix init of the cachedb related module params Init val_prefix, noval_prefix and size_prefix before general cachedb init. Credits go to @Tinet-AaronAn Closes #1203 2017-10-17 Bogdan-Andrei Iancu * [2a594ef21] : README files regenerated 2017-10-17 Bogdan-Andrei Iancu * [2f3128687] : Regenerate to cover the "shutdown_on_error" new parameter 2017-10-17 Bogdan-Andrei Iancu * [e67a055fc] : Improved explanation on the "port" parameter. The port parameter sets the default port for the protocol, affecting both listeners and sending URIs. 2017-10-17 Bogdan-Andrei Iancu * [b5094f0dc] : Fix escaping URI parameters - skip alphanumerical chars. Reported by Ben Newlin on "user" mailing list. 2017-10-16 rvlad-patrascu * [ad35e7ced] : dialog: also share module flags when replicating dialogs 2017-10-16 rvlad-patrascu * [8c8f27f60] : dialog: fix a runtime bug with DLGCB_LOADED callbacks Relying on the fact that all modules that register dialog callbacks are initialised after the dialog module (thanks to module dependencies), we can run all DLGCB_LOADED callbacks at registration time and also keep them in a list for calling them later (i.e reloading from database via MI cmd or receiving replicated dialog). This fixes a series of bugs where the DLGCB_LOADED callback is not run during, e.g. "dlg_db_sync" MI command or received replicated dialogs which do not have their callbacks installed or run. 2017-10-13 Liviu Chircu * [c0cdc66b2] : drouting docs: Clarify behavior for the gateway "type" parameter (cherry picked from commit 9cf184ec74731bf6a4709ebdfacd09b0bc171365) 2017-10-13 Bogdan-Andrei Iancu * [8ce5a92a5] : Increased the attr size for dialplan rules to 256 Also be more tolerent with long attr strings. Simply truncate them rather than spitting an error. Reported by Pete Kelly Closes #1131 2017-10-13 Liviu Chircu * [568675291] : Integer fixups rework: Complete commit f37527dcf 2017-10-13 Liviu Chircu * [5c4db4f32] : dns_cache: Avoid incorrect error logs during startup 2017-10-12 Liviu Chircu * [6f54f780d] : proto_hep: Fix pkg memory leaks 2017-10-10 Liviu Chircu * [b10b14237] : drouting: Fix verbose log line 2017-10-06 rvlad-patrascu * [aa32bf1b6] : acc: fix possbile memory leak when calling do_accounting() on CANCEL while "report_cancels" modparam not set 2017-10-05 Liviu Chircu * [a8db3e45c] : cachedb_redis: Do not abort startup if Redis is unreachable This patch add the "shutdown_on_error" modparam, allowing the script writer to control the startup behavior of OpenSIPS (ignore/abort) when Redis is unreachable. Many thanks to Bernard Buitenhuis for sponsoring this feature. 2017-10-04 rvlad-patrascu * [3f39e0eb7] : clusterer: add script function to check if an IP address belongs to the cluster nodes 2017-10-04 Razvan Crainea * [6a0cd259c] : siprec: remove passive recorder to avoid any confusion 2017-09-29 Nick Altmann * [4de5bed3b] : siprec: add rpm packaging 2017-09-29 rvlad-patrascu * [34b13a7e2] : clusterer: fix ID parameters for script message received events 2017-09-29 Razvan Crainea * [a6956c70b] : siprec: add packaging 2017-09-28 Razvan Crainea * [0de3c072f] : siprec: fix uuid lib dependency 2017-09-28 Razvan Crainea * [98cf480fb] : Revert "siprec: fix uuid lib path" This reverts commit aa2cb9a90afdfa51cfc7841a6c8d8de74281d4ab. 2017-09-28 Razvan Crainea * [aa2cb9a90] : siprec: fix uuid lib path 2017-09-28 Razvan Crainea * [08280ab0a] : siprec: add libuuid dependency 2017-09-28 Razvan Crainea * [4a17aa5f3] : siprec: add README file 2017-09-28 Razvan Crainea * [76047f177] : siprec: refactor files names 2017-09-28 Razvan Crainea * [e47b3c491] : siprec: add failover logic 2017-09-28 Razvan Crainea * [bccc92a18] : siprec: make media port configurable 2017-09-28 Razvan Crainea * [e013471c7] : siprec: remove useless functions and stats 2017-09-28 Razvan Crainea * [17741adfe] : siprec: add support for reinvites 2017-09-28 Razvan Crainea * [4c8f3abb3] : siprec: cleanup 2017-09-28 Razvan Crainea * [6e82ceb12] : siprec: make sessions restart persistent 2017-09-28 Razvan Crainea * [1b0cc0bb5] : bin: build backet from buffer 2017-09-28 Razvan Crainea * [2a460a2ab] : siprec: fix dialog reference in case of error 2017-09-28 Razvan Crainea * [d4fd99d61] : siprec: fix modules dependencies 2017-09-28 Razvan Crainea * [49aafbdbc] : siprec: add socket support 2017-09-28 Razvan Crainea * [c37878a27] : siprec: fix to checking 2017-09-28 Razvan Crainea * [6e4dda46f] : siprec: fix references 2017-09-28 Razvan Crainea * [1d3e6086b] : memory: prevent crash at shutdown 2017-09-28 Razvan Crainea * [fe98342c2] : siprec: add ref logic to prevent session from being lost 2017-09-28 Razvan Crainea * [f2c42e379] : siprec: add group support and caller/callee info 2017-09-28 Razvan Crainea * [b6f2f84ba] : modules/siprec: use rtpproxy server instead of set 2017-09-28 Razvan Crainea * [d774a30c9] : rtpproxy: use a proxy instead of a set 2017-09-28 Razvan Crainea * [2fe95dc18] : siprec: move b2b key in shm 2017-09-28 Razvan Crainea * [d36d1be6f] : siprec: add participants and uuids Finished PoC 2017-09-28 Razvan Crainea * [16f6e6b54] : utils: move base64 length compute to macros This allows us to initialize data for static variables, such as uuid 2017-09-28 Razvan Crainea * [f0d2a8734] : siprec: engage recording in initial request 2017-09-28 Razvan Crainea * [573e5d81e] : siprec: start recording for sessions 2017-09-28 Razvan Crainea * [2ad845014] : rtpproxy: fix typo in set checking 2017-09-28 Razvan Crainea * [7b5799611] : rtpproxy: provide media stream to copy 2017-09-28 Razvan Crainea * [c0959f8cd] : sdp: store each attribute in stream and session 2017-09-28 Razvan Crainea * [7876b11b9] : rtpproxy: add start_recording command 2017-09-28 Razvan Crainea * [6e68145a5] : siprec: use rtpproxy interface 2017-09-28 Razvan Crainea * [9e4d21296] : rtpproxy: add interface skeleton 2017-09-28 Razvan Crainea * [25fbf3063] : siprec: initial poc Only builds SDP from two different bodies 2017-09-28 Razvan Crainea * [c4e261aff] : msg_translator: move OSS-boundary in header 2017-09-28 Razvan Crainea * [4e3326842] : sdp: store msg body in streams and sessions 2017-09-28 Razvan Crainea * [f9a886f17] : msg_translator: add contact_builder function 2017-09-28 Razvan Crainea * [2ddffd269] : mod_fix: add fixup_free_spve functions 2017-09-28 Liviu Chircu * [b9d409a86] : drouting: Fix mispelled error log 2017-09-28 Liviu Chircu * [f37527dcf] : Rework the integer fixup functions The current integer fixup interface does not allow module developers to distinguish between "missing integer parameter" and "zero value integer parameter". This may lead to some unexpected/unintented behavior in some cases. For example, this currently causes any type "0" drouting gateway to act as the special type "-1" (global match). 2017-09-26 rvlad-patrascu * [dc3f6eafb] : clusterer: support dynamic topology discovery for nodes not provisioned in the DB. For an instance running in non-DB mode, provisioning information about the current node and other neighbours in the cluster should be defined in the script through module parameters. 2017-09-26 rvlad-patrascu * [a822b56c6] : clusterer: don't require any fields in the DB for the topology establishing mechanism 2017-09-25 Răzvan Crainea * [675164c74] : Merge pull request #1195 from etamme/master check if trace id node exists before de-reference (fix segfault) 2017-09-25 Eric Tamme * [8ba5c8aa4] : check if trace id node exists before de-reference (fix segfault) 2017-09-21 Bogdan Andrei IANCU * [bf1c6de3c] : Merge pull request #1168 from sippy/master_freebsd_fix Fix some minor build issues on FreeBSD 2017-09-21 Răzvan Crainea * [1bd368bb2] : Merge pull request #1083 from jleren/debian-sqlite-module Added SQLite module to debian packaging 2017-09-21 Răzvan Crainea * [7f3a5e97b] : Merge branch 'master' into debian-sqlite-module 2017-09-21 Bogdan Andrei IANCU * [2a64a1455] : Merge pull request #1191 from etamme/master fix memory leak in cpl-c write_to_db 2017-09-21 Razvan Crainea * [6c1a79d29] : add sqlite for jessie and wheezy Fix provided by Nick Altman 2017-09-15 Razvan Crainea * [b7f9ca331] : siptrace: allow capturing on any port reported by Eric Tamme from OnSIP 2017-09-14 Bogdan-Andrei Iancu * [0c8d59777] : Fix bogus error message (probabaly copy paste error) Credits for the fix go to Michael Mavroudis. (cherry picked from commit 9e497ea4ab03c67cb073bdf0dccef2b16bff80e2) 2017-09-13 Razvan Crainea * [99af2fc44] : proto_wss: release lock even if write fails Detected and fixed by Eric Tamme from OnSIP 2017-09-12 Razvan Crainea * [b0eb928e7] : parse_fline: fix implicit cast sign 2017-09-12 Razvan Crainea * [e113e147c] : proto_wss: write all TLS chunks under a single lock Reported by Eric Tamme from OnSIP 2017-09-08 Eric Tamme * [9ef3aacce] : add back missing return 2017-09-08 Eric Tamme * [308662a9b] : free db_hdl and res after doing a db write - memory leak 2017-09-04 Razvan Crainea * [07c3b1059] : travis: add IRC notifications 2017-08-31 Liviu Chircu * [396dca37c] : mid_registrar: Fix commit 496e2dcc Suggested by Chad Attermann Fixes #1178 Fixes #1187 Fixes #1184 2017-08-31 Liviu Chircu * [eb992099e] : freeswitch: Update the assumed heartbeat interval Assuming a 1 second heartbeat interval setting on the FS boxes (the minimum) is a good compromise between performance and near-realtime rate of update for the balancing weights. (cherry picked from commit 2778a511646dc6e90f2320985bc159476a83639a) 2017-08-31 rvlad-patrascu * [ea231c023] : siptrace: fix type for message DB column value, str instead of blob (cherry picked from commit 36f43169e238a53f7c077832f4d968ca8be38b4f) 2017-08-31 Razvan Crainea * [d8854637e] : ratelimit: fix buffer overflow when using SBT algorithm Make sure the window doesn't overflow Fixes #1176 2017-08-31 Liviu Chircu * [4b9f34d6b] : mid_registrar: Avoid some memory leaks on parsing errors Also improve mri_free(): avoid redundant checks on non-NULL fields. Suggested by Chad Attermann 2017-08-31 Liviu Chircu * [496e2dcc2] : mid_registrar: Fix a tm callback race condition Commit f522b0ef089 is incomplete, since the tm's TMCB_RESPONSE_IN callbacks are actually not mutually exclusive. We fix this by protecting the tm parameter read/overwriting with an SHM'ized rw lock. Reported by Chad Attermann 2017-08-31 Liviu Chircu * [12ab75ad9] : mid_registrar: Properly update timestamps on usrloc inserts This avoids a buggy forward of the 2nd REGISTER to the main registrar, after which behavior would correct itself anyway. Affected modes: 1 and 2. Also refactor a small code block. 2017-08-30 Liviu Chircu * [f522b0ef0] : mid_registrar: Fix mem corruption on SIP retransmissions The TMCB_RESPONSE_IN function gets called once per each retransmission, and we want to avoid this in the mid_registrar code. Since the callbacks themselves are mutually exclusive, we can get away with zeroizing our own parameter after the first run. A better way of fixing this would be to extend the tm callback API to include SIP retransmission preferences. 2017-08-30 Liviu Chircu * [ee2370071] : mid_registrar: Fix missing expiry values in mode = 2 Proper handling when forwarding REGISTER requests with missing Expires hf. 2017-08-30 Liviu Chircu * [1143419b7] : mid_registrar: Improve De-REGISTER behavior in mode = 2 Do not auto-reply to de-registrations for the last contact in AoR throttling mode, but forward them to main registrar first. Additionally, avoid auto-generating De-REGISTER messages for contacts that were deleted through a De-REGISTER to begin with (and did not expire or get deleted through the remove() script function). 2017-08-30 Liviu Chircu * [803d5d3a4] : mid_registrar: Fix un-initialized global variable 2017-08-29 Liviu Chircu * [d71cb43e8] : sipmsgops: Adapt SDP iteration code to the new format Reported by Denis Fixes #1181 2017-08-29 Razvan Crainea * [83669d2ca] : dialog: do not allow callbacks in state DELETED If these callbacks would have been registered, they will be never ran, but the free function will still be called. This breaks some modules (such as acc), which rely the function will be called. 2017-08-29 Razvan Crainea * [f1aabeaf9] : acc: prevent multiple CDRs in case of retransmissions 2017-08-25 Liviu Chircu * [b763544ad] : sipcapture: Fix uneditable "custom_fieldX" columns This allows the script writer to optionally provide data for the "custom_field1", "custom_field2" and "custom_field3" columns using sip_capture(). 2017-08-25 Liviu Chircu * [71af8fcd4] : sipcapture: Fix segfault when proto_hep is not loaded 2017-08-25 Liviu Chircu * [bcae3a0e1] : mid_registrar: Improve resilience in some corner-case scenarios * do not crash with usrloc replication (although it's not supported) * handle registrar + mid_registrar concurrently Fixes #1172 Fixes #1183 2017-08-24 Liviu Chircu * [4d028f716] : statistics: Improve the stat group parser Although we break backwards-compatibility, we actually fix the logic to be closer to what users would expect. For example, a "method:register:auth" statistic is more naturally interpreted as: { "group": "method", "stat": "register:auth" } (new behavior) rather than: { "group": "method:register", "stat": "auth" } (old behavior). 2017-08-22 Liviu Chircu * [e3be4a13d] : sipcapture: Fix primary key issues with PostgreSQL Postgres handles zero-value auto-increment columns which are part of composite primary keys differently than MySQL. Omitting the column altogether from the INSERT statements rather than setting it to zero leads to the expected behavior on both platforms (i.e. "always try to insert a unique id"). Thanks to Jennifer Hashimoto for reporting and troubleshooting 2017-08-21 Bogdan-Andrei Iancu * [4aa5fb91a] : Fixed deadlock in CANCEL handling. Reported by Maxim Sobolev 2017-08-18 Liviu Chircu * [7a5e2c7b4] : cachedb_mongodb: Avoid redundant mongoc_init() calls mongoc_init() is using pthread_once() anyway, so we might as well avoid calling it multiple times. 2017-08-18 Liviu Chircu * [7587326d3] : cachedb: Improve error reporting for bad connect strings Based on an original report+patch provided by @jalung on GitHub. 2017-08-18 Liviu Chircu * [c2a0e7e71] : registrar: Fix possible crash with remove() When using usrloc "use_domain = 1", the registrar remove() function could cause OpenSIPS to crash due to some uninitialized struct. Based on an original report+patch provided by @jalung on GitHub. 2017-08-18 Liviu Chircu * [de0e58a59] : usrloc: Fix contact matching with db_cachedb Based on an original report+patch provided by @jalung on GitHub. 2017-08-18 Liviu Chircu * [18045793a] : cachedb_mongodb: Fix several issues * fix startup crash when libmongoc is compiled with --disable-automatic-init-and-cleanup * add silent startup dependency with tls_mgm module, since both modules attempt to perform TLS initialization * add proper handling for NULL and ObjectID types * fix a bson iteration bug, causing find() to skip 1st doc * fix a bug in kvo_to_bson(), causing OpenSIPS to crash * fix compile errors on some platforms due to "str" var names Based on an original report+patch provided by @jalung on GitHub. Closes #1135 Closes #1163 2017-08-17 rvlad-patrascu * [06fa801a9] : clusterer: add new clusterer MI commands for dispatching any other MI command in a cluster. The "cluster_send_mi" command dispatches an MI command to be executed on specified node. "cluster_broadcast_mi" dispatches a command to the entire cluster and also runs it locally. 2017-08-16 Liviu Chircu * [8338fd48e] : acc: Improve documentation 2017-08-16 Liviu Chircu * [efdc829db] : Improve some logs 2017-08-16 Razvan Crainea * [1885c0d46] : event_xmlrpc: rebuild buffer for each event This prenvets crashes when multiple xmlrpc subscribers are used 2017-08-04 rvlad-patrascu * [52f651440] : Fix more references to deprecated keywords in example cfgs and READMEs. 2017-08-03 Razvan Crainea * [db5d1bddc] : cgrates: return OK as a successful result Before that it was returning 0, which was not consistent to what cgrates was expecting 2017-08-03 Bogdan-Andrei Iancu * [bb573a1f5] : Run TMCB_MSG_SENT_OUT callbacks only if the msg was successfully sent out. This fix prevents tracing SIP messages which were actually not set out (due network related issues). 2017-08-01 Bogdan-Andrei Iancu * [68419e3ba] : Fix missing handling on LAUNCH triggering in extra timer proc. 2017-08-01 Liviu Chircu * [fce1f4730] : mid_registrar: Normalize registration expiries in AoR throttling 2017-08-01 Bogdan-Andrei Iancu * [e59a7399e] : Propagate the tracing context via function param. Inside SIPtrace module propagate the tracing context as function param instead of relying on the processing context - there are cases were we have no processing context (like retransmissions). 2017-08-01 Bogdan-Andrei Iancu * [528f1cae8] : Revert 0f7e72efcd879ef0d11bf133c132140f80bc841d A following fix will address this particular problem in a more generic way 2017-07-31 Liviu Chircu * [21322d64e] : Allow memory dumps to be enabled at runtime Memory dumps and full memory logging can now also be enabled by setting "log_level = 14" and "log_level = 15", respectively, without having to restart OpenSIPS and set a proper value for "memdump" / "memlog". 2017-07-31 Liviu Chircu * [df374c635] : mid_registrar: Fix broken "Path:" URIs when using domains The module now properly handles usrloc's "use_domain = 1". 2017-07-28 rvlad-patrascu * [1812a05dd] : clusterer: Add module functions for sending generic clusterer messages at script level. Also introduce the events: E_CLUSTERER_REQ_RECEIVED and E_CLUSTERER_RPL_RECEIVED, corresponding to two types of messages, request-like and reply-like, in order to handle received messages. 2017-07-27 Bogdan Andrei IANCU * [77e678a6a] : Merge pull request #1164 from caringi/master db_mysql: fix build against MariaDB 10.2 2017-07-27 Liviu Chircu * [47af7de23] : mid_registrar: Fix some AoR throttling bugs #2 * report proper expiration time back to the UAC when the main registrar shortens the lifetime on the virtual Contact * properly handle auth'ed registrations (completes commit aa5366796) 2017-07-27 Liviu Chircu * [0831d9a3a] : mid_registrar: Code refactoring 2017-07-27 Augusto Caringi * [f5abcccca] : db_mysql: fix build against MariaDB 10.2 Fixes the following build error while building against MariaDB 10.2 library: my_con.c: In function 'db_mysql_connect': my_con.c:68:10: error: 'MYSQL {aka struct st_mysql}' has no member named 'reconnect' ptr->con->reconnect = 0; ^~ In this new version of the library the reconnect field was moved to another struct. Setting it through API seems to be a better approach. 2017-07-27 Liviu Chircu * [597695cdb] : mid_registrar: Fix some AoR throttling bugs * prevent AoR throttling lookups from using "rid" * always mangle contacts in AoR throttling, regardless of "insertion_mode". This prevents lookup issues in "Path" insertion mode with clients that are using auto-generated Contact usernames. 2017-07-27 Liviu Chircu * [450906194] : Remove some deprecated script grammar rules The following types of statements no longer have any meaning/purpose after the removal of core keywords - the script should not allow them anymore. $var(foo) = bar123; if ($var(foo) == BAR123) ... 2017-07-27 Bogdan-Andrei Iancu * [160b42410] : Avoid locking during shutdown Do not do locking when running the destroy handler, as we may get into a deadlock (if a worker process got killed while holding the lock). 2017-07-27 root * [a79647d1d] : Gracefully handling missing or malformed Contact and Expires headers in REGISTER requests. (cherry picked from commit 605098bb0697f78f3ae41eb50c8360d6ff6d6092) 2017-07-27 root * [e003d4a4f] : Gracefully handling missing or malformed Expires header in REGISTER request. (cherry picked from commit 747dcdb6f245316ff6103b4f3fe44a1014c8eb1b) 2017-07-26 Vlad Paiu * [2bfcf7dd9] : Fixed branch flags propagation to the event 2017-07-26 Liviu Chircu * [0017951f3] : mid_registrar: Add a useful startup error case 2017-07-26 Liviu Chircu * [f30217538] : rest_client: Update documentation Reported by Tito Cumpen 2017-07-26 Liviu Chircu * [071f6c7da] : Allow multi-line "pvar list" strings This directly improves avp_db_query() and cache_raw_query(), allowing the following (notice param #2): avp_db_query(" SELECT table_name, table_version FROM version", "$avp(tn), $avp(tv)"); 2017-07-25 Razvan Crainea * [91da5063d] : ratelimit: fix documentation typo 2017-07-25 Bogdan-Andrei Iancu * [f0e36896b] : Fixed wrong TLS parameters. TLS configuration parameters were moved from proto_tls to tls_mgm module. Credits to Mike Tesliuk for reporting this. 2017-07-25 Răzvan Crainea * [5a7fad1ae] : Merge pull request #1167 from sippy/mod.rtpproxy_iodebug Increase amount of debug produced by the rtpproxy module on error 2017-07-25 Maksym Sobolyev * [60c80b298] : Rename LIST_HEAD() macro into OSIPS_LIST_HEAD() to avoid collision with the BSD's sys/queue.h that declares macro with the same name. That include is pulled in by some other system includes and that breaks the build. 2017-07-25 Maksym Sobolyev * [30d27a0b8] : Add missed includes required on the *BSD systems to get struct in_addr defined. 2017-07-25 Maksym Sobolyev * [e43ba9e7e] : Increase amount of debug produced by the rtpproxy module when read() or recv() from the rtpproxy fails to also include relevant errno. This is to debug sporadic errors during the module initialization phase, such as: Jul 24 21:53:41 [21066] ERROR:rtpproxy:send_rtpp_command: can't read reply from a RTP proxy Jul 24 21:53:41 [21058] ERROR:rtpproxy:send_rtpp_command: can't read reply from a RTP proxy Jul 24 21:53:41 [21058] ERROR:rtpproxy:send_rtpp_command: proxy does not respond, disable it Jul 24 21:53:41 [21066] ERROR:rtpproxy:send_rtpp_command: proxy does not respond, disable it Jul 24 21:53:41 [21066] WARNING:rtpproxy:rtpp_test: RTP proxy went down during version query Jul 24 21:53:41 [21066] WARNING:rtpproxy:rtpp_test: support for RTP proxy has been disabled temporarily Jul 24 21:53:41 [21066] ERROR:core:tcp_start_processes: failed to send 0 status code Jul 24 21:53:41 [21067] ERROR:rtpproxy:send_rtpp_command: can't read reply from a RTP proxy Jul 24 21:53:41 [21067] ERROR:rtpproxy:send_rtpp_command: proxy does not respond, disable it Jul 24 21:53:41 [21067] WARNING:rtpproxy:rtpp_test: RTP proxy went down during version query Jul 24 21:53:41 [21067] WARNING:rtpproxy:rtpp_test: support for RTP proxy has been disabled temporarily 2017-07-24 Bogdan-Andrei Iancu * [0f7e72efc] : Add siptrace contact for in request (needed by ACK handling) 2017-07-24 Razvan Crainea * [8ba6567f2] : b2b_entities: fix b2b key memory leak 2017-07-21 Bogdan-Andrei Iancu * [6eec7f950] : Fixed missing traced SIP messages. The following SIP messages were not traced by SIP trace: * 100 trying generated by OpenSIPS * incoming ACK for negative replies * outgoing ACK to negative replies * incoming replies to CANCEL requests * incoming request retransmissions * outgoing request retransmissions * outgoing reply retransmissions The fix introduced two new TM callback to get access to the lowest level in TM message handling: * matching a SIP message to the transaction * sending a SIP message related to the transaction 2017-07-19 Liviu Chircu * [aa2b42ca6] : Debian packaging: Improve INSTALL_PREFIX logic * now also alters the install paths of configuration files * "dh_usrlocal" is now automatically overriden, if needed (i.e. if INSTALL_PREFIX begins with "/usr/local/") * the "opensips.init" script paths are now properly updated 2017-07-19 Liviu Chircu * [45a98e187] : Debian packaging: Fix source tarball name for "dev" sources 2017-07-19 Liviu Chircu * [a7eb448ed] : Debian packaging: Add a global INSTALL_PREFIX 2017-07-19 Liviu Chircu * [0e1029b1f] : exec: Improve documentation * fix incorrect AVP example * clarify the line-oriented nature of "stdout" and "stderr" 2017-07-19 Liviu Chircu * [8a1b3ef3e] : exec: Improve environment AVP typing Reported by Tito Cumpen 2017-07-17 Liviu Chircu * [15f151b96] : menuconfig template: Fix typos / improve TCP detection logic 2017-07-17 rvlad-patrascu * [eecdac348] : Update module docs for keywords removal. 2017-07-17 rvlad-patrascu * [4aa8279cc] : Remove core keywords from default configuration scripts. 2017-07-17 Bogdan-Andrei Iancu * [d1d897ebc] : Fix replicating NULL socket in contact A contact added by ul_add MI contact has a NULL contact, so take care on this during contact replication. Also, when receiving a replicated contact with NULL socket, do not discard it, but simply set NULL socket. Reported by Samusenko Andrej on user mailing list 2017-07-14 Bogdan-Andrei Iancu * [dcf591544] : Fix incorrect bug log. A missing tracing context in the SL_reply_out callback is perfectly valid - if you send from script a reply (se_send_reply) without doing any sip_trace() before. (cherry picked from commit 5a4550b23deb137db33c50fb6fcf773392d31940) 2017-07-13 Liviu Chircu * [d507a864f] : opensips.vim: Update syntax 2017-07-13 rvlad-patrascu * [815d885a1] : Merge branch 'keywords_rework' 2017-07-13 Bradley Jokinen * [56bb24175] : cgrates: add DisconnectCause for CDRs 2017-07-13 rvlad-patrascu * [9c9252c97] : Remove keywords "method", "msg:len", "proto", "max_len". 2017-07-13 rvlad-patrascu * [6d8bb3c83] : Replace "af" keyword with "$af" script variable. 2017-07-13 Liviu Chircu * [5b9f7d3d1] : struct history tracker: Add API docs 2017-07-13 Liviu Chircu * [eb22f4eb0] : struct history tracker: Optimize memory allocations Especially useful when used with QM_MALLOC. 2017-07-13 Razvan Crainea * [991b3ef4f] : drouting: fix parameters specifications for gw detection functions 2017-07-13 rvlad-patrascu * [2ca34ff01] : clusterer: prevent crash when calling module destroy function before initializing DB handler. 2017-07-12 rvlad-patrascu * [7113323c8] : Remove "src_ip", "dst_ip", "src_port" and "dst_port" keywords and allow any script variable to be compared wih IPs and netmasks. 2017-07-12 Liviu Chircu * [aa5366796] : mid_registrar: Fix authenticated registrations This applies to both throttling modes (contact and AOR). Closes #1156 2017-07-12 Razvan Crainea * [e2f9d8fc7] : acc: restore new_uri in case an error occurs on reply 2017-07-11 Liviu Chircu * [7d024fa97] : struct history: Fix mem leak 2017-07-11 Liviu Chircu * [6b612a079] : struct history: Fix the support for memory-only logging 2017-07-11 rvlad-patrascu * [d29733d61] : Second parameter of "is_myself" is now also a quoted string that should contain a pvar or port number. 2017-07-06 rvlad-patrascu * [905a18ce3] : Remove core keywords related to URIs: "uri", "from_uri" and "to_uri". 2017-07-05 Liviu Chircu * [02da97c96] : struct history tracker: Several logging improvements * fix potentially missed logs * allow logs to be matched in highly concurrent environments 2017-07-05 rvlad-patrascu * [de76c2d19] : Remove core value "myself" and offer approximately the same features via a new core function "is_myself". 2017-07-05 Liviu Chircu * [ceb6528d2] : freeswitch: Mitigate effects of the shutdown cleanup problem Since the FS conn manager process is often polling _after_ having acquired a read lock, any standard OpenSIPS shutdown while the FS module is enabled would have a high chance of deadlocking the attendant. 2017-07-04 Liviu Chircu * [4a628f411] : struct history tracker: Rework verb defining and printing Thanks to Răzvan for suggesting the sweet cpp trick 2017-07-04 Liviu Chircu * [9957ff2d9] : pua: Fix several locking & memory access bugs Several issues with publ_cback_func(): * 1 x extra lock release upon breaking "send publish" loop * N x extra lock releases inside the loop, per each failed publish * invalid memory access on "presentity" ptr after send_publish_int() 2017-07-04 Bogdan-Andrei Iancu * [e08d54e6b] : Destroy the TCP conn even if the WS link has missing data. Perform full conn destroy (in the TCP network layer) even if the WS link doesn't have (very unlikely) the proto-specific data attached. 2017-07-04 Bogdan-Andrei Iancu * [e2f872598] : Fixed memory leak on proto TLS tracing. Free the tracing data (if any) when the TLS connection is destroyed 2017-07-04 Bogdan-Andrei Iancu * [059545765] : Fix tracing race condition on SSL based connects When performing a connects (required by a write op) for a SSL enabled connection, the returning handshake make lead to a concurent read on the same connection. And the read op will try to dump the traced data aquired by the write (connect) op -> different processes, different memory chuncks To avoid such probles, the "connect" tracing will be flushed on write (a connect is always trigger by a write need) and the "accept" tracing will be flushed only on read (an accept is always followed by a read). 2017-07-04 Liviu Chircu * [e9a2dc24e] : struct history tracker: Fix some subtle locking bugs * possible memory corruption due to unsafe mem writes * deadlock on oom 2017-07-04 Liviu Chircu * [6675c6e8a] : struct history tracker: Include object name in API 2017-07-03 Liviu Chircu * [969e1b7b1] : struct history tracker: Improve log flushing behavior 2017-07-03 Bogdan-Andrei Iancu * [05ece7940] : Remove bogus auto conversion from SIP uri to TEL uri For ancient reasons, a SIP URI with user=phone was automatically converted to a TEL URI. Such conversion, automatically done, is dangerous - there is nothing in the RFC3261 stating something like this. Even more, the conversion is not complete - besides moving the username parameters to URI parameters, the domain is not stripped and the TEL not added. 2017-07-03 Bogdan-Andrei Iancu * [c4c84f1e3] : Set some default value for "already", to avoid bogus printing. Reported by Ovidiu Sas (cherry picked from commit e1497271f02966736de834c35bf5943d0fd9ef0b) 2017-06-30 Liviu Chircu * [6b68fa846] : Allow config file to be read from stdin Via the "-f -" command-line option 2017-06-30 Razvan Crainea * [2c9d86019] : clusterer: prevent crash when calling send_to after destroy (cherry picked from commit 5928e4606f21522736f42874b251452ac1e2e24e) 2017-06-30 Razvan Crainea * [802579283] : acc: fix substitutions typo 2017-06-29 Bogdan-Andrei Iancu * [b60780c50] : Downgrade severity and extra loging on epoll self healing 2017-06-29 Liviu Chircu * [5c407c64c] : exec: Improve docs for "time_to_kill" Reported by Tito Cumpen 2017-06-28 Ovidiu Sas * [5cb01c85f] : tls_mgm: fix warning: ‘port’ may be used uninitialized in this function [-Wmaybe-uninitialized] 2017-06-28 Liviu Chircu * [9e07f3f36] : cfg parser: Fix underflow with an empty mpath 2017-06-28 Bogdan-Andrei Iancu * [805c0e2f3] : Related to prev fix - dialog table has no PK 2017-06-28 Bogdan-Andrei Iancu * [0f36c9d0f] : Fix granting permissions on the PK of location table. As the PK column has a custom name "contact_id", it needs special handling when granting permissions upon PSQL DB creation. 2017-06-27 Bogdan-Andrei Iancu * [51859e045] : Do not expose the transaction when t_newtran() detects a retransmission It is much safer and consistent to avoid exposing the transaction when retransmision is detected; t_newtran() anyhow is automatically taking care of the retransmission handling, so makes no sense to expose the transaction further. 2017-06-27 Bogdan-Andrei Iancu * [0f9e65fef] : Set proper UPDATED flag upon cloning. IF the cloning is full (with the updatable part too), set the UPDATED flag too 2017-06-26 Razvan Crainea * [b1dd0cae3] : rtpproxy: allow module to specify the name of the recording This also allows rtpproxy to stream media to a remote destination. 2017-06-26 rvlad-patrascu * [37d98b00e] : All script transformations now return NULL instead of empty string for unsuccessful operation or errors. Also allow NULL as input in order to support chaining transformations. 2017-06-26 rvlad-patrascu * [71ca5691c] : tls_mgm: fix skipping invalid TLS domain definitions in the script 2017-06-23 Liviu Chircu * [6b03023d2] : TCP engine: Fix incorrect returned bytes on async writes This isn't actually as bad of a bug as it would seem. By occasionally reporting _less_ written bytes than normal, the TCP write flow may trigger some false async write requests to TCP MAIN. The connection will eventually end up in a writer which simply sends it back, as it does not contain any chunks which require writing. 2017-06-23 Liviu Chircu * [951f7e10d] : Fix a bug in is_ws() Reported by Răzvan 2017-06-22 rvlad-patrascu * [ad8fbaf99] : tls_mgm: properly start up even if there are invalid TLS domain definitions in DB 2017-06-22 Liviu Chircu * [8845fd795] : TCP engine: Fix the TCP worker duplicate connection check 2017-06-22 Liviu Chircu * [a7249f03d] : TCP engine: Fix misleading logs 2017-06-22 Bogdan-Andrei Iancu * [ade9c93d8] : Triggered fds with no fd_map are reported and removed from epoll If epoll triggers on a fd that has a cleared (removed) fd_map, remove it from epoll. 2017-06-22 Razvan Crainea * [d5fca4482] : net/tcp: do not reset conn proc_no as a writer when releasing a conn as a writer, do not reset the process owner of the conn, otherwise a reader will have to re-take it back. 2017-06-22 Chad Attermann * [e325e3eb2] : Skipping proxy ip:port append when use_domain enabled In aor-throttling mode, when usrloc use_domain is enabled the aor already includes the domain so there is no need to append the proxy ip:port to the aor in the Contact header that is relayed to the main registrar. (cherry picked from commit 4fb1581a42735483dc24658a6a7ba12d53ef20ab) 2017-06-21 Bogdan-Andrei Iancu * [34a25b733] : Do not replicate if not configured so Test if replication was set before trying to replicate the change of carrier status 2017-06-21 Bogdan-Andrei Iancu * [7249c95f9] : Fixed MI printing of tid (trace ID) URLs. Discard on-stack buffer and use formated printing for IP + port. Use MI_DUP_VALUE flag for adding the DB URL 2017-06-21 Liviu Chircu * [00d44e8bb] : regex transformation: Fix a double free bug Supplying a bad regular expression to {re.subst} would lead to a double pkg_free(). Credits to Nick Altmann for reporting / helping with troubleshooting 2017-06-21 Liviu Chircu * [8ba454be7] : Add optional TCP connection debugging code To include this code, both -DDBG_STRUCT_HIST and -DDBG_TCPCON compile flags must be defined under Makefile.conf 2017-06-21 Liviu Chircu * [3da3e8008] : tm: Remove unused/redundant tm_list_entry() macro 2017-06-21 Liviu Chircu * [f30a658c4] : Add support for generic struct troubleshooting Optionally includible via the -DDBG_STRUCT_HIST compile flag 2017-06-21 Liviu Chircu * [99181710c] : TCP engine: Fix a race condition related to con lifetime management Connections which received a read event concurrently with their expiration time could trigger an indefinitely long, CPU wasteful, rapid succession of back-forth passing of the connection object between TCP Main and a TCP worker process. The fix involves adding a TCP connection lifetime update in the TCP worker just after receiving the connection object from TCP Main (this is correct - there is some pending data, the connection is non-idle), before the expiration check is done. Thanks to Bogdan for helping with troubleshooting 2017-06-21 Liviu Chircu * [04e2d6e5f] : TCP engine: Fix ref counting bug in async writes TCP writes done by TCP workers were subject to an extra dereferencing operation, potentially leading to memory corruption due to SHM overwriting on freed tcp_connection structs. This patch eliminates the extra dereferening operation, while also taking care not to break the code for non-TCP worker writers, which will now have their passed connections dereferenced by TCP main. 2017-06-21 Chad Attermann * [8b52f1331] : Parameter "use_domain" not imported from usrloc Variable reg_use_domain is initialized to 0, but not imported from usrloc module as eluded in docs. Added import of "use_domain" parameter from usrloc module to initialize reg_use_domain (taken from registrar module). (cherry picked from commit a182a9445fcbc1679a7627bcc786c085fc304221) 2017-06-20 Razvan Crainea * [6e796ff56] : debian: add libbson-dev dependency Reported by Nick Altman 2017-06-20 Razvan Crainea * [53a4f9473] : dialplan: fix typo in previous commit 2017-06-20 Razvan Crainea * [b0258fa9d] : dialplan: proper error when no partition is defined 2017-06-19 Bogdan-Andrei Iancu * [34d98d82d] : Flag reset fixed; print flags as hexa 2017-06-19 Bogdan-Andrei Iancu * [0dfbad386] : Fix for prev+1 commit - fd=0 should be consider unset (as -1) 2017-06-19 Bogdan-Andrei Iancu * [b90094c46] : Fix prev commit - data may be null for valid fd maps (like timer jobs) 2017-06-19 Bogdan-Andrei Iancu * [ab26d0559] : Added extra code for sanity checks over reactor data 2017-06-17 Chad Attermann * [01e37f756] : Required CRLF missing in 200 OK response Addition of CRLF was mistakenly placed inside of check for Contact expires paramtere. Moved outside so that CRLF is always appended after last Contact header. (cherry picked from commit 78eaed807adf636a9448a3a0f9f0a77b4c879096) 2017-06-16 Bogdan-Andrei Iancu * [149d703c2] : Fix leak in use_next_gw() The leak occurs only when doing fallback between rules. (cherry picked from commit 911478b102576eb73e8c08989a0f6beb109821d9) 2017-06-15 rvlad-patrascu * [030bed9a8] : clusterer: start only if DB info is invalid, shutdown for other errors when loading from DB 2017-06-15 Liviu Chircu * [96ba9ed03] : exec: Fix incorrect pclose() calls on standard I/O streams Many thanks to Walter Doekes for detailing this issue (also including some minor code improvements) 2017-06-15 rvlad-patrascu * [edf519b93] : clusterer: start even if unable to load provisioning info from DB 2017-06-15 rvlad-patrascu * [24ad5dbae] : clusterer: properly init node info structures(memset to 0) 2017-06-15 Liviu Chircu * [f7a7fabcc] : core statistics: Fix a bad logical condition (regression from e90ac3e937de8) 2017-06-14 Bogdan-Andrei Iancu * [af584bc8f] : Fix memory leak in do_routing() (cherry picked from commit 3c0df80d3b5ec8dfb5e54e78cd84153266fbf0f7) (cherry picked from commit df9c76f216b190e12d2eccd57e3eb1be1196094c) 2017-06-14 rvlad-patrascu * [a043ee829] : presence: improve subs_phtable_list MI command * optionally filter listed subscriptions by "From" and "To" URIs * include Contact and first proxy from Record-Route in output 2017-06-13 Bogdan-Andrei Iancu * [4929bcee6] : Added auto-healing for reactor. If the epoll() fires a fd with a removed fd_map, better do not trigger the handler and remove the fd from epoll and fd_array 2017-06-13 Bogdan-Andrei Iancu * [0a3bfed03] : Intercept ECONNRESET and silently handle it as EOF 2017-06-13 Liviu Chircu * [df29102e9] : Do not exit startup sequences with unusable HP_MALLOC params 2017-06-13 Bogdan-Andrei Iancu * [4e7a14bd7] : Fix missing braken (introduced with previous commit) 2017-06-13 Bogdan-Andrei Iancu * [27a36a940] : Intercept ECONNRESET and silently handle it as EOF 2017-06-13 Bogdan-Andrei Iancu * [69e3576d8] : Just code identation. 2017-06-13 Bogdan-Andrei Iancu * [cf8caeb8e] : Do not log EINTR and EAGAIN as errors during UDP write. 2017-06-13 Bogdan-Andrei Iancu * [a90723d89] : Intercept ECONNRESET and silently handle it as EOF 2017-06-07 Bogdan-Andrei Iancu * [4cc5e2ed1] : Add proper listing for XML module. Not being listed with full description make the menuconfig to ignore it. (cherry picked from commit 5ecf882c65b66bae762d1b436e9329f7b29864a3) 2017-06-07 Razvan Crainea * [52b7ece21] : ratelimit: clarify limits scope for timer_interval Reported by Max Mühlbronner on mailing list 2017-06-07 Razvan Crainea * [7935ad3c8] : cgrates: switch id from long to int for backward compatibility 2017-06-07 Razvan Crainea * [8ab1deb47] : cgrates: use an integer unique id rather than string 2017-06-07 Bogdan-Andrei Iancu * [0f9ccb576] : Fixed mem leaks and bogus err logs during contact replication. Reported by sekil on IRC. 2017-06-06 Liviu Chircu * [99ebafdd7] : cachedb_mongodb: Update documentation 2017-06-06 Liviu Chircu * [53d62036f] : cachedb_mongodb: Remove unused module parameters 2017-06-06 Razvan Crainea * [402ff3411] : cgrates: add id in request Add an identifier for the requests done to cgrates. Requested by cgrates/cgrates#674 2017-06-06 Liviu Chircu * [a09dada86] : cachedb_mongodb: Fix pkg-config errors with missing libraries 2017-05-31 rvlad-patrascu * [e8160868e] : Fix assignment for $var when right operand is a binary buffer: duplicate entire buffer including zeros. 2017-05-31 rvlad-patrascu * [124c2238b] : sip_i: export script transformations that allow access to the parsed ISUP parameters and subfields. 2017-05-31 rvlad-patrascu * [254743d61] : Fix script transformations cleanup. 2017-05-31 Razvan Crainea * [9d0436eef] : dialog: don't flush in db unnecessary flag values 2017-05-31 Razvan Crainea * [8691a5da1] : rabbitmq: provide errno in case of socket error 2017-05-29 rvlad-patrascu * [b2d4fdb5e] : Fix typo in nat_traversal module exports initialization: no ',' after transformations. 2017-05-29 rvlad-patrascu * [b662d96af] : Allow modules to export script transformations. This is done by including an array of transformation classes (with parsing and evaluation functions for each class) in the module exports structure. 2017-05-25 Bogdan-Andrei Iancu * [ae1c1f32b] : Fixed examples in docs 2017-05-25 Bogdan-Andrei Iancu * [619183358] : Fix memory leak for HEPv12. Do not add formated payload or extra correlation IDs in HEP version 1 or 2 packets as they are not used and it generate a mem leak. 2017-05-22 Bogdan-Andrei Iancu * [739aac528] : Proper HEP free upon failures (cherry picked from commit eb0e47129c5e09615090cc9a41230904390c2919) 2017-05-22 Bogdan-Andrei Iancu * [3954cf532] : Proper HEP free upon failures in sip_context_trace_impl() (cherry picked from commit 1fea1d71f90df306b60932ce5a2454f6e33644d9) 2017-05-22 Bogdan-Andrei Iancu * [6b0701023] : Better reset the freed pointers. (cherry picked from commit 2b93469b135a5033e2d2eab5e58a00eafd3ce59e) 2017-05-22 Bogdan-Andrei Iancu * [fc2c7ab9a] : Free the HEP message in case of send failure too (cherry picked from commit 9bba5954cb86bc56f81887087f0dc4ff20923e74) 2017-05-22 Bogdan-Andrei Iancu * [a39471a21] : Proper free of HEP message if building fails (cherry picked from commit 84c33d1842a0ba3e14453120fe2151b3e22a4603) 2017-05-22 Bogdan-Andrei Iancu * [6a6664706] : Proper OOM handling and reporting in add_hep_payload() (cherry picked from commit 83c286573e5355688e7a77bf1c7061f1162512bb) 2017-05-22 Bogdan-Andrei Iancu * [11d062948] : Make free_hep_message() safe to partially allocated HEP messages. (cherry picked from commit 8e8988183ba0af301087a44296d99f4b5658af4d) 2017-05-17 Razvan Crainea * [494e048cd] : dialog: update documentation for triggered event Updated documentation for the event triggered when the state is changed 2017-05-17 Razvan Crainea * [070e7d471] : rtpproxy: allow multiple servers on same machine Before this fix, rtpproxy was accepting a single connection from a specific IP. This prevented multiple rtpproxy servers on the same machine (or behind the same NAT) to send timeout notifications simultaneously. Using this fix each rtpproxy provisioned can have on connection to opensips. This commit also adds some extra debugging. Reported and debugged by Flavio Goncalves. Fix #865 2017-05-16 ionutrazvanionita * [8ebf59215] : [acc extra] fix leg index when doing CDRs 2017-05-16 ionutrazvanionita * [789b9b063] : [acc] fix adding extra when doing CDRs 2017-05-16 ionutrazvanionita * [1c0914eb9] : [acc extra] fix overwriting right-operand value when setting acc extra/leg 2017-05-16 Bogdan-Andrei Iancu * [d465e6195] : Fix free space calculation. Improper computing of the available buffer space lead to false errors in writing down the dialog HASH and ID (only when using the D flag - dialog ID in contact username) (cherry picked from commit 43764b66adec9b6c4468c368fb584a7637b4bbf9) 2017-05-12 Razvan Crainea * [4bb3f1ffa] : cgrates: fix error detection for different libjson version This is a rework on interpreting the error reports in the cgrates replies. Reported by DigiDaz Fixes #1122 2017-05-12 ionutrazvanionita * [853aae1cb] : [acc] null terminate leg/extra values when storing them * problems appeared when the name of the AVP was given to radius backend which expected null terminated strings 2017-05-12 ionutrazvanionita * [d6cec5722] : [acc] don't start if extra values defined but no aaa/db url defined 2017-05-12 Razvan Crainea * [0b2f7bb81] : tls_mgm: add version and adapt to newer 1.1.0 interface 2017-05-12 Razvan Crainea * [2bf6f6237] : tls_mgm: use os_free with line and file indication 2017-05-12 Razvan Crainea * [25538b4e4] : mem: allow custom alocators to specify file 2017-05-11 Razvan Crainea * [64b897e3d] : rtpengine: remove .orig file 2017-05-11 Razvan Crainea * [17087e1b5] : rtpengine: add in-iface and out-iface params These new params can be used to specify rtpengine interface in bridge mode 2017-05-11 Liviu Chircu * [c75a7ddcd] : str2ip(): Do not reject IPs with leading '0' byte This is useful in some code areas (e.g. allowing 0.0.0.0/0 "catch-all" networks in the permissions module) 2017-05-11 Liviu Chircu * [69b14b0ae] : dialog: Fix possible crash when disabling "accept_replicated_profiles" Avoid processing received replicated profiles when "accept_replicated_profiles" is disabled. In this case, the profile handling code will be optimized and will break if attempting to run replicated profiles through it. 2017-05-11 Liviu Chircu * [2d474f003] : dialog: Fix possible crash in "profile_get_values" MI command 2017-05-11 ionutrazvanionita * [05d42b61a] : [acc] allow multiple rows extra/leg fields definition 2017-05-11 Razvan Crainea * [9798924ba] : fix $source_uri pvar when using IPv6 This fix encloses the IPv6 address in square brackets in the resulted URI Reported by Ankur Gupta on mailing list 2017-05-11 Bogdan-Andrei Iancu * [aa2f0f5f2] : Fix doc formating and improve some description 2017-05-10 Razvan Crainea * [a8294457a] : usrloc: fix event trigger when no socket is used Without this fix, opensips crashes when trying to add a contact from MI or when loading a user from DB without a socket or with an unknown socket. Reported by Cindy Leung on mailing list 2017-05-10 Razvan Crainea * [b6d7a9e27] : tls_mgm: fix uninitialized variable 2017-05-01 Ovidiu Sas * [90f16f7b7] : sliblist: complete file relocation from core to lib 2017-05-01 Ovidiu Sas * [767f2d90d] : lib: move sliblist from core to lib 2017-04-28 rvlad-patrascu * [24d48c518] : tls_mgm: db_schema: same default values for verify_cert and require_cert when taken from DB as from script 2017-04-28 rvlad-patrascu * [cc50c0912] : tls_mgm: some doc fixes and improvements * fix client domain AVP usage example * document default TLS settings for any domain when not set * fix some default values for module parameters 2017-04-28 Liviu Chircu * [abd1e655f] : Proper fix for PostgreSQL login Submitted by @volga629 2017-04-28 ionutrazvanionita * [16a1be540] : [aaa_radius] fix Makefile if pkg-config doesn't find the lib 2017-04-27 Razvan Crainea * [b9fba7c1e] : tm: fix uninitialized variable to make travis happy 2017-04-27 ionutrazvanionita * [fdfb68905] : [proto_hep] fix handling tcp requests coming in multiple chunks This commit fixes 2 bugs: 1) fixes not reading second part of a single TCP request because of bad parsed pointer update; 2) fixes major bug that was causing packets to be processed infinite times by hep callback when one message + some part of a second message came in a chunk and in the second chunk it was the second part of the second message; the tcp request structure was not updated(complete was not set to 0 after first message was processed) causing the second message to be processed an infinte amount of times into the database; 2017-04-27 Liviu Chircu * [01c9ae2f3] : mid_registrar: Fix insertion issues in mirror mode Reported by @volga629 Fixes #1094