diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 78fc103dbce..28c4d4f41bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,7 +48,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive diff --git a/.github/workflows/multiarch.yml b/.github/workflows/multiarch.yml index 0bd292d46b9..1db5bd299f0 100644 --- a/.github/workflows/multiarch.yml +++ b/.github/workflows/multiarch.yml @@ -29,13 +29,13 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive # Cache the compiler cache - name: Cache the compiler cache - uses: actions/cache@v3 + uses: actions/cache@v4 if: endsWith(matrix.compiler, '-qemu-cross') with: path: ccache diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 91d44b697bd..c4da07a3fd2 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -56,12 +56,12 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Cache the compiler cache - uses: actions/cache@v3 + uses: actions/cache@v4 if: endsWith(matrix.compiler, '-qemu-cross') with: path: ccache @@ -109,7 +109,7 @@ jobs: color: danger - name: Collect test logs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: unit_tests-logs_${{ matrix.os }}_${{ matrix.compiler }} path: | diff --git a/ChangeLog b/ChangeLog index 7d58a1b6fe8..d7388f9cb57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,2855 @@ +=========================== Release 3.4.11 ============================== + +2025-02-16 OpenSIPS + * [fd6c580e4] : + + Rebuild documentation + + +2025-02-12 Liviu Chircu + * [9355b00ed] : + + usrloc: Silence ERR logs on failed contact DEL packets + + (cherry picked from commit cfbfd3f7170f55f217d5e7bddccbc5c9c2cbd6d4) + + +2025-02-09 OpenSIPS + * [841c8bcad] : + + Rebuild documentation + + +2025-02-07 Liviu Chircu + * [24977242d] : + + CacheDB: Allow "@" in URL "params" part + + (cherry picked from commit a6d16ddb0b4351b19855137c8a20b5bdd6ea6afb) + + +2025-02-07 Razvan Crainea + * [305e644e1] : + + debian: mongodb package should check for libmongoc-1.0-0t64 package too + + (cherry picked from commit be9bbe950938ab5a222db7eaf351f609657015f0) + + +2025-02-07 Răzvan Crainea + * [96d1e7750] : + + Merge pull request #3572 from petekelly/3.4 + + Pass the directional flag to rtpengine if required + +2025-02-06 Peter Kelly + * [ca648c19a] : + + Pass the directional flag to rtpengine if required + + +2025-02-02 OpenSIPS + * [be3d5cd67] : + + Rebuild documentation + + +2025-01-28 Liviu Chircu + * [41c3dcbe5] : + + registrar docs: Fix misleading $(ct[1]) example input + + The $(ct[1]) value is actually a full Contact header body, not just the + URI. This, in turn, leads to a silent failure of + is_contact_registered() even on the happy path, which can be + time-consuming to debug... + + Credits to Bogdan Iancu for spotting this! + + (cherry picked from commit 8232ff0bb47dfa15edb2c2f4bfa944c895d64bd7) + + +2025-01-28 Razvan Crainea + * [ac8e09fab] : + + parser_authenticate: fix re-entrance of parse_authenticate_header + + properly populate the picked_auth body when calling + parse_authenticate_header twice. + + (cherry picked from commit 5f8376d211c993d1eea689258bda3821850df0c3) + + +2025-01-26 OpenSIPS + * [bb45717cd] : + + Rebuild documentation + + +2025-01-23 Bogdan-Andrei Iancu + * [4093083a8] : + + Fix dangling parsed_uri structure in to_body + + Whenever the SIP URI parsing fails, be sure you reset to_body->parsed_uri, as other functions may later try to use it and we want to have it in a consistent format. + The issue was reported by @vladpaiu + Closes #3557 + + (cherry picked from commit 021172b5ea1db1f80489280c4f4913b4beb14cbd) + (cherry picked from commit dba13a43b10e62490f835fb92c60f35be2fdedaf) + + +2025-01-23 Bogdan-Andrei Iancu + * [378ace545] : + + [b2b_entities] fixed RURI matching against our sockets/listeners + + The proto and port must be correctly expanded to default values, if not present + For example, if TLS, the default port is 5061 and not 5060 + Fixes #3546 + + (cherry picked from commit 9f2aa5bb4920a06dcd037ee4b89b1f97a4b44f3d) + + +2025-01-21 Razvan Crainea + * [905daa129] : + + b2b_logic: make sure old entity peer is stored when bridged + + Prevents a crash when accessing NULL peer. + Many thanks to Norm Brandinger for reporting and providing valuable + information for troubleshooing and testing! + + (cherry picked from commit cf8b3d5690d2cd2576518a9eec603894a6b873fd) + + +2025-01-19 OpenSIPS + * [0a428c7d1] : + + Rebuild documentation + + +2025-01-15 Bogdan Andrei IANCU + * [feb77ef2e] : + + Merge pull request #3555 from vasilevalex/sqlite_fixes + + Minor fixes to db_sqlite module + + (cherry picked from commit 178c138bf7fdeb10e5857b7f60ad0914e5595a77) + + +2025-01-14 Bogdan-Andrei Iancu + * [5f7aa8719] : + + [tm] fix format of trasaction identifier in t_reply MI cmd + + besides the old (almost obsolete) format provided by t_write_fifo(), we must also support the new format provided by $T_id + + (cherry picked from commit b8bb4446e114e612a5720b930d4b61b5aff94443) + + +2025-01-14 Bogdan-Andrei Iancu + * [5f4904ec7] : + + Fix missing handling of certain hdr types when cloning MSG/HDRs + + (cherry picked from commit cc7619070dab61029d2c023779e563ccfbb06b54) + + +2025-01-12 OpenSIPS + * [32bb0fc71] : + + Rebuild documentation + + +2025-01-10 Liviu Chircu + * [c1fc6bbc9] : + + dispatcher: Fix rare crash with 'pvar_algo_pattern' + + This patch simply moves the name buffer for the 'pvar_algo_pattern' into + SHM rather than a stack buffer, in order to avoid invalid memory being + referenced past the function's return point. + + Many thanks to Eric Tamme from Five9 for reporting & testing! + + (cherry picked from commit fe1a50d2513296819179612b8b072ab70871b9eb) + + +2025-01-08 Razvan Crainea + * [7ba69c167] : + + rtpproxy: do not create dialog unless timeout notifications are enforced + + (cherry picked from commit af495d7c73ff1e5fa92157bdcf75b791a17f65b7) + + +2025-01-08 Razvan Crainea + * [56f3aabf2] : + + rtpengine: fix docs typos + + (cherry picked from commit e7548529f9973b4a59edf814d7dbd000ea2da9fd) + + +2024-12-22 OpenSIPS + * [c1740e877] : + + Rebuild documentation + + +2024-12-20 Liviu Chircu + * [bf9db6ca5] : + + script routes: Fix memory corruption with dialog routes + + This patch fixes an issue which impacted the dlg_on_xxx() set of dialog + functions, where PKG and SHM memory could get mixed up when using the HA + clustering support. The issue mostly caused the backup instance to + crash (dlg BIN receiver) instance. + + (cherry picked from commit 36dbd1d419e3dcd6f7febdee7be79bc12660a0dd) + + +2024-12-19 Liviu Chircu + * [c0b2ea5a8] : + + script routes: Fix rare edge-case leading to crash + + (cherry picked from commit 1b57607905c3bbad632fb2a7c7c1e7add9a09197) + + +=========================== Release 3.4.10 ============================== + +2024-12-18 Razvan Crainea + * [902f20532] : + + b2b_logic: make retry list NULL terminated + + (cherry picked from commit 8a547bdd6c35e8af17afed6bd54a1d49e75ec043) + + +2024-12-17 Bogdan-Andrei Iancu + * [ae38e5cf6] : + + [sipmsgops] Fix messing up the max-fwd parsed value upon msg validation + + For more details, see #3511 for the details. + Alternativ fix/workaround to #3511 + + (cherry picked from commit f1e3750a83dc606f96100baaaccc555e6a923ca7) + + +2024-12-17 Bogdan-Andrei Iancu + * [40c2e94ef] : + + [dns_cache] Fix restoring IP array in hostend struct + + When restoring (from cache) a hostend structure, be sure you end the "aliases" and "addresses" arrays with a NULL element. + Without that NULL terminator, when doing DNS-based failover on a cached hostend, OpenSIPS will use garbage IPs from the addresses array. + + (cherry picked from commit 7d31fef29eefca30a8b8be668eebf1694e4df4a5) + + +2024-12-16 Bogdan Andrei IANCU + * [1f3bb9d94] : + + Merge pull request #3480 from ar45/fix-maxfwds + + [maxfwd]: Fix bug `is_maxfwd_lt` function limit value + + (cherry picked from commit e6a0c98e829eef5c62ff7507fb6afc0cd0b98d14) + + +2024-12-15 OpenSIPS + * [d72113280] : + + Rebuild documentation + + +2024-12-10 Liviu Chircu + * [2ab7e9e5c] : + + json: Fix handling for long integers + + This patch adds the "enable_long_quoting" modparam (default: OFF), which + causes larger integers to be returned as strings, in order to avoid the + integer overflow and data loss. + + (cherry picked from commit b191025b75afb07b96562f730a8e9631c8ea35fa) + + Author: Vlad Paiu + Add support for bigints ( store as string when exposing to opensips script ) + + (cherry picked from commit f324a1a432b02137cab73978fe5df5e11005d938) + + Author: Vlad Paiu + Fixed undefined int_value + + (cherry picked from commit ae113c7271ef0a5baa4674972d3b713ac6def6c7) + (cherry picked from commit c1b23178a3a0535ee66bafcd36a0c3df8cdab3c3) + + +2024-12-08 OpenSIPS + * [3e10b12ff] : + + Rebuild documentation + + +2024-12-04 Liviu Chircu + * [7cd555003] : + + clusterer: Add some dev debugging logs + + (cherry picked from commit 5eae5fb1580feb512cc9a065c558a72d85405afb) + + +2024-12-04 Liviu Chircu + * [b1038d4a2] : + + clusterer: Fix a subtle subtraction bug + + The "--node->no_ping_retries" operation is bogus, because that field + is only written during DB reload, or when dynamically learning a new + node. This can lead to the following state, where a node's link flips + between ON/OFF on each ping attempt: + + [Nov 29 20:23:15] INFO:clusterer:do_action_trans_2: Ping reply not received, node [2] is down + [Nov 29 20:23:15] INFO:clusterer:handle_pong: Node [2] is UP + [Nov 29 20:23:42] INFO:clusterer:do_action_trans_2: Ping reply not received, node [2] is down + [Nov 29 20:23:42] INFO:clusterer:handle_pong: Node [2] is UP + [Nov 29 20:24:30] INFO:clusterer:do_action_trans_2: Ping reply not received, node [2] is down + [Nov 29 20:24:30] INFO:clusterer:handle_pong: Node [2] is UP + + (cherry picked from commit 02c4d14d79ff6cfd76b4220cdece80c0853e4e1f) + + +2024-12-04 Liviu Chircu + * [aa1aa937e] : + + usrloc HA: Improve management for replicated "labels" + + This patch aims to fix the occasional "differring rlabels" + debugging error messages which may occur after a restart in usrloc HA + scenarios, especially if the active SIP box is restarted while + processing REGISTER requests in parallel. + + Since both record and contact labels are dynamic, per-instance and lost + on restart, conflicts are to be expected. The idea behind the fix is to + simply adapt the replicated contact_id to the local instance, thus + preferring the local labels to the remote labels whenever detecting + conflict. + + (cherry picked from commit 90a00795b1d0685394818c4a69c235f487389878) + + +2024-12-04 Liviu Chircu + * [223d89a6b] : + + clusterer: Fix links going down during sync; Optimize pinging + + This patch makes it so *any* succesfully sent BIN packet is also + considered a Ping (for sender) and Pong (for receiver). This helps + improve the stability of the inter-node links, which will no longer go + down during a lengthy sync operation (e.g. 50K+ registered phones, which + take a few seconds to sync, and which would also significantly delay any + Ping/Pong packets happening to be queued up on that same TCP stream). + + Moreover, thanks to the "last ping" timestamp updates during regular + BIN replication mentioned above, the clusterer pinging timer will now + only generate Ping packets during idle times (no BIN traffic produced). + + (cherry picked from commit 7d74f3dc6233cf0cd6ad517a2329b837e2bac8bb) + + +2024-12-04 Razvan Crainea + * [ca35a937b] : + + b2b_logic: do not discard BYEs of active entities + + Completes/fixes ce19c70ec. + + Many thanks go to Norm Brandinger for reporting and testing it! + + (cherry picked from commit 8631e9835bef7bfdee9fac1c618096cd462e4ac3) + + +2024-12-03 Liviu Chircu + * [518380f6f] : + + proto_bin: Bump 'bin_async_max_postponed_chunks' 32 -> 1024 + + The default of 32 chunks was too low, considering that BIN TCP conns are + very low in count (often a handful of nodes!), while also transporting + large volums of data within short periods of time (e.g. dialog/usrloc + syncs), so async data buffering may often occur. + + (cherry picked from commit 1f17e3076e6946bcc54e6c627299bee60cf4210b) + + +2024-11-24 OpenSIPS + * [175743ca1] : + + Rebuild documentation + + +2024-11-21 Liviu Chircu + * [b5c1bb232] : + + Merge pull request #3519 from vladpaiu/troubleshoot_redis_issue + + Fix Cluster Master-Slave detection + +2024-11-21 Vlad Paiu + * [9fed325f4] : + + cachedb_redis: Fix Cluster Master-Slave detection; Add dbg logs + + +2024-11-20 Liviu Chircu + * [6bf24a3ea] : + + Fix more logs exposing URL passwords + + Continuation of ed74875df6 + + (cherry picked from commit 1370ed710955ffef4f3e34c715f60821ce886da6) + + +2024-11-19 Liviu Chircu + * [b3c7f70aa] : + + nathelper: Improve docs on fix_nated_register() and received_avp + + (cherry picked from commit 526b538cba8058f0829c21110597d82718d6bab4) + + +2024-11-19 Liviu Chircu + * [9bd311bfc] : + + dialog: Do not crash with previous table version (11) + + This patch ensures OpenSIPS doesn't crash if the "dialog.script_flags" + column is still of INT type (previous DB schema, before OpenSIPS 3.4). + + (cherry picked from commit a1b273828f3b20e1b99f9c8185d5a7bf78504d50) + + +2024-11-17 OpenSIPS + * [448fdf959] : + + Rebuild documentation + + +2024-11-15 Gang Zhuo + * [d2bd39139] : + + db_oracle: fix "invalid parameter value" error when do sql_query("update ...") + + (cherry picked from commit b5133bde0020740185e2c8c459b3b73f58623f65) + + +2024-11-15 Gang Zhuo + * [19c7631b6] : + + usrloc: fix build error when ORACLE_USRLOC flag is present + + (cherry picked from commit 1f998239078fd5a0a067f6c56b83c3c2f4cce40f) + + +2024-11-15 Liviu Chircu + * [e7fcb8a01] : + + event_routing: Clean up convoluted looping logic + + (cherry picked from commit a9e8b9203f405fcefda8670e7b9bbe7d0a504bab) + + +2024-11-15 Vlad Paiu + * [1ba9ebe74] : + + go to the next sub on continue + + (cherry picked from commit 6ef166a4b1e09bdf6f535c15ed57ca62fcaab436) + + +2024-11-12 Bogdan-Andrei Iancu + * [f17c60f79] : + + [drouting] do not report error if replicated flags are the same + + Avoid reporting error if the GW/Carrier replicated package does not change the existing status flags. + + (cherry picked from commit 36b916a7e1333c7f539dcc25c93ba8c143d8016f) + + +2024-10-27 OpenSIPS + * [653361b19] : + + Rebuild documentation + + +2024-10-24 Liviu Chircu + * [d6ad7687b] : + + clusterer sync: Fix several SHM leaks on error cases (Donor side) + + (cherry picked from commit 101396a59c23f91bc821c36b9bc1bd2e5daa1d35) + + +2024-10-24 Liviu Chircu + * [8d6cd3740] : + + clusterer: Fix sync edge-case causing SHM accumulation + + This patch fixes a specific sync sequence leading to indefinite + accumulation of BIN packets and SHM exhaustion, as follows: + + 1) Sync Receiver node times out the sync in sync_check_timer() + (default timeout is 5s, by no means difficult to achieve) + 2) Sync Donor continues to send SYNC packets + (on Receiver side, cap state is updated: PROGRESSING) + 3) ! Sync Donor node loses link-state mid-sync, due to the pings being + on the same TCP connection (and delayed, way in the back) + 4) Sync Donor fails & drops remaining SYNC + SYNC-END packets, as link + is down. Due to this, the handle_sync_end(!is_timeout) procedure + is never ran on the Receiver, so the PROGRESSING flag is never + removed -> indefinite SHM buffering / memory leak + + Thanks to Răzvan Crainea for helping with code & troubleshooting here! + + (cherry picked from commit e5b2317ca9e9f33baef29205ecd792d8a5d5d2ed) + + +2024-10-24 Razvan Crainea + * [fe9fac9d7] : + + b2b_logic: a BYE for a disconnected entity should not influence the call + + (cherry picked from commit 49ba1c37bfcd8dbc265c19c45895b3eee767b561) + + +2024-10-24 Razvan Crainea + * [817adea7c] : + + b2b_logic: always terminate a bridge initiator + + Before this commit, only if the `notify` flag was used, the entity would + have been deleted. + + (cherry picked from commit aff2d963126f097411753d699239bc938479c892) + + +2024-10-24 Razvan Crainea + * [61c8ec659] : + + b2b_logic: do not discard a recognized cross-BYE + + (cherry picked from commit ce19c70ec7ca6cd6a7a12347a5acc0a282432c50) + + +2024-10-24 Razvan Crainea + * [717940a01] : + + b2b_entities: always unref a transaction created programatically + + Ensure transactions do not leak by creating/replying them and not + unreffing when callback exits SCB_DROP_MSG + + (cherry picked from commit 8b36f4cd6da33b26a8e2ce2bccf5cb075f2f1d04) + + +2024-10-24 Razvan Crainea + * [06724800b] : + + dialog: accurate match of outgoing legs + + The initial code assumes that for each transaction branch, we serially + create a dialog leg - therefore, when a reply is received for a specific + branch, we match the leg based on its index. + This logic breaks when having a branch that has no outgoing leg/message + (i.e. when push notification is used), because the dialog legs id gets + offsetted by the number of "blind" branches, thus we are no longer able + to properly match the reply with the leg. + This fix makes sure that when creating a let, it has the same index as + the transaction's branch id, hence the reply is properly matched. + + (cherry picked from commit 5280c86a100ad9414e9beeca620648d8388bab42) + + +2024-10-24 Vlad Paiu + * [e629e20af] : + + Only update the TM UAS if we are in request context and are not running on top of a fake req + + (cherry picked from commit 2031348d0c44da7b077b3a083973d3b525044b11) + + +=========================== Release 3.4.9 ============================== + +2024-10-23 Bogdan-Andrei Iancu + * [94184a296] : + + [clusterer] Fix error handling when failing to load nodes + + On failing to add a node (to the cluster), continue, as time as that node is not the current node. + And if giving up on whole cluster info loading, be sure we clean up and properly report this to the above layer - the last thing we should do is to report success (on load) but have partial, unconsistent data. + + Fixes #3473 + + (cherry picked from commit 784e1a4cc52be74c0a2e9706e74794c4ea5940cf) + + +2024-10-22 Liviu Chircu + * [8392a70aa] : + + clusterer: Prevent startup delays from causing aborted syncs + + This patch makes it so the 'seed_fallback_interval' modparam + time-counting is done in a way that *ignores* any random startup delays + (e.g. mod init stuff which may take time such as loading drouting, + dispatcher, rtpproxy, etc.). + + Previously, the effect of this issue was that some modules (e.g. usrloc) + would randomly *not* sync data on startup, depending if the startup + delay happened to be lesser or greater than the 'seed_fallback_interval'. + + (cherry picked from commit 928727410a63fa137f48aa8a77492c3c7b14b460) + + +2024-10-22 Liviu Chircu + * [eeddfcc85] : + + clusterer: Add/Improve some important logs during startup sync + + (cherry picked from commit 2bf1bdcf5c087f16c21c99101738ed52ad8741c1) + + +2024-10-22 Liviu Chircu + * [f423f90ec] : + + clusterer: Fix potential AB/BA sync deadlock on DONOR nodes + + This deadlock was reproduced with usrloc, but may also affect other + sync-based modules, as follows: + + ---- sync DONOR node ---- + 1) [sync send Worker-1] grabs (A) cluster lock, then (B) usrloc hash lock + while building/sending the sync packets + 2) [handle SIP REGISTER Worker-2] grabs (B) usrloc hash lock, then (A) + cluster lock when replicating data with cl_api.send_all() + + This patch converts the "A+B" sequence in 1) into a "B,A" sequence. + + (cherry picked from commit d89f1703f60aaaa2d6cca23aab191e5671dc0c83) + + +2024-10-20 OpenSIPS + * [0a9931075] : + + Rebuild documentation + + +2024-10-18 Bogdan Andrei IANCU + * [b793fdeac] : + + Merge pull request #3497 from sippy/pr_fix_3495 + + python: Validate script_name a bit more carefully. + (cherry picked from commit e9f9e8e8c298f6aa1f1d6cdad2ba50c2d4827d8d) + + +2024-10-17 Razvan Crainea + * [ec2ccb850] : + + load_balancer: open db connection from every process + + This ensures that the `mi("lb_reload")` command runs properly from + whatever process the job is dispatched from. + + Many thanks to Antonis Psaras (@apsaras on GitHub) for reporting it. + Close #3488 + + (cherry picked from commit 3df04c7c6cc21999119a02301be316a605f06036) + + +2024-10-13 OpenSIPS + * [bcbfaf83a] : + + Rebuild documentation + + +2024-10-09 Bogdan-Andrei Iancu + * [0c060fb2d] : + + [ldap] fix error handling when no available conn + + Do not try to release/free a conn if we do not have one + + (cherry picked from commit 27acf2a08be0b60f5a6675c8b44fb65a4cab0a7b) + + +2024-10-08 Razvan Crainea + * [2aac7fe07] : + + media_exchange: handle faked replies for re-INVITEs + + Fix possible crash when a faked reply is received for re-INVITEs + + (cherry picked from commit a70f7159773cb86dde220d4c851f49de83f73802) + + +2024-10-06 OpenSIPS + * [1ebff082c] : + + Rebuild documentation + + +2024-10-03 Liviu Chircu + * [7919e3222] : + + uac_auth(): Fix corner-case with missing "algorithm=" in 401 + + Make sure to convert ALG_UNSPEC to ALG_MD5 before doing the bitmask + conversion, as otherwise the matching will fail! + + (cherry picked from commit 42fa1db32a259818495282a4eeaa1ae08087d9d3) + + +2024-10-03 Razvan Crainea + * [f078fe057] : + + dialog: fix compile error in previous commit + + +2024-10-03 Razvan Crainea + * [9c0f5b034] : + + dialog: update SDP on ACK as well + + in case of lage negotiation, we need to update the SDP in dialog as well, + otherwise pinging or sending sequential messages will have no info on + the callee's SDP + + (cherry picked from commit cacdc58e228e3c9fdd56e8107f7b528ed1c92d22) + + +2024-10-02 Razvan Crainea + * [eb2014113] : + + media_exchange: keep media session until dlg ends + + This fixes situation when a media session is both started and ended from + different (MI) processes. + + (cherry picked from commit d70b9c063b2da3eef05980cd826fd39a1c96ee56) + + +2024-10-01 Razvan Crainea + * [f68caa6d9] : + + db_sqlite: properly store BLOB values in DB + + Do not insert BLOB values as strings, as they might have non-printable + characters, which breaks the value when storing. Instead, store them as + a hex-string. + + Many thanks to Eric Tamme from Five9 for reporting this bug! + + (cherry picked from commit 3e89bcfa935803ee4d85ba19daf2cbe8ae2c342a) + + +2024-10-01 Alexandra Titoc + * [2dde327bb] : + + dialog: Fix potential copy-paste error + + CID #417795 + + (cherry picked from commit bd0989cd5d81cb06468304c07ffc5211b4307951) + + +2024-10-01 Alexandra Titoc + * [1223e3edb] : + + compression: Add and fix null checks + + CID #58406, #200016, #58416 + + (cherry picked from commit 8cfb66b9050394b31ac53fd0b5117544f0838cae) + + +2024-10-01 Alexandra Titoc + * [3f89c051f] : + + compression: Fix potential copy-paste error + + CID #58327 + + (cherry picked from commit 56b218bd7a065db61e02cbc9e0f759bec035dc1c) + + +2024-09-29 OpenSIPS + * [ffb6a646b] : + + Rebuild documentation + + +2024-09-26 Vlad Paiu + * [11c99480a] : + + Populate last dst leg for internally generated sequentials + + (cherry picked from commit 4d6e5d572f934c11d3c721d6beec366ee57f3a9a) + + +2024-09-25 Liviu Chircu + * [c667f1adb] : + + db_sqlite: Fix some mis-placed NULL checks during row reallocs + + (cherry picked from commit 1cc9f5d475fa4e68a0622357c59fa2b5ba997380) + + +2024-09-23 Liviu Chircu + * [8b19e1da9] : + + Clustered modules: Add sections on clusterer's "seed" mechanism + + * b2b_entities + * cachedb_local + * dialog + * load_balancer + * presence + * usrloc + + (cherry picked from commit 7723f0e918d0cb562a5424104eb3077bd8dd3054) + + +2024-09-23 Liviu Chircu + * [304ced9c3] : + + drouting docs: Add a section on clusterer's "seed" mechanism + + (cherry picked from commit 184075c4695facd370ec17e2f2184c4c255afa9e) + + +2024-09-23 Liviu Chircu + * [4590c5784] : + + dispatcher docs: Add a section on clusterer's "seed" mechanism + + (cherry picked from commit d9a3c55f0c97c618034ed7be9b82aa17e6981ec4) + + +2024-09-22 OpenSIPS + * [023478cf0] : + + Rebuild documentation + + +2024-09-20 Razvan Crainea + * [4abf73a8e] : + + b2b_logic: prevent crash in case a bridging is in progress + + (cherry picked from commit c69201ebcc6cc382d1ec82f7e6756ff3fc0928ed) + + +2024-09-20 Bogdan-Andrei Iancu + * [2d3f1e640] : + + Fix bogus active counting for procs terminating due to down-scaling + + Be sure to mark the proc as idel before actually doing "exit()", otherwise we will count it as busy for the whole time the proc is terminated by OS (we automatically clear the load stats only upon sigchild on attendant) + + (cherry picked from commit e982e90b4a7ccab0dfcff3628566359fb0ab0539) + + +2024-09-17 Razvan Crainea + * [809a23e1e] : + + permissions: connect to db from each process + + Many thanks to Wayne Davies from Five9 for reporting it! + + (cherry picked from commit 4d79a71ee77ae020b9f1440bff4439257bed014a) + + +2024-09-15 OpenSIPS + * [e1b334c90] : + + Rebuild documentation + + +2024-09-13 Razvan Crainea + * [18b9c36c2] : + + b2b_entities: do not `reset_cancelled_t` + + As it is not exposed through the API. This completes c7780dbd. + + Many thanks to Norm Brandinger for reporting it! + + (cherry picked from commit 95767fc861e9c413c466989f3ac4b15efbd1a7d3) + + +2024-09-13 Razvan Crainea + * [9159b27d1] : + + dialplan: no longer use per MI child init + + All processes already have the database connection, so there is no need + to re-create it in MI + + (cherry picked from commit 7022a48985be59cbc3a19e3f72cf4793415cf22b) + + +2024-09-13 Razvan Crainea + * [8cb9a9504] : + + b2b_entitites: do not unref cancelled cell if not ours + + If a CANCEL is caught by the b2b_entities but it is not part of a b2b + dialog, it should not unref the cell, otherwise after the script is + executed, it will be unreffed again, leading to a double unref. + + Many thanks to Voxtronic for spotting this issue! + + (cherry picked from commit c7780dbd78a2192178694283da982dee84b9f80b) + + +2024-09-13 Razvan Crainea + * [ea95ce883] : + + dialplan: create DB connection from all workers + + This allows modules, such as mi_script, to run reload commands inline, + and not through a dedicated MI process. + + (cherry picked from commit 9a3caeca760ec90f6bf5eaac44eff98923106f4d) + + +2024-09-13 Razvan Crainea + * [26aaf7e36] : + + dialog: never update ACK cseq with 0 value + + In case there is no mapping for an ACK, do not update the message with 0 + + Many thanks to Nick Altmann for reporting this! + + (cherry picked from commit a47c16ffb0f98250a4e8ea8e5cef23c5c187ab06) + + +2024-09-12 Liviu Chircu + * [6dc8c3b8e] : + + rest_client: Complete the fix in a3dd31ad6 + + Proper pointer/data management. + + Credits to Aron Podrigal (@ar45) for providing feedback and testing! + + (cherry picked from commit b15bc4451fc2a04d5896aa75d11d497e6366cd58) + + +2024-09-11 Aron Podrigal + * [371ba4991] : + + Fixes #3464 + + when setting `connected_ts` set the address which is being used as value? + + (cherry picked from commit a3dd31ad6e0cb3728a7f0b0a3e6bbfc5e3beb79c) + + +2024-09-11 Aron Podrigal + * [ba2c904bc] : + + Fixed - rcl_release_url() was never called in some cases + + (cherry picked from commit 50d1efbe9753706a8891ed28be04e4986484db64) + + +2024-09-11 Vlad Paiu + * [920d4e15b] : + + Fix fetching TLS domain for a redis connection + + (cherry picked from commit b3e81a6472214694a4ba47e3c717281e26a04466) + + +2024-09-09 Razvan Crainea + * [be67b0a08] : + + topology_hiding: remove bogus debugging + + (cherry picked from commit 4eda102a5398d63e9b4c45796695fa7408de14c6) + + +2024-09-09 Razvan Crainea + * [5cfe3cfef] : + + b2b_entities: alocate mem for empty str + + Otherwise the `reason` variable points to a volatile memory that + dissapears, leading to an uninitialized variable + + (cherry picked from commit 550eb6b7b1e08d5ea235659038fe536ceecf398a) + + +2024-09-08 OpenSIPS + * [7039ab89b] : + + Rebuild documentation + + +2024-09-05 Razvan Crainea + * [5c5d8a57c] : + + clusterer: fix possible inconsistent list handling + + The tags `active_msgs_sent` list might become inconsistent due to the + fact that the `ni->next` is being populated outside locks. + + (cherry picked from commit 3092ec2d07419f64dc3152e770cfdbdd186b9f1d) + + +2024-09-03 Liviu Chircu + * [c075eb0f0] : + + Merge pull request #3457 from Shkiperon/3.4-builder-fix + + Fix HP_MALLOC build flag - DBG_MALLOC is not necessary for it + +2024-09-03 Razvan Crainea + * [0fbabbe1d] : + + topology_hiding: do not mark the contacts parts as HDR_CONTACT_T + + This ensures that when a fixed contact is restored from a shm lump, it + does not overlap to contact parts, as topology hiding builds them. + + Many thanks to David Trihy from Genesys for reporting and helping us + troubleshoot. + + (cherry picked from commit e65173fc9737a0023e23799a330e852404605548) + + +2024-09-03 Razvan Crainea + * [91af8ccd6] : + + Revert "tm: fix bogus contact built without domain" + + This reverts commit de50249961a25fdf3defbe77601c45c2dd2f0399. + + (cherry picked from commit 307a9862edf60e8c394bb9c0e9062f645d3e3978) + + +2024-09-02 Shkiperon + * [ed632d43f] : + + Fix HP_MALLOC build flag - DBG_MALLOC is not necessary for it + + Style fix + + +2024-09-01 OpenSIPS + * [e39971e28] : + + Rebuild documentation + + +2024-08-28 Vlad Paiu + * [600f0518f] : + + NULL check received connections + + (cherry picked from commit 2b566e67ad207bf05cd1f5768e4482d21b7059f3) + + +2024-08-28 Liviu Chircu + * [96cf16819] : + + SIP PN: Prevent overlapping modifications of pn_ebr_filters template + + The @pn_ebr_filters templates are actually allocated in shared memory and + can be modified by multiple SIP workers concurrently, leading to + occasional strange routing of INVITEs. The fix is to simply allocate + the objects in private memory instead. + + Credits to Ondrej Jirman for documenting, troubleshooting + and providing an initial fix! + + Related to #3394 + + (cherry picked from commit 078e65b98909f477c819b57e79de0b8e18dccdb4) + + +2024-08-25 OpenSIPS + * [883683dc3] : + + Rebuild documentation + + +2024-08-22 Vlad Paiu + * [d5ca8c6da] : + + Fix comparision of SIP URIs, add GR and PN related params checks + + (cherry picked from commit 8fa7bcb9ce4550c978f99bc7aaed21fdf7e28e7e) + + +2024-08-21 Razvan Crainea + * [b802ff40c] : + + tm: fix bogus contact built without domain + + When fixing headers for fake messages (`fix_fake_req_headers` func), the + function was looking for lumps that were removing the contact, because + it would assume they will be the same that would add a new one (i.e. + `fix_nated_contact`). However, the `toppology_hiding("U")` function, + would create a del lump, but then adding 3 lumps over it. This would + make the fixing bogusly learning the contact as "sip:$user" instead of + hole URI. + The fix for this was to make sure that there is only one ADD lump, + otherwise it would point to a shorter (broken) URI. + + Credits go to David Trihy from Genesys for reporting and helping us + troubleshoot. + + (cherry picked from commit de50249961a25fdf3defbe77601c45c2dd2f0399) + + +=========================== Release 3.4.8 ============================== + +2024-08-21 Liviu Chircu + * [7aeb53cab7] : + + tm docs: Expand $T_fr_inv_timeout section + + (cherry picked from commit b71cf95b3ed0c32d3ddaf33b5d382b298ebf3ac0) + + +2024-08-20 Razvan Crainea + * [842a3025dc] : + + packaging: add python3-setuptools dependency on redhat + + +2024-08-20 MonkeyTester <57145271+Integration-IT@users.noreply.github.com> + * [27057b9d04] : + + Update stir_shaken.c - enforce verifier pvar error reason + + - more explicit SET_VERIFY_ERR_VARS. + - stir_shaken_verify generic err_reason pvar is now more explicit to easily reflect the real reason. + + - replace verifier generic "Internal Server Error" by dedicated internal error like "Failed to parse headers", "Failed to parse identity header", "Failed to get current time", "Failed to get UNIX time from Date header", "Failed to load certificate", "Error validating certificate", "Error while verifying signature". + + (cherry picked from commit 2f5be1642b6e8ddf0e1f851f6be2777c87a54198) + + +2024-08-20 MonkeyTester <57145271+Integration-IT@users.noreply.github.com> + * [c32d8da568] : + + Update stir_shaken.h + + - define new internal server error scopes. + + (cherry picked from commit 85f9250131bd44b080efbb92a875d84609a36ed7) + + +2024-08-19 Razvan Crainea + * [ef0b9a7af8] : + + redhat: replace deprecated radiuslient with radcli + + (cherry picked from commit b36a2479c6433d09e7d560c1e466dc5b87735f4e) + + +2024-08-19 Razvan Crainea + * [b8e9e77c9f] : + + b2b_logic: fix error logging when bridging existing entities + + (cherry picked from commit 35d7e1f53d2a3433a71ec154e935fcc5cd9481e0) + + +2024-08-12 Bogdan-Andrei Iancu + * [c76a542480] : + + [TCP] fix OOM error logs (pkg versus shm) + + Part of 50650b7ab64b1cc6e81c051d30e55a6d57e2b173 + + +2024-08-12 Bogdan-Andrei Iancu + * [50650b7ab6] : + + [TCP] fix pkg versus shm for the TCP workers array + + Due to the process auto-scaling, this array may visible not only to TCP Main, but also to attendet and TCP workers procs. See the comments in the code for more details + + +2024-08-11 OpenSIPS + * [c310812b60] : + + Rebuild documentation + + +2024-08-08 Razvan Crainea + * [5b87766f65] : + + rtp_relay: fix debugging in prev commit + + +2024-08-08 Razvan Crainea + * [6668c07890] : + + rtp_relay: add enhanced leg debugging + + (cherry picked from commit 28129a177ac1d7c44e498ee21371fc9d04897b64) + + +2024-08-08 Razvan Crainea + * [eecb64108a] : + + rtp_relay: try first to match by tag, and only fallback to index + + (cherry picked from commit c689ec3a40938c59e49a51ddd02ae0dbbe08902d) + + +2024-08-07 Razvan Crainea + * [43cd7f8f32] : + + rtp_relay: sync leg tag on late + + (cherry picked from commit 2b80f1a04c2e1c75726429e9e6a09011a089efde) + + +2024-08-06 Razvan Crainea + * [739c0596d5] : + + rtp_relay: fix leg detection on newer branches + + (cherry picked from commit 33f42743bb4942cab02b448572bc7d14b3fbc123) + + +2024-08-06 Liviu Chircu + * [4bc0bee25a] : + + mi_script: Avoid race condition in async(mi()) + + Make sure to read & clean @job->req before dispatching @job to a + different OpenSIPS worker, which may do a quick free() on it. + + Credits to Suchi Sahoo from Five9 for reporting! + + (cherry picked from commit c7a9f68d12da814e25c4c7b0398aeccf2fdbcb95) + + +2024-08-04 OpenSIPS + * [4ad27782c4] : + + Rebuild documentation + + +2024-08-02 Razvan Crainea + * [c104d90114] : + + rtp_relay: do not check for pending when late + + Many thanks to Voxtronic for spotting this issue! + + (cherry picked from commit 471dab3130eea8788cbbf0884c6e5c2af8d61622) + + +2024-08-02 Razvan Crainea + * [dafe08381f] : + + topology_hiding: store the appropriate routes in headers for indialog + + Credits go to Bence Szigeti for reporting and troubleshooting! + + (cherry picked from commit 46e3d05de1455eaf1797d313352f2daab7912b9b) + + +2024-08-02 Razvan Crainea + * [e5bf3e172f] : + + tm: clean receive_info for replicated packages + + (cherry picked from commit 2cdda849040118e621967dfcfbd6483a99cf44d6) + + +2024-07-31 Razvan Crainea + * [888f099aba] : + + rtp_relay: prevent patch on abnormal traffic + + (cherry picked from commit 6edaba2281e16c7fd6fa044c9a28d33067fb3f28) + + +2024-07-31 Razvan Crainea + * [6ba0f3019b] : + + rtpengine: respect disable state when choosing a node + + (cherry picked from commit 454b71312040bd3ac893c3d3c2433be11c37d1cc) + + +2024-07-30 Razvan Crainea + * [de32161e05] : + + media_exchange: sync SDPs when offering/answering + + (cherry picked from commit a30ded6bee2fa63b764686b88f561c0cb1a910e3) + + +2024-07-30 Razvan Crainea + * [6763383e50] : + + rtp_relay: update $rtp_relay doc on branch route + + It provisiones the flags for the callee, rather than caller + + (cherry picked from commit cb9c8c94804cea080ad00f90103f5dc1e32e8e5c) + + +2024-07-28 OpenSIPS + * [c209d635ca] : + + Rebuild documentation + + +2024-07-26 Razvan Crainea + * [25647154a5] : + + media_exchange: register index on pre_init + + this avoids overlapping with other modules that register the pointer and + start storing in it immedately, without allowing to register other + indexes + + (cherry picked from commit 267205d77c06795c40cbf6df8a37ed77b2610069) + + +2024-07-26 Liviu Chircu + * [7da509ea36] : + + usrloc federation: Fix shutdown crash edge-case + + This patch fixes a destroy() issue, where _synchronize_all_udomains() + needs to sync an AoR (empty, no contacts) to CacheDB, but @cdbc is NULL + in "attendant" process, per 7b62f2453b. + + +2024-07-26 Razvan Crainea + * [7c8b5b234e] : + + siprec: make sure dialog exists when restoring session + + +2024-07-25 Liviu Chircu + * [c0bc614de1] : + + media_exchange: Fix bad free in MI `media_exchange_from_call_to_uri` + + (cherry picked from commit 19add7c5bb71e7fa93ff5c96783cd4349001a66a) + + +2024-07-25 Liviu Chircu + * [54bea59763] : + + tm: Avoid running hop-by-hop ACK callbacks before reply callbacks + + Commit aaa6b6867 mitigated the effects of a poor HEP connection + affecting the OpenSIPS's responsiveness by delaying the reply callbacks + until after the hop-by-hop ACK is sent out. However, a side-effect in + doing so is that the reply/ACK HEP packets on un-established calls + became swapped. This patch aims to address the issue. + + Related to #3255 + + (cherry picked from commit 43477da50c67eaa4b7bd206c2d8bcaa09b0b6b25) + + +=========================== Release 3.4.7 ============================== + +2024-07-24 Razvan Crainea + * [1d36aff573] : + + event_kafka: fix xml admin doc file + + (cherry picked from commit ea1f23eb3d7e1bf6ce639e2c9d3d112db272a9d1) + + +2024-07-23 Liviu Chircu + * [c594a1188b] : + + [I/O reactor] Small improvements to c15bd04aa4 + + * add @idx check against upper bounds of h->fd_array (avoid overflow) + * recover @idx even when it's out-of-bounds (e.g. idx == -10) + * simplify backtrace call + + (cherry picked from commit 46e2085b60bbd2784511cb31ec6a0a213e8cb081) + + +2024-07-23 Bogdan-Andrei Iancu + * [ff816876a4] : + + [IO reactor] added an enhanced logging when detecting a reactor data corruption + + Use a basic/simple array to store logs to be eventually dump later if a corruption of the reactor data is detected after an io_wait_del() operation. + This is debugging only, with the intention of helping the troubleshooting some ongoing investigations. + + (cherry picked from commit a28e500a0bffa9fcdf1a6223d94bbfe465135228) + + +2024-07-23 Bogdan-Andrei Iancu + * [bbb65c2f1a] : + + [I/O reactor] do sanity check on the provided fd index + + On del operation, if an index (in the fd_array) is provided, check its consistency, to avoid corrupting the reactor's data. + Upon corruption, do a backtrace and force recovery by resetting the index to -1 + + IMPORTANT: this is not a fix, but a detection and recovery, hoping to help identifing bad ops over the reactor's fds. + (cherry picked from commit c15bd04aa47843147427fd56f427152addda8e93) + + +2024-07-23 Bogdan-Andrei Iancu + * [1f4ee25b58] : + + Fixed test over the IO flags when removing a fd from reactor + + ignore the internal flags during the test + + (cherry picked from commit 5e11c80de870f22bca3aae85e88ef8b8b57c0f93) + + +2024-07-22 Liviu Chircu + * [722547d431] : + + presence: Fix subtle race condition in update_db_subs() + + While walking the list and collecting expired subscriptions, it is + incorrect to temporarily release, then re-acquire the lock and still + make use of the @s or @prev_s pointers afterwards, as the list may have + changed in the meantime! + + The fix is to detach and collect any expired subs, then walk & handle + them in a separate iteration. + + (cherry picked from commit b8e0250bc957bb408f23317012716524129f1fa9) + + +2024-07-22 Liviu Chircu + * [2ddd14a35d] : + + TCP debugging: Fine-tune TCP conn history settings + + * reduce logline buffer from 100 -> 80 + * only keep the last 300 events per connection (down from 2000) + * avoid auto-logging (flushing) of all TCP conn histories to syslog + + These changes should reduce the default TCP conn debugging footprint + from ~2GB to ~0.3GB of shared memory, as well as clean up the logs. + + (cherry picked from commit e496cfc28aa6e88259dd17054912f88859087534) + + +2024-07-22 Liviu Chircu + * [d2792575e4] : + + TCP: Fix race condition in "proto_tcp.tcp_parallel_handling" + + During F_TCPCONN handling by a TCP worker, the @con pointer must *not* + be de-referenced if the READ was successful and connection already + returned to TCP Main. This patch adds a new retcode to the tcp.read API + function in order to achieve this. + + Credits to Yury Kirsanov and Bogdan Iancu for helping troubleshoot + this issue! + + (cherry picked from commit 6108ee296fe372cb59719acde9499d0cbe8fbdc8) + + +2024-07-22 Razvan Crainea + * [c67e16b817] : + + sql_cacher: remove test key from cache + + Since this key is stored in a non-base64 format, when the hash is being + iterated, this value breaks the convesion - and when trying to + `base64_decode("cdb_test_val")`, this results in a larger value than the + expected integer, resulting in a stack crash. + + Removing the key from the hash fixes this crash, as all keys remain are + properly base64 encoded. Moreover, if the key is not properly encoded, + we should make sure that its decode does not overwrite the stack frame. + + (cherry picked from commit dc38cf3a19819bc010489e0f88a663a4f35f9aca) + + +2024-07-19 Razvan Crainea + * [b5ba833d7a] : + + b2b_sdp_demux: reset successful legs for in-dialog + + The number of successful legs should be reset after completing the + initial setup, so that if sequential legs are being rejected, we should + not assume they are successful. + + Many thanks to Eric Tamme (@etamme) for reporting the issue and + for providing testing scenarios. + + (cherry picked from commit fd37fa5ea54f67093dd014297ca8451bdeffccf3) + + +2024-07-16 Liviu Chircu + * [31c8c55842] : + + db_mysql: Add the 'tls_opts=' optional DB URL parameter + + With some DBaaS, the TLS connections only require a CA setting on the + client side -- no need to explicitly set the "cert=" or "private_key=", + as they might not even be available. + + (cherry picked from commit 616ddd660a3444e937a5080e18432d5a404dc5a3) + + +2024-07-15 Liviu Chircu + * [abcda64265] : + + TCP: Add more connection debug logs from TCP workers + + (cherry picked from commit 4074f8723d938070f720cc16c664e3146c92172a) + + +2024-07-10 Bogdan-Andrei Iancu + * [306952cb15] : + + [tracer] remove useless line, pron to crashes + + Setting the tracing info into the processing context here is useless as none of the following funcions are using /accessing this context. + Even more, there are cases (like tracing an UAC b2b transaction triggered by a b2b timeout) where there is not processing context set (so crashing). + + (cherry picked from commit 759d08f9168052005eea88742abcb3577f745247) + + +2024-07-09 Liviu Chircu + * [058863cd71] : + + TCP Main: Make connection frees easier to troubleshoot + + By rewriting _tcpconn_rm() as a macro, the built-in shared memory + debugging support (see `shm_memlog_size` core parameter) will record + the TCP connection free() operations more accurately (file/func/line). + + (cherry picked from commit 42ebe1dbc46f7ea850c80b011b00dd76b022a512) + + +2024-07-08 Bogdan Andrei IANCU + * [9145fd1b19] : + + Merge pull request #3429 from okhowang/uac-expires + + uac_registrant: using Expires header if expires is absent in contact + + (cherry picked from commit 3e592b60f4a4883b203fade4f1404c12d4bec2a0) + + +2024-07-08 Liviu Chircu + * [3f3ee783c5] : + + backtrace.h: Make code more usage-friendly + + * avoid having to define -DEXTRA_DEBUG for backtrace logging + * now you can define -DDBG_NO_BACKTRACE in order to disable all traces + * default logging level changed from DBG to CRIT + * fix issue with log level always being INFO; fix bad include + + (cherry picked from commit bbe8f809d119695577792a5438d97d51a4eb420d) + + +2024-07-08 Razvan Crainea + * [caefff7157] : + + siprec: fix failover crash + + When a failover happens, the initial_sdp is no longer available, hence + the module crashes when trying to use it. This fix makes sure that the + initial_sdp is not released, so that sequential failover can catch and + use them. + + Many thanks to Farzaneh Soltanzadeh (@Fr-Soltanzadeh on GitHub) for + reporting it in #3421 and trying to fix it in #3425. + Fix #3421 + Close #3425 + + (cherry picked from commit a970903c113b47c152c0077689c70faa2a1816cf) + + +2024-07-05 Bogdan-Andrei Iancu + * [47659e3491] : + + [stir_shaken] updated docs... + + ...to reflex the fix in a2560af0f7e0180589228267553fbe37d5885140 + + (cherry picked from commit 005aa2e5be85920f5cda82e8b0f89760b8d678b8) + + +2024-07-05 Bogdan-Andrei Iancu + * [25b7e362b2] : + + [stir_shaken] fix agressive test on Identity hdr. + + This will fail in a scenario like: INCITE with Identity received, remove the Identity hdr, call stir_shaken_verify again to add a new Identity hdr. + + (cherry picked from commit a2560af0f7e0180589228267553fbe37d5885140) + + +2024-07-04 Liviu Chircu + * [0f0d08dbad] : + + fraud_detection: Fix possible SHM allocation bug w/ prefixless rules + + During the check_fraud() call, in case dr_binds.match_number() finds a + prefixless route, the output @matched_len is un-initialized, potentially + leading to a bogus map.get_map() call and arbitrary-sized shm_malloc(). + + Many thanks to @okhowang for spotting the bug! + + Closes #3413 + + (cherry picked from commit e8344e88fed2ac2ef9f3737e619f38361d949fc3) + + +2024-07-02 Norm Brandinger + * [cf708e1b2e] : + + Update README + + (cherry picked from commit 2f0940a6cec5e2e7378411e5856821478b52561b) + + +2024-07-01 Razvan Crainea + * [ab093e4734] : + + siprec: proper handling recording resuming + + (cherry picked from commit 79fced4aa5f28354f004e1e9ed5cfefd903b56b6) + + +2024-06-25 Bogdan-Andrei Iancu + * [26e9a75d26] : + + [rabbitmq_consumer] fix wrong IPC advertising in rabbitMQ aux process + + (cherry picked from commit 50006eae756edb075ebe15b7582cd0bfdbc57492) + + +2024-06-21 Razvan Crainea + * [481c12df89] : + + domain: init db connection in all processes + + If the db_mode says we should cache the dialog table and only reload it + in MI proceeses, the module would not initialize the db connection for + SIP workers/timers. This would prevent the mi_script from running the + mi() commands. + This fix initializes the db connection in all proceses, thus enabling + the reload behavior from any process. + + (cherry picked from commit e0d0f6b8fbfdabb8c7fd6e0a9307fb8df0caefe5) + + +2024-06-19 Razvan Crainea + * [c8f852fb84] : + + dialog: advertise dst_leg in callbacks + + This is particularly useful for in-dialog requests that come before the + dialog is established, such as a PRACK - this patch makes sure that the + correct leg is chosen by the topology hiding in such situations. + + (cherry picked from commit 93e90a5ac3a32dc9fde60ed974789f398e6d0885) + + +=========================== Release 3.4.6 ============================== + +2024-06-19 Bogdan-Andrei Iancu + * [31bbb28e2] : + + [event_kafka] remove bogus example in docs + + (cherry picked from commit ccc346b8e3c85fb07de0f05c8cde0123857382f2) + + +2024-06-18 Bogdan-Andrei Iancu + * [2d8ea8ef2] : + + [tcp] check if the history list exists when doing unref + + There are cases where the tcp conn may fail right at the beginning (like a failed connect/accept) and maybe the hist list is not yet attached to the conn. + + +2024-06-17 Razvan Crainea + * [ecbaff29c] : + + rtpengine: fix uninitialized tmp warning + + (cherry picked from commit 675db4c00019f7e782afcc4dbdc2c0860a710362) + + +2024-06-17 Bogdan-Andrei Iancu + * [3bb0d23d9] : + + [net/tcp] log the unref BEFORE destroying the conn + + +2024-06-16 OpenSIPS + * [27cc42dea] : + + Rebuild documentation + + +2024-06-14 Razvan Crainea + * [5b4a17035] : + + rtpproxy: fix structure copying + + (cherry picked from commit 80bee9b8c26efd1f3a5cd4b7df4c1a7c27a2dde3) + + +2024-06-14 Razvan Crainea + * [3b4f48a0c] : + + rtpengine: fix unitialized warning + + (cherry picked from commit 1c3139ae28ed815749e84c7289c50703d16f9191) + + +2024-06-14 Razvan Crainea + * [1b40fea3c] : + + rtp_relay: ignore correct branch index + + Many thanks to Liviu Chircu for spotting the issue + + (cherry picked from commit 90c9b78fb3330231129d49ab32ce4593654e7408) + + +2024-06-13 Razvan Crainea + * [231c71bf6] : + + packaging/debian: do not run berkeley stubs if not built + + If the berkeley package is not build, we should not run its stubs, as + they result in errors. + + Thanks go to Richard Revels (@rrevels-bw on GitHub) for reporting it. + Close #3389 + + (cherry picked from commit 2fba04ae731a519b8eb3a033e7a491aa3c7e8f66) + + +2024-06-13 Razvan Crainea + * [f36f40b05] : + + tracer: use own flag for B2B tracing + + This fix prevents crashes generated when the B2B module is loaded, but + tracing is done at the transaction layer - since the transaction layer + was setting the same flag, B2B tracing was also engaged, but without the + necessary structures, leading to crashes. + + (cherry picked from commit efc25521b294f61955b8a181234278dc8313ccf4) + + +2024-06-13 Razvan Crainea + * [65a5c86a5] : + + siprec: properly handle paused recording + + (cherry picked from commit 0091ab4751164b77a1ea928f04899101ea51c3fe) + + +2024-06-13 Razvan Crainea + * [77924d948] : + + siprec: expose streams in xml + + Close #3287 and #3293 + + (cherry picked from commit fb4402da3969eea64ecdd79b1233325d45346651) + + +2024-06-13 Liviu Chircu + * [54b671f9b] : + + db_sqlite raw queries: Fix unnecessary lowercase restriction + + The code was searching for the " from " string chunk in the query but + in a case-sensitive manner (??), causing formatted queries (e.g. " FROM + ") to fail. + + Credits to Eric Tamme (@etamme) for spotting and reporting the issue + + Fixes #3409 + + (cherry picked from commit 388d4faa99e1d1842d9510947020c3d11157aa2b) + + +2024-06-11 Liviu Chircu + * [098168d45] : + + Update opensips.vim syntax file (v3.4) + + +2024-06-11 Liviu Chircu + * [9d30b05cd] : + + menuconfig templates: Fix nat_uac_test() flags; Load a TLS module + + (cherry picked from commit 1768d6543ebd927081e27e78035c27472dc045d2) + + +2024-06-11 Bogdan-Andrei Iancu + * [4896e5cc2] : + + Remove b2b_logic_xml from exclude list + + The module does not exist anymore + + +2024-06-10 Bogdan-Andrei Iancu + * [bcaadf81c] : + + [nathelper] do proper URI enclosing for FROM and TO URIs + + Reported by @InnovateAsterisk + Closes #3405 + + (cherry picked from commit 9308abc20f177fdd49c1be770dccb100a696e524) + + +2024-06-09 OpenSIPS + * [5a8cca2f1] : + + Rebuild documentation + + +2024-06-06 Liviu Chircu + * [d607d10aa] : + + Fix shutdown crash when 'event_shm_threshold' is enabled + + The SHM lock is NULL at that point, so use shm_free_unsafe() instead. + + (cherry picked from commit d076141e4fa3f5c4ef9a67a72e0c0b23dcd37e7c) + + +2024-06-03 Bogdan Andrei IANCU + * [41475ade0] : + + Merge pull request #3400 from NormB/NormB-patch-4 + + Update b2b_logic_admin.xml + + (cherry picked from commit 909ac1b8896b9d7b76b840cf24e3b900a929a504) + + +2024-06-03 Bogdan Andrei IANCU + * [b353e3e01] : + + Merge pull request #3399 from NormB/NormB-patch-3 + + Update b2b_logic_admin.xml + + (cherry picked from commit e22e9c51a0562f453431610fc5c201ff9dbed13e) + + +2024-06-03 Liviu Chircu + * [6fe6e96ec] : + + Merge pull request #3403 from p120ph37/3.4 + + Fix `perl_exec_simple` memory leak + +2024-06-02 OpenSIPS + * [9d0e05a92] : + + Rebuild documentation + + +2024-05-31 Aaron Meriwether + * [a861f90a8] : + + Fix `perl_exec_simple` memory leak + + +2024-05-28 Liviu Chircu + * [9cfdab532] : + + db_mysql: Drop usage of MYSQL_OPT_RECONNECT in 8.0.35+ + + The auto-reconnect feature of libmysqlclient has been deprecated + starting with version 8.0.34 and is subject to future removal. + Moreover, OpenSIPS was explicitly disabling it anyway on startup, in + favour of the "max_db_queries" application-level query retrying loop. + + (cherry picked from commit 39f056b617c2997daa0fc7f49e7570b5ed94ca6f) + + +2024-05-26 OpenSIPS + * [185980664] : + + Rebuild documentation + + +2024-05-23 Razvan Crainea + * [577ffe1b2] : + + b2b_entities: logic_key should always be printable + + Many thanks to Voxtronic for spotting this issue! + + (cherry picked from commit f96335091d82a15c0a2d2e70f3a03fd7adfb1868) + + +2024-05-22 Liviu Chircu + * [1779c5060] : + + cfg parser: Avoid unnecessary strlen on error case + + When getline() returns -1, the @lineptr argument is never safe to read, + nor is this recommended. So when both rc == -1 and EOF conditions + occur, it is safe to assume we read 0 bytes, without doing the strlen(). + + Many thanks to Dhiraj Mishra (@RandomDhiraj) for detecting, documenting + and reporting the potential risk of a heap buffer overflow here! + + (cherry picked from commit 50b651c230eec5daaf52f8742a9c3dd92123f3d2) + + +2024-05-12 OpenSIPS + * [3eb9916b4] : + + Rebuild documentation + + +2024-05-10 Liviu Chircu + * [fdfe37f3b] : + + status_report: Avoid return 0 in sr_set_status() + + (cherry picked from commit 64c0042b4258eeaf1c52d6f37bda5b2d7d7a1ff7) + + +2024-05-10 Liviu Chircu + * [9f2d4d53b] : + + status_report: Fix bad 3rd parameter to sr_set_status() + + (cherry picked from commit 7f12c44813f080a3a2177c8d89a5c160b80139c9) + + +2024-05-10 Liviu Chircu + * [2939930ca] : + + Remove references to README-MODULES; Remove svn '$Id$' tags + + Reason: this file was slowly becoming more and more outdated and was + ultimately removed in 8292659d5, in favour of the opensips.org listing. + + Fixes #3375 + + (cherry picked from commit 5f3baea398885b93f25e6652001170a440758954) + + +2024-05-07 Liviu Chircu + * [a81afc112] : + + mid_registrar: Improve robustness vs. bad traffic in mode 2 + + In case the main registrar returns extra contacts, make sure to + correctly match the mid-registrar's *single* contact within the list, + then strip all Contacts from the 200 OK, effectively fixing it. + + Thanks go to Slava Bendersky for reporting and helping troubleshoot. + + (cherry picked from commit 7a9912602aa76b2af9dbdf8632cccb8aace7b22a) + + +2024-05-07 Maksym Sobolyev + * [126712e37] : + + usrloc: simplify processing of the refresh events + + Do not abuse "struct socket_info" just to pass sock_str over. + Instead, add str to the refresh event data and pass that alone. + Not only it reduces amount of data to pass, but also makes + code much easier to read and understand. + + (cherry picked from commit 04cb08e70ef467e5d599289abec485c957587d7c) + + +2024-05-05 OpenSIPS + * [dbe02b7ff] : + + Rebuild documentation + + +2024-05-02 Liviu Chircu + * [deb6b25e2] : + + freeswitch: Fix off-by-one comparison bug; Add safety checks + + Many thanks to Five9 (https://www.five9.com) for reporting this issue! + + +2024-05-02 Razvan Crainea + * [ee65c4def] : + + tracer: proper detection of dummy messages + + Complete commit 6fcfc70 + + (cherry picked from commit 99ea7e85722becabfc6788b2c089ecadd1115238) + + +2024-05-02 Liviu Chircu + * [80178f0c5] : + + Exclude "snmpstats" from multi-arch build + + It seems LTO is not possible with clang on the below arch, since + LLVMgold.so is not available, yet snmpstat's `net-snmp-config` program + includes the -ffat-lto-objects CFLAGS, which activates LTO. + + build_multiarch (clang-arm64-qemu-cross, ubuntu-22.04) + + /usr/bin/ld: /usr/lib/llvm-18/bin/../lib/LLVMgold.so: error loading + plugin: /usr/lib/llvm-18/bin/../lib/LLVMgold.so: cannot open shared + object file: No such file or directory + clang: error: linker command failed with exit code 1 (use -v to see invocation) + + (cherry picked from commit 7e421329810a7d11e5721e934d9e4ab52f3eb80a) + + +2024-05-02 Liviu Chircu + * [9590bd7e4] : + + Fix various ARM32 time_t warnings (Ubuntu 22.04) + + (cherry picked from commit 25107836920b2caa0e94d40538691752f3183f57) + + +2024-05-02 Liviu Chircu + * [b70c9270a] : + + usrloc: Fix a data packing bug + + (cherry picked from commit 52f21088b78647f4aa94bb66334e9ebeac6558a7) + + +2024-05-02 Liviu Chircu + * [8f6a9798f] : + + snmpstats: Fix clang warnings on ARM32/QEMU/Ubuntu-22.04 + + clang: warning: argument unused during compilation: + '-fno-stack-clash-protection' [-Wunused-command-line-argument] + (cherry picked from commit 077072d9a87c974d1a9cce67cbea66344db9e1a8) + + +2024-05-02 Liviu Chircu + * [fa4aa2143] : + + python build: Ensure "setuptools" is available + + (cherry picked from commit 4250ccd78f7c900a7eea844e9b41a0f487d08fa9) + + +2024-05-02 Liviu Chircu + * [cab8e5191] : + + b2b_entities: Fix ARM32 time_t warnings (Ubuntu 22.04) + + (cherry picked from commit 61ba2cc98cc63acca4774d153d6f66b5282831f0) + + +2024-05-02 Liviu Chircu + * [19236750e] : + + github/workflows: Auto-detect available libodbc packages + + (cherry picked from commit 63c9eb2306d7989cd63e53e778317e11c8ed16b5) + + github/workflows: Move auto-detection post apt-update + + (cherry picked from commit 3ab5a1cfb6372a40032989fe5e9e4b36df80aa94) + + github/workflows: Fix bash multi-line error + + (cherry picked from commit a09e75e8610925f4737b57dbcb1a38ef79068a2e) + + github/workflows: Avoid fancy bash syntax + + (cherry picked from commit 1e0ea18a637553a4c4ab51fb95428f05c37ddd62) + + +2024-05-02 Liviu Chircu + * [6893324a1] : + + Complete b8fdce475d (ARM32 warnings) + + (cherry picked from commit 41a20d6deca2861e2dce6b06485b3e0347c8fb4c) + + +2024-05-02 Liviu Chircu + * [e7c798e2b] : + + github/workflows: Add exception for multi-arch Ubuntu 22.04 + + (cherry picked from commit 761b844e6804ccba2aa006a8d2efd873e2d54992) + + +2024-05-02 Liviu Chircu + * [5a847bdad] : + + Attempt to fix GitHub Workflow + + On newer 22.04 Ubuntu, it seems the ODBC package has been bumped to "2". + + Related commits: + - fa652e8 + - 6bfd7d2 + + (cherry picked from commit dbf794dccad5f2865f955e693c85a65bc5046237) + + Fix a bunch of ARM32 printf() warnings (Ubuntu 22.04) + + (cherry picked from commit b8fdce475d6c8b7a3df3b2ae1b6d7ec64a053d9c) + + Attempt #2 to fix GitHub Workflow + + Previous commit fixed 22.04 but broke 20.04, so this commit should make + both work. + + (cherry picked from commit d7fcd90432494b259b608d5397c6dd2bcdaa3f59) + + Fix package typo + + (cherry picked from commit 44c995aae67d24f80161096a529ded398bd69c45) + + +2024-05-02 Razvan Crainea + * [6d6a0bec6] : + + parser: log_event_level_filter should be signed int + + This allow setting the filter to more severe levels, i.e. ERROR and + upper + + +2024-04-30 Liviu Chircu + * [0eafd4f7f] : + + Fix the E_CORE_SHM_THRESHOLD event + + For some time now, this event has not been functional, due to + init_shm_mallocs() being called *before* parsing the opensips.cfg, + leading to un-initialized event holders and a quick-exit at runtime, + including times when the event actually needs to be raised. + + Credits to Bogdan Iancu for reporting this issue! + + (cherry picked from commit b38b06aa763d8c7457d5e87c28b2d5f6676c5798) + + +2024-04-30 Bogdan-Andrei Iancu + * [f019ddc15] : + + [pua] properly insert sh_tag into pua table + + Credits go to @NormB + Fixes #3377 + + (cherry picked from commit 92b0dcfbdf75c456da2a66c607875ab60801df89) + + +2024-04-28 OpenSIPS + * [9a503f35c] : + + Rebuild documentation + + +2024-04-26 Razvan Crainea + * [c36068a2b] : + + event_route: fix int interpretation in $param + + Treat the integer as signed when building the $param value + + Many thanks to Norm Brandinger (@NormB on GitHub) for reporting it in #3367 + + (cherry picked from commit 999b8ac5d35f1e53af5cf854b3be2ef5936b2cd0) + + +2024-04-26 Bogdan-Andrei Iancu + * [2d82d20ee] : + + [presence] fix evaluating shtag when cluster disabled + + Avoid evaluating sharing tags when the clustering support in presence module is disabled. + Related to #3359 + + (cherry picked from commit 6af90398171f8f872e68ffe52ee664a285ad6b6c) + + +2024-04-25 Bogdan-Andrei Iancu + * [adf1f7907] : + + [presence_callinfo] fix non-optional params for sca_set_xxx_line() funcs + + The line parameter is supposed to be optional + Reported by @NormB + Closes #3361 + + (cherry picked from commit a80ff86657dc1bb31abb490f151b74317d99c1bd) + + +2024-04-25 Bogdan-Andrei Iancu + * [f8941cb77] : + + [registrar] fix mem bug and mem leak in UA-regexp filter + + The compiled RE (for UA) is to be freed by the fixup-free function and not by the script function. + Reported by @feiyingcheung + Closes #3356 + + (cherry picked from commit b7a8040711f5d801a361722d5ff5bce236ebdfb0) + + +2024-04-25 Bogdan-Andrei Iancu + * [f3912dc34] : + + [registrar] removed old obsolete fixup function + + (cherry picked from commit 887f17b6e076c89b845c81b6ed0741bd3c5177a7) + + +2024-04-24 Bogdan-Andrei Iancu + * [253ad43d3] : + + [proto_ws] fix mem leak when hdr parsing fails + + Even if the hdr parsing failed (due to a bogus hdr), you still have to free whatever hdrs were already parsed ;) + Reported by @11qeq11 + Closes #3353 + + (cherry picked from commit 6a847364b5122d6abc76229c892fb8d48c24fac5) + + +2024-04-23 Razvan Crainea + * [79953d755] : + + tracer: do not trace dummy messages + + If a message is dummy, it should not be traced, as it is never actually + sent to any participants. + This fixes the errors dumped by the module when trying to trace a dummy + (such as a locally generated BYE due to timeout) message that does not + have a bind socket, erroneously logging + `CRITICAL:tracer:proto2str: unsupported proto 0` + + (cherry picked from commit 6fcfc706082c124809ed68186ce6299af884dccd) + + +2024-04-22 Bogdan-Andrei Iancu + * [799da7c2d] : + + [presence] fix federation with local HA combination + + Added a sharing tag to control which node (from the HA combination) is active in the federated cluster. See all the details here https://github.com/OpenSIPS/opensips/issues/2960 + (this is fully backward compatible) + + Closes #2960 + + (cherry picked from commit 8b96b70327ab80e14499edfabd6021d24acbc020) + + +2024-04-21 OpenSIPS + * [b278b74ae] : + + Rebuild documentation + + +2024-04-19 Bogdan-Andrei Iancu + * [fc3609552] : + + [tracer] adapt the backport + + +2024-04-19 Bogdan Andrei IANCU + * [5b5ac2768] : + + Merge pull request #3364 from ovidiusas/master + + tracer: set proper IP instead of FQDN for locally generated requests and outgoing replies + (cherry picked from commit 0b9916c1bd5bb000cf93e761c79129409ecca615) + + +=========================== Release 3.4.5 ============================== + +2024-04-15 Razvan Crainea + * [f4921e3bf] : + + tracer: avoid crash in case bind_address is not present + + Introduced in a13e034 + + (cherry picked from commit b7f471f7b106b1594cb8bccd3fc07228c071713e) + + +2024-04-14 OpenSIPS + * [9a0852850] : + + Rebuild documentation + + +2024-04-09 Liviu Chircu + * [5f7b25036] : + + usrloc: Avoid firing DELETE and EXPIRE for same ct + + This patch fixes a usrloc callbacks API issue where both the + UL_CONTACT_DELETE and UL_CONTACT_EXPIRE events would often be fired for + the same contact, when the "write-back" SQL mode is in use. + + The following modules should notice improved behavior: + mid_registrar, pua_bla, pua_usrloc, snmpstats + + (cherry picked from commit 1a50d66475310b8d1c73fd383b2a64733f24ea2f) + + +2024-03-31 OpenSIPS + * [68bfb9b40] : + + Rebuild documentation + + +2024-03-29 Bogdan-Andrei Iancu + * [40f661bba] : + + [drouting] fixed weight based selection + + if the last element has weight 1, it will never be selected. + This was instroduced with 48c051fc16f4d83bf176d1eefe1df642882b6b88. + The fix is to actually follow the initial PR approach, which was correct. My attempt to improve the original PR actually broke stuff there :( + + (cherry picked from commit cdd84307a4b4cc08209111e96adef0df8b6ae3ea) + + +2024-03-27 Liviu Chircu + * [7b37bdd72] : + + registrar docs: Clarify that save/lookup flags are CSVs + + (cherry picked from commit 9357cd43860f77057e8a0c17dded94b12357d840) + + +2024-03-19 Bogdan-Andrei Iancu + * [de6fcb66b] : + + [db] fix wrong size for mangled_from/to_uri columns in dialog table + + They are URIs, so let's use the URI len, not USER len :) + + (cherry picked from commit 18e7d8dbb56289e83531f51983f63e58f152ef3f) + + +2024-03-10 OpenSIPS + * [829786eb8] : + + Rebuild documentation + + +2024-03-08 Razvan Crainea + * [07e063c44] : + + rtpengine: proper count of the exported processes + + This should fix a memory corruption generated by reloading a process + that was not initially counted. Moreover, an overflow is no longer + possible, as the commit checks on it and triggers a BUG in case it + happens + + (cherry picked from commit 831cdd5ac46412ba8c82e36d4a61648717d9b5b2) + + +2024-03-08 Liviu Chircu + * [9664d5dc1] : + + rest_client: Fix RHEL 7.9 build regression in commit 7e85fddb6 + + RHEL 7.9 is using libcurl 7.29 (from 11 years ago), so the + CURLINFO_CONNECT_TIME_T easyinfo option is not available. So let's use + the CURLINFO_CONNECT_TIME info instead, which returns the exact same + data (i.e. the `data->progress.t_connect` handle info), but divided as + (double)seconds instead of being returned as (long)useconds. + + Credits to Răzvan Crainea for reporting this issue! + + (cherry picked from commit 975f5d13e9444dcb4ebab8f0dec50637ca3809da) + + +2024-03-08 Răzvan Crainea + * [aa2778bb0] : + + Merge pull request #3330 from NormB/master + + Update rtp_relay_ctx.c to avoid segfault + + (cherry picked from commit fcfacae755a8ea7fb0b103a1b5ad8d65c1a65546) + + +2024-03-03 OpenSIPS + * [87e9c6598] : + + Rebuild documentation + + +2024-02-29 Liviu Chircu + * [e50c6736e] : + + aaa_diameter docs: Fix missing default 'answer_timeout' + + (cherry picked from commit 3d386f4e22a76bdd4487b15284afd9795b42cd86) + + +2024-02-28 Razvan Crainea + * [c57dfe4dc] : + + proto_hep: clear context in case of error + + Thanks go to Jonathan Hulme from ConnexCS for reporting and providing + valuable troubleshooting information + + (cherry picked from commit ff2923cc4bfb9b6e6a497becbd97f2407cbdc6f8) + + +2024-02-26 Liviu Chircu + * [5393f19cb] : + + aaa_diameter: Fix some AVP typos; Add a few notices + + (cherry picked from commit 4da5b7317fcccbcd48725d8fbde8aeaa47f3b69f) + + +2024-02-25 OpenSIPS + * [e4c61e3c4] : + + Rebuild documentation + + +2024-02-23 Bogdan Andrei IANCU + * [7ffc81238] : + + Merge pull request #3306 from jes/getsockopt-warnings + + Getsockopt warnings + + (cherry picked from commit be64db1383fc2d66cfb1d343474562d7b132c478) + + +2024-02-22 Razvan Crainea + * [6d7ccca31] : + + msg_translator: avoid mem leak when via params are present + + Many thanks to Nick Altmann for spotting the issue and fixing it! + + (cherry picked from commit d0f238ca8bd47e75b3867b3194962421dbf523c0) + + +2024-02-22 Bogdan Andrei IANCU + * [c7e2c163f] : + + Merge pull request #3308 from ovidiusas/master + + core: consistent usage of int2str_buf + (cherry picked from commit 358afd07328c10434a2575cee8ce977d42e7656c) + + +2024-02-22 Razvan Crainea + * [8cdbfe619] : + + rtpengine: always provide flags for any subcommand + + (cherry picked from commit 4bf072d6338d584db64145c798b3dabc3e454248) + + +2024-02-22 Razvan Crainea + * [4b212321e] : + + rtp_relay: proper cleanup of a copy context + + When a copy context was deleted, a dangling pointer would have remained + in the session - this would lead to a crash, since it would access + invalid memory. + + Thanks go to Rob Moore from Dubber for reporting this! + + (cherry picked from commit 4efc482fc1fa1c518357e6b47a0cc1ee15e25cd1) + + +=========================== Release 3.4.4 ============================== + +2024-02-21 Liviu Chircu + * [47776bc00] : + + rest_client: Improve cURL compatibility when using async() + + This patch aims to fix a regression in 1ecb32491f, breaking the + "SUCCESS" async download test case. Mitigation as follows: + + * improved detection for the "Request Sent" state, before putting the + download on async hold. It seems that whenever both the + CURLINFO_CONNECT_TIME_T and CURLINFO_REQUEST_SIZE become available, + the file descriptor can be safely polled on, awaiting the reply. + Note: there is no official cURL library mechanism to detect this + state. + + * make the async() statement timeout accessible to modules. This fixes + a bug where a GET on a dead HTTP server would time out after + `curl_timeout` seconds, instead of `async()` seconds (lower). + + Fixes #3286 + + (cherry picked from commit 7e85fddb6e463cbdfb43015c3384ef5dbb5e5896) + + +2024-02-21 Razvan Crainea + * [a4b6b21ae] : + + rtp_relay: handle NULL resetting the rtp_relay_ctx value + + Thanks go to Rob Moore from Dubber for reporting this! + + +2024-02-18 OpenSIPS + * [f299b68c8] : + + Rebuild documentation + + +2024-02-13 Bogdan Andrei IANCU + * [0f46cdd76] : + + Merge pull request #3262 from jes/jes/topology-hiding-fix + + topology_hiding: fix encoded Contact length calculation + + (cherry picked from commit da20b2259fd3f96a7530bfd72753a8338e3c4212) + + +2024-02-12 Liviu Chircu + * [45d8d21e0] : + + freeswitch: Avoid failed "unref" operations during mod init + + This fixes a bug where if a FreeSWITCH socket were defined in both + modparam and DB, it would get a +2 ref instead of +1, thus after a DB + removal + reload operation it would remain in a dangling state. + + Many thanks to Five9 (https://www.five9.com) for reporting this issue! + + (cherry picked from commit 6e6c60bd60329e1b0202e7e57cee5f71e2210f34) + + +2024-02-11 OpenSIPS + * [736cd72b4] : + + Rebuild documentation + + +2024-02-09 Razvan Crainea + * [9846f9979] : + + siprec: avoid double unref for failed transaction + + Many thanks to Voxtronic for reporting this! + + (cherry picked from commit 28ea0565cabdbd703ddaab9351628aad43e03775) + + +2024-02-09 Razvan Crainea + * [202a9c705] : + + rtp_relay: clear established when sess is deleted + + This avoids crashes when ctx->established pointer remains dangling + + Many thanks to Voxtronic for spotting this issue! + + (cherry picked from commit 9600ae72d74ed3d7c7a3bf9655dc4e578ea5d3af) + + +2024-02-04 OpenSIPS + * [7edd32586] : + + Rebuild documentation + + +2024-02-02 Razvan Crainea + * [4b7f12172] : + + dialog: get ACK cseq from src leg, rather than dst + + (cherry picked from commit b8bbf1440481c6a2744b6223adfca4608c88c5ea) + + +2024-02-02 Liviu Chircu + * [80acd74af] : + + b2b_logic: Fix a logical bug which could cause crashes + + ... in b2b_init_request(). Completes c84fe372c. + + Neither @e1 or @e2 can be NULL after the "if" guard, otherwise there is + a good chance of a crash shortly afterwards. + + (cherry picked from commit dec380907283b962fa2f1296b0fec1cd730708ea) + + +2024-02-02 Bogdan-Andrei Iancu + * [42a6d3277] : + + [b2b_logic] fix bogus documented prototype for b2b_init_request + + (cherry picked from commit e5f0b5a2cff12e0cbce32d37eb116d489d2fdfc4) + + +2024-01-29 Liviu Chircu + * [2ac87e6e1] : + + RADIUS/Diameter: Fix AVP type for Sip-From-Tag, Sip-To-Tag + + This patch fixes a copy/paste error in commit a2c6c62ba1. + + (cherry picked from commit f8205d1f2d0ea831f1af171e9426dcb928dd3780) + + +2024-01-28 OpenSIPS + * [73b88429b] : + + Rebuild documentation + + +2024-01-23 Bogdan-Andrei Iancu + * [c97e87d38] : + + [sql_cacher] fix proper update on status/report upon quick exit + + Be sure the SR info is properly updated (on the reload result) even when doing a quick return upon no records loaded + + (cherry picked from commit 32539ef8b31f6aefff424219ebf90b4fede86058) + + +2024-01-23 Bogdan Andrei IANCU + * [8cca345ff] : + + Merge pull request #3289 from purecloudlabs/hotfix/sql-cacher_load_entire_table_memory_leak + + sql_cacher: fix SQL result leak when insert_in_cachedb fails + + (cherry picked from commit 3bef4afe600054a52252ca5513ebce50daac2c3a) + + +2024-01-23 Bogdan-Andrei Iancu + * [1c8e55f05] : + + [sql_cacher] promote DBG to ERR to report failures + + Similar to 4ddb507f19bb48654a1dd1f279d4092b301d17f2 + + (cherry picked from commit d3cc59ba6fe52e243acf2f9177583048f068e477) + + +2024-01-23 Bogdan Andrei IANCU + * [0b88c8cf0] : + + Merge pull request #3288 from purecloudlabs/hotfix/sql_cacher_mi_reload_error_loglevel + + sql_cacher: MI/timer initiated table reload error logged on different log level + + (cherry picked from commit 4ddb507f19bb48654a1dd1f279d4092b301d17f2) + + +2024-01-23 Razvan Crainea + * [9bda21e73] : + + b2b_logic: document adv_contact param for b2b_bridge_request + + Complete 726fca1523 + + (cherry picked from commit ce9fccc7f7347568cb16621a02c6480eb8a89542) + + +2024-01-21 OpenSIPS + * [6a8761078] : + + Rebuild documentation + + +2024-01-19 Bogdan-Andrei Iancu + * [b9c291f7b] : + + [presence_dfks] fix XML namespace URL + + (cherry picked from commit 012587e22fa9e7e3b47f66f1afe85e63fab43b44) + + +2024-01-17 Liviu Chircu + * [00130dd54] : + + for-each statement: Fix iteration when context is used + + Make sure to interpret the variable's context, if any, e.g.: + + for ($var(ct) in $(ct[*])) + xlog("300 Redirect Contact: $var(ct)\n"); + + (cherry picked from commit 1d6d2e4b5b91990199b8351b473b8d159e362fba) + + +2024-01-16 Razvan Crainea + * [9f5a598a7] : + + rtp_relay: match reply leg by index, if tag not present + + (cherry picked from commit 133c971e8ecb002f79d4113a2c8754b7d39a58a7) + + +2024-01-16 Razvan Crainea + * [2101c75b6] : + + dialog: do not populate dst_leg on unmatched dlg + + Avoid chaning the dst_leg on unmatched dialogs, as this might lead to + inconsistent states. A common pattern is to match a dialog in state 5, + which would set a dst_leg, but then "invalidate" the dialog due to the + bad state - proceeding to a next dialog would not set the dst_leg (as it + was set by the previous match), leading to an invalid access in the + second dialog. + + Credits go to NFON for reporting and providing valuable troubleshooting + information + + (cherry picked from commit 224a3236cbeaeb06a897cb3beab8c3a0c3d5903f) + + +2024-01-16 Bogdan-Andrei Iancu + * [98781cde4] : + + Fix printing all values of branch(subfield) + + The [*] range was printing all the time the URI subfield of the branches, instead of the requested one. + + (cherry picked from commit 1a11c03a3822cf710ae8af5b5da358d0003d61d5) + + +2024-01-14 OpenSIPS + * [a9bc81085] : + + Rebuild documentation + + +2024-01-11 Liviu Chircu + * [072abebe9] : + + tracer: Fix mixing between "src_ip" and "dst_ip" + + Completes a13e03420c + + Credits to James Seer for reporting this issue! + + (cherry picked from commit fd894705feacc95f1eae1af2d6554ce2b10bf5ad) + + +2024-01-11 Bogdan-Andrei Iancu + * [49692174c] : + + [presence_dfks] updated link to DFKS specs + + (cherry picked from commit f3657e4860e38f7f18f26481f21de245afea9da1) + + +2024-01-09 Liviu Chircu + * [041a7b5bc] : + + transformations: Fix edge-cases with {param.value} and {uri.param} + + For inputs containing only the parameter part, these transformations + would return a bogus {NULL, 0} value (flagged as PV_VAL_STR), which + cannot be used in assignments or conditional checks: + + Credits to Bogdan-Andrei Iancu for finding this issue! + + (cherry picked from commit b7c4f2a3bb3307b3c505f7017934a52bef8762fd) + + +2024-01-08 Liviu Chircu + * [6e71d9293] : + + nathelper: Improve nat_uac_test() docs + + The function involves neither trying nor guessing, it's quite precise. + + (cherry picked from commit 0fb0094b2e4be6638bce51872f1b4aa6d5438c2d) + + +2024-01-07 OpenSIPS + * [5e50fd871] : + + Rebuild documentation + + +2024-01-04 Peter Lemenkov + * [b61381fd7] : + + Ensure VERSIONTYPE is always defined + + Signed-off-by: Peter Lemenkov + (cherry picked from commit 22ef73ed10cc08995211763293a6b87ee88a2666) + + +2024-01-04 Razvan Crainea + * [9f69bc033] : + + rtp_relay: fix broken ref taken with lock + + This caused a deadlock when DLG registers were not able to be setup. + + (cherry picked from commit aae8b39b5779f37f41c828687d6e54667ddc13e4) + + +2023-12-29 OpenSIPS + * [f3c3f1132] : + + Rebuild documentation + + =========================== Release 3.4.3 ============================== 2023-12-20 Razvan Crainea diff --git a/INSTALL b/INSTALL index 8afc43aeff4..6c1f251d674 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,3 @@ -$Id$ - =========================================== diff --git a/Makefile b/Makefile index 9b15fccd5a4..6003dda6c4f 100644 --- a/Makefile +++ b/Makefile @@ -116,7 +116,7 @@ modules_full_path=$(join $(modules), $(addprefix /, $(modules_names))) ALLDEP=Makefile Makefile.sources Makefile.defs Makefile.rules Makefile.conf $(deps_gen) -install_docs := README-MODULES AUTHORS NEWS README +install_docs := AUTHORS NEWS README ifneq ($(skip-install-doc),yes) install_docs += INSTALL endif diff --git a/Makefile.conf.template b/Makefile.conf.template index b54976c6036..5196164ca14 100644 --- a/Makefile.conf.template +++ b/Makefile.conf.template @@ -1,7 +1,6 @@ #aaa_diameter= Diameter implementation for the core AAA API | freeDiameter (libfdcore + libfdproto) v1.2.1 or higher #aaa_radius= Radius implementation for the core AAA API | Radius client development library, typically radiusclient-ng 0.5.0 or higher #auth_jwt= JWT auth support | JWT client development library, libjwt-dev -#b2b_logic_xml= Logic engine of B2BUA, responsible of actually implementing the B2BUA services | xml parsing development library, typically libxml2-dev #cachedb_cassandra= Implementation of a cache system designed to work with Cassandra servers | thrift 0.6.1 #cachedb_couchbase= Implementation of a cache system designed to work with CouchBase servers | libcouchbase >= 2.0 #cachedb_memcached= Implementation of a cache system designed to work with a memcached server. | Memcached client library, typically libmemcached diff --git a/Makefile.defs b/Makefile.defs index 049739d3442..f0899ba4cec 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -66,7 +66,7 @@ MAIN_NAME=opensips #version number VERSION_MAJOR = 3 VERSION_MINOR = 4 -VERSION_SUBMINOR = 3 +VERSION_SUBMINOR = 11 VERSION_BUILD = ifneq (,$(VERSION_BUILD)) diff --git a/README b/README index fa6efbbe925..2e40f984cff 100644 --- a/README +++ b/README @@ -1,8 +1,7 @@ -$Id$ ****************************************************************************** * * -* Welcome to OpenSIPS Project * +* Welcome to OpenSIPS Project * * * ****************************************************************************** @@ -31,7 +30,8 @@ file. For current developers/contributors of this project, see the CREDITS and AUTHORS file. For complete license information, please see the COPYING file. -For a quick overview of OpenSIPS modules, please see the README-MODULES file. +For an overview of OpenSIPS modules, see this listing on opensips.org: + https://www.opensips.org/Documentation/Modules Docs @@ -58,12 +58,12 @@ reports, etc - please use the devel@lists.opensips.org public mailing list. -For questions regarding businesses around OpenSIPS - like products, +For questions regarding businesses around OpenSIPS - like products, consultancy, trainings, etc - please use the business@lists.opensips.org public mailing list. -Also there is a generic news mailing list where you can learn about what is +Also there is a generic news mailing list where you can learn about what is new or important for the OpenSIPS project, about alerts and updates regarding relaces and about events around the project. news@lists.opensips.org diff --git a/README.md b/README.md index 589a143d237..0836d8e4c2b 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ file. For current developers/contributors of this project, see the [CREDITS](CREDITS) and [AUTHORS](AUTHORS) file. For complete license information, please see the [COPYING](COPYING) file. -For a quick overview of OpenSIPS modules, please see the [README-MODULES](README-MODULES) file. +For an overview of OpenSIPS modules, a [modules listing](https://www.opensips.org/Documentation/Modules) +is available on the opensips.org website. ## Docs diff --git a/async.c b/async.c index 63eaa325110..173aba0fe25 100644 --- a/async.c +++ b/async.c @@ -342,18 +342,21 @@ int async_script_launch(struct sip_msg *msg, struct action* a, if (report_route) { ctx->report_route = dup_ref_script_route_in_shm( report_route, 0); if (!ref_script_route_is_valid(ctx->report_route)) { - LM_ERR("failed dup resume route -> act in sync mode\n"); - goto sync; - } - - if (report_route_param) { - ctx->report_route_param.s = (char *)(ctx+1); - ctx->report_route_param.len = report_route_param->len; - memcpy(ctx->report_route_param.s, report_route_param->s, - report_route_param->len); + LM_ERR("failed dup resume route -> ignoring it\n"); + if (ctx->report_route) { + shm_free(ctx->report_route); + ctx->report_route = NULL; + } } else { - ctx->report_route_param.s = NULL; - ctx->report_route_param.len = 0; + if (report_route_param) { + ctx->report_route_param.s = (char *)(ctx+1); + ctx->report_route_param.len = report_route_param->len; + memcpy(ctx->report_route_param.s, report_route_param->s, + report_route_param->len); + } else { + ctx->report_route_param.s = NULL; + ctx->report_route_param.len = 0; + } } } @@ -383,7 +386,7 @@ int async_script_launch(struct sip_msg *msg, struct action* a, if (ctx->report_route) shm_free(ctx->report_route); shm_free(ctx); - if (report_route==NULL) + if (!ref_script_route_check_and_update(report_route)) return 1; /* run the report route inline */ diff --git a/async.h b/async.h index 48110376d25..8e81c14fde7 100644 --- a/async.h +++ b/async.h @@ -58,8 +58,11 @@ typedef struct _async_ctx { void *resume_param; /* the function to be called upon a timeout event while waiting to read */ void *timeout_f; - /* the maximum allowed time for the async op to complete, hinted by the - * more complex async implementation (seconds). Default: 0 (no limit) */ + + /* Optional time limit (seconds) for the async op to complete: + * - on input: the core async() timeout or 0, presented to the module + * - on output: an updated timeout, if any, as processed by the module + * Default: 0 (no timeout) */ unsigned int timeout_s; } async_ctx; diff --git a/bin_interface.c b/bin_interface.c index c0291602bbc..b6e2e50781d 100644 --- a/bin_interface.c +++ b/bin_interface.c @@ -37,7 +37,7 @@ void set_len(bin_packet_t *packet) { } /** - * bin_init - begins the construction of a new binary packet (header part): + * _bin_init - begins the construction of a new binary packet (header part): * * +-----------------------------+-------------------------------------------------------+ * | 12-byte HEADER | BODY max 65535 bytes | @@ -48,8 +48,8 @@ void set_len(bin_packet_t *packet) { * @param: { LEN, CAP } + CMD + VERSION * @length: initial packet size. specify 0 to use the default size (BIN_MAX_BUF_LEN) */ -int bin_init(bin_packet_t *packet, str *capability, int packet_type, - short version, int length) +int _bin_init(bin_packet_t *packet, str *capability, int packet_type, + short version, int length, int use_sysmalloc) { if (length != 0 && length < MIN_BIN_PACKET_SIZE + capability->len) { LM_ERR("Length parameter has to be greater than: %zu\n", @@ -60,14 +60,20 @@ int bin_init(bin_packet_t *packet, str *capability, int packet_type, if (!length) length = BIN_MAX_BUF_LEN; - packet->type = packet_type; - - packet->buffer.s = pkg_malloc(length); + if (use_sysmalloc) { + packet->buffer.s = malloc(length); + packet->flags = BINFL_SYSMEM; + } else { + packet->buffer.s = pkg_malloc(length); + packet->flags = 0; + } if (!packet->buffer.s) { LM_ERR("No more pkg memory!\n"); return -1; } + packet->buffer.len = 0; + packet->type = packet_type; packet->size = length; /* binary packet header: marker + pkg_len */ @@ -112,6 +118,7 @@ void bin_init_buffer(bin_packet_t *packet, char *buffer, int length) packet->buffer.len = length; packet->buffer.s = buffer; packet->size = length; + packet->flags = 0; bin_get_capability(packet, &capability); @@ -441,6 +448,7 @@ void call_callbacks(char* buffer, struct receive_info *rcv) packet.buffer.len = pkg_len; packet.size = pkg_len + 50; + packet.flags = 0; memcpy(packet.buffer.s, buffer, pkg_len); bin_get_capability(&packet, &capability); @@ -481,7 +489,9 @@ static int bin_extend(bin_packet_t *packet, int size) else packet->size = 2 * required; - packet->buffer.s = pkg_realloc(packet->buffer.s, packet->size); + packet->buffer.s = (packet->flags & BINFL_SYSMEM) ? + realloc(packet->buffer.s, packet->size) : + pkg_realloc(packet->buffer.s, packet->size); if (!packet->buffer.s) { LM_ERR("pkg realloc failed\n"); return -1; @@ -493,7 +503,10 @@ static int bin_extend(bin_packet_t *packet, int size) void bin_free_packet(bin_packet_t *packet) { if (packet->buffer.s) { - pkg_free(packet->buffer.s); + if (packet->flags & BINFL_SYSMEM) + free(packet->buffer.s); + else + pkg_free(packet->buffer.s); packet->buffer.s = NULL; } else { LM_INFO("atempting to free uninitialized binary packet\n"); diff --git a/bin_interface.h b/bin_interface.h index 61b54b8b24d..1db49240e91 100644 --- a/bin_interface.h +++ b/bin_interface.h @@ -59,11 +59,16 @@ } while (0) #define ensure_bin_version(pkt, needed) _ensure_bin_version(pkt, needed, "") +typedef unsigned bin_packet_flags_t; +#define BINFL_SYSMEM (1U<<0) + typedef struct bin_packet { str buffer; char *front_pointer; + struct bin_packet *next; int size; int type; + bin_packet_flags_t flags; /* not populated by bin_interface */ int src_id; } bin_packet_t; @@ -123,8 +128,10 @@ int bin_register_cb(str *cap, void (*cb)(bin_packet_t *, int, * * @return: 0 on success */ -int bin_init(bin_packet_t *packet, str *capability, int packet_type, short version, - int length); +int _bin_init(bin_packet_t *packet, str *capability, int packet_type, short version, + int length, int use_sysmalloc); +#define bin_init(_pk, _cap, _pt, _ver, _len) \ + _bin_init(_pk, _cap, _pt, _ver, _len, 0) /** * function called to build a binary packet with a known buffer diff --git a/cachedb/cachedb_id.c b/cachedb/cachedb_id.c index b509d1a51e2..1ca05af3ed1 100644 --- a/cachedb/cachedb_id.c +++ b/cachedb/cachedb_id.c @@ -89,7 +89,7 @@ static int parse_cachedb_url(struct cachedb_id* id, const str* url) enum state st; unsigned int len, i, ipv6_flag=0, multi_hosts=0; - char* begin, *last_at; + char* begin, *last_at, *last_slash, *last_qm; char* prev_token,*start_host=NULL,*start_prev=NULL,*ptr; prev_token = 0; @@ -112,7 +112,15 @@ static int parse_cachedb_url(struct cachedb_id* id, const str* url) if (dupl_string(&id->initial_url,url->s,url->s+url->len) < 0) goto err; - last_at = q_memrchr(url->s, '@', url->len); + last_slash = q_memrchr(url->s, '/', url->len); + last_qm = q_memrchr(url->s, '?', url->len); + + /* ignore any '@' characters inside the "params" part */ + if (last_qm || last_slash) + last_at = q_memrchr(url->s, '@', + last_slash ? (last_slash-url->s) : (last_qm-url->s)); + else + last_at = q_memrchr(url->s, '@', url->len); for(i = 0; i < len; i++) { switch(st) { diff --git a/cachedb/test/test_cachedb.c b/cachedb/test/test_cachedb.c index 3d640793e58..da0eaf961bd 100644 --- a/cachedb/test/test_cachedb.c +++ b/cachedb/test/test_cachedb.c @@ -927,4 +927,17 @@ static void test_cachedb_url(void) ok(!strcmp(db->host, "h1,h2,h3:6379")); ok(!strcmp(db->database, "d")); ok(db->port == 0); + + CDB_PARSE("mongodb://opensips-voip-cosmosdb:" + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + "@opensips-voip-cosmosdb.mongo.cosmos.azure.com:10255" + "/?ssl=true&replicaSet=opensipsdb&retrywrites=false" + "&maxIdleTimeMS=120000&appName=@opensips-voip-cosmosdb@"); + ok(db->flags == 0); + ok(!strcmp(db->username, "opensips-voip-cosmosdb")); + ok(!strcmp(db->password, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")); + ok(!strcmp(db->host, "opensips-voip-cosmosdb.mongo.cosmos.azure.com")); + ok(db->port == 10255); + ok(!strcmp(db->extra_options, "ssl=true&replicaSet=opensipsdb&retrywrites=false&maxIdleTimeMS=120000&appName=@opensips-voip-cosmosdb@")); + ok(!db->database); } diff --git a/ccopts.sh b/ccopts.sh index 39e5ef7ea25..5a3130b2f15 100644 --- a/ccopts.sh +++ b/ccopts.sh @@ -1,6 +1,5 @@ #!/bin/sh -#$Id$ # # returns the CFLAGS for the given compiler (maximum optimizations) # diff --git a/ccver.sh b/ccver.sh index 9e9596a8787..801b488c215 100644 --- a/ccver.sh +++ b/ccver.sh @@ -1,6 +1,5 @@ #!/bin/sh -#$Id$ # # finds CC version and prints it in the following format: # compiler_name version major_version diff --git a/cfg.y b/cfg.y index ab0c2ad6b56..acddd4bebd3 100644 --- a/cfg.y +++ b/cfg.y @@ -982,7 +982,7 @@ assign_stm: LOGLEVEL EQUAL snumber { IFOR(); set_log_consumer_level_filter(&s_tmp, $3); } | SYSLOG_LEVEL_FILTER EQUAL error { yyerror("number expected"); } - | LOG_EVENT_LEVEL_FILTER EQUAL NUMBER { IFOR(); + | LOG_EVENT_LEVEL_FILTER EQUAL snumber { IFOR(); log_event_level_filter = $3; } | LOG_EVENT_LEVEL_FILTER EQUAL error { yyerror("number expected"); } | STDERROR_FORMAT EQUAL STRING { IFOR(); diff --git a/cfg_pp.c b/cfg_pp.c index 4042a8cc0d4..0ca976198e4 100644 --- a/cfg_pp.c +++ b/cfg_pp.c @@ -368,7 +368,7 @@ static int __flatten_opensips_cfg(FILE *cfg, const char *cfg_path, goto out_err; } - line_len = strlen(line); + line_len = 0; break; } else if (line_len == 0) { diff --git a/db/README b/db/README index 11ad6cf6c9f..53649ed73c5 100644 --- a/db/README +++ b/db/README @@ -1,5 +1,3 @@ -$Id$ - This directory contains generic database support interface. The interface should be used by all modules willing to communicate with a database. OpenSIPS can then switch from one database to another simply by loading a different diff --git a/db/db_id.h b/db/db_id.h index d299ebc0719..50ad9e56f0e 100644 --- a/db/db_id.h +++ b/db/db_id.h @@ -31,6 +31,11 @@ #define DB_TLS_DOMAIN_PARAM "tls_domain" #define DB_TLS_DOMAIN_PARAM_EQ DB_TLS_DOMAIN_PARAM "=" +#define DB_TLS_DOMAIN_PARAM_EQ_S (sizeof(DB_TLS_DOMAIN_PARAM_EQ) - 1) + +#define DB_TLS_OPTS_PARAM "tls_opts" +#define DB_TLS_OPTS_PARAM_EQ DB_TLS_OPTS_PARAM "=" +#define DB_TLS_OPTS_PARAM_EQ_S (sizeof(DB_TLS_OPTS_PARAM_EQ) - 1) /** Structure representing a database ID */ struct db_id { diff --git a/db/doc/db-api.txt b/db/doc/db-api.txt index f9c124b5e8c..f282e8c5ef9 100644 --- a/db/doc/db-api.txt +++ b/db/doc/db-api.txt @@ -1,5 +1,3 @@ -# $Id$ -# Generic Database Interface -------------------------- diff --git a/db/example/Makefile b/db/example/Makefile index 0c34a00fe9c..a2e465f5503 100644 --- a/db/example/Makefile +++ b/db/example/Makefile @@ -1,4 +1,3 @@ -# $Id$ # # database example module makefile # diff --git a/db/example/README b/db/example/README index 0d0ab19eed6..56ed3a31ccf 100644 --- a/db/example/README +++ b/db/example/README @@ -1,7 +1,6 @@ -$Id$ This is very simple example module that shows how to use database interface. If you want to compile this module, move it to modules -directory. \ No newline at end of file +directory. diff --git a/db/schema/Makefile b/db/schema/Makefile index ad1e37fe1af..6666fa6ff78 100644 --- a/db/schema/Makefile +++ b/db/schema/Makefile @@ -1,6 +1,3 @@ -# -# $Id$ -# # OpenSIPS database descriptions for modules TABLES := $(patsubst opensips-%.xml,%,$(wildcard opensips-*.xml)) diff --git a/db/schema/dialog.xml b/db/schema/dialog.xml index 0ce070a6422..a973dc664ec 100644 --- a/db/schema/dialog.xml +++ b/db/schema/dialog.xml @@ -69,7 +69,7 @@ mangled_from_uri string - &user_len; + &uri_len; The mangled from URI, in case uac_replace_from @@ -79,7 +79,7 @@ mangled_to_uri string - &user_len; + &uri_len; The mangled to URI, in case uac_replace_to diff --git a/doc/entities.xml b/doc/entities.xml index 651b9a0cdda..129c7737319 100644 --- a/doc/entities.xml +++ b/doc/entities.xml @@ -1,5 +1,3 @@ - - diff --git a/evi/evi_params.h b/evi/evi_params.h index cad8a56c120..d4ffd93ebf7 100644 --- a/evi/evi_params.h +++ b/evi/evi_params.h @@ -79,7 +79,9 @@ int evi_param_set(evi_param_p element, const void *param, int flags); #define evi_param_set_int(p_el, p_int) \ evi_param_set(p_el, p_int, EVI_INT_VAL) -/* sets a string value to a parameter */ +/* sets a string value to a parameter + * WARNING: the string is *not* duplicated, make sure to keep the buffer until + * all "EVI raise" operations have been issued */ #define evi_param_set_str(p_el, p_str) \ evi_param_set(p_el, p_str, EVI_STR_VAL) diff --git a/examples/acc.cfg b/examples/acc.cfg index 5080243b9b0..15e19b44ddc 100644 --- a/examples/acc.cfg +++ b/examples/acc.cfg @@ -1,6 +1,4 @@ # -# $Id$ -# # example: accounting calls to nummerical destinations # diff --git a/examples/ctd.sh b/examples/ctd.sh index 3e104e0ab32..b6f0b488112 100644 --- a/examples/ctd.sh +++ b/examples/ctd.sh @@ -1,7 +1,5 @@ #!/bin/sh # -# $Id$ -# # Usage: ctd.sh $FROM $TARGET # # click-to-dial example using REFER diff --git a/examples/exec_s3.cfg b/examples/exec_s3.cfg index b324fbb6613..31c60ae9cb4 100644 --- a/examples/exec_s3.cfg +++ b/examples/exec_s3.cfg @@ -1,6 +1,4 @@ # -# $Id$ -# # email notification to email address from mysql database # diff --git a/examples/exec_s4.cfg b/examples/exec_s4.cfg index 9db8ef04ed3..051ed927827 100644 --- a/examples/exec_s4.cfg +++ b/examples/exec_s4.cfg @@ -1,6 +1,4 @@ # -# $Id$ -# # email notification to email address from mysql database # diff --git a/examples/exec_s5.cfg b/examples/exec_s5.cfg index a7655ef6953..27f68fd52f7 100644 --- a/examples/exec_s5.cfg +++ b/examples/exec_s5.cfg @@ -1,6 +1,4 @@ # -# $Id$ -# # simple quick-start config script # diff --git a/examples/fork.cfg b/examples/fork.cfg index 95fe75c3272..5f7fa40a8aa 100644 --- a/examples/fork.cfg +++ b/examples/fork.cfg @@ -1,6 +1,4 @@ # -# $Id$ -# # example script showing both types of forking; # incoming message is forked in parallel to # 'nobody' and 'parallel', if no positive reply diff --git a/examples/httpd.cfg b/examples/httpd.cfg index dcef6d9ba07..46be6340abb 100644 --- a/examples/httpd.cfg +++ b/examples/httpd.cfg @@ -1,6 +1,4 @@ # -# $Id$ -# # this example shows use of opensips's provisioning interface # diff --git a/examples/nathelper.cfg b/examples/nathelper.cfg index e28ce7a244d..fc37cad59fe 100644 --- a/examples/nathelper.cfg +++ b/examples/nathelper.cfg @@ -104,7 +104,7 @@ route{ # in Contact (may fail if line-folding is used); also, # the received test should, if completed, should check all # vias for rpesence of received - if (nat_uac_test(3)) { + if (nat_uac_test("diff-ip-src-via,private-contact")) { # Allow RR-ed requests, as these may indicate that # a NAT-enabled proxy takes care of it; unless it is # a REGISTER @@ -222,7 +222,7 @@ onreply_route[reply_handler] { rtpproxy_answer(); # otherwise, is it a transaction behind a NAT and we did not # know at time of request processing ? (RFC1918 contacts) - } else if (nat_uac_test(1)) { + } else if (nat_uac_test("private-contact")) { fix_nated_contact(); }; } diff --git a/examples/pstn.cfg b/examples/pstn.cfg index 28b56cbaf00..567500b9733 100644 --- a/examples/pstn.cfg +++ b/examples/pstn.cfg @@ -1,6 +1,4 @@ # -# $Id$ -# # example: ser configured as PSTN gateway guard; PSTN gateway is located # at 192.168.0.10 # diff --git a/examples/redirect.cfg b/examples/redirect.cfg index 47dc06b87ec..843bf4df4bc 100644 --- a/examples/redirect.cfg +++ b/examples/redirect.cfg @@ -1,6 +1,4 @@ # -# $Id$ -# # this example shows use of ser as stateless redirect server # diff --git a/examples/web_im/README b/examples/web_im/README index 216f45d2afc..ed54626999a 100644 --- a/examples/web_im/README +++ b/examples/web_im/README @@ -1,7 +1,3 @@ -# -# $Id$ -# - This examle illustrate how to use ser's FIFO interface to initate sending an instant message from a webpage. diff --git a/examples/web_im/click_to_dial.html b/examples/web_im/click_to_dial.html index 32de324846f..c9b620ce3f2 100644 --- a/examples/web_im/click_to_dial.html +++ b/examples/web_im/click_to_dial.html @@ -1,5 +1,4 @@ - Click-To-Dial diff --git a/examples/web_im/click_to_dial.php b/examples/web_im/click_to_dial.php index 976dd54904c..39e56f974de 100644 --- a/examples/web_im/click_to_dial.php +++ b/examples/web_im/click_to_dial.php @@ -1,5 +1,4 @@ <html> -<!-- $Id$ --> <head> <title> Click-To-Dial diff --git a/examples/web_im/send_im.html b/examples/web_im/send_im.html index d29d3b77494..14428f4199b 100644 --- a/examples/web_im/send_im.html +++ b/examples/web_im/send_im.html @@ -1,5 +1,4 @@ <html> -<!-- $Id$ --> <head> <title> Send IM diff --git a/examples/web_im/send_im.php b/examples/web_im/send_im.php index aaed3560d80..fcb21f7467b 100644 --- a/examples/web_im/send_im.php +++ b/examples/web_im/send_im.php @@ -1,5 +1,4 @@ <html> -<!-- $Id$ --> <head> <title> Send IM Status diff --git a/forward.h b/forward.h index 37005982989..3535260d644 100644 --- a/forward.h +++ b/forward.h @@ -1,4 +1,5 @@ /* + * Copyright (C) 2008-2025 OpenSIPS Project * Copyright (C) 2001-2003 FhG Fokus * * This file is part of opensips, a free SIP server. @@ -15,16 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * History: - * ------- - * 2001-??-?? created by andrei - * ????-??-?? lots of changes by a lot of people - * 2003-02-11 added inline msg_send (andrei) - * 2003-04-07 changed all ports to host byte order (andrei) - * 2003-04-12 FORCE_RPORT_T added (andrei) - * 2003-04-15 added tcp_disable support (andrei) + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*! @@ -48,13 +40,27 @@ #include "socket_info.h" struct socket_info* get_send_socket(struct sip_msg* msg, - union sockaddr_union* su, int proto); -struct socket_info* get_out_socket(union sockaddr_union* to, int proto); + union sockaddr_union* su, int proto); + +struct socket_info* get_out_socket(union sockaddr_union* to, + int proto); + int check_self(str* host, unsigned short port, unsigned short proto); + +/*! \brief checks if the proto:host:port is one of the address we listen on + * + * if port==0, the port number is expended to default + * if proto==0 (PROTO_NONE) the protocol is considered UDP + * returns 1 if true, 0 if false, -1 on error + */ +#define check_self_strict( _host, _port, _proto) \ + check_self(_host,_port?_port:protos[_proto?_proto:PROTO_UDP].default_port,\ + _proto?_proto:PROTO_UDP) + int forward_request( struct sip_msg* msg, struct proxy_l* p); + int update_sock_struct_from_via( union sockaddr_union* to, - struct sip_msg* msg, - struct via_body* via ); + struct sip_msg* msg, struct via_body* via ); /*! \brief use src_ip, port=src_port if rport, via port if via port, 5060 otherwise */ #define update_sock_struct_from_ip( to, msg ) \ diff --git a/globals.c b/globals.c index f418205c638..640071a329d 100644 --- a/globals.c +++ b/globals.c @@ -155,8 +155,12 @@ int process_no = 0; /* cfg parsing */ int cfg_errors=0; -/* start-up time */ -time_t startup_time = 0; +/** + * @startup_time - near to OpenSIPS launch time, see init_mi_uptime() + * @ready_time - per process, denotes completion of mod_init + child_init + * @ready_delay - difference between above two UNIX timestamps + */ +time_t startup_time, ready_time, ready_delay; /* shared memory (in MB) */ unsigned long shm_mem_size=SHM_MEM_SIZE * 1024 * 1024; diff --git a/globals.h b/globals.h index f4c6bd84bea..c1fe3a8dfae 100644 --- a/globals.h +++ b/globals.h @@ -145,7 +145,7 @@ extern int max_while_loops; extern int sl_fwd_disabled; -extern time_t startup_time; +extern time_t startup_time, ready_time, ready_delay; extern char *db_version_table; extern char *db_default_url; diff --git a/io_wait.h b/io_wait.h index 47255440998..0d9eee44a99 100644 --- a/io_wait.h +++ b/io_wait.h @@ -94,6 +94,7 @@ #ifdef __OS_linux #include <features.h> /* for GLIBC version testing */ #endif +#include "lib/dbg/backtrace.h" #ifndef FD_TYPE_DEFINED typedef int fd_type; @@ -181,7 +182,7 @@ typedef struct io_wait_handler io_wait_h; */ #define unhash_fd_map(pfm,c_flags,sock_flags,erase) \ do{ \ - if ((c_flags & IO_FD_CLOSING) || pfm->flags == sock_flags) { \ + if ((c_flags & IO_FD_CLOSING) || (pfm->flags&IO_WATCH_PRV_FILTER)==sock_flags) { \ (pfm)->type=0 /*F_NONE */; \ (pfm)->fd=-1; \ (pfm)->flags = 0; \ @@ -193,6 +194,23 @@ typedef struct io_wait_handler io_wait_h; } \ }while(0) +#define unhash_fd_map2(pfm,c_flags,sock_flags,erase) \ + do{ \ + if ((c_flags & IO_FD_CLOSING) || (pfm->flags&IO_WATCH_PRV_FILTER)==sock_flags) { \ + rla_log("erase case detected with sflags=%x\n",sock_flags); \ + (pfm)->type=0 /*F_NONE */; \ + (pfm)->fd=-1; \ + (pfm)->flags = 0; \ + (pfm)->data = NULL; \ + erase = 1; \ + } else { \ + rla_log("not erasing flags=%x, flags=%x\n",(pfm)->flags,sock_flags); \ + (pfm)->flags &= ~sock_flags; \ + erase = 0; \ + } \ + }while(0) + + /*! \brief add a fd_map structure to the fd hash */ static inline struct fd_map* hash_fd_map( io_wait_h* h, int fd, @@ -260,7 +278,8 @@ static inline int kq_ev_change(io_wait_h* h, int fd, int filter, int flag, #define IO_WATCH_WRITE (1<<1) #define IO_WATCH_ERROR (1<<2) #define IO_WATCH_TIMEOUT (1<<3) -/* reserved, do not attempt to use */ +/* 24 starting are reserved, do not attempt to use */ +#define IO_WATCH_PRV_FILTER ((1<<24)-1) #define IO_WATCH_PRV_CHECKED (1<<29) #define IO_WATCH_PRV_TRIG_READ (1<<30) #define IO_WATCH_PRV_TRIG_WRITE (1<<31) @@ -434,6 +453,13 @@ inline static int io_watch_add( io_wait_h* h, // lgtm [cpp/use-of-goto] /* hash sanity check */ e=get_fd_map(h, fd); + check_io_data(); + if (check_error) { + LM_CRIT("[%s] check failed before fd add " + "(fd=%d,type=%d,data=%p,flags=%x) already=%d\n",h->name, + fd, type, data, flags, already); + } + if (e->flags & flags){ if (e->data != data) { LM_BUG("[%s] BUG trying to overwrite entry %d" @@ -630,6 +656,7 @@ inline static int io_watch_del(io_wait_h* h, int fd, int idx, for (idx=0; (idx<h->fd_no) && \ (h->fd_array[idx].fd!=fd); idx++); \ } \ + rla_log("fixing: final idx=%d out of %d, erase=%d\n",idx,idx<h->fd_no,erase); \ if (idx<h->fd_no){ \ if (erase) { \ memmove(&h->fd_array[idx], &h->fd_array[idx+1], \ @@ -663,6 +690,19 @@ inline static int io_watch_del(io_wait_h* h, int fd, int idx, int check_error; int i; + #define x_RL_NO 10 + #define x_RL_LEN 200 + static char rla[x_RL_NO][x_RL_LEN]; + int rla_idx=0; + #define rla_log( _fmt, args...) \ + snprintf( rla[rla_idx++], x_RL_LEN, _fmt, ## args) + #define rla_dump() \ + do { \ + int w; \ + for(w=0;w<rla_idx;w++) \ + LM_CRIT("[%d]-> [%s]",w,rla[w]); \ + } while(0) + if ((fd<0) || (fd>=h->max_fd_no)){ LM_CRIT("[%s] invalid fd %d, not in [0, %d)\n", h->name, fd, h->fd_no); goto error0; @@ -670,6 +710,9 @@ inline static int io_watch_del(io_wait_h* h, int fd, int idx, LM_DBG("[%s] io_watch_del op on index %d %d (%p, %d, %d, 0x%x,0x%x) " "fd_no=%d called\n", h->name,idx,fd, h, fd, idx, flags, sock_flags,h->fd_no); + rla_log("[%s] io_watch_del op on index %d %d (%p, %d, %d, 0x%x,0x%x) " + "fd_no=%d called\n", h->name,idx,fd, h, fd, idx, flags, + sock_flags,h->fd_no); //fd_array_print; e=get_fd_map(h, fd); @@ -685,13 +728,29 @@ inline static int io_watch_del(io_wait_h* h, int fd, int idx, goto error0; } + if (idx != -1) { + if (!(idx>=0 && idx<h->fd_no)) { + LM_CRIT("[%s] FD index check failed, idx=%d, max=%d" + " operating on %d\n",h->name, idx, h->fd_no, fd ); + log_backtrace(); + rla_dump(); + idx = -1; + } else if (h->fd_array[idx].fd!=fd) { + LM_CRIT("[%s] FD consistency check failed, idx=%d points to fd=%d," + " but operating on %d\n",h->name, idx, h->fd_array[idx].fd, fd ); + log_backtrace(); + rla_dump(); + idx = -1; + } + } + if ((e->flags & sock_flags) == 0) { LM_ERR("BUG - [%s] trying to del fd %d with flags %d %d\n", h->name, fd, e->flags,sock_flags); goto error0; } - unhash_fd_map(e,flags,sock_flags,erase); + unhash_fd_map2(e,flags,sock_flags,erase); switch(h->poll_method){ case POLL_POLL: @@ -797,6 +856,7 @@ inline static int io_watch_del(io_wait_h* h, int fd, int idx, h->name,poll_method_str[h->poll_method], h->poll_method); goto error; } + rla_log("fixing fd array, idx=%d\n",idx); \ fix_fd_array; //fd_array_print; @@ -809,6 +869,7 @@ inline static int io_watch_del(io_wait_h* h, int fd, int idx, fd, flags, sock_flags, e->fd, e->type, e->data, e->flags, erase); + rla_dump(); } return 0; @@ -827,6 +888,7 @@ inline static int io_watch_del(io_wait_h* h, int fd, int idx, fd, flags, sock_flags, e->fd, e->type, e->data, e->flags, erase); + rla_dump(); } error0: diff --git a/lib/dbg/backtrace.h b/lib/dbg/backtrace.h index c301e1b273d..13745af6224 100644 --- a/lib/dbg/backtrace.h +++ b/lib/dbg/backtrace.h @@ -21,17 +21,16 @@ #ifndef __DBG_BACKTRACE__ #define __DBG_BACKTRACE__ -#ifndef EXTRA_DEBUG +#ifdef DBG_NO_BACKTRACE #define log_backtrace() #define _log_backtrace(logging_level) #else #include <execinfo.h> -#include "backtrace.h" #include "../../mem/mem.h" /* logs the current function stack, using the L_DBG level */ -#define log_backtrace() _log_backtrace(L_DBG) +#define log_backtrace() _log_backtrace(L_CRIT) /* logs the current function stack using a custom logging level */ #define _log_backtrace(logging_level) \ @@ -48,11 +47,11 @@ ___stkfuncs = backtrace_symbols(___stkbuf, ___nframes); \ LM_GEN1(logging_level, "===========\n"); \ for (___i = 0; ___i < ___nframes; ___i++) \ - LM_INFO("%s\n", ___stkfuncs[___i]); \ + LM_GEN1(logging_level, "%s\n", ___stkfuncs[___i]); \ LM_GEN1(logging_level, "===========\n"); \ free(___stkfuncs); \ pkg_free(___stkbuf); \ } while (0) -#endif /* HAVE_DEBUG */ +#endif /* DBG_NO_BACKTRACE */ #endif /* __DBG_BACKTRACE__ */ diff --git a/lib/dbg/struct_hist.c b/lib/dbg/struct_hist.c index 5724534f140..ef57793fff5 100644 --- a/lib/dbg/struct_hist.c +++ b/lib/dbg/struct_hist.c @@ -189,6 +189,9 @@ static void sh_free(struct struct_hist *sh, osips_free_f free_f) void _sh_unref(struct struct_hist *sh, osips_free_f free_f) { + if (!sh) + return; + gen_lock_t *shl_lock = &sh->shlist->wlock; lock_get(shl_lock); diff --git a/lib/dbg/struct_hist.h b/lib/dbg/struct_hist.h index 5212f4f1201..87a0befb5e3 100644 --- a/lib/dbg/struct_hist.h +++ b/lib/dbg/struct_hist.h @@ -45,7 +45,7 @@ * remain available inside the global history list for a while */ -#define MAX_SHLOG_SIZE 100 /* longer log lines will get truncated */ +#define MAX_SHLOG_SIZE 80 /* longer log lines will get truncated */ /** * To be freely extended by any piece of OpenSIPS code which makes use of @@ -54,6 +54,7 @@ #define SH_ALL_VERBS(VERB_FUN) \ VERB_FUN(TCP_SEND2CHILD) \ VERB_FUN(TCP_SEND2MAIN) \ + VERB_FUN(TCP_ADD_READER) \ VERB_FUN(TCP_REF) \ VERB_FUN(TCP_UNREF) \ VERB_FUN(TCP_DESTROY) \ @@ -84,7 +85,7 @@ struct struct_hist_action { struct struct_hist; struct struct_hist_list; -#define FLUSH_LIMIT 2000 +#define FLUSH_LIMIT 300 #define flushable(sh) (sh->len == FLUSH_LIMIT) /** diff --git a/lib/digest_auth/digest_auth.c b/lib/digest_auth/digest_auth.c index 732e31108ee..04c85dbea82 100644 --- a/lib/digest_auth/digest_auth.c +++ b/lib/digest_auth/digest_auth.c @@ -55,7 +55,8 @@ int dauth_algorithm_check(const struct authenticate_body *auth, if (!digest_algorithm_available(auth->algorithm)) return (0); damp = (const struct dauth_algorithm_match *)mdp->argp; - return (ALG2ALGFLG(auth->algorithm) & damp->algmask); + return (ALG2ALGFLG(auth->algorithm==ALG_UNSPEC ? ALG_MD5:auth->algorithm) + & damp->algmask); } int dauth_fixup_algorithms(void** param) diff --git a/lib/digest_auth/digest_auth.h b/lib/digest_auth/digest_auth.h index 651abf46e9d..33303f92c4d 100644 --- a/lib/digest_auth/digest_auth.h +++ b/lib/digest_auth/digest_auth.h @@ -72,7 +72,7 @@ struct digest_auth_credential { }; struct dauth_algorithm_match { - int algmask; + unsigned algmask; }; #define DAUTH_ALGMATCH_ALL (const struct dauth_algorithm_match){.algmask = ~0} diff --git a/lib/list.h b/lib/list.h index a09bb4fb6ce..483a70bbc00 100644 --- a/lib/list.h +++ b/lib/list.h @@ -66,10 +66,12 @@ static inline void __list_add(struct list_head *new, * Insert a new entry after the specified head. * This is good for implementing stacks. */ +#ifndef _list_h_skip_list_add_ /* conflict with 'mysql/my_list.h' list_add() */ static inline void list_add(struct list_head *new, struct list_head *head) { __list_add(new, head, head->next); } +#endif /** * list_add_tail - add a new entry diff --git a/lib/reg/ci.c b/lib/reg/ci.c index 23c6a9d129b..ef9c81c1465 100644 --- a/lib/reg/ci.c +++ b/lib/reg/ci.c @@ -214,8 +214,8 @@ void print_ci(ucontact_info_t *ci) LM_DBG(" ----- UCI DUMP (%p) ------\n", ci); LM_DBG("received: %.*s, path: %.*s\n", ci->received.len, ci->received.s, ci->path ? ci->path->len : 0, ci->path ? ci->path->s : NULL); - LM_DBG("expires: %ld, expires_in: %ld, expires_out: %ld\n", ci->expires, - ci->expires_in, ci->expires_out); + LM_DBG("expires: %lld, expires_in: %lld, expires_out: %lld\n", (long long)ci->expires, + (long long)ci->expires_in, (long long)ci->expires_out); LM_DBG("q: %d, instance: %.*s, callid: %.*s\n", ci->q, ci->instance.len, ci->instance.s, ci->callid ? ci->callid->len : 0, ci->callid ? ci->callid->s : NULL); @@ -224,6 +224,6 @@ void print_ci(ucontact_info_t *ci) LM_DBG("user_agent: %.*s, sock: %p, methods: %d\n", ci->user_agent ? ci->user_agent->len : 0, ci->user_agent ? ci->user_agent->s : NULL, ci->sock, ci->methods); - LM_DBG("last_modified: %ld, attr: %.*s\n", ci->last_modified, + LM_DBG("last_modified: %lld, attr: %.*s\n", (long long)ci->last_modified, ci->attr ? ci->attr->len : 0, ci->attr ? ci->attr->s : NULL); } diff --git a/lib/reg/common.h b/lib/reg/common.h index 674460fd85c..c893193ace3 100644 --- a/lib/reg/common.h +++ b/lib/reg/common.h @@ -84,8 +84,8 @@ static inline time_t randomize_expires(unsigned int expires_ts) expires_dur = max_expires; ret = expires_dur + get_act_time(); - LM_DBG("randomized expiry ts from %u to %lu (adj: %d/%d, " - "max_deviation: %d)\n", expires_ts, ret, expires_adj, + LM_DBG("randomized expiry ts from %u to %lld (adj: %d/%d, " + "max_deviation: %d)\n", expires_ts, (long long)ret, expires_adj, (int)ret - (int)expires_ts, expires_max_deviation); return ret; diff --git a/lib/reg/doc/lookup_flags.xml b/lib/reg/doc/lookup_flags.xml index f0efdcefe6d..d1d739ba656 100644 --- a/lib/reg/doc/lookup_flags.xml +++ b/lib/reg/doc/lookup_flags.xml @@ -1,4 +1,5 @@ -<para><emphasis>flags (string, optional)</emphasis></para> +<para><emphasis>flags (string, optional) - string composed of one or more of + the following flags, comma-separated:</emphasis></para> <itemizedlist> <listitem> diff --git a/lib/reg/lookup.c b/lib/reg/lookup.c index fcfd919d79f..212ed80cf77 100644 --- a/lib/reg/lookup.c +++ b/lib/reg/lookup.c @@ -73,7 +73,7 @@ lookup_rc lookup(struct sip_msg *req, udomain_t *d, if (lookup_flags) { flags = lookup_flags->flags; - if (lookup_flags->ua_re_is_set) + if (flags & REG_LOOKUP_UAFILTER_FLAG) ua_re = &lookup_flags->ua_re; max_latency = lookup_flags->max_latency; } @@ -208,8 +208,6 @@ lookup_rc lookup(struct sip_msg *req, udomain_t *d, ul.unlock_udomain(d, &aor); } out_cleanup: - if (flags & REG_LOOKUP_UAFILTER_FLAG) - regfree(ua_re); return ret; } @@ -342,84 +340,6 @@ static ucontact_t **select_contacts(struct sip_msg *msg, ucontact_t *contacts, } -int parse_lookup_flags(const str *input, unsigned int *flags, regex_t *ua_re, - int *regexp_flags, int *max_latency) -{ - char *ua = NULL, *re_end = NULL; - int i, re_len = 0; - - *flags = 0; - if (ZSTRP(input)) - return 0; - - for (i = 0; i < input->len; i++) { - switch (input->s[i]) { - case 'm': *flags |= REG_LOOKUP_METHODFILTER_FLAG; break; - case 'b': *flags |= REG_LOOKUP_NOBRANCH_FLAG; break; - case 'g': *flags |= REG_LOOKUP_GLOBAL_FLAG; break; - case 'r': *flags |= REG_BRANCH_AOR_LOOKUP_FLAG; break; - case 'B': *flags |= REG_LOOKUP_NO_RURI_FLAG; break; - case 'u': - if (input->s[i+1] != '/') { - LM_ERR("no regexp start after 'u' flag\n"); - break; - } - i++; - re_end = q_memchr(input->s + i + 1, '/', input->len - i - 1); - if (!re_end) { - LM_ERR("no regexp end after 'u' flag\n"); - break; - } - i++; - re_len = re_end - input->s - i; - if (re_len == 0) { - LM_ERR("empty regexp\n"); - break; - } - ua = input->s + i; - *flags |= REG_LOOKUP_UAFILTER_FLAG; - LM_DBG("found regexp /%.*s/", re_len, ua); - - i += re_len; - break; - - case 'i': *regexp_flags |= REG_ICASE; break; - case 'e': *regexp_flags |= REG_EXTENDED; break; - case 'y': - *max_latency = 0; - while (i<input->len-1 && isdigit(input->s[i+1])) { - *max_latency = *max_latency*10 + input->s[i+1] - '0'; - i++; - } - - if (*max_latency) - *flags |= REG_LOOKUP_MAX_LATENCY_FLAG; - else - *flags &= ~REG_LOOKUP_MAX_LATENCY_FLAG; - break; - - case 'Y': *flags |= REG_LOOKUP_LATENCY_SORT_FLAG; break; - - default: - LM_WARN("unsupported flag %c \n", input->s[i]); - } - } - - LM_DBG("final flags: %d\n", *flags); - - if (*flags & REG_LOOKUP_UAFILTER_FLAG) { - ua[re_len] = '\0'; - if (regcomp(ua_re, ua, *regexp_flags) != 0) { - LM_ERR("bad regexp '%s'\n", ua); - ua[re_len] = '/'; - return -1; - } - ua[re_len] = '/'; - } - - return 0; -} - #define REG_LOOKUP_TMP_REG_ICASE (1<<6) #define REG_LOOKUP_TMP_REG_EXTENDED (1<<7) @@ -508,8 +428,6 @@ int reg_fixup_lookup_flags(void** param) return -1; } *(p + re_len) = '/'; - - lookup_flags->ua_re_is_set = 1; } /* max-ping-latency */ @@ -529,8 +447,13 @@ int reg_fixup_lookup_flags(void** param) int reg_fixup_free_lookup_flags(void** param) { - if (*param) - pkg_free(*param); + struct lookup_flags *lookup_flags = (struct lookup_flags *)*param; + + if (lookup_flags) { + if (lookup_flags->flags & REG_LOOKUP_UAFILTER_FLAG) + regfree(&lookup_flags->ua_re); + pkg_free(lookup_flags); + } return 0; } diff --git a/lib/reg/lookup.h b/lib/reg/lookup.h index 5ee977612aa..baded79e21e 100644 --- a/lib/reg/lookup.h +++ b/lib/reg/lookup.h @@ -48,7 +48,6 @@ typedef enum _lookup_rc { struct lookup_flags { unsigned int flags; regex_t ua_re; - char ua_re_is_set; int max_latency; }; diff --git a/lib/reg/pn.c b/lib/reg/pn.c index 7b500ac3238..754e71d4815 100644 --- a/lib/reg/pn.c +++ b/lib/reg/pn.c @@ -132,7 +132,7 @@ int pn_init(void) param->s.len, param->s.s); /* build the filter templates, values are to be filled in at runtime */ - filter = shm_malloc(sizeof *filter); + filter = pkg_malloc(sizeof *filter); if (!filter) { LM_ERR("oom\n"); return -1; @@ -162,7 +162,7 @@ int pn_init(void) return -1; } - provider = shm_malloc(sizeof *provider + pnp->s.len + 1 + + provider = pkg_malloc(sizeof *provider + pnp->s.len + 1 + MAX_FEATURE_CAPS_SIZE); if (!provider) { LM_ERR("oom\n"); diff --git a/lib/reg/sip_msg.c b/lib/reg/sip_msg.c index deeac785fa2..a8c9ae5c018 100644 --- a/lib/reg/sip_msg.c +++ b/lib/reg/sip_msg.c @@ -361,6 +361,25 @@ contact_t* get_first_contact(struct sip_msg* _m) return __get_first_contact(_m, &act_contact_1); } +contact_t* get_first_contact_matching(struct sip_msg* _m, const str *uri_chunk) +{ + contact_t *ct; + + ct = __get_first_contact(_m, &act_contact_1); + if (!ct) + return NULL; + if (ZSTRP(uri_chunk)) + return ct; + + while (!str_strstr(&ct->uri, uri_chunk)) { + ct = __get_next_contact(ct, &act_contact_1); + if (!ct) + return NULL; + } + + return ct; +} + contact_t* get_next_contact(contact_t* _c) { return __get_next_contact(_c, &act_contact_1); diff --git a/lib/reg/sip_msg.h b/lib/reg/sip_msg.h index 119ff0bea86..47826bbedff 100644 --- a/lib/reg/sip_msg.h +++ b/lib/reg/sip_msg.h @@ -80,6 +80,7 @@ int calc_contact_q(param_t* _q, qvalue_t* _r); * Return: NULL on star, missing or unparsed Contact header, otherwise the ptr */ contact_t* get_first_contact(struct sip_msg* _m); +contact_t* get_first_contact_matching(struct sip_msg* _m, const str *uri_chunk); contact_t* get_next_contact(contact_t* _c); void reset_first_contact(void); diff --git a/md5.c b/md5.c index 04b887cb910..797607ddf98 100644 --- a/md5.c +++ b/md5.c @@ -1,7 +1,4 @@ /* - -$Id$ - MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All diff --git a/mem/shm_mem.c b/mem/shm_mem.c index e81a97e26ed..3baadaf1bd1 100644 --- a/mem/shm_mem.c +++ b/mem/shm_mem.c @@ -592,22 +592,22 @@ int shm_mem_init_mallocs(void* mempool, unsigned long pool_size) #endif #ifdef STATISTICS - if (event_shm_threshold) { - event_shm_last=shm_malloc_unsafe(sizeof(long)); - if (event_shm_last==0){ - LM_CRIT("could not allocate shm last event indicator\n"); + { + struct { + long last; + int pending; + } *ev_holders; + + ev_holders = shm_malloc_unsafe(sizeof *ev_holders); + if (!ev_holders) { + LM_CRIT("could not allocate SHM event holders\n"); shm_mem_destroy(); return -1; } - *event_shm_last=0; - event_shm_pending=shm_malloc_unsafe(sizeof(int)); - if (event_shm_pending==0){ - LM_CRIT("could not allocate shm pending flags\n"); - shm_mem_destroy(); - return -1; - } - *event_shm_pending=0; + memset(ev_holders, 0, sizeof *ev_holders); + event_shm_last = &ev_holders->last; + event_shm_pending = &ev_holders->pending; } #endif /* STATISTICS */ @@ -1019,12 +1019,8 @@ void shm_mem_destroy(void) #endif #ifdef STATISTICS - if (event_shm_threshold) { - if (event_shm_last) - shm_free(event_shm_last); - if (event_shm_pending) - shm_free(event_shm_pending); - } + if (event_shm_last) + shm_free_unsafe(event_shm_last); #endif } shm_relmem(shm_mempool, shm_mem_size); diff --git a/mem/shm_mem.h b/mem/shm_mem.h index 5b07c785148..217e860359f 100644 --- a/mem/shm_mem.h +++ b/mem/shm_mem.h @@ -301,6 +301,7 @@ inline static void shm_threshold_check(void) lock_release(mem_lock); \ } while (0) #endif + extern unsigned long long *shm_hash_usage; #else #define shm_lock() lock_get(mem_lock) #define shm_unlock() lock_release(mem_lock) @@ -629,8 +630,6 @@ inline static void _shm_free_bulk(void *ptr, #define shm_free_bulk( _ptr ) _shm_free_bulk( (_ptr), \ __FILE__, __FUNCTION__, __LINE__ ) -extern unsigned long long *shm_hash_usage; - #else /*DBG_MALLOC*/ #define shm_malloc_func shm_malloc diff --git a/menuconfig/configs/opensips_loadbalancer.m4 b/menuconfig/configs/opensips_loadbalancer.m4 index 5407b2d626f..56e6586131e 100644 --- a/menuconfig/configs/opensips_loadbalancer.m4 +++ b/menuconfig/configs/opensips_loadbalancer.m4 @@ -138,6 +138,7 @@ loadmodule "proto_udp.so" ifelse(ENABLE_TCP, `yes', `loadmodule "proto_tcp.so"' , `') ifelse(ENABLE_TLS, `yes', `loadmodule "proto_tls.so" +loadmodule "tls_wolfssl.so" loadmodule "tls_mgm.so" modparam("tls_mgm","server_domain", "default") modparam("tls_mgm","match_ip_address", "[default]*") diff --git a/menuconfig/configs/opensips_residential.m4 b/menuconfig/configs/opensips_residential.m4 index 8e1c92f3240..e219b01cb99 100644 --- a/menuconfig/configs/opensips_residential.m4 +++ b/menuconfig/configs/opensips_residential.m4 @@ -185,8 +185,9 @@ loadmodule "mi_http.so" ',`')dnl loadmodule "proto_udp.so" -ifelse(ENABLE_TCP, `yes', `loadmodule "proto_tcp.so"' , `')dnl +ifelse(ENABLE_TCP, `yes', `loadmodule "proto_tcp.so"' , `') ifelse(ENABLE_TLS, `yes', `loadmodule "proto_tls.so" +loadmodule "tls_wolfssl.so" loadmodule "tls_mgm.so" modparam("tls_mgm","server_domain", "default") modparam("tls_mgm","match_ip_address", "[default]*") @@ -207,7 +208,7 @@ ifelse(USE_NAT,`yes',` # initial NAT handling; detect if the request comes from behind a NAT # and apply contact fixing force_rport(); - if (nat_uac_test(23)) { + if (nat_uac_test("diff-port-src-via,private-via,diff-ip-src-via,private-contact")) { if (is_method("REGISTER")) { fix_nated_register(); setbflag("NAT"); @@ -501,7 +502,7 @@ branch_route[per_branch_ops] { onreply_route[handle_nat] { - ifelse(USE_NAT,`yes',`if (nat_uac_test(1)) + ifelse(USE_NAT,`yes',`if (nat_uac_test("private-contact")) fix_nated_contact(); if ( isflagset("NAT") && has_body("application/sdp") ) rtpproxy_answer("ro");',`') diff --git a/menuconfig/configs/opensips_trunking.m4 b/menuconfig/configs/opensips_trunking.m4 index 45041e4cf89..afd5dfd7037 100644 --- a/menuconfig/configs/opensips_trunking.m4 +++ b/menuconfig/configs/opensips_trunking.m4 @@ -134,6 +134,7 @@ loadmodule "proto_udp.so" ifelse(ENABLE_TCP, `yes', `loadmodule "proto_tcp.so"' , `') ifelse(ENABLE_TLS, `yes', `loadmodule "proto_tls.so" +loadmodule "tls_wolfssl.so" loadmodule "tls_mgm.so" modparam("tls_mgm","server_domain", "default") modparam("tls_mgm","match_ip_address", "[default]*") diff --git a/modules/aaa_diameter/README b/modules/aaa_diameter/README index 747d276ba13..3559dded3c5 100644 --- a/modules/aaa_diameter/README +++ b/modules/aaa_diameter/README @@ -151,6 +151,8 @@ xtra-avps-file:dictionary.opensips") Time, in milliseconds, after which a dm_send_request() function call with no received reply will time out and return a -2 code. + Default value is 2000 ms. + Example 1.6. Setting the answer_timeout parameter modparam("aaa_diameter", "answer_timeout", 5000) @@ -287,7 +289,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Liviu Chircu (@liviuchircu) 89 24 5918 955 + 1. Liviu Chircu (@liviuchircu) 91 26 5928 960 2. Razvan Crainea (@razvancrainea) 11 8 233 35 3. Maksym Sobolyev (@sobomax) 3 1 5 5 @@ -311,8 +313,8 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) May 2023 - May 2023 - 2. Liviu Chircu (@liviuchircu) May 2021 - Apr 2023 + 1. Liviu Chircu (@liviuchircu) May 2021 - Feb 2024 + 2. Razvan Crainea (@razvancrainea) May 2023 - May 2023 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 (1) including any documentation-related commits, excluding @@ -322,8 +324,8 @@ Chapter 3. Documentation 3.1. Contributors - Last edited by: Razvan Crainea (@razvancrainea), Liviu Chircu - (@liviuchircu). + Last edited by: Liviu Chircu (@liviuchircu), Razvan Crainea + (@razvancrainea). Documentation Copyrights: diff --git a/modules/aaa_diameter/aaa_impl.c b/modules/aaa_diameter/aaa_impl.c index 562cf85a7af..5a0fa32cec6 100644 --- a/modules/aaa_diameter/aaa_impl.c +++ b/modules/aaa_diameter/aaa_impl.c @@ -660,12 +660,12 @@ static int dm_register_digest_avps(void) FD_CHECK_dict_new(DICT_AVP, &data, UTF8String_type, NULL); } - /* Digest-Qop */ + /* Digest-QoP */ { struct dict_avp_data data = { 110, /* Code */ 0, /* Vendor */ - "Digest-Qop", /* Name */ + "Digest-QoP", /* Name */ AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ AVP_FLAG_MANDATORY, /* Fixed flag values */ AVP_TYPE_OCTETSTRING /* base type of data */ @@ -855,7 +855,7 @@ int dm_init_sip_application(void) that identifies a SIP server. */ struct dict_avp_data data = { - 369, /* Code */ + 371, /* Code */ 0, /* Vendor */ "SIP-Server-URI", /* Name */ AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ @@ -1030,7 +1030,7 @@ int dm_init_sip_application(void) [ Digest-Algorithm ] [ Digest-CNonce ] [ Digest-Opaque ] - [ Digest-Qop ] + [ Digest-QoP ] [ Digest-Nonce-Count ] [ Digest-Method] [ Digest-Entity-Body-Hash ] @@ -1055,7 +1055,7 @@ int dm_init_sip_application(void) { "Digest-Algorithm", RULE_OPTIONAL, -1, 1 }, { "Digest-CNonce", RULE_OPTIONAL, -1, 1 }, { "Digest-Opaque", RULE_OPTIONAL, -1, 1 }, - { "Digest-Qop", RULE_OPTIONAL, -1, 1 }, + { "Digest-QoP", RULE_OPTIONAL, -1, 1 }, { "Digest-Nonce-Count", RULE_OPTIONAL, -1, 1 }, { "Digest-Method", RULE_OPTIONAL, -1, 1 }, { "Digest-Entity-Body-Hash", RULE_OPTIONAL, -1, 1 }, diff --git a/modules/aaa_diameter/aaa_impl.h b/modules/aaa_diameter/aaa_impl.h index f9ef8c6c630..c2d9bd96941 100644 --- a/modules/aaa_diameter/aaa_impl.h +++ b/modules/aaa_diameter/aaa_impl.h @@ -53,6 +53,8 @@ __FD_CHECK_GT((__call__), (__retok__), out) #define FD_CHECK_GT(__call__) _FD_CHECK_GT((__call__), 0) +/* Note: if you get a EEXIST (-17) error code while adding an AVP, the error + signifies a data conflict, since duplicate additions are allowed (rc: 0) */ #define FD_CHECK_dict_new(type, data, parent, ref) \ FD_CHECK(fd_dict_new(fd_g_config->cnf_dict, (type), \ (data), (parent), (ref))) diff --git a/modules/aaa_diameter/doc/aaa_diameter_admin.xml b/modules/aaa_diameter/doc/aaa_diameter_admin.xml index 942116e8812..b401ce124f4 100644 --- a/modules/aaa_diameter/doc/aaa_diameter_admin.xml +++ b/modules/aaa_diameter/doc/aaa_diameter_admin.xml @@ -163,6 +163,9 @@ modparam("aaa_diameter", "aaa_url", "diameter:freeDiameter-client.conf;extra-avp function call with no received reply will time out and return a <emphasis role='bold'>-2</emphasis> code. </para> + <para> + Default value is <emphasis>2000</emphasis> ms. + </para> <example> <title>Setting the <varname>answer_timeout</varname> parameter diff --git a/modules/aaa_diameter/doc/contributors.xml b/modules/aaa_diameter/doc/contributors.xml index 201b9c13227..16d81e2a964 100644 --- a/modules/aaa_diameter/doc/contributors.xml +++ b/modules/aaa_diameter/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Liviu Chircu (@liviuchircu) - 89 - 24 - 5918 - 955 + 91 + 26 + 5928 + 960 2. @@ -72,13 +72,13 @@ 1. - Razvan Crainea (@razvancrainea) - May 2023 - May 2023 + Liviu Chircu (@liviuchircu) + May 2021 - Feb 2024 2. - Liviu Chircu (@liviuchircu) - May 2021 - Apr 2023 + Razvan Crainea (@razvancrainea) + May 2023 - May 2023 3. @@ -99,7 +99,7 @@ Documentation
Contributors - Last edited by: Razvan Crainea (@razvancrainea), Liviu Chircu (@liviuchircu). + Last edited by: Liviu Chircu (@liviuchircu), Razvan Crainea (@razvancrainea).
diff --git a/modules/acc/Makefile b/modules/acc/Makefile index e1a1c9280dc..137a381571d 100644 --- a/modules/acc/Makefile +++ b/modules/acc/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # acc module makefile # # diff --git a/modules/acc/README b/modules/acc/README index 81de2fb7bf7..b7e9d2f80f2 100644 --- a/modules/acc/README +++ b/modules/acc/README @@ -1059,7 +1059,7 @@ Chapter 3. Contributors 2. Jan Janak (@janakj) 145 16 5587 5074 3. Ionut Ionita (@ionutrazvanionita) 139 39 3730 4180 4. Razvan Crainea (@razvancrainea) 98 65 2702 662 - 5. Liviu Chircu (@liviuchircu) 73 54 984 605 + 5. Liviu Chircu (@liviuchircu) 74 55 984 607 6. Jiri Kuthan (@jiriatipteldotorg) 56 26 2272 660 7. Daniel-Constantin Mierla (@miconda) 26 23 115 88 8. Elena-Ramona Modroiu 24 4 2267 5 @@ -1096,7 +1096,7 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Jan 2013 - Dec 2023 + 1. Liviu Chircu (@liviuchircu) Jan 2013 - May 2024 2. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2003 - May 2023 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 4. Maksym Sobolyev (@sobomax) Dec 2003 - Feb 2023 diff --git a/modules/acc/doc/contributors.xml b/modules/acc/doc/contributors.xml index 20a9901cfaa..15d5d4f51fc 100644 --- a/modules/acc/doc/contributors.xml +++ b/modules/acc/doc/contributors.xml @@ -53,10 +53,10 @@ 5. Liviu Chircu (@liviuchircu) - 73 - 54 + 74 + 55 984 - 605 + 607 6. @@ -129,7 +129,7 @@ 1. Liviu Chircu (@liviuchircu) - Jan 2013 - Dec 2023 + Jan 2013 - May 2024 2. diff --git a/modules/alias_db/Makefile b/modules/alias_db/Makefile index debbeb48d0d..412aef041d4 100644 --- a/modules/alias_db/Makefile +++ b/modules/alias_db/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # User aliases # # diff --git a/modules/alias_db/README b/modules/alias_db/README index 54f8a4d29be..bda86c680fa 100644 --- a/modules/alias_db/README +++ b/modules/alias_db/README @@ -265,7 +265,7 @@ Chapter 3. Contributors Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 32 27 216 170 2. Daniel-Constantin Mierla (@miconda) 15 12 28 64 - 3. Liviu Chircu (@liviuchircu) 12 9 48 62 + 3. Liviu Chircu (@liviuchircu) 13 10 48 64 4. Razvan Crainea (@razvancrainea) 8 6 10 8 5. Henning Westerholt (@henningw) 6 4 48 49 6. Elena-Ramona Modroiu 5 3 92 39 @@ -299,11 +299,11 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Walter Doekes (@wdoekes) Apr 2010 - Apr 2021 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2005 - Mar 2020 - 4. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 - 5. Liviu Chircu (@liviuchircu) Mar 2014 - Apr 2019 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Walter Doekes (@wdoekes) Apr 2010 - Apr 2021 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2005 - Mar 2020 + 5. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 8. Dusan Klinec (@ph4r05) Dec 2015 - Dec 2015 diff --git a/modules/alias_db/doc/contributors.xml b/modules/alias_db/doc/contributors.xml index 2119d9fbc16..9cfec999202 100644 --- a/modules/alias_db/doc/contributors.xml +++ b/modules/alias_db/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 12 - 9 + 13 + 10 48 - 62 + 64 4. @@ -128,29 +128,29 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Walter Doekes (@wdoekes) Apr 2010 - Apr 2021 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2005 - Mar 2020 - 4. + 5. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 - - 5. - Liviu Chircu (@liviuchircu) - Mar 2014 - Apr 2019 - 6. Vlad Patrascu (@rvlad-patrascu) diff --git a/modules/auth/Makefile b/modules/auth/Makefile index 86b321155d6..8f4d531591f 100644 --- a/modules/auth/Makefile +++ b/modules/auth/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # auth example module makefile # # diff --git a/modules/auth/README b/modules/auth/README index 30ce91cc4b6..5d9de0b4ed7 100644 --- a/modules/auth/README +++ b/modules/auth/README @@ -523,7 +523,7 @@ Chapter 2. Contributors 2. Bogdan-Andrei Iancu (@bogdan-iancu) 51 34 704 615 3. Daniel-Constantin Mierla (@miconda) 39 21 1136 476 4. Maksym Sobolyev (@sobomax) 33 13 587 862 - 5. Liviu Chircu (@liviuchircu) 27 20 206 284 + 5. Liviu Chircu (@liviuchircu) 28 21 206 292 6. Jiri Kuthan (@jiriatipteldotorg) 26 19 660 51 7. Vlad Patrascu (@rvlad-patrascu) 18 10 420 236 8. Razvan Crainea (@razvancrainea) 12 9 87 102 @@ -557,7 +557,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Mar 2014 - Apr 2023 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 2. Maksym Sobolyev (@sobomax) Jan 2005 - Mar 2023 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jun 2022 4. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2002 - Jan 2021 diff --git a/modules/auth/doc/contributors.xml b/modules/auth/doc/contributors.xml index 4096303a1bf..0515cee6276 100644 --- a/modules/auth/doc/contributors.xml +++ b/modules/auth/doc/contributors.xml @@ -53,10 +53,10 @@ 5. Liviu Chircu (@liviuchircu) - 27 - 20 + 28 + 21 206 - 284 + 292 6. @@ -129,7 +129,7 @@ 1. Liviu Chircu (@liviuchircu) - Mar 2014 - Apr 2023 + Mar 2014 - May 2024 2. diff --git a/modules/auth_aaa/Makefile b/modules/auth_aaa/Makefile index d1908ee1bab..ef3d6559018 100644 --- a/modules/auth_aaa/Makefile +++ b/modules/auth_aaa/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # Digest Authentication - AAA generic support # # diff --git a/modules/auth_aaa/README b/modules/auth_aaa/README index 078a95020d1..a71a7ec142f 100644 --- a/modules/auth_aaa/README +++ b/modules/auth_aaa/README @@ -315,7 +315,7 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Jan Janak (@janakj) 87 24 3294 2182 2. Bogdan-Andrei Iancu (@bogdan-iancu) 44 31 892 255 - 3. Liviu Chircu (@liviuchircu) 23 19 96 142 + 3. Liviu Chircu (@liviuchircu) 24 20 96 144 4. Daniel-Constantin Mierla (@miconda) 15 13 67 55 5. Irina-Maria Stanescu 15 8 185 299 6. Maksym Sobolyev (@sobomax) 13 8 171 175 @@ -349,8 +349,8 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Dec 2003 - Feb 2023 - 2. Liviu Chircu (@liviuchircu) Jan 2013 - Jun 2021 + 1. Liviu Chircu (@liviuchircu) Jan 2013 - May 2024 + 2. Maksym Sobolyev (@sobomax) Dec 2003 - Feb 2023 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2005 - May 2020 4. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 diff --git a/modules/auth_aaa/doc/contributors.xml b/modules/auth_aaa/doc/contributors.xml index 1e0956990dc..ea6cc1ce4ac 100644 --- a/modules/auth_aaa/doc/contributors.xml +++ b/modules/auth_aaa/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 23 - 19 + 24 + 20 96 - 142 + 144 4. @@ -128,13 +128,13 @@ 1. - Maksym Sobolyev (@sobomax) - Dec 2003 - Feb 2023 + Liviu Chircu (@liviuchircu) + Jan 2013 - May 2024 2. - Liviu Chircu (@liviuchircu) - Jan 2013 - Jun 2021 + Maksym Sobolyev (@sobomax) + Dec 2003 - Feb 2023 3. diff --git a/modules/auth_db/Makefile b/modules/auth_db/Makefile index 384418ae94d..88d39faeabf 100644 --- a/modules/auth_db/Makefile +++ b/modules/auth_db/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # Digest Authentication - Database support # # diff --git a/modules/auth_db/README b/modules/auth_db/README index e8b519d5a7b..6548a060289 100644 --- a/modules/auth_db/README +++ b/modules/auth_db/README @@ -471,7 +471,7 @@ Chapter 2. Contributors 1. Bogdan-Andrei Iancu (@bogdan-iancu) 51 37 783 380 2. Jan Janak (@janakj) 50 29 1610 424 3. Daniel-Constantin Mierla (@miconda) 29 20 130 382 - 4. Liviu Chircu (@liviuchircu) 22 17 161 135 + 4. Liviu Chircu (@liviuchircu) 23 18 161 137 5. Henning Westerholt (@henningw) 11 9 83 49 6. Maksym Sobolyev (@sobomax) 10 5 307 116 7. Razvan Crainea (@razvancrainea) 9 7 29 47 @@ -506,8 +506,8 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Oct 2004 - Feb 2023 - 2. Liviu Chircu (@liviuchircu) Mar 2014 - Sep 2022 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Oct 2004 - Feb 2023 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2005 - Jul 2021 4. Walter Doekes (@wdoekes) Apr 2021 - Apr 2021 5. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 diff --git a/modules/auth_db/doc/contributors.xml b/modules/auth_db/doc/contributors.xml index 125f4e8a9fa..decfc2c8203 100644 --- a/modules/auth_db/doc/contributors.xml +++ b/modules/auth_db/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 22 - 17 + 23 + 18 161 - 135 + 137 5. @@ -128,13 +128,13 @@ 1. - Maksym Sobolyev (@sobomax) - Oct 2004 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Liviu Chircu (@liviuchircu) - Mar 2014 - Sep 2022 + Maksym Sobolyev (@sobomax) + Oct 2004 - Feb 2023 3. diff --git a/modules/auth_jwt/Makefile b/modules/auth_jwt/Makefile index 9260ac2c712..fa951fbcab6 100644 --- a/modules/auth_jwt/Makefile +++ b/modules/auth_jwt/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # JWT Authentication # # diff --git a/modules/auth_jwt/README b/modules/auth_jwt/README index ab0c22daf69..09d1831bc1a 100644 --- a/modules/auth_jwt/README +++ b/modules/auth_jwt/README @@ -364,7 +364,7 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Vlad Paiu (@vladpaiu) 19 5 1520 16 2. Bogdan-Andrei Iancu (@bogdan-iancu) 4 2 6 7 - 3. Liviu Chircu (@liviuchircu) 3 1 3 3 + 3. Liviu Chircu (@liviuchircu) 4 2 3 5 4. Maksym Sobolyev (@sobomax) 3 1 3 3 (1) DevScore = author_commits + author_lines_added / @@ -387,8 +387,8 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Vlad Paiu (@vladpaiu) Mar 2020 - Jul 2023 - 2. Liviu Chircu (@liviuchircu) May 2023 - May 2023 + 1. Liviu Chircu (@liviuchircu) May 2023 - May 2024 + 2. Vlad Paiu (@vladpaiu) Mar 2020 - Jul 2023 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 4. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2020 - Dec 2021 diff --git a/modules/auth_jwt/doc/contributors.xml b/modules/auth_jwt/doc/contributors.xml index cf0acd215b8..bcbcede8412 100644 --- a/modules/auth_jwt/doc/contributors.xml +++ b/modules/auth_jwt/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) + 4 + 2 3 - 1 - 3 - 3 + 5 4. @@ -80,13 +80,13 @@ 1. - Vlad Paiu (@vladpaiu) - Mar 2020 - Jul 2023 + Liviu Chircu (@liviuchircu) + May 2023 - May 2024 2. - Liviu Chircu (@liviuchircu) - May 2023 - May 2023 + Vlad Paiu (@vladpaiu) + Mar 2020 - Jul 2023 3. diff --git a/modules/avpops/Makefile b/modules/avpops/Makefile index 93fa9b6be52..8e673134e26 100644 --- a/modules/avpops/Makefile +++ b/modules/avpops/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # avpops module makefile # # diff --git a/modules/avpops/README b/modules/avpops/README index db82f289789..510daa3f4f9 100644 --- a/modules/avpops/README +++ b/modules/avpops/README @@ -708,7 +708,7 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Daniel-Constantin Mierla (@miconda) 104 44 2927 2158 2. Bogdan-Andrei Iancu (@bogdan-iancu) 67 49 690 716 - 3. Liviu Chircu (@liviuchircu) 53 27 1112 944 + 3. Liviu Chircu (@liviuchircu) 54 28 1112 946 4. Elena-Ramona Modroiu 51 11 4040 390 5. Razvan Crainea (@razvancrainea) 21 14 149 246 6. Elena-Ramona Modroiu 18 5 1051 192 @@ -720,10 +720,11 @@ Chapter 2. Contributors All remaining contributors: Andrei Pelinescu-Onciul, Anca Vamanu, Maksym Sobolyev (@sobomax), Norman Brandinger (@NormB), Vlad Patrascu (@rvlad-patrascu), Klaus Darilion, John Burke - (@john08burke), Andrey Vorobiev, Olle E. Johansson, Kennard - White, Julián Moreno Patiño, Konstantin Bokarius, Walter Doekes - (@wdoekes), Andreas Granig, Peter Lemenkov (@lemenkov), Sergio - Gutierrez, Edson Gellert Schubert, Ovidiu Sas (@ovidiusas). + (@john08burke), Andrey Vorobiev, Nick Altmann (@nikbyte), Olle + E. Johansson, Kennard White, Julián Moreno Patiño, Konstantin + Bokarius, Walter Doekes (@wdoekes), Andreas Granig, Peter + Lemenkov (@lemenkov), Sergio Gutierrez, Edson Gellert Schubert, + Ovidiu Sas (@ovidiusas). (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -745,24 +746,25 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Jun 2011 - Mar 2023 - 2. Maksym Sobolyev (@sobomax) Oct 2022 - Feb 2023 - 3. John Burke (@john08burke) Jun 2022 - Jun 2022 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2005 - Mar 2020 - 5. Liviu Chircu (@liviuchircu) Mar 2013 - Mar 2020 - 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2019 - 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 8. Andrey Vorobiev Apr 2016 - Apr 2016 - 9. Julián Moreno Patiño Feb 2016 - Feb 2016 - 10. Ionut Ionita (@ionutrazvanionita) Nov 2015 - Feb 2016 - - All remaining contributors: Ovidiu Sas (@ovidiusas), Walter - Doekes (@wdoekes), Vlad Paiu (@vladpaiu), Anca Vamanu, Kennard - White, Norman Brandinger (@NormB), Sergio Gutierrez, Kobi Eshun - (@ekobi), Henning Westerholt (@henningw), Olle E. Johansson, - Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson - Gellert Schubert, Elena-Ramona Modroiu, Klaus Darilion, Andreas - Granig, Andrei Pelinescu-Onciul, Elena-Ramona Modroiu. + 1. Nick Altmann (@nikbyte) Feb 2025 - Feb 2025 + 2. Liviu Chircu (@liviuchircu) Mar 2013 - May 2024 + 3. Razvan Crainea (@razvancrainea) Jun 2011 - Mar 2023 + 4. Maksym Sobolyev (@sobomax) Oct 2022 - Feb 2023 + 5. John Burke (@john08burke) Jun 2022 - Jun 2022 + 6. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2005 - Mar 2020 + 7. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2019 + 8. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 + 9. Andrey Vorobiev Apr 2016 - Apr 2016 + 10. Julián Moreno Patiño Feb 2016 - Feb 2016 + + All remaining contributors: Ionut Ionita (@ionutrazvanionita), + Ovidiu Sas (@ovidiusas), Walter Doekes (@wdoekes), Vlad Paiu + (@vladpaiu), Anca Vamanu, Kennard White, Norman Brandinger + (@NormB), Sergio Gutierrez, Kobi Eshun (@ekobi), Henning + Westerholt (@henningw), Olle E. Johansson, Daniel-Constantin + Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, + Elena-Ramona Modroiu, Klaus Darilion, Andreas Granig, Andrei + Pelinescu-Onciul, Elena-Ramona Modroiu. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/avpops/avpops.c b/modules/avpops/avpops.c index b8d93f08cd9..83b2e28a504 100644 --- a/modules/avpops/avpops.c +++ b/modules/avpops/avpops.c @@ -106,6 +106,7 @@ static int fixup_free_check_avp_p2(void** param); static int fixup_free_avp_subst_p1(void** param); static int fixup_free_avp_subst_p2(void** param); static int fixup_free_pvname_list(void** param); +static int fixup_free_avp_source(void** param); static int fixup_free_avp_dbparam(void** param); static int fixup_avp_shuffle_name(void** param); @@ -146,7 +147,7 @@ static const cmd_export_t cmds[] = { STARTUP_ROUTE|TIMER_ROUTE|EVENT_ROUTE}, {"avp_db_load", (cmd_function)w_dbload_avps, { - {CMD_PARAM_STR|CMD_PARAM_NO_EXPAND, fixup_db_avp_source, fixup_free_pkg}, + {CMD_PARAM_STR|CMD_PARAM_NO_EXPAND, fixup_db_avp_source, fixup_free_avp_source}, {CMD_PARAM_STR|CMD_PARAM_NO_EXPAND, fixup_db_avp_dbparam_scheme, fixup_free_avp_dbparam}, {CMD_PARAM_INT|CMD_PARAM_OPT, fixup_db_url, 0}, {CMD_PARAM_STR|CMD_PARAM_OPT, fixup_avp_prefix, fixup_free_pkg}, {0, 0, 0}}, @@ -154,14 +155,14 @@ static const cmd_export_t cmds[] = { STARTUP_ROUTE|TIMER_ROUTE|EVENT_ROUTE}, {"avp_db_delete", (cmd_function)w_dbdelete_avps, { - {CMD_PARAM_STR|CMD_PARAM_NO_EXPAND, fixup_db_avp_source, fixup_free_pkg}, + {CMD_PARAM_STR|CMD_PARAM_NO_EXPAND, fixup_db_avp_source, fixup_free_avp_source}, {CMD_PARAM_STR|CMD_PARAM_NO_EXPAND, fixup_db_avp_dbparam, fixup_free_avp_dbparam}, {CMD_PARAM_INT|CMD_PARAM_OPT, fixup_db_url, 0}, {0, 0, 0}}, REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE| STARTUP_ROUTE|TIMER_ROUTE|EVENT_ROUTE}, {"avp_db_store", (cmd_function)w_dbstore_avps, { - {CMD_PARAM_STR|CMD_PARAM_NO_EXPAND, fixup_db_avp_source, fixup_free_pkg}, + {CMD_PARAM_STR|CMD_PARAM_NO_EXPAND, fixup_db_avp_source, fixup_free_avp_source}, {CMD_PARAM_STR|CMD_PARAM_NO_EXPAND, fixup_db_avp_dbparam, fixup_free_avp_dbparam}, {CMD_PARAM_INT|CMD_PARAM_OPT, fixup_db_url, 0}, {0, 0, 0}}, REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|ONREPLY_ROUTE|LOCAL_ROUTE| @@ -576,6 +577,17 @@ static int fixup_db_avp_dbparam(void** param) return fixup_db_avp(param, 2, 0); } +static int fixup_free_avp_source(void** param) +{ + struct fis_param* sp = (struct fis_param*)*param; + + if ((sp->opd & AVPOPS_VAL_STR) && sp->u.s.s) { + pkg_free(sp->u.s.s); + } + pkg_free(sp); + return 0; +} + static int fixup_free_avp_dbparam(void** param) { struct db_param *dbp = (struct db_param *)*param; diff --git a/modules/avpops/doc/contributors.xml b/modules/avpops/doc/contributors.xml index bf80a90b2c4..f5bbf55b2b4 100644 --- a/modules/avpops/doc/contributors.xml +++ b/modules/avpops/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 53 - 27 + 54 + 28 1112 - 944 + 946 4. @@ -101,7 +101,7 @@ -All remaining contributors: Andrei Pelinescu-Onciul, Anca Vamanu, Maksym Sobolyev (@sobomax), Norman Brandinger (@NormB), Vlad Patrascu (@rvlad-patrascu), Klaus Darilion, John Burke (@john08burke), Andrey Vorobiev, Olle E. Johansson, Kennard White, Julián Moreno Patiño, Konstantin Bokarius, Walter Doekes (@wdoekes), Andreas Granig, Peter Lemenkov (@lemenkov), Sergio Gutierrez, Edson Gellert Schubert, Ovidiu Sas (@ovidiusas). +All remaining contributors: Andrei Pelinescu-Onciul, Anca Vamanu, Maksym Sobolyev (@sobomax), Norman Brandinger (@NormB), Vlad Patrascu (@rvlad-patrascu), Klaus Darilion, John Burke (@john08burke), Andrey Vorobiev, Nick Altmann (@nikbyte), Olle E. Johansson, Kennard White, Julián Moreno Patiño, Konstantin Bokarius, Walter Doekes (@wdoekes), Andreas Granig, Peter Lemenkov (@lemenkov), Sergio Gutierrez, Edson Gellert Schubert, Ovidiu Sas (@ovidiusas). (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits) @@ -128,58 +128,58 @@ 1. + Nick Altmann (@nikbyte) + Feb 2025 - Feb 2025 + + + 2. + Liviu Chircu (@liviuchircu) + Mar 2013 - May 2024 + + + 3. Razvan Crainea (@razvancrainea) Jun 2011 - Mar 2023 - 2. + 4. Maksym Sobolyev (@sobomax) Oct 2022 - Feb 2023 - 3. + 5. John Burke (@john08burke) Jun 2022 - Jun 2022 - 4. + 6. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2005 - Mar 2020 - 5. - Liviu Chircu (@liviuchircu) - Mar 2013 - Mar 2020 - - - 6. + 7. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2019 - 7. + 8. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 8. + 9. Andrey Vorobiev Apr 2016 - Apr 2016 - 9. + 10. Julián Moreno Patiño Feb 2016 - Feb 2016 - - 10. - Ionut Ionita (@ionutrazvanionita) - Nov 2015 - Feb 2016 - -All remaining contributors: Ovidiu Sas (@ovidiusas), Walter Doekes (@wdoekes), Vlad Paiu (@vladpaiu), Anca Vamanu, Kennard White, Norman Brandinger (@NormB), Sergio Gutierrez, Kobi Eshun (@ekobi), Henning Westerholt (@henningw), Olle E. Johansson, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Elena-Ramona Modroiu, Klaus Darilion, Andreas Granig, Andrei Pelinescu-Onciul, Elena-Ramona Modroiu. +All remaining contributors: Ionut Ionita (@ionutrazvanionita), Ovidiu Sas (@ovidiusas), Walter Doekes (@wdoekes), Vlad Paiu (@vladpaiu), Anca Vamanu, Kennard White, Norman Brandinger (@NormB), Sergio Gutierrez, Kobi Eshun (@ekobi), Henning Westerholt (@henningw), Olle E. Johansson, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Elena-Ramona Modroiu, Klaus Darilion, Andreas Granig, Andrei Pelinescu-Onciul, Elena-Ramona Modroiu. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/b2b_entities/README b/modules/b2b_entities/README index 3b78b6a32ea..bb515d0d862 100644 --- a/modules/b2b_entities/README +++ b/modules/b2b_entities/README @@ -290,6 +290,14 @@ modparam("b2b_entities", "db_table", "some table name") This also ensures restart persistency through the clusterer module's data "sync" mechanism. + This OpenSIPS cluster exposes the "b2be-entities-repl" + capability in order to mark nodes as eligible for becoming data + donors during an arbitrary sync request. Consequently, the + cluster must have at least one node marked with the "seed" + value as the clusterer.flags column/property in order to be + fully functional. Consult the clusterer - Capabilities chapter + for more details. + Default value is “0” (clustering disabled) Example 1.12. Set cluster_id parameter @@ -797,10 +805,10 @@ Chapter 3. Contributors Name DevScore Commits Lines ++ Lines -- 1. Anca Vamanu 181 94 6839 1860 2. Vlad Patrascu (@rvlad-patrascu) 127 63 5504 1156 - 3. Razvan Crainea (@razvancrainea) 77 62 774 483 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) 57 48 499 190 + 3. Razvan Crainea (@razvancrainea) 84 68 790 504 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) 59 50 504 198 5. Ovidiu Sas (@ovidiusas) 53 41 855 293 - 6. Liviu Chircu (@liviuchircu) 19 15 90 126 + 6. Liviu Chircu (@liviuchircu) 21 17 97 128 7. Vlad Paiu (@vladpaiu) 6 4 74 47 8. Carsten Bock 6 4 66 40 9. Nick Altmann (@nikbyte) 6 3 166 29 @@ -831,13 +839,13 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Dec 2010 - Oct 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Aug 2009 - Oct 2023 - 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jun 2023 - 4. Giedrius Apr 2023 - Apr 2023 - 5. Ovidiu Sas (@ovidiusas) Nov 2010 - Feb 2023 - 6. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 7. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2022 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Aug 2009 - Mar 2025 + 2. Liviu Chircu (@liviuchircu) Mar 2014 - Sep 2024 + 3. Razvan Crainea (@razvancrainea) Dec 2010 - Feb 2024 + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jun 2023 + 5. Giedrius Apr 2023 - Apr 2023 + 6. Ovidiu Sas (@ovidiusas) Nov 2010 - Feb 2023 + 7. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 8. Carsten Bock Mar 2022 - Apr 2022 9. Nick Altmann (@nikbyte) Jan 2013 - Feb 2022 10. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 @@ -854,10 +862,10 @@ Chapter 4. Documentation 4.1. Contributors - Last edited by: Vlad Patrascu (@rvlad-patrascu), Carsten Bock, - Razvan Crainea (@razvancrainea), Peter Lemenkov (@lemenkov), - Liviu Chircu (@liviuchircu), Bogdan-Andrei Iancu - (@bogdan-iancu), Vlad Paiu (@vladpaiu), Ovidiu Sas + Last edited by: Liviu Chircu (@liviuchircu), Vlad Patrascu + (@rvlad-patrascu), Carsten Bock, Razvan Crainea + (@razvancrainea), Peter Lemenkov (@lemenkov), Bogdan-Andrei + Iancu (@bogdan-iancu), Vlad Paiu (@vladpaiu), Ovidiu Sas (@ovidiusas), Anca Vamanu. Documentation Copyrights: diff --git a/modules/b2b_entities/b2be_db.c b/modules/b2b_entities/b2be_db.c index 936ec9e3a50..b6e31e91c72 100644 --- a/modules/b2b_entities/b2be_db.c +++ b/modules/b2b_entities/b2be_db.c @@ -228,7 +228,8 @@ static int b2be_cdb_insert(int type, b2b_dlg_t* dlg, int cols_no) if ((rc = b2be_cdbf.map_set(b2be_cdb, cdb_key, cdb_subkey, &cdb_pairs))) LM_ERR("cachedb set failed\n"); - pkg_free(cdb_subkey->s); + if (cdb_subkey) + pkg_free(cdb_subkey->s); pkg_free(cdb_key->s); cdb_free_entries(&cdb_pairs, NULL); @@ -258,12 +259,7 @@ int b2be_db_insert(b2b_dlg_t* dlg, int type) qvals[11].val.str_val.s = 0; qvals[11].val.str_val.len = 0; } - if (!str_check_token(&dlg->logic_key)) { - qvals[12].val.str_val.s = NULL; - qvals[12].val.str_val.len = 0; - } else { - qvals[12].val.str_val = dlg->logic_key; - } + qvals[12].val.str_val = dlg->logic_key; qvals[13].val.str_val= dlg->mod_name; if (!dlg->storage.len) { @@ -327,21 +323,16 @@ static void b2b_entity_cdb_delete(int type, b2b_dlg_t* dlg) return; } - if (!str_check_token(&dlg->logic_key)) { - cdb_subkey = NULL; - } else { - cdb_subkey = get_b2be_map_subkey(&dlg->logic_key); - if (!cdb_subkey) { - LM_ERR("Failed to build map key\n"); - return; - } + cdb_subkey = get_b2be_map_subkey(&dlg->logic_key); + if (!cdb_subkey) { + LM_ERR("Failed to build map key\n"); + return; } if (b2be_cdbf.map_remove(b2be_cdb, cdb_key, cdb_subkey) < 0) LM_ERR("Failed to delete from cachedb\n"); - if (cdb_subkey) - pkg_free(cdb_subkey->s); + pkg_free(cdb_subkey->s); pkg_free(cdb_key->s); } @@ -503,12 +494,7 @@ void store_b2b_dlg(b2b_table htable, unsigned int hsize, int type, int no_lock) qvals[11].val.str_val.s = 0; qvals[11].val.str_val.len = 0; } - if (!str_check_token(&dlg->logic_key)) { - qvals[12].val.str_val.s = NULL; - qvals[12].val.str_val.len = 0; - } else { - qvals[12].val.str_val = dlg->logic_key; - } + qvals[12].val.str_val = dlg->logic_key; qvals[13].val.str_val= dlg->mod_name; } diff --git a/modules/b2b_entities/dlg.c b/modules/b2b_entities/dlg.c index 9379f7c16b7..d707c7a0efa 100644 --- a/modules/b2b_entities/dlg.c +++ b/modules/b2b_entities/dlg.c @@ -358,8 +358,8 @@ str* b2b_generate_key(unsigned int hash_index, unsigned int local_index) str* b2b_key; int len; - len = sprintf(buf, "%s.%d.%d.%ld.%d", b2b_key_prefix.s, hash_index, local_index, - startup_time+get_ticks(), rand()); + len = sprintf(buf, "%s.%d.%d.%lld.%d", b2b_key_prefix.s, hash_index, local_index, + (long long)(startup_time+get_ticks()), rand()); b2b_key = (str*)pkg_malloc(sizeof(str)+ len); if(b2b_key== NULL) @@ -714,6 +714,7 @@ int b2b_register_cb(b2b_cb_t cb, int cb_type, str *mod_name) return 0; } + int b2b_prescript_f(struct sip_msg *msg, void *uparam) { str b2b_key; @@ -767,8 +768,7 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam) rt->nameaddr.uri.len,redact_pii(rt->nameaddr.uri.s)); return SCB_RUN_ALL; } - if (check_self( &puri.host, puri.port_no?puri.port_no:SIP_PORT, - puri.proto?puri.proto:PROTO_UDP)!= 1 ) { + if (check_self_strict( &puri.host, puri.port_no, puri.proto)!= 1 ) { LM_DBG("First Route uri is not mine\n"); return SCB_RUN_ALL; /* not for b2b */ @@ -786,13 +786,12 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam) } } if (rt) { - if ( parse_uri(rt->nameaddr.uri.s,rt->nameaddr.uri.len,&puri)!=0 ) { + if ( parse_uri(rt->nameaddr.uri.s,rt->nameaddr.uri.len,&puri)!=0 ){ LM_ERR("Second route uri is not valid <%.*s>\n", rt->nameaddr.uri.len,redact_pii(rt->nameaddr.uri.s)); return SCB_RUN_ALL; } - if (check_self( &puri.host, puri.port_no?puri.port_no:SIP_PORT, - puri.proto?puri.proto:PROTO_UDP)!= 1 ) { + if (check_self_strict( &puri.host, puri.port_no, puri.proto)!= 1 ){ LM_DBG("Second Route uri is not mine\n"); return SCB_RUN_ALL; /* not for b2b */ } @@ -823,7 +822,7 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam) if(method_value!= METHOD_CANCEL) { LM_DBG(" host:port [%.*s][%d]\n", host.len, host.s, port); - if (!check_self( &host, port ? port : SIP_PORT, msg->rcv.proto)) + if (check_self_strict( &host, port, msg->parsed_uri.proto)!= 1 ) { LM_DBG("RURI does not point to me\n"); return SCB_RUN_ALL; @@ -886,13 +885,13 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam) */ dlg = b2bl_search_iteratively(&callid, &from_tag, T_invite, hash_index); - tmb.unref_cell( T_invite ); if(dlg == NULL) { B2BE_LOCK_RELEASE(server_htable, hash_index); LM_DBG("No dialog found for cancel\n"); return SCB_RUN_ALL; } + tmb.unref_cell( T_invite ); ctx = b2b_get_context(); if (!ctx) { @@ -1014,9 +1013,6 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam) if(method_value == METHOD_ACK) { tmb.t_newtran(msg); - tm_tran = tmb.t_gett(); - if (tm_tran && tm_tran!=T_UNDEFINED) - tmb.unref_cell(tm_tran); } else if(method_value == METHOD_BYE) { @@ -1026,6 +1022,9 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam) str ko = str_init("Call/Transaction Does Not Exist"); tmb.t_reply(msg, 481, &ko); } + tm_tran = tmb.t_gett(); + if (tm_tran && tm_tran!=T_UNDEFINED) + tmb.unref_cell(tm_tran); B2BE_LOCK_RELEASE(table, hash_index); return SCB_DROP_MSG; } @@ -1383,8 +1382,12 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam) return SCB_DROP_MSG; } } else { - b2b_cback(msg, &b2b_key, B2B_REQUEST, logic_key.s?&logic_key:0, - dlg->param, b2b_cb_flags); + if (!b2b_cback) + LM_DBG("calback not yet registered for [%.*s]\n", + (logic_key.s?logic_key.len:0), (logic_key.s?logic_key.s:"")); + else + b2b_cback(msg, &b2b_key, B2B_REQUEST, logic_key.s?&logic_key:0, + dlg->param, b2b_cb_flags); if(logic_key.s) pkg_free(logic_key.s); @@ -2469,7 +2472,6 @@ int _b2b_send_request(b2b_dlg_t* dlg, b2b_req_data_t* req_data) if(dlg->uac_tran) { struct cell *inv_t; - struct cell *bk_t = tmb.t_gett(); LM_DBG("send cancel request\n"); if (tmb.t_lookup_ident( &inv_t, dlg->uac_tran->hash_index, dlg->uac_tran->label) != 1) { @@ -2479,7 +2481,6 @@ int _b2b_send_request(b2b_dlg_t* dlg, b2b_req_data_t* req_data) // FIXME - tracing: how do we get to the cancel transaction? ret = tmb.t_cancel_trans( inv_t, &ehdr); tmb.unref_cell(inv_t); - tmb.t_sett(bk_t); if (dlg->state > B2B_CONFIRMED) method_value = METHOD_INVITE; } @@ -3687,8 +3688,12 @@ void b2b_tm_cback(struct cell *t, b2b_table htable, struct tmcb_params *ps) goto error1; } } else { - b2b_cback(msg, b2b_key, B2B_REPLY, logic_key.s?&logic_key:0, - b2b_param, b2b_cb_flags); + if (!b2b_cback) + LM_DBG("calback not yet registered for [%.*s]\n", + (logic_key.s?logic_key.len:0), (logic_key.s?logic_key.s:"")); + else + b2b_cback(msg, b2b_key, B2B_REPLY, logic_key.s?&logic_key:0, + b2b_param, b2b_cb_flags); if(logic_key.s) { pkg_free(logic_key.s); diff --git a/modules/b2b_entities/doc/b2b_entities.xml b/modules/b2b_entities/doc/b2b_entities.xml index f44c05e81a7..15e51b28947 100644 --- a/modules/b2b_entities/doc/b2b_entities.xml +++ b/modules/b2b_entities/doc/b2b_entities.xml @@ -7,6 +7,8 @@ + + diff --git a/modules/b2b_entities/doc/b2b_entities_admin.xml b/modules/b2b_entities/doc/b2b_entities_admin.xml index 8123a664eff..907b2e92283 100644 --- a/modules/b2b_entities/doc/b2b_entities_admin.xml +++ b/modules/b2b_entities/doc/b2b_entities_admin.xml @@ -297,6 +297,9 @@ modparam("b2b_entities", "db_table", "some table name") persistency through the clusterer module's data "sync" mechanism. + + &clusterer_sync_cap_para; + Default value is 0 (clustering disabled) diff --git a/modules/b2b_entities/doc/contributors.xml b/modules/b2b_entities/doc/contributors.xml index c49f34eff31..fc9bd4d8118 100644 --- a/modules/b2b_entities/doc/contributors.xml +++ b/modules/b2b_entities/doc/contributors.xml @@ -37,18 +37,18 @@ 3. Razvan Crainea (@razvancrainea) - 77 - 62 - 774 - 483 + 84 + 68 + 790 + 504 4. Bogdan-Andrei Iancu (@bogdan-iancu) - 57 - 48 - 499 - 190 + 59 + 50 + 504 + 198 5. @@ -61,10 +61,10 @@ 6. Liviu Chircu (@liviuchircu) - 19 - 15 - 90 - 126 + 21 + 17 + 97 + 128 7. @@ -128,39 +128,39 @@ 1. - Razvan Crainea (@razvancrainea) - Dec 2010 - Oct 2023 + Bogdan-Andrei Iancu (@bogdan-iancu) + Aug 2009 - Mar 2025 2. - Bogdan-Andrei Iancu (@bogdan-iancu) - Aug 2009 - Oct 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - Sep 2024 3. + Razvan Crainea (@razvancrainea) + Dec 2010 - Feb 2024 + + + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jun 2023 - 4. + 5. Giedrius Apr 2023 - Apr 2023 - 5. + 6. Ovidiu Sas (@ovidiusas) Nov 2010 - Feb 2023 - 6. + 7. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - - 7. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2022 - 8. Carsten Bock @@ -190,7 +190,7 @@ Documentation
Contributors - Last edited by: Vlad Patrascu (@rvlad-patrascu), Carsten Bock, Razvan Crainea (@razvancrainea), Peter Lemenkov (@lemenkov), Liviu Chircu (@liviuchircu), Bogdan-Andrei Iancu (@bogdan-iancu), Vlad Paiu (@vladpaiu), Ovidiu Sas (@ovidiusas), Anca Vamanu. + Last edited by: Liviu Chircu (@liviuchircu), Vlad Patrascu (@rvlad-patrascu), Carsten Bock, Razvan Crainea (@razvancrainea), Peter Lemenkov (@lemenkov), Bogdan-Andrei Iancu (@bogdan-iancu), Vlad Paiu (@vladpaiu), Ovidiu Sas (@ovidiusas), Anca Vamanu.
diff --git a/modules/b2b_entities/ua_api.c b/modules/b2b_entities/ua_api.c index 0203bdc2592..97e0d4ae0dd 100644 --- a/modules/b2b_entities/ua_api.c +++ b/modules/b2b_entities/ua_api.c @@ -171,6 +171,7 @@ int raise_ua_sess_event(str *key, enum b2b_entity_type ent_type, str method; str *reason; int statuscode; + str empty = STR_NULL; if (evi_param_set_str(evi_key_param, key) < 0) { LM_ERR("cannot set event parameter\n"); @@ -190,7 +191,7 @@ int raise_ua_sess_event(str *key, enum b2b_entity_type ent_type, if (msg->first_line.type == SIP_REQUEST) { method = msg->first_line.u.request.method; statuscode = 0; - reason = &STR_NULL; + reason = ∅ } else { method = get_cseq(msg)->method; statuscode = msg->first_line.u.reply.statuscode; diff --git a/modules/b2b_logic/README b/modules/b2b_logic/README index eae72995262..980cb895395 100644 --- a/modules/b2b_logic/README +++ b/modules/b2b_logic/README @@ -531,7 +531,7 @@ modparam("b2b_logic", "b2bl_early_update", 1) Note - If you have a multi interface setup and want to chance the + If you have a multi interface setup and want to change the outbound interface, it is mandatory to use the "force_send_socket()" core function before passing control to b2b function. If you do not do it, the requests may be @@ -565,7 +565,7 @@ if(is_method("INVITE") && !has_totag() && prepaid_user()) { B2B actions. * adv_contact (string, optional) - Contact header to advertise in generated messages. - * extra_hdrs (var, optioanl) - AVP variable holding a list of + * extra_hdrs (var, optional) - AVP variable holding a list of extra headers (the header names) to be added for any request sent to this entity. * extra_hdr_bodies (var, optional) - AVP variable holding a @@ -1242,9 +1242,9 @@ Chapter 3. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Vlad Patrascu (@rvlad-patrascu) 235 57 8167 6793 - 2. Razvan Crainea (@razvancrainea) 28 17 782 229 - 3. Nick Altmann (@nikbyte) 14 10 346 36 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) 13 9 145 67 + 2. Razvan Crainea (@razvancrainea) 36 25 810 237 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) 16 12 148 72 + 4. Nick Altmann (@nikbyte) 14 10 346 36 5. Carsten Bock 12 5 679 23 6. Maksym Sobolyev (@sobomax) 5 3 26 26 7. Liviu Chircu (@liviuchircu) 5 3 4 3 @@ -1274,9 +1274,9 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Nov 2020 - Feb 2024 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2021 - Feb 2024 - 3. Razvan Crainea (@razvancrainea) Jan 2021 - Jan 2024 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2021 - Jan 2025 + 2. Razvan Crainea (@razvancrainea) Jan 2021 - Jan 2025 + 3. Liviu Chircu (@liviuchircu) Nov 2020 - Feb 2024 4. Vlad Patrascu (@rvlad-patrascu) Nov 2020 - Jul 2023 5. Shanee Vanstone Apr 2023 - Apr 2023 6. truong.hua Jan 2023 - Feb 2023 diff --git a/modules/b2b_logic/bridging.c b/modules/b2b_logic/bridging.c index 54fac2d853b..4b82eb9ca97 100644 --- a/modules/b2b_logic/bridging.c +++ b/modules/b2b_logic/bridging.c @@ -204,15 +204,17 @@ mi_response_t *mi_b2b_bridge(const mi_params_t *params, goto error; } - if (old_entity->peer->peer == old_entity) - old_entity->peer->peer = NULL; - else - { - LM_ERR("Unexpected chain: old_entity=[%p] and old_entity->peer->peer=[%p]\n", - old_entity, old_entity->peer->peer); - goto error; + if (old_entity->peer) { + if (old_entity->peer->peer == old_entity) + old_entity->peer->peer = NULL; + else + { + LM_ERR("Unexpected chain: old_entity=[%p] and old_entity->peer->peer=[%p]\n", + old_entity, old_entity->peer->peer); + goto error; + } + old_entity->peer = NULL; } - old_entity->peer = NULL; tuple->bridge_entities[0]= bridging_entity; @@ -388,8 +390,12 @@ int process_bridge_bye(struct sip_msg* msg, b2bl_tuple_t* tuple, entity_no = bridge_get_entityno(tuple, entity); if(entity_no < 0) { - LM_ERR("No match found\n"); - return -1; + if (!entity) { + LM_ERR("No match found\n"); + return -1; + } + /* we've got a known entity, but no longer part of the + * bridge - we gracefully reply and drop */ } } @@ -400,7 +406,8 @@ int process_bridge_bye(struct sip_msg* msg, b2bl_tuple_t* tuple, rpl_data.text =&ok; b2b_api.send_reply(&rpl_data); - return process_bridge_dialog_end(tuple, hash_index, entity_no, entity); + return (entity_no < 0 ? 0: + process_bridge_dialog_end(tuple, hash_index, entity_no, entity)); } int process_bridge_negreply(b2bl_tuple_t* tuple, @@ -1094,7 +1101,7 @@ int b2b_script_bridge(struct sip_msg *msg, str *br_ent1_str, str *br_ent2_str, if (e) { if (old_entity) - LM_ERR("At least one new client entity required for bridging\n"); + LM_ERR("both entities are already bridged - trying the first one\n"); else old_entity = e; } else if (!new_br_ent[1]) { @@ -1112,9 +1119,7 @@ int b2b_script_bridge(struct sip_msg *msg, str *br_ent1_str, str *br_ent2_str, goto done; } - if ((params->flags & B2BL_BR_FLAG_NOTIFY || - params->flags & B2BL_BR_FLAG_RETURN_AFTER_FAILURE) && entity) - tuple->bridge_initiator = entity; + tuple->bridge_initiator = entity; cur_route_ctx.flags |= B2BL_RT_DO_UPDATE; @@ -1324,6 +1329,9 @@ static int bridging_start_new_ent(b2bl_tuple_t* tuple, b2bl_entity_id_t *old_ent } entity->no = 1; + entity->peer = old_entity; + if (!old_entity->peer) + old_entity->peer = entity; tuple->bridge_entities[1] = entity; return 0; @@ -2345,7 +2353,7 @@ int b2bl_push_bridge_retry(b2bl_tuple_t *tuple) * order they appear */ lock_get(b2bl_bridge_retry_lock); retry->time = get_uticks(); - retry->next = *b2bl_bridge_retry_head; + retry->next = NULL; if (*b2bl_bridge_retry_last) (*b2bl_bridge_retry_last)->next = retry; else diff --git a/modules/b2b_logic/doc/b2b_logic_admin.xml b/modules/b2b_logic/doc/b2b_logic_admin.xml index 67711aa2e71..7e796d9378f 100644 --- a/modules/b2b_logic/doc/b2b_logic_admin.xml +++ b/modules/b2b_logic/doc/b2b_logic_admin.xml @@ -563,7 +563,7 @@ modparam("b2b_logic", "b2bl_early_update", 1) This function can be used from REQUEST_ROUTE. - If you have a multi interface setup and want to chance the outbound interface, + If you have a multi interface setup and want to change the outbound interface, it is mandatory to use the "force_send_socket()" core function before passing control to b2b function. If you do not do it, the requests may be correctly routed, but the SIP pacakge may be invalid (as Contact, Via, etc). @@ -608,7 +608,7 @@ if(is_method("INVITE") && !has_totag() && prepaid_user()) { advertise in generated messages. - extra_hdrs (var, optioanl) - AVP variable holding a list + extra_hdrs (var, optional) - AVP variable holding a list of extra headers (the header names) to be added for any request sent to this entity. diff --git a/modules/b2b_logic/doc/contributors.xml b/modules/b2b_logic/doc/contributors.xml index d15336ffaca..f62bfb16ca6 100644 --- a/modules/b2b_logic/doc/contributors.xml +++ b/modules/b2b_logic/doc/contributors.xml @@ -29,27 +29,27 @@ 2. Razvan Crainea (@razvancrainea) - 28 - 17 - 782 - 229 + 36 + 25 + 810 + 237 3. + Bogdan-Andrei Iancu (@bogdan-iancu) + 16 + 12 + 148 + 72 + + + 4. Nick Altmann (@nikbyte) 14 10 346 36 - - 4. - Bogdan-Andrei Iancu (@bogdan-iancu) - 13 - 9 - 145 - 67 - 5. Carsten Bock @@ -128,18 +128,18 @@ 1. - Liviu Chircu (@liviuchircu) - Nov 2020 - Feb 2024 + Bogdan-Andrei Iancu (@bogdan-iancu) + Apr 2021 - Jan 2025 2. - Bogdan-Andrei Iancu (@bogdan-iancu) - Apr 2021 - Feb 2024 + Razvan Crainea (@razvancrainea) + Jan 2021 - Jan 2025 3. - Razvan Crainea (@razvancrainea) - Jan 2021 - Jan 2024 + Liviu Chircu (@liviuchircu) + Nov 2020 - Feb 2024 4. diff --git a/modules/b2b_logic/logic.c b/modules/b2b_logic/logic.c index 59fe3b3e4fe..b0c78758bde 100644 --- a/modules/b2b_logic/logic.c +++ b/modules/b2b_logic/logic.c @@ -904,9 +904,10 @@ int _b2b_handle_reply(struct sip_msg *msg, b2bl_tuple_t *tuple, /* Reply from new bridge entity */ if(statuscode >= 200 && entity == (tuple->bridge_entities[2]?tuple->bridge_entities[2]:tuple->bridge_entities[1]) && - tuple->bridge_flags & B2BL_BR_FLAG_NOTIFY && tuple->bridge_initiator != 0) + tuple->bridge_initiator != 0) { - send_bridge_notify(tuple->bridge_initiator, cur_route_ctx.hash_index, msg); + if (tuple->bridge_flags & B2BL_BR_FLAG_NOTIFY) + send_bridge_notify(tuple->bridge_initiator, cur_route_ctx.hash_index, msg); if(statuscode == 200 || !(tuple->bridge_flags & B2BL_BR_FLAG_RETURN_AFTER_FAILURE)) { if (!(tuple->bridge_flags & B2BL_BR_FLAG_DONT_DELETE_BRIDGE_INITIATOR)) { @@ -1591,6 +1592,17 @@ int b2b_logic_notify_request(int src, struct sip_msg* msg, str* key, str* body, goto done; } + if (entity->disconnected) { + /* if already disconnected, this is probably a cross BYE + * that we no longer need to process, so we simply reply it */ + memset(&rpl_data, 0, sizeof(b2b_rpl_data_t)); + PREP_RPL_DATA(entity); + rpl_data.method =METHOD_BYE; + rpl_data.code =200; + rpl_data.text =&ok; + b2b_api.send_reply(&rpl_data); + goto done; + } entity->disconnected = 1; if(cbf && (tuple->cb.mask&B2B_BYE_CB)) @@ -2190,9 +2202,7 @@ int b2b_logic_notify(int src, struct sip_msg* msg, str* key, int type, str* b2bl { if(msg->first_line.u.request.method_value==METHOD_REFER && parse_refer_to_header(msg)==0 && msg->refer_to!=NULL && - get_refer_to(msg)!=NULL && parse_uri(get_refer_to(msg)->uri.s, - get_refer_to(msg)->uri.len, - &(get_refer_to(msg)->parsed_uri))==0) + parse_to_body_uri( get_refer_to(msg) )==0 ) { /* We have a Refer-To header */ if(get_refer_to(msg)->parsed_uri.headers.s && diff --git a/modules/b2b_sdp_demux/README b/modules/b2b_sdp_demux/README index ab6bfa80da5..9e7b41335d9 100644 --- a/modules/b2b_sdp_demux/README +++ b/modules/b2b_sdp_demux/README @@ -165,7 +165,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Razvan Crainea (@razvancrainea) 90 57 2946 500 + 1. Razvan Crainea (@razvancrainea) 91 58 2947 500 2. Maksym Sobolyev (@sobomax) 3 1 3 3 (1) DevScore = author_commits + author_lines_added / @@ -188,7 +188,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) May 2021 - Aug 2023 + 1. Razvan Crainea (@razvancrainea) May 2021 - Jul 2024 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 (1) including any documentation-related commits, excluding diff --git a/modules/b2b_sdp_demux/b2b_sdp_demux.c b/modules/b2b_sdp_demux/b2b_sdp_demux.c index 53b5c3d4a69..938e8b86a64 100644 --- a/modules/b2b_sdp_demux/b2b_sdp_demux.c +++ b/modules/b2b_sdp_demux/b2b_sdp_demux.c @@ -1271,6 +1271,7 @@ static int b2b_sdp_client_reply_invite(struct sip_msg *msg, struct b2b_sdp_clien ret = -2; goto release; } + ctx->success_no = 0; /* we've actually completed all the upstream clients * therefore we need to respond to the server */ body = b2b_sdp_mux_body(ctx); diff --git a/modules/b2b_sdp_demux/doc/contributors.xml b/modules/b2b_sdp_demux/doc/contributors.xml index a70bf9eab14..207335bc69f 100644 --- a/modules/b2b_sdp_demux/doc/contributors.xml +++ b/modules/b2b_sdp_demux/doc/contributors.xml @@ -21,9 +21,9 @@ 1. Razvan Crainea (@razvancrainea) - 90 - 57 - 2946 + 91 + 58 + 2947 500 @@ -65,7 +65,7 @@ 1. Razvan Crainea (@razvancrainea) - May 2021 - Aug 2023 + May 2021 - Jul 2024 2. diff --git a/modules/benchmark/Makefile b/modules/benchmark/Makefile index 19943697f04..e5b86c8f65e 100644 --- a/modules/benchmark/Makefile +++ b/modules/benchmark/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # User aliases # # diff --git a/modules/benchmark/README b/modules/benchmark/README index 318f6824a94..5b5272a0996 100644 --- a/modules/benchmark/README +++ b/modules/benchmark/README @@ -369,7 +369,7 @@ Chapter 3. Contributors Name DevScore Commits Lines ++ Lines -- 1. Daniel-Constantin Mierla (@miconda) 23 10 1391 50 2. Bogdan-Andrei Iancu (@bogdan-iancu) 21 19 88 53 - 3. Liviu Chircu (@liviuchircu) 12 10 28 59 + 3. Liviu Chircu (@liviuchircu) 13 11 28 61 4. Razvan Crainea (@razvancrainea) 11 9 23 21 5. Vlad Patrascu (@rvlad-patrascu) 9 4 185 143 6. Stanislaw Pitucha 7 3 170 65 @@ -401,8 +401,8 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2019 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 3. Razvan Crainea (@razvancrainea) Sep 2011 - Sep 2019 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2007 - Apr 2019 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 diff --git a/modules/benchmark/doc/contributors.xml b/modules/benchmark/doc/contributors.xml index e32e5bcdeba..7ec2e73829f 100644 --- a/modules/benchmark/doc/contributors.xml +++ b/modules/benchmark/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 12 - 10 + 13 + 11 28 - 59 + 61 4. @@ -128,13 +128,13 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2019 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 3. diff --git a/modules/cachedb_cassandra/README b/modules/cachedb_cassandra/README index 8bde74e0216..96a7f4b55fe 100644 --- a/modules/cachedb_cassandra/README +++ b/modules/cachedb_cassandra/README @@ -278,7 +278,7 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Vlad Patrascu (@rvlad-patrascu) 374 13 1998 21057 2. Vlad Paiu (@vladpaiu) 183 7 21444 38 - 3. Liviu Chircu (@liviuchircu) 10 8 38 49 + 3. Liviu Chircu (@liviuchircu) 11 9 39 50 4. Razvan Crainea (@razvancrainea) 8 6 16 14 5. fabriziopicconi 4 2 5 5 6. Maksym Sobolyev (@sobomax) 4 2 3 3 @@ -308,9 +308,9 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Feb 2012 - Jan 2021 - 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jun 2020 - 4. Liviu Chircu (@liviuchircu) Mar 2014 - Sep 2019 + 2. Liviu Chircu (@liviuchircu) Mar 2014 - Apr 2021 + 3. Razvan Crainea (@razvancrainea) Feb 2012 - Jan 2021 + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jun 2020 5. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Julián Moreno Patiño Feb 2016 - Feb 2016 diff --git a/modules/cachedb_cassandra/cachedb_cassandra.c b/modules/cachedb_cassandra/cachedb_cassandra.c index 0d3f2c5244e..87f5a014b69 100644 --- a/modules/cachedb_cassandra/cachedb_cassandra.c +++ b/modules/cachedb_cassandra/cachedb_cassandra.c @@ -153,7 +153,7 @@ static int child_init(int rank) cachedb_con *con; for (it = cassandra_script_urls; it; it = it->next) { - LM_DBG("iterating through conns - [%.*s]\n", it->url.len, it->url.s); + LM_DBG("iterating through conns - [%s]\n", db_url_escape(&it->url)); con = cassandra_init(&it->url); if (con == NULL) { LM_ERR("failed to open connection\n"); diff --git a/modules/cachedb_cassandra/doc/contributors.xml b/modules/cachedb_cassandra/doc/contributors.xml index a845983cb3e..e98c770fb32 100644 --- a/modules/cachedb_cassandra/doc/contributors.xml +++ b/modules/cachedb_cassandra/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 10 - 8 - 38 - 49 + 11 + 9 + 39 + 50 4. @@ -133,18 +133,18 @@ 2. - Razvan Crainea (@razvancrainea) - Feb 2012 - Jan 2021 + Liviu Chircu (@liviuchircu) + Mar 2014 - Apr 2021 3. - Vlad Patrascu (@rvlad-patrascu) - May 2017 - Jun 2020 + Razvan Crainea (@razvancrainea) + Feb 2012 - Jan 2021 4. - Liviu Chircu (@liviuchircu) - Mar 2014 - Sep 2019 + Vlad Patrascu (@rvlad-patrascu) + May 2017 - Jun 2020 5. diff --git a/modules/cachedb_local/README b/modules/cachedb_local/README index 0fcc47ce3f8..315549d16ad 100644 --- a/modules/cachedb_local/README +++ b/modules/cachedb_local/README @@ -199,6 +199,14 @@ modparam("cachedb_local", "cache_clean_period", 1200) Specifies the cluster ID which this instance will send to and receive cache data. + This OpenSIPS cluster exposes the "cachedb-local-repl" + capability in order to mark nodes as eligible for becoming data + donors during an arbitrary sync request. Consequently, the + cluster must have at least one node marked with the "seed" + value as the clusterer.flags column/property in order to be + fully functional. Consult the clusterer - Capabilities chapter + for more details. + Default value is 0 (replication disabled). Example 1.4. Setting the cluster_id parameter @@ -310,7 +318,7 @@ Chapter 3. Contributors Name DevScore Commits Lines ++ Lines -- 1. Vlad Paiu (@vladpaiu) 32 10 1155 693 2. Vlad Patrascu (@rvlad-patrascu) 25 16 509 226 - 3. Liviu Chircu (@liviuchircu) 22 16 127 191 + 3. Liviu Chircu (@liviuchircu) 23 17 132 191 4. Bogdan-Andrei Iancu (@bogdan-iancu) 16 14 46 50 5. Anca Vamanu 13 5 739 54 6. Andrei Dragus 9 4 182 181 @@ -343,9 +351,9 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 2. Vlad Patrascu (@rvlad-patrascu) Jan 2017 - Oct 2022 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - Aug 2022 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - Sep 2024 + 2. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 + 3. Vlad Patrascu (@rvlad-patrascu) Jan 2017 - Oct 2022 4. Zero King (@l2dy) Mar 2020 - Mar 2020 5. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 6. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2019 diff --git a/modules/cachedb_local/doc/cachedb_local.xml b/modules/cachedb_local/doc/cachedb_local.xml index 22ff863c306..9f9b15e6c77 100644 --- a/modules/cachedb_local/doc/cachedb_local.xml +++ b/modules/cachedb_local/doc/cachedb_local.xml @@ -6,6 +6,8 @@ + + diff --git a/modules/cachedb_local/doc/cachedb_local_admin.xml b/modules/cachedb_local/doc/cachedb_local_admin.xml index f3e7fd96dc7..15534d74695 100644 --- a/modules/cachedb_local/doc/cachedb_local_admin.xml +++ b/modules/cachedb_local/doc/cachedb_local_admin.xml @@ -192,6 +192,9 @@ modparam("cachedb_local", "cache_clean_period", 1200) Specifies the cluster ID which this instance will send to and receive cache data. + + &clusterer_sync_cap_para; + Default value is 0 (replication disabled). diff --git a/modules/cachedb_local/doc/contributors.xml b/modules/cachedb_local/doc/contributors.xml index 2d1785eb624..e65e4c88806 100644 --- a/modules/cachedb_local/doc/contributors.xml +++ b/modules/cachedb_local/doc/contributors.xml @@ -37,9 +37,9 @@ 3. Liviu Chircu (@liviuchircu) - 22 - 16 - 127 + 23 + 17 + 132 191 @@ -128,18 +128,18 @@ 1. - Maksym Sobolyev (@sobomax) - Jan 2021 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - Sep 2024 2. - Vlad Patrascu (@rvlad-patrascu) - Jan 2017 - Oct 2022 + Maksym Sobolyev (@sobomax) + Jan 2021 - Feb 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - Aug 2022 + Vlad Patrascu (@rvlad-patrascu) + Jan 2017 - Oct 2022 4. diff --git a/modules/cachedb_mongodb/README b/modules/cachedb_mongodb/README index e1a3891f01e..bd1f9d1c201 100644 --- a/modules/cachedb_mongodb/README +++ b/modules/cachedb_mongodb/README @@ -264,7 +264,7 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Liviu Chircu (@liviuchircu) 152 82 2920 2758 - 2. Vlad Paiu (@vladpaiu) 35 9 2964 50 + 2. Vlad Paiu (@vladpaiu) 36 10 3018 50 3. Razvan Crainea (@razvancrainea) 12 10 30 26 4. Ovidiu Sas (@ovidiusas) 10 8 92 16 5. Vlad Patrascu (@rvlad-patrascu) 6 4 96 11 @@ -297,18 +297,18 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Liviu Chircu (@liviuchircu) Mar 2014 - Jul 2021 - 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2021 - 4. Razvan Crainea (@razvancrainea) Aug 2015 - Dec 2020 - 5. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Mar 2020 - 6. Alessio Garzi (@Ozzyboshi) Nov 2019 - Dec 2019 - 7. Dan Pascu (@danpascu) May 2019 - May 2019 - 8. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 9. @jalung Aug 2017 - Aug 2017 - 10. Julián Moreno Patiño Feb 2016 - Feb 2016 - - All remaining contributors: Vlad Paiu (@vladpaiu), Ovidiu Sas + 1. Vlad Paiu (@vladpaiu) Jan 2013 - Aug 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Liviu Chircu (@liviuchircu) Mar 2014 - Jul 2021 + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2021 + 5. Razvan Crainea (@razvancrainea) Aug 2015 - Dec 2020 + 6. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Mar 2020 + 7. Alessio Garzi (@Ozzyboshi) Nov 2019 - Dec 2019 + 8. Dan Pascu (@danpascu) May 2019 - May 2019 + 9. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 + 10. @jalung Aug 2017 - Aug 2017 + + All remaining contributors: Julián Moreno Patiño, Ovidiu Sas (@ovidiusas). (1) including any documentation-related commits, excluding diff --git a/modules/cachedb_mongodb/cachedb_mongodb_dbase.c b/modules/cachedb_mongodb/cachedb_mongodb_dbase.c index c17f4b03c13..b0a01bc5833 100644 --- a/modules/cachedb_mongodb/cachedb_mongodb_dbase.c +++ b/modules/cachedb_mongodb/cachedb_mongodb_dbase.c @@ -182,6 +182,9 @@ cachedb_con *mongo_con_init(str *url) void mongo_free_connection(cachedb_pool_con *con) { mongo_con *mcon = (mongo_con *)con; + + if (!mcon) + return; mongoc_collection_destroy(mcon->collection); mongoc_database_destroy(mcon->database); @@ -208,6 +211,9 @@ int mongo_con_get(cachedb_con *con, str *attr, str *val) char *p; int ret = 0; + if (!con) + return -1; + LM_DBG("find %.*s in %s\n", attr->len, attr->s, MONGO_NAMESPACE(con)); @@ -295,6 +301,9 @@ int mongo_con_set(cachedb_con *con, str *attr, str *val, int expires) struct timeval start; int ret = 0; + if (!con) + return -1; + query = bson_new(); bson_append_utf8(query, MDB_PK, MDB_PKLEN, attr->s, attr->len); @@ -329,6 +338,9 @@ int mongo_con_remove(cachedb_con *con, str *attr) struct timeval start; int ret = 0; + if (!con) + return -1; + doc = bson_new(); bson_append_utf8(doc, MDB_PK, MDB_PKLEN, attr->s, attr->len); @@ -368,6 +380,9 @@ int mongo_raw_find(cachedb_con *con, bson_t *raw_query, bson_iter_t *ns, int i, len, csz = 0, ret = -1; const char *p; + if (!con) + return -1; + if (bson_iter_type(ns) != BSON_TYPE_UTF8) { LM_ERR("collection name must be a string (%d)!\n", bson_iter_type(ns)); return -1; @@ -519,6 +534,9 @@ int mongo_raw_update(cachedb_con *con, bson_t *raw_query, bson_iter_t *ns) const bson_value_t *v; int ret, count = 0; + if (!con) + return -1; + if (bson_iter_type(ns) != BSON_TYPE_UTF8) { LM_ERR("collection name must be a string (%d)!\n", bson_iter_type(ns)); return -1; @@ -624,6 +642,9 @@ int mongo_raw_insert(cachedb_con *con, bson_t *raw_query, bson_iter_t *ns) const bson_value_t *v; int ret, count = 0; + if (!con) + return -1; + if (bson_iter_type(ns) != BSON_TYPE_UTF8) { LM_ERR("collection name must be a string (%d)!\n", bson_iter_type(ns)); return -1; @@ -708,6 +729,9 @@ int mongo_raw_remove(cachedb_con *con, bson_t *raw_query, bson_iter_t *ns) const bson_value_t *v; int ret, count = 0; + if (!con) + return -1; + if (bson_iter_type(ns) != BSON_TYPE_UTF8) { LM_ERR("collection name must be a string (%d)!\n", bson_iter_type(ns)); return -1; @@ -807,6 +831,9 @@ int mongo_con_raw_query(cachedb_con *con, str *qstr, cdb_raw_entry ***reply, const char *p; int csz = 0, i, len; + if (!con) + return -1; + LM_DBG("Get operation on namespace %s\n", MONGO_NAMESPACE(con)); start_expire_timer(start,mongo_exec_threshold); @@ -966,6 +993,9 @@ int mongo_con_add(cachedb_con *con, str *attr, int val, int expires, int *new_va struct timeval start; int ret = 0; + if (!con) + return -1; + cmd = bson_new(); bson_append_utf8(cmd, "findAndModify", 13, mongoc_collection_get_name(MONGO_COLLECTION(con)), -1); @@ -1032,6 +1062,9 @@ int mongo_con_get_counter(cachedb_con *con, str *attr, int *val) struct timeval start; int ret = -2; + if (!con) + return -1; + query = bson_new(); #if MONGOC_CHECK_VERSION(1, 5, 0) bson_append_utf8(query, MDB_PK, MDB_PKLEN, attr->s, attr->len); @@ -1217,6 +1250,9 @@ int mongo_db_query_trans(cachedb_con *con, const str *table, const db_key_t *_k, char *strf, *stro; str st; + if (!con) + return -1; + *_r = NULL; filter = bson_new(); @@ -1516,6 +1552,9 @@ int mongo_db_insert_trans(cachedb_con *con, const str *table, mongoc_collection_t *col = NULL; struct timeval start; + if (!con) + return -1; + doc = bson_new(); if (kvo_to_bson(_k, _v, NULL, _n, doc) != 0) { LM_ERR("failed to build bson\n"); @@ -1565,6 +1604,9 @@ int mongo_db_delete_trans(cachedb_con *con, const str *table, mongoc_collection_t *col = NULL; struct timeval start; + if (!con) + return -1; + doc = bson_new(); if (kvo_to_bson(_k, _v, _o, _n, doc) != 0) { LM_ERR("failed to build bson\n"); @@ -1615,6 +1657,9 @@ int mongo_db_update_trans(cachedb_con *con, const str *table, mongoc_collection_t *col = NULL; struct timeval start; + if (!con) + return -1; + query = bson_new(); if (kvo_to_bson(_k, _v, _o, _n, query) != 0) { LM_ERR("failed to build query bson\n"); @@ -1677,6 +1722,9 @@ int mongo_truncate(cachedb_con *con) struct timeval start; int ret = 0; + if (!con) + return -1; + start_expire_timer(start, mongo_exec_threshold); if (!mongoc_collection_remove(MONGO_COLLECTION(con), MONGOC_REMOVE_NONE, &empty_doc, NULL, &error)) { @@ -1894,6 +1942,9 @@ int mongo_con_query(cachedb_con *con, const cdb_filter_t *filter, const bson_t *doc; struct timeval start; + if (!con) + return -1; + LM_DBG("find all in %s\n", MONGO_NAMESPACE(con)); cdb_res_init(res); @@ -2074,6 +2125,9 @@ int mongo_con_update(cachedb_con *con, const cdb_filter_t *row_filter, cdb_pair_t *pair; str key; + if (!con) + return -1; + if (mongo_cdb_filter_to_bson(row_filter, &filter) != 0) { LM_ERR("failed to build bson filter\n"); return -1; diff --git a/modules/cachedb_mongodb/doc/contributors.xml b/modules/cachedb_mongodb/doc/contributors.xml index c9d09e9fbd3..a67022dcdb3 100644 --- a/modules/cachedb_mongodb/doc/contributors.xml +++ b/modules/cachedb_mongodb/doc/contributors.xml @@ -29,9 +29,9 @@ 2. Vlad Paiu (@vladpaiu) - 35 - 9 - 2964 + 36 + 10 + 3018 50 @@ -128,58 +128,58 @@ 1. + Vlad Paiu (@vladpaiu) + Jan 2013 - Aug 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Liviu Chircu (@liviuchircu) Mar 2014 - Jul 2021 - 3. + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2021 - 4. + 5. Razvan Crainea (@razvancrainea) Aug 2015 - Dec 2020 - 5. + 6. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Mar 2020 - 6. + 7. Alessio Garzi (@Ozzyboshi) Nov 2019 - Dec 2019 - 7. + 8. Dan Pascu (@danpascu) May 2019 - May 2019 - 8. + 9. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 9. + 10. @jalung Aug 2017 - Aug 2017 - - 10. - Julián Moreno Patiño - Feb 2016 - Feb 2016 - -All remaining contributors: Vlad Paiu (@vladpaiu), Ovidiu Sas (@ovidiusas). +All remaining contributors: Julián Moreno Patiño, Ovidiu Sas (@ovidiusas). (1) including any documentation-related commits, excluding merge commits diff --git a/modules/cachedb_redis/README b/modules/cachedb_redis/README index 882564f1d61..a13fdbdbc43 100644 --- a/modules/cachedb_redis/README +++ b/modules/cachedb_redis/README @@ -257,7 +257,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Vlad Paiu (@vladpaiu) 30 17 1428 43 + 1. Vlad Paiu (@vladpaiu) 32 19 1446 50 2. Liviu Chircu (@liviuchircu) 29 19 558 277 3. Razvan Crainea (@razvancrainea) 16 13 130 35 4. Vlad Patrascu (@rvlad-patrascu) 12 6 595 38 @@ -292,20 +292,19 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Mar 2014 - Oct 2023 - 2. zhengsh Aug 2023 - Aug 2023 - 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 4. John Burke (@john08burke) Apr 2022 - Apr 2022 - 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jan 2022 - 6. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Mar 2020 - 7. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 - 8. Dan Pascu (@danpascu) May 2019 - May 2019 - 9. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 10. Kristian Høgh Apr 2016 - Apr 2016 - - All remaining contributors: Julián Moreno Patiño, Jarrod - Baumann (@jarrodb), jalung, Vlad Paiu (@vladpaiu), Ezequiel - Lovelle. + 1. Vlad Paiu (@vladpaiu) Oct 2011 - Nov 2024 + 2. Liviu Chircu (@liviuchircu) Mar 2014 - Oct 2023 + 3. zhengsh Aug 2023 - Aug 2023 + 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 5. John Burke (@john08burke) Apr 2022 - Apr 2022 + 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jan 2022 + 7. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Mar 2020 + 8. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 + 9. Dan Pascu (@danpascu) May 2019 - May 2019 + 10. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 + + All remaining contributors: Kristian Høgh, Julián Moreno + Patiño, Jarrod Baumann (@jarrodb), jalung, Ezequiel Lovelle. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/cachedb_redis/cachedb_redis_dbase.c b/modules/cachedb_redis/cachedb_redis_dbase.c index 8797080d7c6..1831ac5e1fe 100644 --- a/modules/cachedb_redis/cachedb_redis_dbase.c +++ b/modules/cachedb_redis/cachedb_redis_dbase.c @@ -97,7 +97,7 @@ static int redis_init_ssl(char *url_extra_opts, redisContext *ctx, SSL *ssl; struct tls_domain *d; - if (tls_dom == NULL) { + if (tls_dom == NULL || *tls_dom == NULL) { if (strncmp(url_extra_opts, CACHEDB_TLS_DOM_PARAM, CACHEDB_TLS_DOM_PARAM_LEN)) { LM_ERR("Invalid Redis URL parameter: %s\n", url_extra_opts); @@ -258,6 +258,8 @@ int redis_connect(redis_con *con) freeReplyObject(rpl); goto error; } + + memset(con->nodes,0,sizeof(cluster_node) + len + 1); con->nodes->ip = (char *)(con->nodes + 1); strcpy(con->nodes->ip,con->host); @@ -271,7 +273,7 @@ int redis_connect(redis_con *con) /* cluster instance mode */ con->flags |= REDIS_CLUSTER_INSTANCE; con->slots_assigned = 0; - LM_DBG("cluster instance mode\n"); + LM_DBG("cluster instance mode on %p\n",con); if (build_cluster_nodes(con,rpl->str,rpl->len) < 0) { LM_ERR("failed to parse Redis cluster info\n"); freeReplyObject(rpl); diff --git a/modules/cachedb_redis/cachedb_redis_utils.c b/modules/cachedb_redis/cachedb_redis_utils.c index 0579044bbcb..0735dc98820 100644 --- a/modules/cachedb_redis/cachedb_redis_utils.c +++ b/modules/cachedb_redis/cachedb_redis_utils.c @@ -88,13 +88,17 @@ cluster_node *get_redis_connection(redis_con *con,str *key) unsigned short hash_slot; cluster_node *it; - if (con->flags & REDIS_SINGLE_INSTANCE) + if (con->flags & REDIS_SINGLE_INSTANCE) { + LM_DBG("Single redis connection, returning %p\n",con->nodes); return con->nodes; - else { + } else { hash_slot = redisHash(con, key); for (it=con->nodes;it;it=it->next) { - if (it->start_slot <= hash_slot && it->end_slot >= hash_slot) + + if (it->start_slot <= hash_slot && it->end_slot >= hash_slot) { + LM_DBG("Redis cluster connection, matched con %p for slot %u \n",it,hash_slot); return it; + } } return NULL; } @@ -230,6 +234,7 @@ int build_cluster_nodes(redis_con *con,char *info,int size) // Cluster data into Array if (explode(info,delimeters,newret1)) { for (i=0;i<=newret1[0]->count;i++) { + LM_DBG("Nodes : %s\n",newret1[0]->redisdata[i]); if ((strstr(newret1[0]->redisdata[i],"master") && (masters <= count)) || strstr(newret1[0]->redisdata[i],"myself,master")) { @@ -243,10 +248,14 @@ int build_cluster_nodes(redis_con *con,char *info,int size) if (strstr(newret1[0]->redisdata[i],"myself") && strstr(newret2[0]->redisdata[j],"myself")) { //myself no ip - ip = con->id->host; - port = con->id->port; - if (i==0) masters--; - + if (ip == NULL) { + ip = con->id->host; + port = con->id->port; + LM_DBG("Myself and no IP, set ip to main host %s\n",con->id->host); + if (i==0) masters--; + } else + LM_DBG("Master already discovered to not be myself, not going to main host \n"); + } else { //Get the ip and port of other master if (strstr(newret2[0]->redisdata[j],":") && (strlen(newret2[0]->redisdata[j]) > 5)) { @@ -269,8 +278,6 @@ int build_cluster_nodes(redis_con *con,char *info,int size) } else { block = "row to array"; goto error;} - LM_DBG("ip port start end %s %hu %hu %hu\n",ip,port,start_slot,end_slot); - if ( ip == NULL || !(port > 0) || (start_slot > end_slot) || !(end_slot > 0) ) {block = ":processing row"; goto error;} len = strlen(ip); @@ -288,6 +295,8 @@ int build_cluster_nodes(redis_con *con,char *info,int size) new->start_slot = start_slot; new->end_slot = end_slot; + LM_DBG("Saving connection %p for ip %s port %hu start %hu end %hu\n",new,ip,port,start_slot,end_slot); + if (con->nodes == NULL) con->nodes = new; else { diff --git a/modules/cachedb_redis/doc/contributors.xml b/modules/cachedb_redis/doc/contributors.xml index b1898f32ea8..3a36139560b 100644 --- a/modules/cachedb_redis/doc/contributors.xml +++ b/modules/cachedb_redis/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Vlad Paiu (@vladpaiu) - 30 - 17 - 1428 - 43 + 32 + 19 + 1446 + 50 2. @@ -128,58 +128,58 @@ 1. + Vlad Paiu (@vladpaiu) + Oct 2011 - Nov 2024 + + + 2. Liviu Chircu (@liviuchircu) Mar 2014 - Oct 2023 - 2. + 3. zhengsh Aug 2023 - Aug 2023 - 3. + 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 4. + 5. John Burke (@john08burke) Apr 2022 - Apr 2022 - 5. + 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jan 2022 - 6. + 7. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Mar 2020 - 7. + 8. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 - 8. + 9. Dan Pascu (@danpascu) May 2019 - May 2019 - 9. + 10. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - 10. - Kristian Høgh - Apr 2016 - Apr 2016 - -All remaining contributors: Julián Moreno Patiño, Jarrod Baumann (@jarrodb), jalung, Vlad Paiu (@vladpaiu), Ezequiel Lovelle. +All remaining contributors: Kristian Høgh, Julián Moreno Patiño, Jarrod Baumann (@jarrodb), jalung, Ezequiel Lovelle. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/cachedb_sql/README b/modules/cachedb_sql/README index c38c9abdc69..0f4801fa720 100644 --- a/modules/cachedb_sql/README +++ b/modules/cachedb_sql/README @@ -196,7 +196,7 @@ Chapter 3. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Vlad Paiu (@vladpaiu) 16 5 1001 87 - 2. Liviu Chircu (@liviuchircu) 10 8 41 58 + 2. Liviu Chircu (@liviuchircu) 11 9 42 59 3. Razvan Crainea (@razvancrainea) 7 5 4 2 4. Bogdan-Andrei Iancu (@bogdan-iancu) 5 3 5 2 5. Maksym Sobolyev (@sobomax) 4 2 1 2 @@ -228,9 +228,9 @@ Chapter 3. Contributors Name Commit Activity 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 2. Ovidiu Sas (@ovidiusas) Apr 2022 - Apr 2022 - 3. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2019 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Apr 2019 - 5. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2018 + 3. Liviu Chircu (@liviuchircu) Mar 2014 - Apr 2021 + 4. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2019 + 5. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2017 8. Julián Moreno Patiño Feb 2016 - Feb 2016 diff --git a/modules/cachedb_sql/cachedb_sql.c b/modules/cachedb_sql/cachedb_sql.c index 0e6d4a59910..e4117ebe3b6 100644 --- a/modules/cachedb_sql/cachedb_sql.c +++ b/modules/cachedb_sql/cachedb_sql.c @@ -565,7 +565,7 @@ static int child_init(int rank) cachedb_con *con; for (it = sql_script_urls;it;it=it->next) { - LM_DBG("iterating through conns - [%.*s]\n",it->url.len,it->url.s); + LM_DBG("iterating through conns - [%s]\n", db_url_escape(&it->url)); con = dbcache_init(&it->url); if (con == NULL) { LM_ERR("failed to open connection\n"); diff --git a/modules/cachedb_sql/doc/contributors.xml b/modules/cachedb_sql/doc/contributors.xml index ac126d7c843..3f7398bf601 100644 --- a/modules/cachedb_sql/doc/contributors.xml +++ b/modules/cachedb_sql/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 10 - 8 - 41 - 58 + 11 + 9 + 42 + 59 3. @@ -138,18 +138,18 @@ 3. - Razvan Crainea (@razvancrainea) - Aug 2015 - Sep 2019 + Liviu Chircu (@liviuchircu) + Mar 2014 - Apr 2021 4. - Bogdan-Andrei Iancu (@bogdan-iancu) - Oct 2014 - Apr 2019 + Razvan Crainea (@razvancrainea) + Aug 2015 - Sep 2019 5. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2018 + Bogdan-Andrei Iancu (@bogdan-iancu) + Oct 2014 - Apr 2019 6. diff --git a/modules/call_control/Makefile b/modules/call_control/Makefile index 3f44b124125..f5899f4ca7b 100644 --- a/modules/call_control/Makefile +++ b/modules/call_control/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # call_control module makefile # # diff --git a/modules/call_control/README b/modules/call_control/README index 95ca33534ae..66959ccaccf 100644 --- a/modules/call_control/README +++ b/modules/call_control/README @@ -507,7 +507,7 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Dan Pascu (@danpascu) 27 10 1621 177 - 2. Liviu Chircu (@liviuchircu) 15 12 56 65 + 2. Liviu Chircu (@liviuchircu) 16 13 56 67 3. Saúl Ibarra Corretgé (@saghul) 15 9 320 124 4. Razvan Crainea (@razvancrainea) 11 9 57 33 5. Bogdan-Andrei Iancu (@bogdan-iancu) 11 9 18 48 @@ -540,13 +540,13 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Alexey Vasilyev (@vasilevalex) Mar 2022 - Mar 2022 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2009 - May 2020 - 4. Zero King (@l2dy) Mar 2020 - Mar 2020 - 5. Razvan Crainea (@razvancrainea) Jul 2010 - Sep 2019 - 6. Dan Pascu (@danpascu) Dec 2008 - Aug 2019 - 7. Liviu Chircu (@liviuchircu) Jan 2013 - May 2019 + 1. Liviu Chircu (@liviuchircu) Jan 2013 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Alexey Vasilyev (@vasilevalex) Mar 2022 - Mar 2022 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2009 - May 2020 + 5. Zero King (@l2dy) Mar 2020 - Mar 2020 + 6. Razvan Crainea (@razvancrainea) Jul 2010 - Sep 2019 + 7. Dan Pascu (@danpascu) Dec 2008 - Aug 2019 8. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 9. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 10. Julián Moreno Patiño Feb 2016 - Feb 2016 diff --git a/modules/call_control/doc/contributors.xml b/modules/call_control/doc/contributors.xml index a0a150bb623..3dde191c8d7 100644 --- a/modules/call_control/doc/contributors.xml +++ b/modules/call_control/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 15 - 12 + 16 + 13 56 - 65 + 67 3. @@ -128,39 +128,39 @@ 1. + Liviu Chircu (@liviuchircu) + Jan 2013 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Alexey Vasilyev (@vasilevalex) Mar 2022 - Mar 2022 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2009 - May 2020 - 4. + 5. Zero King (@l2dy) Mar 2020 - Mar 2020 - 5. + 6. Razvan Crainea (@razvancrainea) Jul 2010 - Sep 2019 - 6. + 7. Dan Pascu (@danpascu) Dec 2008 - Aug 2019 - - 7. - Liviu Chircu (@liviuchircu) - Jan 2013 - May 2019 - 8. Vlad Patrascu (@rvlad-patrascu) diff --git a/modules/callops/README b/modules/callops/README index d696de90bdf..1c99588270f 100644 --- a/modules/callops/README +++ b/modules/callops/README @@ -438,7 +438,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Razvan Crainea (@razvancrainea) 44 22 2267 157 + 1. Razvan Crainea (@razvancrainea) 45 23 2273 163 2. Vlad Patrascu (@rvlad-patrascu) 5 1 123 66 3. Maksym Sobolyev (@sobomax) 4 2 4 5 4. Bogdan-Andrei Iancu (@bogdan-iancu) 3 1 2 1 @@ -464,11 +464,11 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2023 - Apr 2023 - 2. Vlad Patrascu (@rvlad-patrascu) Mar 2023 - Mar 2023 - 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 4. Liviu Chircu (@liviuchircu) Jan 2021 - Jan 2021 - 5. Razvan Crainea (@razvancrainea) May 2020 - Jul 2020 + 1. Razvan Crainea (@razvancrainea) May 2020 - Mar 2025 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2023 - Apr 2023 + 3. Vlad Patrascu (@rvlad-patrascu) Mar 2023 - Mar 2023 + 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 5. Liviu Chircu (@liviuchircu) Jan 2021 - Jan 2021 (1) including any documentation-related commits, excluding merge commits diff --git a/modules/callops/callops.c b/modules/callops/callops.c index ad2c2b6ebc5..867f549d68f 100644 --- a/modules/callops/callops.c +++ b/modules/callops/callops.c @@ -892,7 +892,7 @@ static mi_response_t *mi_call_blind_transfer(const mi_params_t *params, if (call_dlg_api.send_indialog_request(dlg, &refer, (caller?DLG_CALLER_LEG:callee_idx(dlg)), NULL, NULL, refer_hdr, - mi_call_transfer_reply, async_hdl) < 0) { + mi_call_transfer_reply, async_hdl, NULL) < 0) { LM_ERR("could not send the transfer message!\n"); isval.s = empty_str; call_dlg_api.store_dlg_value(dlg, &call_transfer_param, &isval, @@ -1037,7 +1037,7 @@ static mi_response_t *mi_call_attended_transfer(const mi_params_t *params, if (call_dlg_api.send_indialog_request(dlgA, &refer, (callerA?DLG_CALLER_LEG:callee_idx(dlgA)), NULL, NULL, refer_hdr, - mi_call_transfer_reply, async_hdl) < 0) { + mi_call_transfer_reply, async_hdl, NULL) < 0) { LM_ERR("could not send the transfer message!\n"); isval.s = empty_str; call_dlg_api.store_dlg_value((dlgB?dlgB:dlgA), @@ -1179,7 +1179,7 @@ static int call_put_leg_onhold(struct dlg_cell *dlg, int leg) /* send it out */ ret = call_dlg_api.send_indialog_request(dlg, &invite, leg, &body, &ct, - NULL, mi_call_hold_reply, (void *)(long)param); + NULL, mi_call_hold_reply, (void *)(long)param, NULL); pkg_free(body.s); if (ret < 0) { init_str(&state, "fail"); @@ -1227,7 +1227,7 @@ static int call_resume_leg_onhold(struct dlg_cell *dlg, int leg) RAISE_CALL_EVENT(HOLD, &dlg->callid, &sleg, &action, &state, NULL); if (call_dlg_api.send_indialog_request(dlg, &invite, leg, &body, &ct, - NULL, mi_call_hold_reply, (void *)(long)param) < 0) { + NULL, mi_call_hold_reply, (void *)(long)param, NULL) < 0) { init_str(&state, "fail"); RAISE_CALL_EVENT(HOLD, &dlg->callid, &sleg, &action, &state, NULL); LM_ERR("could not resume leg %d\n", leg); @@ -1411,7 +1411,7 @@ static int w_call_blind_transfer(struct sip_msg *req, int leg, str *dst) if (call_dlg_api.send_indialog_request(dlg, &refer, (leg == DLG_CALLER_LEG?DLG_CALLER_LEG:callee_idx(dlg)), NULL, NULL, - refer_hdr, mi_call_transfer_reply, NULL) < 0) { + refer_hdr, mi_call_transfer_reply, NULL, NULL) < 0) { LM_ERR("could not send the transfer message!\n"); isval.s = empty_str; call_dlg_api.store_dlg_value(dlg, &call_transfer_param, &isval, @@ -1498,7 +1498,7 @@ static int w_call_attended_transfer(struct sip_msg *req, int leg, if (call_dlg_api.send_indialog_request(dlgA, &refer, (leg == DLG_CALLER_LEG?DLG_CALLER_LEG:callee_idx(dlgA)), NULL, NULL, - refer_hdr, mi_call_transfer_reply, NULL) < 0) { + refer_hdr, mi_call_transfer_reply, NULL, NULL) < 0) { LM_ERR("could not send the transfer message!\n"); isval.s = empty_str; call_dlg_api.store_dlg_value(dlgB, &call_transfer_callid_param, &isval, diff --git a/modules/callops/doc/contributors.xml b/modules/callops/doc/contributors.xml index 05afc9d2f11..ae859014ca3 100644 --- a/modules/callops/doc/contributors.xml +++ b/modules/callops/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Razvan Crainea (@razvancrainea) - 44 - 22 - 2267 - 157 + 45 + 23 + 2273 + 163 2. @@ -88,29 +88,29 @@ 1. + Razvan Crainea (@razvancrainea) + May 2020 - Mar 2025 + + + 2. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2023 - Apr 2023 - 2. + 3. Vlad Patrascu (@rvlad-patrascu) Mar 2023 - Mar 2023 - 3. + 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 4. + 5. Liviu Chircu (@liviuchircu) Jan 2021 - Jan 2021 - - 5. - Razvan Crainea (@razvancrainea) - May 2020 - Jul 2020 - diff --git a/modules/carrierroute/Makefile b/modules/carrierroute/Makefile index c96e59cfbde..d7e9fa41564 100644 --- a/modules/carrierroute/Makefile +++ b/modules/carrierroute/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # carrierroute Makefile # # WARNING: do not run this directly, it should be run by the master Makefile diff --git a/modules/carrierroute/README b/modules/carrierroute/README index 23be3fc134c..836f2b71c6d 100644 --- a/modules/carrierroute/README +++ b/modules/carrierroute/README @@ -1226,7 +1226,7 @@ Chapter 2. Contributors 4. Bogdan-Andrei Iancu (@bogdan-iancu) 29 24 131 154 5. Razvan Crainea (@razvancrainea) 23 20 109 108 6. Vlad Patrascu (@rvlad-patrascu) 22 5 384 764 - 7. Liviu Chircu (@liviuchircu) 18 12 134 208 + 7. Liviu Chircu (@liviuchircu) 19 13 134 210 8. Daniel-Constantin Mierla (@miconda) 9 7 34 30 9. Maksym Sobolyev (@sobomax) 4 2 5 5 10. Carsten Bock 3 1 64 15 @@ -1256,7 +1256,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2023 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 2. Maksym Sobolyev (@sobomax) Oct 2022 - Feb 2023 3. ihsinme Feb 2022 - Feb 2022 4. Razvan Crainea (@razvancrainea) Jun 2011 - Jan 2021 diff --git a/modules/carrierroute/doc/contributors.xml b/modules/carrierroute/doc/contributors.xml index 44e92a654c1..373444bca46 100644 --- a/modules/carrierroute/doc/contributors.xml +++ b/modules/carrierroute/doc/contributors.xml @@ -69,10 +69,10 @@ 7. Liviu Chircu (@liviuchircu) - 18 - 12 + 19 + 13 134 - 208 + 210 8. @@ -129,7 +129,7 @@ 1. Liviu Chircu (@liviuchircu) - Mar 2014 - May 2023 + Mar 2014 - May 2024 2. diff --git a/modules/cfgutils/Makefile b/modules/cfgutils/Makefile index 31c6dcf13ac..4020bf2cf5f 100644 --- a/modules/cfgutils/Makefile +++ b/modules/cfgutils/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # cfgutils module makefile # # diff --git a/modules/cfgutils/README b/modules/cfgutils/README index 7c266edf124..c61d139ffd6 100644 --- a/modules/cfgutils/README +++ b/modules/cfgutils/README @@ -914,7 +914,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Liviu Chircu (@liviuchircu) 92 42 2964 1509 + 1. Liviu Chircu (@liviuchircu) 94 44 2966 1512 2. Henning Westerholt (@henningw) 29 18 1088 86 3. Bogdan-Andrei Iancu (@bogdan-iancu) 27 22 367 109 4. Razvan Crainea (@razvancrainea) 20 15 289 79 @@ -949,7 +949,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Sep 2012 - Dec 2023 + 1. Liviu Chircu (@liviuchircu) Sep 2012 - May 2024 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2023 3. Maksym Sobolyev (@sobomax) Dec 2015 - Feb 2023 4. Razvan Crainea (@razvancrainea) Oct 2010 - Jan 2020 diff --git a/modules/cfgutils/cfgutils.c b/modules/cfgutils/cfgutils.c index 99485ddb3c7..81912d9b4c0 100644 --- a/modules/cfgutils/cfgutils.c +++ b/modules/cfgutils/cfgutils.c @@ -699,7 +699,8 @@ static int get_accurate_time(struct sip_msg* msg, val.flags = PV_VAL_STR; val.rs.s = sec_usec_buf; - val.rs.len = sprintf(sec_usec_buf, "%ld.%06ld", tv.tv_sec, tv.tv_usec); + val.rs.len = sprintf(sec_usec_buf, "%lld.%06lld", + (long long)tv.tv_sec, (long long)tv.tv_usec); if (pv_set_value(msg, pv_sec_usec, 0, &val) != 0) { LM_ERR("failed to set 'pv_sec_usec'\n"); return -1; diff --git a/modules/cfgutils/doc/contributors.xml b/modules/cfgutils/doc/contributors.xml index 7f17cf36319..fc709c394d1 100644 --- a/modules/cfgutils/doc/contributors.xml +++ b/modules/cfgutils/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Liviu Chircu (@liviuchircu) - 92 - 42 - 2964 - 1509 + 94 + 44 + 2966 + 1512 2. @@ -129,7 +129,7 @@ 1. Liviu Chircu (@liviuchircu) - Sep 2012 - Dec 2023 + Sep 2012 - May 2024 2. diff --git a/modules/cgrates/README b/modules/cgrates/README index 8d6d4c60724..7a290be5074 100644 --- a/modules/cgrates/README +++ b/modules/cgrates/README @@ -716,7 +716,7 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Razvan Crainea (@razvancrainea) 187 97 7241 1854 2. Vlad Patrascu (@rvlad-patrascu) 16 10 138 190 - 3. Liviu Chircu (@liviuchircu) 12 10 51 61 + 3. Liviu Chircu (@liviuchircu) 14 11 56 65 4. Bogdan-Andrei Iancu (@bogdan-iancu) 6 4 20 21 5. Maksym Sobolyev (@sobomax) 5 3 14 14 6. wuhanck 3 1 3 3 @@ -744,8 +744,8 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Dec 2016 - Nov 2023 - 2. Liviu Chircu (@liviuchircu) Nov 2017 - May 2023 + 1. Liviu Chircu (@liviuchircu) Nov 2017 - Apr 2024 + 2. Razvan Crainea (@razvancrainea) Dec 2016 - Nov 2023 3. James Stanley Mar 2023 - Mar 2023 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 5. Maksym Sobolyev (@sobomax) Jul 2017 - Feb 2023 diff --git a/modules/cgrates/cgrates_engine.c b/modules/cgrates/cgrates_engine.c index 42d8adcb2cb..b62212fc82b 100644 --- a/modules/cgrates/cgrates_engine.c +++ b/modules/cgrates/cgrates_engine.c @@ -166,8 +166,8 @@ struct cgr_conn *cgr_get_default_conn(struct cgr_engine *e) time_t now = time(NULL); if (e->disable_time && e->disable_time + cgre_retry_tout > now) { - LM_DBG("engine=%p down now=%lu until=%lu\n", e, now, - e->disable_time + cgre_retry_tout); + LM_DBG("engine=%p down now=%lld until=%lld\n", e, (long long)now, + (long long)(e->disable_time + cgre_retry_tout)); return NULL; } @@ -191,8 +191,9 @@ struct cgr_conn *cgr_get_default_conn(struct cgr_engine *e) return e->default_con; } } else { - LM_DBG("conn=%p state=%x now=%lu until=%lu\n", e->default_con, - e->default_con->state, now, e->default_con->disable_time + cgre_retry_tout); + LM_DBG("conn=%p state=%x now=%lld until=%lld\n", e->default_con, + e->default_con->state, (long long)now, + (long long)(e->default_con->disable_time + cgre_retry_tout)); } return NULL; } @@ -270,7 +271,7 @@ static int cgrc_conn(struct cgr_conn *c) tcp_con_get_profile(&c->engine->su, src_su, PROTO_TCP, &prof); - s = tcp_sync_connect_fd(src_su, &c->engine->su, PROTO_TCP, &prof, 0); + s = tcp_sync_connect_fd(src_su, &c->engine->su, PROTO_TCP, &prof, 0, 0); if (s < 0) { LM_ERR("cannot connect to %.*s:%d\n", c->engine->host.len, c->engine->host.s, c->engine->port); diff --git a/modules/cgrates/doc/contributors.xml b/modules/cgrates/doc/contributors.xml index b819621004f..aa05115b4cc 100644 --- a/modules/cgrates/doc/contributors.xml +++ b/modules/cgrates/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 12 - 10 - 51 - 61 + 14 + 11 + 56 + 65 4. @@ -120,13 +120,13 @@ 1. - Razvan Crainea (@razvancrainea) - Dec 2016 - Nov 2023 + Liviu Chircu (@liviuchircu) + Nov 2017 - Apr 2024 2. - Liviu Chircu (@liviuchircu) - Nov 2017 - May 2023 + Razvan Crainea (@razvancrainea) + Dec 2016 - Nov 2023 3. diff --git a/modules/clusterer/Makefile b/modules/clusterer/Makefile index 0d22c5b0a2c..3ca15b036d3 100644 --- a/modules/clusterer/Makefile +++ b/modules/clusterer/Makefile @@ -3,6 +3,7 @@ include ../../Makefile.defs auto_gen= NAME=clusterer.so +#DEFS+= -DCLUSTERER_DBG #DEFS+= -DCLUSTERER_EXTRA_BIN_DBG include ../../Makefile.modules diff --git a/modules/clusterer/README b/modules/clusterer/README index c866cc8a18f..659c4cf8d75 100644 --- a/modules/clusterer/README +++ b/modules/clusterer/README @@ -1433,10 +1433,10 @@ Chapter 3. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Vlad Patrascu (@rvlad-patrascu) 360 135 13387 7101 - 2. Liviu Chircu (@liviuchircu) 57 43 653 454 + 2. Liviu Chircu (@liviuchircu) 70 53 824 556 3. Eseanu Marius Cristian (@eseanucristian) 45 10 3142 534 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) 29 15 1332 124 - 5. Razvan Crainea (@razvancrainea) 25 19 324 145 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) 30 16 1342 128 + 5. Razvan Crainea (@razvancrainea) 26 20 326 147 6. Ionel Cerghit (@ionel-cerghit) 9 2 250 212 7. Maksym Sobolyev (@sobomax) 6 4 10 11 8. Jasper Hafkenscheid 4 2 107 2 @@ -1466,11 +1466,11 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Vlad Patrascu (@rvlad-patrascu) Jul 2016 - Jul 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2016 - Apr 2023 - 3. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 4. Liviu Chircu (@liviuchircu) Mar 2016 - Oct 2022 - 5. Razvan Crainea (@razvancrainea) Nov 2015 - Aug 2022 + 1. Liviu Chircu (@liviuchircu) Mar 2016 - Mar 2025 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2016 - Sep 2024 + 3. Razvan Crainea (@razvancrainea) Nov 2015 - Sep 2024 + 4. Vlad Patrascu (@rvlad-patrascu) Jul 2016 - Jul 2023 + 5. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 6. Jasper Hafkenscheid May 2022 - Jul 2022 7. kworm83 Feb 2021 - Feb 2021 8. Fabian Gast (@fgast) Nov 2018 - Jul 2020 @@ -1487,9 +1487,9 @@ Chapter 4. Documentation 4.1. Contributors - Last edited by: Bogdan-Andrei Iancu (@bogdan-iancu), Vlad - Patrascu (@rvlad-patrascu), Jasper Hafkenscheid, Liviu Chircu - (@liviuchircu), Fabian Gast (@fgast), Razvan Crainea + Last edited by: Liviu Chircu (@liviuchircu), Bogdan-Andrei + Iancu (@bogdan-iancu), Vlad Patrascu (@rvlad-patrascu), Jasper + Hafkenscheid, Fabian Gast (@fgast), Razvan Crainea (@razvancrainea), Peter Lemenkov (@lemenkov), Eseanu Marius Cristian (@eseanucristian). diff --git a/modules/clusterer/clusterer.c b/modules/clusterer/clusterer.c index 93636e22e94..0997c2081e9 100644 --- a/modules/clusterer/clusterer.c +++ b/modules/clusterer/clusterer.c @@ -73,6 +73,12 @@ void sync_check_timer(utime_t ticks, void *param) struct local_cap *cap; struct timeval now; + if (sr_get_core_status() != STATE_RUNNING) { + LM_DBG("opensips is not operational (state: %d), nothing " + "to check for now\n", sr_get_core_status()); + return; + } + gettimeofday(&now, NULL); lock_start_read(cl_list_lock); @@ -93,15 +99,18 @@ void sync_check_timer(utime_t ticks, void *param) if ((cap->flags & CAP_SYNC_PENDING) && (cl->current_node->flags & NODE_IS_SEED) && (TIME_DIFF(cap->sync_req_time, now) >= - seed_fb_interval*1000000)) { + ((cap->flags&CAP_SYNC_STARTUP ? ready_delay:0) + + seed_fb_interval) * 1000000)) { cap->flags |= CAP_STATE_OK; - cap->flags &= ~CAP_SYNC_PENDING; + cap->flags &= ~(CAP_SYNC_PENDING|CAP_SYNC_STARTUP); sr_set_status(cl_srg, STR2CI(cap->reg.sr_id), CAP_SR_SYNCED, STR2CI(CAP_SR_STATUS_STR(CAP_SR_SYNCED)), 0); sr_add_report_fmt(cl_srg, STR2CI(cap->reg.sr_id), 0, - "Donor node not found, fallback to synced state"); - LM_INFO("No donor found, falling back to synced state\n"); + "ERROR: Sync request aborted! (no donor found in due time)" + " => fallback to synced state"); + LM_ERR("Sync request aborted! (no donor found in due time)" + ", falling back to synced state\n"); /* send update about the state of this capability */ send_single_cap_update(cl, cap, 1); @@ -295,9 +304,10 @@ int get_capability_status(cluster_info_t *cluster, str *capability) static int msg_send_retry(bin_packet_t *packet, node_info_t *dest, int change_dest, int *ev_actions_required) { - int retr_send = 0; + struct timeval now; node_info_t *chosen_dest = dest; str send_buffer; + int retr_send = 0; do { lock_get(chosen_dest->lock); @@ -337,6 +347,14 @@ static int msg_send_retry(bin_packet_t *packet, node_info_t *dest, } } while (retr_send); + gettimeofday(&now, NULL); + + /* sent a TCP BIN packet directly to @dest -> delay next ping */ + lock_get(chosen_dest->lock); + if (chosen_dest->link_state == LS_UP) + chosen_dest->last_ping = now; + lock_release(chosen_dest->lock); + return 0; } @@ -864,7 +882,7 @@ static void handle_cap_update(bin_packet_t *packet, node_info_t *source) node_id); if (rc == CLUSTERER_SEND_SUCCESS) { lock_get(source->cluster->lock); - lcap->flags &= ~CAP_SYNC_PENDING; + lcap->flags &= ~(CAP_SYNC_PENDING|CAP_SYNC_STARTUP); lock_release(source->cluster->lock); } else if (rc == CLUSTERER_SEND_ERR) LM_ERR("Failed to send sync request to node: %d\n", @@ -1013,6 +1031,7 @@ void bin_rcv_cl_extra_packets(bin_packet_t *packet, int packet_type, int ev_actions_required = 0; char *ip; unsigned short port; + struct timeval now; bin_pop_back_int(packet, &dest_id); bin_pop_back_int(packet, &source_id); @@ -1027,6 +1046,8 @@ void bin_rcv_cl_extra_packets(bin_packet_t *packet, int packet_type, return; } + gettimeofday(&now, NULL); + if (!db_mode && packet_type == CLUSTERER_REMOVE_NODE) lock_start_write(cl_list_lock); else @@ -1061,6 +1082,9 @@ void bin_rcv_cl_extra_packets(bin_packet_t *packet, int packet_type, lock_get(node->lock); + /* bump "last pong" ts, since we fully read a valid TCP BIN packet */ + node->last_pong = now; + if (!(node->flags & NODE_STATE_ENABLED)) { lock_release(node->lock); LM_DBG("node disabled, ignoring received clusterer bin packet\n"); @@ -1193,6 +1217,10 @@ void bin_rcv_cl_packets(bin_packet_t *packet, int packet_type, } lock_get(node->lock); + + /* bump "last pong" ts, since we fully read a valid TCP BIN packet */ + node->last_pong = now; + if (!(node->flags & NODE_STATE_ENABLED)) { lock_release(node->lock); LM_DBG("node disabled, ignoring received clusterer bin packet\n"); @@ -1277,6 +1305,7 @@ static void bin_rcv_mod_packets(bin_packet_t *packet, int packet_type, { struct capability_reg *cap; struct local_cap *cl_cap; + struct timeval now; unsigned short port; int source_id, dest_id, cluster_id; char *ip; @@ -1305,6 +1334,8 @@ static void bin_rcv_mod_packets(bin_packet_t *packet, int packet_type, return; } + gettimeofday(&now, NULL); + lock_start_read(cl_list_lock); cl = get_cluster_by_id(cluster_id); @@ -1335,6 +1366,9 @@ static void bin_rcv_mod_packets(bin_packet_t *packet, int packet_type, lock_get(node->lock); + /* bump "last pong" ts, since we fully read a valid TCP BIN packet */ + node->last_pong = now; + if (!(node->flags & NODE_STATE_ENABLED)) { lock_release(node->lock); LM_DBG("node disabled, ignoring received bin packet\n"); @@ -1638,7 +1672,7 @@ void do_actions_node_ev(cluster_info_t *clusters, int *select_cluster, /* check pending sync replies */ for (n_cap = node->capabilities; n_cap; n_cap = n_cap->next) { if (n_cap->flags & CAP_SYNC_PENDING) { - n_cap->flags &= ~CAP_SYNC_PENDING; + n_cap->flags &= ~(CAP_SYNC_PENDING|CAP_SYNC_STARTUP); lock_release(node->lock); /* reply now that the node is up */ if (ipc_dispatch_sync_reply(cl, node->node_id, @@ -1691,7 +1725,7 @@ void do_actions_node_ev(cluster_info_t *clusters, int *select_cluster, * a module tries to sync on node UP event */ if (rst_sync_pending) { lock_get(cl->lock); - cap_it->flags &= ~CAP_SYNC_PENDING; + cap_it->flags &= ~(CAP_SYNC_PENDING|CAP_SYNC_STARTUP); lock_release(cl->lock); } } diff --git a/modules/clusterer/clusterer.h b/modules/clusterer/clusterer.h index 29ff9c8e422..e87ce7dfc7e 100644 --- a/modules/clusterer/clusterer.h +++ b/modules/clusterer/clusterer.h @@ -54,10 +54,11 @@ #define NODE_IS_SEED (1<<3) /* capability flags */ -#define CAP_STATE_OK (1<<0) -#define CAP_SYNC_PENDING (1<<1) -#define CAP_SYNC_IN_PROGRESS (1<<2) -#define CAP_STATE_ENABLED (1<<3) +#define CAP_STATE_OK (1<<0) +#define CAP_SYNC_STARTUP (1<<1) +#define CAP_SYNC_PENDING (1<<2) +#define CAP_SYNC_IN_PROGRESS (1<<3) +#define CAP_STATE_ENABLED (1<<4) #define CAP_DISABLED 0 #define CAP_ENABLED 1 @@ -217,4 +218,10 @@ int run_rcv_mi_cmd(str *cmd_name, str *cmd_params_arr, int no_params); int ipc_dispatch_mod_packet(bin_packet_t *packet, struct capability_reg *cap, int cluster_id); +#ifdef CLUSTERER_DBG + #define CL_DBG(fmtargs...) LM_INFO(fmtargs) +#else + #define CL_DBG(fmtargs...) +#endif + #endif /* CLUSTERER_H */ diff --git a/modules/clusterer/clusterer_mod.c b/modules/clusterer/clusterer_mod.c index 60b4a0080ea..a31b461399a 100644 --- a/modules/clusterer/clusterer_mod.c +++ b/modules/clusterer/clusterer_mod.c @@ -467,7 +467,7 @@ static int mod_init(void) LM_ERR("cannot initialize database connection\n"); goto error; } - if (load_db_info(&dr_dbf, db_hdl, &db_table, cluster_list) < 0) { + if (load_db_info(&dr_dbf, db_hdl, &db_table, cluster_list) != 0) { LM_ERR("Failed to load info from DB\n"); goto error; } diff --git a/modules/clusterer/doc/clusterer_sync_cap.xml b/modules/clusterer/doc/clusterer_sync_cap.xml new file mode 100644 index 00000000000..14155b01667 --- /dev/null +++ b/modules/clusterer/doc/clusterer_sync_cap.xml @@ -0,0 +1,9 @@ + +This OpenSIPS cluster exposes the "&my_cl_sync_cap;" +capability in order to mark nodes as eligible for becoming data donors during an +arbitrary sync request. Consequently, the cluster must have at least +one node marked with the "seed" value +as the clusterer.flags column/property in order to be fully functional. +Consult the clusterer - Capabilities +chapter for more details. + diff --git a/modules/clusterer/doc/contributors.xml b/modules/clusterer/doc/contributors.xml index b7c8d36d734..3a3f7074855 100644 --- a/modules/clusterer/doc/contributors.xml +++ b/modules/clusterer/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 57 - 43 - 653 - 454 + 70 + 53 + 824 + 556 3. @@ -45,18 +45,18 @@ 4. Bogdan-Andrei Iancu (@bogdan-iancu) - 29 - 15 - 1332 - 124 + 30 + 16 + 1342 + 128 5. Razvan Crainea (@razvancrainea) - 25 - 19 - 324 - 145 + 26 + 20 + 326 + 147 6. @@ -128,28 +128,28 @@ 1. - Vlad Patrascu (@rvlad-patrascu) - Jul 2016 - Jul 2023 + Liviu Chircu (@liviuchircu) + Mar 2016 - Mar 2025 2. Bogdan-Andrei Iancu (@bogdan-iancu) - Apr 2016 - Apr 2023 + Apr 2016 - Sep 2024 3. - Maksym Sobolyev (@sobomax) - Jan 2021 - Feb 2023 + Razvan Crainea (@razvancrainea) + Nov 2015 - Sep 2024 4. - Liviu Chircu (@liviuchircu) - Mar 2016 - Oct 2022 + Vlad Patrascu (@rvlad-patrascu) + Jul 2016 - Jul 2023 5. - Razvan Crainea (@razvancrainea) - Nov 2015 - Aug 2022 + Maksym Sobolyev (@sobomax) + Jan 2021 - Feb 2023 6. @@ -190,7 +190,7 @@ Documentation
Contributors - Last edited by: Bogdan-Andrei Iancu (@bogdan-iancu), Vlad Patrascu (@rvlad-patrascu), Jasper Hafkenscheid, Liviu Chircu (@liviuchircu), Fabian Gast (@fgast), Razvan Crainea (@razvancrainea), Peter Lemenkov (@lemenkov), Eseanu Marius Cristian (@eseanucristian). + Last edited by: Liviu Chircu (@liviuchircu), Bogdan-Andrei Iancu (@bogdan-iancu), Vlad Patrascu (@rvlad-patrascu), Jasper Hafkenscheid, Fabian Gast (@fgast), Razvan Crainea (@razvancrainea), Peter Lemenkov (@lemenkov), Eseanu Marius Cristian (@eseanucristian).
diff --git a/modules/clusterer/node_info.c b/modules/clusterer/node_info.c index ea96ca6aba9..6f0baf96791 100644 --- a/modules/clusterer/node_info.c +++ b/modules/clusterer/node_info.c @@ -395,6 +395,7 @@ int load_db_info(db_func_t *dr_dbf, db_con_t* db_hdl, str *db_table, if (RES_ROW_N(res) == 0) { LM_WARN("Current node does not belong to any cluster\n"); + dr_dbf->free_result(db_hdl, res); return 1; } @@ -493,12 +494,17 @@ int load_db_info(db_func_t *dr_dbf, db_con_t* db_hdl, str *db_table, if ((rc = add_node_info(&_, cl_list, int_vals, str_vals)) != 0) { LM_ERR("Unable to add node info to backing list\n"); if (rc < 0) { - return -1; + /* serious error happened, better give up */ + goto error; } else if (int_vals[INT_VALS_NODE_ID_COL] == current_id) { LM_ERR("Invalid info for local node\n"); - return -1; + /* the node info is bogus, but cannot be skipped + * as it is the current node) */ + goto error; } else { - return 2; + /* the node info is bogus, just skip it + * (it's not current node) */ + continue; } } } diff --git a/modules/clusterer/sharing_tags.c b/modules/clusterer/sharing_tags.c index 32d47e7136e..0a136625a6c 100644 --- a/modules/clusterer/sharing_tags.c +++ b/modules/clusterer/sharing_tags.c @@ -447,8 +447,9 @@ int shtag_get(str *tag_name, int cluster_id) return ret; } +/* Note: assumes write-lock on @shtags_lock */ static struct shtag_sync_status *_get_sync_status(struct sharing_tag *tag, - str *capability, int cluster_id, int *w_lock) + str *capability, int cluster_id) { struct shtag_sync_status *status; struct local_cap *cap; @@ -458,12 +459,6 @@ static struct shtag_sync_status *_get_sync_status(struct sharing_tag *tag, str_strcmp(&status->capability->reg.name, capability); status=status->next) ; if (!status) { - if (*w_lock == 0) { - *w_lock = 1; - lock_stop_read(shtags_lock); - lock_start_write(shtags_lock); - } - status = shm_malloc(sizeof *status + capability->len); if (!status) { LM_ERR("No more shm memory!\n"); @@ -501,47 +496,39 @@ int shtag_get_sync_status(str *tag_name, int cluster_id, str *capability) struct sharing_tag *tag; struct shtag_sync_status *status; int ret; - int w_lock = 0; - lock_start_read(shtags_lock); + lock_start_write(shtags_lock); for (tag = *shtags_list; tag && (tag->cluster_id!=cluster_id || str_strcmp(&tag->name, tag_name)); tag = tag->next) ; if (!tag) { - lock_stop_read(shtags_lock); - lock_start_write(shtags_lock); - tag = shtag_get_unsafe(tag_name, cluster_id); - if (!tag) { - lock_stop_write(shtags_lock); - return -1; - } + if (!tag) + goto error; - w_lock = 1; - status = _get_sync_status(tag, capability, cluster_id, &w_lock); + status = _get_sync_status(tag, capability, cluster_id); if (!status) { LM_ERR("Failed to get sync status structure\n"); - return -1; + goto error; } ret = status->status; - lock_stop_write(shtags_lock); } else { - status = _get_sync_status(tag, capability, cluster_id, &w_lock); + status = _get_sync_status(tag, capability, cluster_id); if (!status) { LM_ERR("Failed to get sync status structure\n"); - return -1; + goto error; } ret = status->status; - - if (w_lock) - lock_stop_write(shtags_lock); - else - lock_stop_read(shtags_lock); } + lock_stop_write(shtags_lock); return ret; + +error: + lock_stop_write(shtags_lock); + return -1; } int shtag_set_sync_status(str *tag_name, int cluster_id, str *capability, @@ -549,7 +536,6 @@ int shtag_set_sync_status(str *tag_name, int cluster_id, str *capability, { struct sharing_tag *tag; struct shtag_sync_status *status; - int w_lock = 1; lock_start_write(shtags_lock); @@ -558,15 +544,17 @@ int shtag_set_sync_status(str *tag_name, int cluster_id, str *capability, (tag_name && str_strcmp(&tag->name, tag_name))) continue; - status = _get_sync_status(tag, capability, cluster_id, &w_lock); + status = _get_sync_status(tag, capability, cluster_id); if (!status) { LM_ERR("Failed to get sync status structure\n"); lock_stop_write(shtags_lock); return -1; } - if (status->capability->flags & (CAP_SYNC_PENDING|CAP_SYNC_IN_PROGRESS)) + if (status->capability->flags & (CAP_SYNC_PENDING|CAP_SYNC_IN_PROGRESS)) { + lock_stop_write(shtags_lock); return 0; + } status->status = new_status; } @@ -578,15 +566,17 @@ int shtag_set_sync_status(str *tag_name, int cluster_id, str *capability, return -1; } - status = _get_sync_status(tag, capability, cluster_id, &w_lock); + status = _get_sync_status(tag, capability, cluster_id); if (!status) { LM_ERR("Failed to get sync status structure\n"); lock_stop_write(shtags_lock); return -1; } - if (status->capability->flags & (CAP_SYNC_PENDING|CAP_SYNC_IN_PROGRESS)) + if (status->capability->flags & (CAP_SYNC_PENDING|CAP_SYNC_IN_PROGRESS)) { + lock_stop_write(shtags_lock); return 0; + } status->status = new_status; } @@ -624,7 +614,6 @@ int shtag_sync_all_backup(int cluster_id, str *capability) struct sharing_tag *tag; struct shtag_sync_status *status; int ret = 0; - int w_lock = 1; lock_start_write(shtags_lock); @@ -632,7 +621,7 @@ int shtag_sync_all_backup(int cluster_id, str *capability) if (tag->cluster_id != cluster_id) continue; - status = _get_sync_status(tag, capability, cluster_id, &w_lock); + status = _get_sync_status(tag, capability, cluster_id); if (!status) { LM_ERR("Failed to get sync status structure\n"); lock_stop_write(shtags_lock); @@ -739,8 +728,8 @@ int shtag_activate(str *tag_name, int cluster_id, char *reason, int reason_len) return ret; } ni->node_id = node->node_id; - ni->next = tag->active_msgs_sent; lock_switch_write(shtags_lock, lock_old_flag); + ni->next = tag->active_msgs_sent; tag->active_msgs_sent = ni; lock_switch_read(shtags_lock, lock_old_flag); } @@ -816,8 +805,8 @@ void shtag_flush_state(int c_id, int node_id) return; } ni->node_id = node_id; - ni->next = tag->active_msgs_sent; lock_switch_write(shtags_lock, lock_old_flag); + ni->next = tag->active_msgs_sent; tag->active_msgs_sent = ni; lock_switch_read(shtags_lock, lock_old_flag); } diff --git a/modules/clusterer/sync.c b/modules/clusterer/sync.c index 43d6fd26717..187e825c0cf 100644 --- a/modules/clusterer/sync.c +++ b/modules/clusterer/sync.c @@ -30,9 +30,11 @@ int sync_packet_size = DEFAULT_SYNC_PACKET_SIZE; int _sync_from_id = 0; -static bin_packet_t *sync_packet_snd; +static bin_packet_t *sync_packet_last; static int sync_prev_buf_len; static int *sync_last_chunk_sz; +static bin_packet_t *sync_packets; +static unsigned sync_packets_cnt; int send_sync_req(str *capability, int cluster_id, int source_id) { @@ -93,15 +95,24 @@ int queue_sync_request(cluster_info_t *cluster, struct local_cap *lcap) { lock_get(cluster->lock); lcap->flags |= CAP_SYNC_PENDING; + if (sr_get_core_status() == STATE_INITIALIZING) + lcap->flags |= CAP_SYNC_STARTUP; + else + lcap->flags &= ~CAP_SYNC_STARTUP; if (cluster->current_node->flags & NODE_IS_SEED) gettimeofday(&lcap->sync_req_time, NULL); lock_release(cluster->lock); + LM_INFO("Queue'ing sync request for capability '%.*s' in cluster %d " + "(no donor available)\n", lcap->reg.name.len, lcap->reg.name.s, + cluster->cluster_id); + sr_set_status(cl_srg, STR2CI(lcap->reg.sr_id), CAP_SR_SYNC_PENDING, STR2CI(CAP_SR_STATUS_STR(CAP_SR_SYNC_PENDING)), 0); - if (sr_add_report_fmt(cl_srg, STR2CI(lcap->reg.sr_id), 0, "Sync requested")) + if (sr_add_report_fmt(cl_srg, STR2CI(lcap->reg.sr_id), 0, + "Sync request postponed! (no donor available)")) return -1; return 0; @@ -204,8 +215,8 @@ bin_packet_t *cl_sync_chunk_start(str *capability, int cluster_id, int dst_id, int aloc_new_pkt = 0; bin_packet_t *new_packet = NULL; - if (sync_packet_snd) { - bin_get_buffer(sync_packet_snd, &bin_buffer); + if (sync_packet_last) { + bin_get_buffer(sync_packet_last, &bin_buffer); prev_chunk_size = bin_buffer.len - sync_prev_buf_len; /* assume this chunk will have aprox the same size as the previous one * and check if there is enough space in the packet */ @@ -215,62 +226,59 @@ bin_packet_t *cl_sync_chunk_start(str *capability, int cluster_id, int dst_id, aloc_new_pkt = 1; if (aloc_new_pkt) { /* next chunk will be in a new packet */ - if (sync_packet_snd) { + if (sync_packet_last) { *sync_last_chunk_sz = prev_chunk_size; - /* send and free the previous packet */ - msg_add_trailer(sync_packet_snd, cluster_id, dst_id); - - if (clusterer_send_msg(sync_packet_snd, cluster_id, dst_id, 0, - 1 /* we should be in a SYNC_REQ_RCV callback here so - * already locked*/) < 0) - LM_ERR("Failed to send sync packet\n"); - - bin_free_packet(sync_packet_snd); - pkg_free(sync_packet_snd); - sync_packet_snd = NULL; + /* properly end the previous packet (to be sent later) */ + msg_add_trailer(sync_packet_last, cluster_id, dst_id); sync_last_chunk_sz = NULL; } - new_packet = pkg_malloc(sizeof *new_packet); + new_packet = malloc(sizeof *new_packet); if (!new_packet) { LM_ERR("No more pkg memory\n"); return NULL; } + new_packet->next = NULL; - if (bin_init(new_packet,&cl_extra_cap,CLUSTERER_SYNC,BIN_SYNC_VERSION,0)<0) { + if (_bin_init(new_packet,&cl_extra_cap,CLUSTERER_SYNC,BIN_SYNC_VERSION,0,1)<0) { LM_ERR("Failed to init bin packet\n"); - pkg_free(new_packet); + free(new_packet); return NULL; } bin_push_str(new_packet, capability); bin_push_int(new_packet, data_version); - sync_packet_snd = new_packet; + if (sync_packet_last) + sync_packet_last->next = new_packet; + else + sync_packets = new_packet; + sync_packet_last = new_packet; + sync_packets_cnt++; } if (sync_last_chunk_sz) *sync_last_chunk_sz = prev_chunk_size; /* reserve and remember a holder for the upcoming data chunk size */ - bin_get_buffer(sync_packet_snd, &bin_buffer); - bin_push_int(sync_packet_snd, 0); + bin_get_buffer(sync_packet_last, &bin_buffer); + bin_push_int(sync_packet_last, 0); sync_last_chunk_sz = (int *)(bin_buffer.s + bin_buffer.len); - bin_push_int(sync_packet_snd, SYNC_CHUNK_START_MARKER); + bin_push_int(sync_packet_last, SYNC_CHUNK_START_MARKER); - bin_get_buffer(sync_packet_snd, &bin_buffer); + bin_get_buffer(sync_packet_last, &bin_buffer); sync_prev_buf_len = bin_buffer.len; no_sync_chunks_sent++; - return sync_packet_snd; + return sync_packet_last; } int no_sync_chunks_iter; -/* this mechanism allows modules to ignore all or part of a sync chunk - * without disrupting the sequencing / consuming of the remaining data */ +/* this mechanism allows modules to ignore all or part of a sync chunk on the + * receiver node, without affecting their consuming of remaining sync chunks */ char *next_data_chunk; int cl_sync_chunk_iter(bin_packet_t *packet) @@ -324,42 +332,49 @@ int cl_sync_chunk_iter(bin_packet_t *packet) void send_sync_repl(int sender, void *param) { - bin_packet_t sync_end_pkt; + bin_packet_t sync_end_pkt, *pkt, *next_pkt; str bin_buffer; struct local_cap *cap; - int rc, cluster_id; + int rc, cluster_id, pkt_no = 0; struct reply_rpc_params *p = (struct reply_rpc_params *)param; - lock_start_read(cl_list_lock); - for (cap = p->cluster->capabilities; cap; cap = cap->next) if (!str_strcmp(&p->cap_name, &cap->reg.name)) break; if (!cap) { LM_ERR("Sync request for unknown capability: %.*s\n", p->cap_name.len, p->cap_name.s); - lock_stop_read(cl_list_lock); - return; + goto out_free; } no_sync_chunks_sent = 0; cap->reg.event_cb(SYNC_REQ_RCV, p->node_id); - if (sync_packet_snd) { - bin_get_buffer(sync_packet_snd, &bin_buffer); + lock_start_read(cl_list_lock); + + if (sync_packets) { + bin_get_buffer(sync_packet_last, &bin_buffer); *sync_last_chunk_sz = bin_buffer.len - sync_prev_buf_len; /* send and free the lastly built packet */ - msg_add_trailer(sync_packet_snd, p->cluster->cluster_id, p->node_id); + msg_add_trailer(sync_packet_last, p->cluster->cluster_id, p->node_id); - if ((rc = clusterer_send_msg(sync_packet_snd, p->cluster->cluster_id, - p->node_id, 0, 1))<0) - LM_ERR("Failed to send sync packet, rc=%d\n", rc); + for (pkt = sync_packets; pkt; pkt = next_pkt) { + next_pkt = pkt->next; - bin_free_packet(sync_packet_snd); - pkg_free(sync_packet_snd); - sync_packet_snd = NULL; + if ((rc = clusterer_send_msg(pkt, p->cluster->cluster_id, + p->node_id, 0, 1))<0) + LM_ERR("Failed to send sync packet, rc=%d\n", rc); + + bin_free_packet(pkt); + free(pkt); + } + + sync_packets = NULL; + pkt_no = sync_packets_cnt; + sync_packets_cnt = 0; + sync_packet_last = NULL; sync_last_chunk_sz = NULL; } @@ -367,7 +382,7 @@ void send_sync_repl(int sender, void *param) if (bin_init(&sync_end_pkt,&cl_extra_cap,CLUSTERER_SYNC_END,BIN_SYNC_VERSION,0)<0) { LM_ERR("Failed to init bin packet\n"); lock_stop_read(cl_list_lock); - return; + goto out_free; } bin_push_str(&sync_end_pkt, &p->cap_name); bin_push_int(&sync_end_pkt, no_sync_chunks_sent); @@ -378,7 +393,7 @@ void send_sync_repl(int sender, void *param) LM_ERR("Failed to send sync end message\n"); bin_free_packet(&sync_end_pkt); lock_stop_read(cl_list_lock); - return; + goto out_free; } cluster_id = p->cluster->cluster_id; @@ -386,9 +401,9 @@ void send_sync_repl(int sender, void *param) bin_free_packet(&sync_end_pkt); - LM_INFO("Sent all sync packets for capability '%.*s' to node %d, cluster " - "%d\n", p->cap_name.len, p->cap_name.s, p->node_id, cluster_id); - + LM_INFO("Sent all sync packets (%d) for capability '%.*s' to node %d, cluster " + "%d\n", pkt_no, p->cap_name.len, p->cap_name.s, p->node_id, cluster_id); +out_free: shm_free(param); } @@ -580,10 +595,18 @@ void handle_sync_packet(bin_packet_t *packet, int packet_type, bin_pop_int(packet, &data_version); lock_get(cluster->lock); - if (cap->flags & CAP_SYNC_IN_PROGRESS) - was_in_progress = 1; - /* buffer other types of packets during sync */ - cap->flags |= CAP_SYNC_IN_PROGRESS; + + /* if the cap's state is already OK (e.g. donor aborted sync mid-way, + * then sync_check_timer() timed out the sync back to CAP_STATE_OK), + * avoid forcing a state where repl packets queue indefinitely! */ + if (!(cap->flags & CAP_STATE_OK)) { + if (cap->flags & CAP_SYNC_IN_PROGRESS) + was_in_progress = 1; + + /* buffer other types of packets during sync */ + cap->flags |= CAP_SYNC_IN_PROGRESS; + } + cap->last_sync_pkt = get_ticks(); lock_release(cluster->lock); diff --git a/modules/clusterer/topology.c b/modules/clusterer/topology.c index e5fe1e94d44..21898d22959 100644 --- a/modules/clusterer/topology.c +++ b/modules/clusterer/topology.c @@ -31,8 +31,8 @@ extern int node_timeout; extern int ping_timeout; #define PING_REPLY_INTERVAL(_node) \ - ((_node)->last_pong.tv_sec*1000000 + (_node)->last_pong.tv_usec \ - - (_node)->last_ping.tv_sec*1000000 - (_node)->last_ping.tv_usec) + ((_node)->last_ping.tv_sec*1000000 + (_node)->last_ping.tv_usec \ + - (_node)->last_pong.tv_sec*1000000 - (_node)->last_pong.tv_usec) static int send_ping(node_info_t *node, int req_node_list) { @@ -126,7 +126,7 @@ static void do_action_trans_2(node_info_t *node, int *link_state_to_set) } else { LM_DBG("Sent ping retry to node [%d]\n", node->node_id); *link_state_to_set = LS_RETRYING; - node->curr_no_retries = --node->no_ping_retries; + node->curr_no_retries = node->no_ping_retries - 1; } } } @@ -184,7 +184,7 @@ static void do_action_trans_5(node_info_t *node, int *link_state_to_set, void heartbeats_timer(void) { struct timeval now; - utime_t last_ping_int, ping_reply_int; + time_t last_ping_int, ping_reply_int; cluster_info_t *clusters_it; node_info_t *node; int ev_actions_required[MAX_NO_CLUSTERS] = {0}; @@ -219,19 +219,22 @@ void heartbeats_timer(void) if (node->link_state == LS_RESTART_PINGING) { prev_ls = node->link_state; lock_release(node->lock); + CL_DBG("case 0: RESTART_PINGING\n"); /* restart pinging sequence */ do_action_trans_0(node, &new_ls); } else if (node->link_state == LS_RETRY_SEND_FAIL && last_ping_int >= (utime_t)ping_timeout*1000) { + CL_DBG("case 1: RETRY_SEND_FAIL and timeout\n"); prev_ls = node->link_state; lock_release(node->lock); /* failed to send previous ping, retry */ do_action_trans_1(node, &new_ls); } else if ((node->link_state == LS_UP || node->link_state == LS_RESTARTED) && - (ping_reply_int >= (utime_t)ping_timeout*1000 || ping_reply_int <= 0) && + (ping_reply_int >= (time_t)ping_timeout*1000) && last_ping_int >= (utime_t)ping_timeout*1000) { + CL_DBG("case 2: LS_UP and timeout\n"); prev_ls = -2; lock_release(node->lock); @@ -239,8 +242,9 @@ void heartbeats_timer(void) do_action_trans_2(node, &new_ls); ev_actions_required[no_clusters] = 1; } else if (node->link_state == LS_RETRYING && - (ping_reply_int >= (utime_t)ping_timeout*1000 || ping_reply_int <= 0) && + (ping_reply_int >= (time_t)ping_timeout*1000) && last_ping_int >= (utime_t)ping_timeout*1000) { + CL_DBG("case 3: LS_RETRYING and timeout\n"); prev_ls = node->link_state; lock_release(node->lock); @@ -248,6 +252,7 @@ void heartbeats_timer(void) do_action_trans_3(node, &new_ls); } else if (node->link_state == LS_DOWN && last_ping_int >= (utime_t)node_timeout*1000000) { + CL_DBG("case 4: LS_DOWN and timeout\n"); prev_ls = node->link_state; lock_release(node->lock); @@ -255,13 +260,16 @@ void heartbeats_timer(void) do_action_trans_4(node, &new_ls); } else if (node->link_state == LS_UP && last_ping_int >= (utime_t)ping_interval*1000000) { + CL_DBG("case 5: LS_UP and timeout\n"); prev_ls = node->link_state; lock_release(node->lock); /* send regular ping */ do_action_trans_5(node, &new_ls, ev_actions_required, no_clusters); - } else + } else { + CL_DBG("case 6: do nothing\n"); lock_release(node->lock); + } if (new_ls >= 0) set_link_w_neigh_adv(prev_ls, new_ls, node); @@ -1358,11 +1366,9 @@ void handle_pong(bin_packet_t *received, node_info_t *src_node, src_node->link_state = LS_TEMP; /* if the node was retried and a reply was expected, it should be UP again */ - if ((src_node->link_state == LS_RESTARTED || + if (src_node->link_state == LS_RESTARTED || src_node->link_state == LS_RETRYING || - src_node->link_state == LS_TEMP) && - PING_REPLY_INTERVAL(src_node) > 0 && - PING_REPLY_INTERVAL(src_node) < (utime_t)ping_timeout*1000) { + src_node->link_state == LS_TEMP) { lock_release(src_node->lock); set_link_w_neigh_up(src_node, nr_nodes, node_list); diff --git a/modules/compression/Makefile b/modules/compression/Makefile index 81307241f8f..207a25f3928 100644 --- a/modules/compression/Makefile +++ b/modules/compression/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/compression/README b/modules/compression/README index 782e98cc796..46a53c526f8 100644 --- a/modules/compression/README +++ b/modules/compression/README @@ -290,17 +290,17 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Ionut Ionita (@ionutrazvanionita) 49 12 3976 192 2. Razvan Crainea (@razvancrainea) 32 20 283 518 - 3. Liviu Chircu (@liviuchircu) 8 6 31 44 + 3. Liviu Chircu (@liviuchircu) 9 7 31 46 4. Vlad Patrascu (@rvlad-patrascu) 6 4 8 11 5. Aron Podrigal (@ar45) 6 3 126 43 6. Bogdan-Andrei Iancu (@bogdan-iancu) 5 3 4 2 - 7. Maksym Sobolyev (@sobomax) 4 2 3 3 - 8. Ryan Bullock 3 1 4 4 - 9. Julián Moreno Patiño 3 1 2 2 - 10. Peter Lemenkov (@lemenkov) 3 1 1 1 + 7. Alexandra Titoc 4 2 4 3 + 8. Maksym Sobolyev (@sobomax) 4 2 3 3 + 9. Ryan Bullock 3 1 4 4 + 10. Julián Moreno Patiño 3 1 2 2 - All remaining contributors: Ryan Bullock (@rrb3942), Zero King - (@l2dy). + All remaining contributors: Peter Lemenkov (@lemenkov), Ryan + Bullock (@rrb3942), Zero King (@l2dy). (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -322,19 +322,19 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Ryan Bullock Jan 2023 - Jan 2023 - 3. Liviu Chircu (@liviuchircu) Apr 2018 - Nov 2022 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2014 - Apr 2022 - 5. Aron Podrigal (@ar45) Nov 2021 - Apr 2022 - 6. Razvan Crainea (@razvancrainea) Dec 2014 - Jul 2020 - 7. Zero King (@l2dy) Mar 2020 - Mar 2020 - 8. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 9. Ryan Bullock (@rrb3942) Mar 2019 - Mar 2019 - 10. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - All remaining contributors: Ionut Ionita (@ionutrazvanionita), - Julián Moreno Patiño. + 1. Alexandra Titoc Sep 2024 - Sep 2024 + 2. Liviu Chircu (@liviuchircu) Apr 2018 - May 2024 + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 4. Ryan Bullock Jan 2023 - Jan 2023 + 5. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2014 - Apr 2022 + 6. Aron Podrigal (@ar45) Nov 2021 - Apr 2022 + 7. Razvan Crainea (@razvancrainea) Dec 2014 - Jul 2020 + 8. Zero King (@l2dy) Mar 2020 - Mar 2020 + 9. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 + 10. Ryan Bullock (@rrb3942) Mar 2019 - Mar 2019 + + All remaining contributors: Peter Lemenkov (@lemenkov), Ionut + Ionita (@ionutrazvanionita), Julián Moreno Patiño. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/compression/compression.c b/modules/compression/compression.c index 0c9f8fad456..34c2541b94d 100644 --- a/modules/compression/compression.c +++ b/modules/compression/compression.c @@ -1012,7 +1012,8 @@ static int mc_compact_cb(char** buf_p, struct mc_compact_args *mc_compact_args, memerr: LM_ERR("No more pkg mem\n"); free_mem: - free_hdr_mask(hdr_mask); + if (hdr_mask != NULL) + free_hdr_mask(hdr_mask); return -1; } @@ -1733,7 +1734,7 @@ static int mc_decompress(struct sip_msg* msg) /*If compressed with this module there are great chances that Content-Encoding is last*/ hdr_vec[3] = msg->last_header; - if (!is_content_encoding(hdr_vec[3])) { + if (hdr_vec[3] && !is_content_encoding(hdr_vec[3])) { hdr_vec[3] = NULL; for (hf = msg->headers; hf; hf = hf->next) { if (is_content_encoding(hf)) { @@ -1811,7 +1812,7 @@ static int mc_decompress(struct sip_msg* msg) b64_required=0; if (hdr_vec[2]) { - parse_algo_hdr(hdr_vec[3], &algo, &b64_required); + parse_algo_hdr(hdr_vec[2], &hdrs_algo, &b64_required); } if (b64_required > 0 && hdr_vec[1]) { diff --git a/modules/compression/doc/contributors.xml b/modules/compression/doc/contributors.xml index 131dee5bb1d..e99a9e4bc56 100644 --- a/modules/compression/doc/contributors.xml +++ b/modules/compression/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 8 - 6 + 9 + 7 31 - 44 + 46 4. @@ -68,6 +68,14 @@ 7. + Alexandra Titoc + 4 + 2 + 4 + 3 + + + 8. Maksym Sobolyev (@sobomax) 4 2 @@ -75,7 +83,7 @@ 3 - 8. + 9. Ryan Bullock 3 1 @@ -83,25 +91,17 @@ 4 - 9. + 10. Julián Moreno Patiño 3 1 2 2 - - 10. - Peter Lemenkov (@lemenkov) - 3 - 1 - 1 - 1 - -All remaining contributors: Ryan Bullock (@rrb3942), Zero King (@l2dy). +All remaining contributors: Peter Lemenkov (@lemenkov), Ryan Bullock (@rrb3942), Zero King (@l2dy). (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits) @@ -128,58 +128,58 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Alexandra Titoc + Sep 2024 - Sep 2024 2. - Ryan Bullock - Jan 2023 - Jan 2023 + Liviu Chircu (@liviuchircu) + Apr 2018 - May 2024 3. - Liviu Chircu (@liviuchircu) - Apr 2018 - Nov 2022 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 4. + Ryan Bullock + Jan 2023 - Jan 2023 + + + 5. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2014 - Apr 2022 - 5. + 6. Aron Podrigal (@ar45) Nov 2021 - Apr 2022 - 6. + 7. Razvan Crainea (@razvancrainea) Dec 2014 - Jul 2020 - 7. + 8. Zero King (@l2dy) Mar 2020 - Mar 2020 - 8. + 9. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 9. + 10. Ryan Bullock (@rrb3942) Mar 2019 - Mar 2019 - - 10. - Peter Lemenkov (@lemenkov) - Jun 2018 - Jun 2018 - -All remaining contributors: Ionut Ionita (@ionutrazvanionita), Julián Moreno Patiño. +All remaining contributors: Peter Lemenkov (@lemenkov), Ionut Ionita (@ionutrazvanionita), Julián Moreno Patiño. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/compression/gz_helpers.c b/modules/compression/gz_helpers.c index 8b3d9c9f33a..08f9ae5016f 100644 --- a/modules/compression/gz_helpers.c +++ b/modules/compression/gz_helpers.c @@ -79,7 +79,7 @@ int gzip_compress(unsigned char* in, unsigned long ilen, str* out, unsigned long if (!out->s) { out->s = pkg_malloc(neededSize); out->len = neededSize; - if (!out) + if (!out->s) goto memerr; } else if (ilen > out->len) { out->s = pkg_realloc(out->s, neededSize); diff --git a/modules/cpl_c/Makefile b/modules/cpl_c/Makefile index 24d95612e19..31e44c87a74 100644 --- a/modules/cpl_c/Makefile +++ b/modules/cpl_c/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/cpl_c/README b/modules/cpl_c/README index e1fc9c60752..233f5c5193a 100644 --- a/modules/cpl_c/README +++ b/modules/cpl_c/README @@ -499,8 +499,8 @@ Chapter 2. Contributors 1. Bogdan-Andrei Iancu (@bogdan-iancu) 405 171 15553 6550 2. Razvan Crainea (@razvancrainea) 24 17 265 221 3. Daniel-Constantin Mierla (@miconda) 18 15 80 73 - 4. Jan Janak (@janakj) 18 10 463 219 - 5. Liviu Chircu (@liviuchircu) 17 14 72 117 + 4. Liviu Chircu (@liviuchircu) 18 15 72 119 + 5. Jan Janak (@janakj) 18 10 463 219 6. Henning Westerholt (@henningw) 16 12 108 132 7. Vlad Patrascu (@rvlad-patrascu) 11 8 117 111 8. Andrei Pelinescu-Onciul 9 7 107 60 @@ -534,10 +534,10 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Sep 2010 - Sep 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Aug 2002 - May 2023 - 3. Maksym Sobolyev (@sobomax) Feb 2017 - Feb 2023 - 4. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2020 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Razvan Crainea (@razvancrainea) Sep 2010 - Sep 2023 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Aug 2002 - May 2023 + 4. Maksym Sobolyev (@sobomax) Feb 2017 - Feb 2023 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Eric Tamme (@etamme) Sep 2017 - Sep 2017 diff --git a/modules/cpl_c/doc/contributors.xml b/modules/cpl_c/doc/contributors.xml index d41def6ea8f..f0d5010a4fd 100644 --- a/modules/cpl_c/doc/contributors.xml +++ b/modules/cpl_c/doc/contributors.xml @@ -44,20 +44,20 @@
4. + Liviu Chircu (@liviuchircu) + 18 + 15 + 72 + 119 + + + 5. Jan Janak (@janakj) 18 10 463 219 - - 5. - Liviu Chircu (@liviuchircu) - 17 - 14 - 72 - 117 - 6. Henning Westerholt (@henningw) @@ -128,24 +128,24 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Razvan Crainea (@razvancrainea) Sep 2010 - Sep 2023 - 2. + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Aug 2002 - May 2023 - 3. + 4. Maksym Sobolyev (@sobomax) Feb 2017 - Feb 2023 - - 4. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2020 - 5. Vlad Patrascu (@rvlad-patrascu) diff --git a/modules/db_berkeley/Makefile b/modules/db_berkeley/Makefile index d318123a4a0..e90f910d3ee 100644 --- a/modules/db_berkeley/Makefile +++ b/modules/db_berkeley/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/db_berkeley/README b/modules/db_berkeley/README index 26c61af87d8..283ac239cd7 100644 --- a/modules/db_berkeley/README +++ b/modules/db_berkeley/README @@ -457,7 +457,7 @@ Chapter 2. Contributors 3. Henning Westerholt (@henningw) 26 10 381 688 4. Bogdan-Andrei Iancu (@bogdan-iancu) 24 19 149 170 5. Anonymous 16 4 681 341 - 6. Liviu Chircu (@liviuchircu) 12 9 19 77 + 6. Liviu Chircu (@liviuchircu) 13 10 19 79 7. Daniel-Constantin Mierla (@miconda) 10 8 47 30 8. Vlad Patrascu (@rvlad-patrascu) 6 4 34 28 9. Andrei Dragus 5 1 135 103 @@ -488,9 +488,9 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Sep 2011 - Jul 2020 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - May 2019 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Sep 2011 - Jul 2020 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2008 - Apr 2019 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/db_berkeley/doc/contributors.xml b/modules/db_berkeley/doc/contributors.xml index 32672c8eaa1..143b62ca645 100644 --- a/modules/db_berkeley/doc/contributors.xml +++ b/modules/db_berkeley/doc/contributors.xml @@ -61,10 +61,10 @@ 6. Liviu Chircu (@liviuchircu) - 12 - 9 + 13 + 10 19 - 77 + 79 7. @@ -128,18 +128,18 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Razvan Crainea (@razvancrainea) - Sep 2011 - Jul 2020 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - May 2019 + Razvan Crainea (@razvancrainea) + Sep 2011 - Jul 2020 4. diff --git a/modules/db_cachedb/README b/modules/db_cachedb/README index 5be9596e5de..64e8d2ce561 100644 --- a/modules/db_cachedb/README +++ b/modules/db_cachedb/README @@ -161,8 +161,8 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Vlad Paiu (@vladpaiu) 10 3 626 7 - 2. Liviu Chircu (@liviuchircu) 9 7 31 32 + 1. Liviu Chircu (@liviuchircu) 10 8 34 35 + 2. Vlad Paiu (@vladpaiu) 10 3 626 7 3. Razvan Crainea (@razvancrainea) 7 5 7 5 4. Maksym Sobolyev (@sobomax) 4 2 3 4 5. Vlad Patrascu (@rvlad-patrascu) 4 2 3 2 @@ -191,11 +191,11 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2019 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Apr 2019 - 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 6. Liviu Chircu (@liviuchircu) Mar 2014 - Jun 2018 + 2. Liviu Chircu (@liviuchircu) Mar 2014 - Apr 2021 + 3. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2019 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Apr 2019 + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Walter Doekes (@wdoekes) May 2014 - May 2014 8. Vlad Paiu (@vladpaiu) Feb 2013 - Mar 2013 diff --git a/modules/db_cachedb/dbase.c b/modules/db_cachedb/dbase.c index 66b7a57ae2c..13a2d690d3e 100644 --- a/modules/db_cachedb/dbase.c +++ b/modules/db_cachedb/dbase.c @@ -63,11 +63,11 @@ db_con_t* db_cachedb_init(const str* _url) for (it=db_cachedb_script_urls;it;it=it->next) { if (memcmp(it->url.s,p,len) == 0) { - LM_DBG("Found matching URL : [%.*s]\n",it->url.len,it->url.s); + LM_DBG("Found matching URL : [%s]\n", db_url_escape(&it->url)); if (cachedb_bind_mod(&it->url,&cdbf) < 0) { - LM_ERR("Cannot bind cachedb functions for URL [%.*s]\n", - it->url.len,it->url.s); + LM_ERR("Cannot bind cachedb functions for URL [%s]\n", + db_url_escape(&it->url)); return NULL; } diff --git a/modules/db_cachedb/doc/contributors.xml b/modules/db_cachedb/doc/contributors.xml index e2eac253dd4..91a54e97a24 100644 --- a/modules/db_cachedb/doc/contributors.xml +++ b/modules/db_cachedb/doc/contributors.xml @@ -20,19 +20,19 @@ 1. - Vlad Paiu (@vladpaiu) + Liviu Chircu (@liviuchircu) 10 - 3 - 626 - 7 + 8 + 34 + 35 2. - Liviu Chircu (@liviuchircu) - 9 + Vlad Paiu (@vladpaiu) + 10 + 3 + 626 7 - 31 - 32 3. @@ -117,29 +117,29 @@ 2. + Liviu Chircu (@liviuchircu) + Mar 2014 - Apr 2021 + + + 3. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2019 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Apr 2019 - 4. + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - 6. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jun 2018 - 7. Walter Doekes (@wdoekes) diff --git a/modules/db_flatstore/Makefile b/modules/db_flatstore/Makefile index 6b53fdbe6d9..e56816122d5 100644 --- a/modules/db_flatstore/Makefile +++ b/modules/db_flatstore/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/db_flatstore/README b/modules/db_flatstore/README index 8f3e19a7e0c..7e4e5bd4531 100644 --- a/modules/db_flatstore/README +++ b/modules/db_flatstore/README @@ -239,7 +239,7 @@ Chapter 3. Contributors 1. Bogdan-Andrei Iancu (@bogdan-iancu) 35 26 557 230 2. Razvan Crainea (@razvancrainea) 16 10 481 99 3. Jan Janak (@janakj) 16 4 1232 20 - 4. Liviu Chircu (@liviuchircu) 13 10 83 91 + 4. Liviu Chircu (@liviuchircu) 15 12 84 94 5. Daniel-Constantin Mierla (@miconda) 12 10 60 40 6. Vlad Patrascu (@rvlad-patrascu) 6 4 34 41 7. Henning Westerholt (@henningw) 6 4 24 35 @@ -270,8 +270,8 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2017 - Feb 2023 - 2. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2022 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2017 - Feb 2023 3. Razvan Crainea (@razvancrainea) Sep 2011 - Sep 2019 4. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2005 - Apr 2019 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 diff --git a/modules/db_flatstore/doc/contributors.xml b/modules/db_flatstore/doc/contributors.xml index a99ff31d7b1..8aaeb8d79ce 100644 --- a/modules/db_flatstore/doc/contributors.xml +++ b/modules/db_flatstore/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 13 - 10 - 83 - 91 + 15 + 12 + 84 + 94 5. @@ -128,13 +128,13 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2017 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2022 + Maksym Sobolyev (@sobomax) + Feb 2017 - Feb 2023 3. diff --git a/modules/db_flatstore/flatstore.c b/modules/db_flatstore/flatstore.c index f696d8c5a35..2a7da5a49fb 100644 --- a/modules/db_flatstore/flatstore.c +++ b/modules/db_flatstore/flatstore.c @@ -396,7 +396,7 @@ int flat_db_insert(const db_con_t* h, const db_key_t* k, const db_val_t* v, case DB_DATETIME: /* guess this is 20 */ FLAT_ALLOC(20); - FLAT_PRINTF("%lu", VAL_TIME(v+i), i); + FLAT_PRINTF("%lld", (long long)VAL_TIME(v+i), i); break; case DB_BLOB: diff --git a/modules/db_mysql/Makefile b/modules/db_mysql/Makefile index f9624f79932..18cd3a839f4 100644 --- a/modules/db_mysql/Makefile +++ b/modules/db_mysql/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/db_mysql/README b/modules/db_mysql/README index 7139e5c2935..cfa387d55d5 100644 --- a/modules/db_mysql/README +++ b/modules/db_mysql/README @@ -154,7 +154,11 @@ modparam("db_mysql", "ps_max_col_size", 4096) connections. In order to enable TLS for a specific connection, you can use the "tls_domain=dom_name" URL parameter in the db_url of the respective OpenSIPS module. This should be placed - at the end of the URL after the '?' character. + at the end of the URL after the '?' character. Additionally, + the query string may include the "tls_opts= + PKEY,CERT,CA,CA_DIR,CIPHERS" CSV parameter, in order to + control/limit the amount of TLS options passed to the TLS + library. When using this parameter, you must also ensure that tls_mgm is loaded and properly configured. Refer to the the module for @@ -185,6 +189,9 @@ modparam("db_mysql", "use_tls", 1) modparam("usrloc", "db_url", "mysql://root:1234@localhost/opensips?tls_d omain=dom1") ... +modparam("usrloc", "db_url", "mysql://root:1234@localhost/opensips?tls_d +omain=dom1&tls_opts=PKEY,CERT,CA,CA_DIR,CIPHERS") +... 1.4. Exported Functions @@ -225,7 +232,7 @@ Chapter 2. Contributors 1. Jan Janak (@janakj) 150 53 5336 3190 2. Bogdan-Andrei Iancu (@bogdan-iancu) 97 71 1573 792 3. Henning Westerholt (@henningw) 57 30 693 1239 - 4. Liviu Chircu (@liviuchircu) 38 31 484 177 + 4. Liviu Chircu (@liviuchircu) 43 34 581 206 5. Daniel-Constantin Mierla (@miconda) 28 20 571 154 6. Razvan Crainea (@razvancrainea) 19 16 231 59 7. Andrei Pelinescu-Onciul 16 14 52 49 @@ -262,8 +269,8 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Liviu Chircu (@liviuchircu) Mar 2014 - Dec 2022 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - Jul 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 3. Vlad Paiu (@vladpaiu) Feb 2011 - Jan 2022 4. Vlad Patrascu (@rvlad-patrascu) Apr 2017 - May 2021 5. Walter Doekes (@wdoekes) Apr 2021 - Apr 2021 diff --git a/modules/db_mysql/doc/contributors.xml b/modules/db_mysql/doc/contributors.xml index 25e49aa014b..9537cd4ac4e 100644 --- a/modules/db_mysql/doc/contributors.xml +++ b/modules/db_mysql/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 38 - 31 - 484 - 177 + 43 + 34 + 581 + 206 5. @@ -128,13 +128,13 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - Jul 2024 2. - Liviu Chircu (@liviuchircu) - Mar 2014 - Dec 2022 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 3. diff --git a/modules/db_mysql/doc/db_mysql_admin.xml b/modules/db_mysql/doc/db_mysql_admin.xml index c412f5be42d..0ddbc6a101a 100644 --- a/modules/db_mysql/doc/db_mysql_admin.xml +++ b/modules/db_mysql/doc/db_mysql_admin.xml @@ -164,9 +164,12 @@ modparam("db_mysql", "ps_max_col_size", 4096) Setting this parameter will allow you to use TLS for MySQL connections. In order to enable TLS for a specific connection, you can use the - "tls_domain=dom_name" URL parameter in the db_url of + "tls_domain=dom_name" URL parameter in the db_url of the respective OpenSIPS module. This should be placed at the end of the - URL after the '?' character. + URL after the '?' character. Additionally, + the query string may include the "tls_opts= + PKEY,CERT,CA,CA_DIR,CIPHERS" CSV parameter, in order to control/limit the + amount of TLS options passed to the TLS library. When using this parameter, you must also ensure that @@ -202,6 +205,8 @@ modparam("db_mysql", "use_tls", 1) ... modparam("usrloc", "db_url", "mysql://root:1234@localhost/opensips?tls_domain=dom1") ... +modparam("usrloc", "db_url", "mysql://root:1234@localhost/opensips?tls_domain=dom1&tls_opts=PKEY,CERT,CA,CA_DIR,CIPHERS") +...
diff --git a/modules/db_mysql/my_con.c b/modules/db_mysql/my_con.c index 8dd744c6619..5a6e3d621c1 100644 --- a/modules/db_mysql/my_con.c +++ b/modules/db_mysql/my_con.c @@ -25,39 +25,90 @@ #include "dbase.h" #include +#define _list_h_skip_list_add_ +#include "../../lib/csv.h" #include "../tls_mgm/api.h" +#include "../../mod_fix.h" #include "../../mem/mem.h" #include "../../dprint.h" #include "../../ut.h" -static str *get_mysql_tls_dom(struct db_id* id) +unsigned int db_mysql_tls_opts; + +static str *get_mysql_tls_dom(struct db_id* id, unsigned int *opts) { static str dom = {0,0}; + csv_record *rec; + str params; + int have_opts = 0; if (!id->parameters) return NULL; - if (strncmp(id->parameters, DB_TLS_DOMAIN_PARAM_EQ, - strlen(DB_TLS_DOMAIN_PARAM_EQ))) { - LM_ERR("Invalid URL parameter: %s\n", id->parameters); - return NULL; + init_str(¶ms, id->parameters); + rec = __parse_csv_record(¶ms, 0, '&'); + for (; rec; rec = rec->next) { + /* tls_domain= */ + if (rec->s.len >= DB_TLS_DOMAIN_PARAM_EQ_S && !memcmp( + rec->s.s, DB_TLS_DOMAIN_PARAM_EQ, DB_TLS_DOMAIN_PARAM_EQ_S)) { + dom.s = rec->s.s + DB_TLS_DOMAIN_PARAM_EQ_S; + dom.len = rec->s.len - DB_TLS_DOMAIN_PARAM_EQ_S; + if (!dom.len) { + LM_ERR("Empty TLS domain name\n"); + goto error; + } + + /* tls_opts= */ + } else if (rec->s.len >= DB_TLS_OPTS_PARAM_EQ_S && !memcmp( + rec->s.s, DB_TLS_OPTS_PARAM_EQ, DB_TLS_OPTS_PARAM_EQ_S)) { + str tokens, f_names[] = { + str_init("PKEY"), + str_init("CERT"), + str_init("CA"), + str_init("CA_DIR"), + str_init("CIPHERS"), + {0}, + }; + void *inout = &tokens; + + tokens.s = rec->s.s + DB_TLS_OPTS_PARAM_EQ_S; + tokens.len = rec->s.len - DB_TLS_OPTS_PARAM_EQ_S; + if (fixup_named_flags(&inout, f_names, NULL, NULL) != 0) { + LM_ERR("failed to parse 'tls_opts=' value: '%s'\n", tokens.s); + goto error; + } + + *opts = (unsigned int)(unsigned long)inout; + have_opts = 1; + + LM_INFO("using custom MySQL TLS opts: %s (mask: %u)\n", + tokens.s, *opts); + } else { + LM_ERR("unknown MySQL URL param: '%.*s'\n", rec->s.len, rec->s.s); + } } - dom.s = id->parameters + strlen(DB_TLS_DOMAIN_PARAM_EQ); - dom.len = strlen(dom.s); if (!dom.len) { - LM_ERR("Empty TLS domain name\n"); - return NULL; + if (have_opts) + LM_ERR("Missing 'tls_domain=' URL parameter\n"); + goto error; } + if (!have_opts) + *opts = MY_CON_TLS_ALL_OPTS; + + free_csv_record(rec); return &dom; +error: + free_csv_record(rec); + return NULL; } int db_mysql_connect(struct my_con* ptr) { str *tls_domain_name; + unsigned int tls_opts; - my_bool reconnect = 0; /* if connection already in use, close it first*/ if (ptr->init) mysql_close(ptr->con); @@ -65,7 +116,7 @@ int db_mysql_connect(struct my_con* ptr) mysql_init(ptr->con); ptr->init = 1; - tls_domain_name = get_mysql_tls_dom(ptr->id); + tls_domain_name = get_mysql_tls_dom(ptr->id, &tls_opts); if (use_tls && tls_domain_name) { /* the connection should use TLS */ if (!ptr->tls_dom) { @@ -79,15 +130,19 @@ int db_mysql_connect(struct my_con* ptr) } } - LM_DBG("TLS key file: %.*s\n", ptr->tls_dom->pkey.len, ptr->tls_dom->pkey.s); - LM_DBG("TLS cert file: %.*s\n", ptr->tls_dom->cert.len, ptr->tls_dom->cert.s); - LM_DBG("TLS ca file: %.*s\n", ptr->tls_dom->ca.len, ptr->tls_dom->ca.s); - LM_DBG("TLS ca dir: %s\n", ptr->tls_dom->ca_directory); - LM_DBG("TLS ciphers: %s\n", ptr->tls_dom->ciphers_list); - - mysql_ssl_set(ptr->con, ptr->tls_dom->pkey.s, ptr->tls_dom->cert.s, - ptr->tls_dom->ca.s, ptr->tls_dom->ca_directory, - ptr->tls_dom->ciphers_list); + LM_DBG("TLS key file: %s\n", (tls_opts & MY_CON_TLS_PKEY) ? ptr->tls_dom->pkey.s:NULL); + LM_DBG("TLS cert file: %s\n", (tls_opts & MY_CON_TLS_CERT) ? ptr->tls_dom->cert.s:NULL); + LM_DBG("TLS ca file: %s\n", (tls_opts & MY_CON_TLS_CA) ? ptr->tls_dom->ca.s:NULL); + LM_DBG("TLS ca dir: %s\n", (tls_opts & MY_CON_TLS_CA_DIR) ? ptr->tls_dom->ca_directory:NULL); + LM_DBG("TLS ciphers: %s\n", (tls_opts & MY_CON_TLS_CIPHERS) ? ptr->tls_dom->ciphers_list:NULL); + LM_DBG("TLS opts: %u\n", tls_opts); + + mysql_ssl_set(ptr->con, + (tls_opts & MY_CON_TLS_PKEY) ? ptr->tls_dom->pkey.s:NULL, + (tls_opts & MY_CON_TLS_CERT) ? ptr->tls_dom->cert.s:NULL, + (tls_opts & MY_CON_TLS_CA) ? ptr->tls_dom->ca.s:NULL, + (tls_opts & MY_CON_TLS_CA_DIR) ? ptr->tls_dom->ca_directory:NULL, + (tls_opts & MY_CON_TLS_CIPHERS) ? ptr->tls_dom->ciphers_list:NULL); } /* set connect, read and write timeout, the value counts three times */ @@ -95,11 +150,14 @@ int db_mysql_connect(struct my_con* ptr) mysql_options(ptr->con, MYSQL_OPT_READ_TIMEOUT, (void *)&db_mysql_timeout_interval); mysql_options(ptr->con, MYSQL_OPT_WRITE_TIMEOUT, (void *)&db_mysql_timeout_interval); - /* force no auto reconnection */ -#if MYSQL_VERSION_ID >= 50013 - mysql_options(ptr->con, MYSQL_OPT_RECONNECT, &reconnect); -#else + /* explicitly disable auto-reconnect on older libraries (default: 0) */ +#if MYSQL_VERSION_ID < 50013 ptr->con->reconnect = 0; +#elif MYSQL_VERSION_ID < 80034 + { + my_bool reconnect = 0; + mysql_options(ptr->con, MYSQL_OPT_RECONNECT, &reconnect); + } #endif if (ptr->id->port) { diff --git a/modules/db_mysql/my_con.h b/modules/db_mysql/my_con.h index 2a332473900..8a646f7684c 100644 --- a/modules/db_mysql/my_con.h +++ b/modules/db_mysql/my_con.h @@ -88,7 +88,14 @@ struct my_con { struct tls_domain *tls_dom;; /* TLS domain */ }; - +#define MY_CON_TLS_PKEY (1<<0) +#define MY_CON_TLS_CERT (1<<1) +#define MY_CON_TLS_CA (1<<2) +#define MY_CON_TLS_CA_DIR (1<<3) +#define MY_CON_TLS_CIPHERS (1<<4) +#define MY_CON_TLS_ALL_OPTS (MY_CON_TLS_PKEY|MY_CON_TLS_CERT|MY_CON_TLS_CA\ + |MY_CON_TLS_CA_DIR|MY_CON_TLS_CIPHERS) +extern unsigned int db_mysql_tls_opts; /* * Some convenience wrappers diff --git a/modules/db_oracle/Makefile b/modules/db_oracle/Makefile index 5d0d07ae42a..ba5ac045ff5 100644 --- a/modules/db_oracle/Makefile +++ b/modules/db_oracle/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/db_oracle/README b/modules/db_oracle/README index c5c45de28fd..d48def3c257 100644 --- a/modules/db_oracle/README +++ b/modules/db_oracle/README @@ -142,11 +142,11 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Iouri Kharon 21 1 2363 0 2. Bogdan-Andrei Iancu (@bogdan-iancu) 14 11 64 68 - 3. Liviu Chircu (@liviuchircu) 11 8 23 81 + 3. Liviu Chircu (@liviuchircu) 12 9 23 83 4. Razvan Crainea (@razvancrainea) 10 8 111 39 5. dronord 8 6 29 18 6. Peter Lemenkov (@lemenkov) 7 5 41 5 - 7. Gang Zhuo 5 3 31 13 + 7. Gang Zhuo 6 4 42 16 8. Henning Westerholt (@henningw) 5 3 19 7 9. Gang Zhuo 4 2 4 2 10. Vlad Patrascu (@rvlad-patrascu) 4 2 3 3 @@ -175,11 +175,11 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Gang Zhuo Nov 2022 - Jan 2023 - 3. Gang Zhuo Dec 2021 - Dec 2021 - 4. Razvan Crainea (@razvancrainea) Oct 2011 - Sep 2019 - 5. Liviu Chircu (@liviuchircu) Mar 2014 - May 2019 + 1. Gang Zhuo Nov 2022 - Nov 2024 + 2. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 4. Gang Zhuo Dec 2021 - Dec 2021 + 5. Razvan Crainea (@razvancrainea) Oct 2011 - Sep 2019 6. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2008 - Apr 2019 7. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 8. Peter Lemenkov (@lemenkov) Aug 2012 - Jun 2018 diff --git a/modules/db_oracle/dbase.c b/modules/db_oracle/dbase.c index dba61d02f8f..57166729889 100644 --- a/modules/db_oracle/dbase.c +++ b/modules/db_oracle/dbase.c @@ -189,11 +189,15 @@ int db_oracle_free_result(db_con_t* _h, db_res_t* _r) { ub4 i; - if (!_h || !_r) { + if (!_h) { LM_ERR("invalid parameter value\n"); return -1; } + if (!_r) { + return 0; /* nothing to free */ + } + if (RES_NAMES(_r)) for (i=0; i < RES_COL_N(_r); ++i) if (RES_NAMES(_r)[i]->s) @@ -415,7 +419,6 @@ int db_oracle_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r) return -2; } #undef _S_DIFF - if (_r) goto badparam; cb._rs = NULL; } diff --git a/modules/db_oracle/doc/contributors.xml b/modules/db_oracle/doc/contributors.xml index c2376674e38..12c8bae7fb5 100644 --- a/modules/db_oracle/doc/contributors.xml +++ b/modules/db_oracle/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 11 - 8 + 12 + 9 23 - 81 + 83 4. @@ -69,10 +69,10 @@ 7. Gang Zhuo - 5 - 3 - 31 - 13 + 6 + 4 + 42 + 16 8. @@ -128,28 +128,28 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Gang Zhuo + Nov 2022 - Nov 2024 2. - Gang Zhuo - Nov 2022 - Jan 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 3. - Gang Zhuo - Dec 2021 - Dec 2021 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 4. - Razvan Crainea (@razvancrainea) - Oct 2011 - Sep 2019 + Gang Zhuo + Dec 2021 - Dec 2021 5. - Liviu Chircu (@liviuchircu) - Mar 2014 - May 2019 + Razvan Crainea (@razvancrainea) + Oct 2011 - Sep 2019 6. diff --git a/modules/db_oracle/res.c b/modules/db_oracle/res.c index ccbbb9484d7..97099b4a088 100644 --- a/modules/db_oracle/res.c +++ b/modules/db_oracle/res.c @@ -457,9 +457,14 @@ int db_oracle_store_result(const db_con_t* _h, db_res_t** _r) query_data_t *pcb = con->pqdata; - if (!pcb || !pcb->_rs) + if (!pcb) goto badparam; + if (!pcb->_rs) { + if (_r) *_r = NULL; + return 0; /* No results */ + } + hs = *pcb->_rs; pcb->_rs = NULL; /* paranoid for next call */ } diff --git a/modules/db_perlvdb/Makefile b/modules/db_perlvdb/Makefile index 250287bcfee..2851fcfe90c 100644 --- a/modules/db_perlvdb/Makefile +++ b/modules/db_perlvdb/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/db_perlvdb/README b/modules/db_perlvdb/README index 0cce0ff360c..cfcf01581ba 100644 --- a/modules/db_perlvdb/README +++ b/modules/db_perlvdb/README @@ -274,7 +274,7 @@ Chapter 3. Contributors Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 26 19 257 202 2. Bastian Friedrich 18 2 1820 18 - 3. Liviu Chircu (@liviuchircu) 13 11 25 55 + 3. Liviu Chircu (@liviuchircu) 14 12 25 57 4. Razvan Crainea (@razvancrainea) 11 9 27 14 5. Daniel-Constantin Mierla (@miconda) 9 7 27 25 6. Maksym Sobolyev (@sobomax) 5 3 5 21 @@ -306,9 +306,9 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Aug 2015 - Aug 2023 - 2. Maksym Sobolyev (@sobomax) Oct 2022 - Feb 2023 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - May 2020 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Razvan Crainea (@razvancrainea) Aug 2015 - Aug 2023 + 3. Maksym Sobolyev (@sobomax) Oct 2022 - Feb 2023 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2007 - Apr 2019 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/db_perlvdb/doc/contributors.xml b/modules/db_perlvdb/doc/contributors.xml index 24d9436d335..1afed68a57d 100644 --- a/modules/db_perlvdb/doc/contributors.xml +++ b/modules/db_perlvdb/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 13 - 11 + 14 + 12 25 - 55 + 57 4. @@ -128,18 +128,18 @@ 1. - Razvan Crainea (@razvancrainea) - Aug 2015 - Aug 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Maksym Sobolyev (@sobomax) - Oct 2022 - Feb 2023 + Razvan Crainea (@razvancrainea) + Aug 2015 - Aug 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - May 2020 + Maksym Sobolyev (@sobomax) + Oct 2022 - Feb 2023 4. diff --git a/modules/db_postgres/Makefile b/modules/db_postgres/Makefile index a0ab9bb6bc3..13618b1aa5b 100644 --- a/modules/db_postgres/Makefile +++ b/modules/db_postgres/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/db_postgres/README b/modules/db_postgres/README index 3aaf1cb2753..c3fcda8b759 100644 --- a/modules/db_postgres/README +++ b/modules/db_postgres/README @@ -173,7 +173,7 @@ Chapter 2. Contributors 3. Norman Brandinger (@NormB) 53 4 1449 2247 4. Greg Fausak 41 3 4472 2 5. Daniel-Constantin Mierla (@miconda) 27 20 350 203 - 6. Liviu Chircu (@liviuchircu) 17 14 45 85 + 6. Liviu Chircu (@liviuchircu) 18 15 45 87 7. Razvan Crainea (@razvancrainea) 13 10 208 25 8. Jan Janak (@janakj) 12 8 300 23 9. Klaus Darilion 10 6 139 67 @@ -207,12 +207,12 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Apr 2004 - Feb 2023 - 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Oct 2021 - 3. Norman Brandinger (@NormB) Aug 2006 - Oct 2021 - 4. Razvan Crainea (@razvancrainea) Oct 2011 - Sep 2019 - 5. Dan Pascu (@danpascu) May 2019 - May 2019 - 6. Liviu Chircu (@liviuchircu) Sep 2012 - May 2019 + 1. Liviu Chircu (@liviuchircu) Sep 2012 - May 2024 + 2. Maksym Sobolyev (@sobomax) Apr 2004 - Feb 2023 + 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Oct 2021 + 4. Norman Brandinger (@NormB) Aug 2006 - Oct 2021 + 5. Razvan Crainea (@razvancrainea) Oct 2011 - Sep 2019 + 6. Dan Pascu (@danpascu) May 2019 - May 2019 7. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2005 - Apr 2019 8. Ryan Bullock (@rrb3942) Mar 2019 - Mar 2019 9. Vlad Paiu (@vladpaiu) Jan 2011 - Feb 2019 diff --git a/modules/db_postgres/doc/contributors.xml b/modules/db_postgres/doc/contributors.xml index c7f6088f25b..5b909785e5a 100644 --- a/modules/db_postgres/doc/contributors.xml +++ b/modules/db_postgres/doc/contributors.xml @@ -61,10 +61,10 @@ 6. Liviu Chircu (@liviuchircu) - 17 - 14 + 18 + 15 45 - 85 + 87 7. @@ -128,34 +128,34 @@ 1. + Liviu Chircu (@liviuchircu) + Sep 2012 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Apr 2004 - Feb 2023 - 2. + 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Oct 2021 - 3. + 4. Norman Brandinger (@NormB) Aug 2006 - Oct 2021 - 4. + 5. Razvan Crainea (@razvancrainea) Oct 2011 - Sep 2019 - 5. + 6. Dan Pascu (@danpascu) May 2019 - May 2019 - - 6. - Liviu Chircu (@liviuchircu) - Sep 2012 - May 2019 - 7. Bogdan-Andrei Iancu (@bogdan-iancu) diff --git a/modules/db_sqlite/Makefile b/modules/db_sqlite/Makefile index 14668258f54..31ac22c00e7 100644 --- a/modules/db_sqlite/Makefile +++ b/modules/db_sqlite/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/db_sqlite/README b/modules/db_sqlite/README index 72510c355e6..c0f5ecff983 100644 --- a/modules/db_sqlite/README +++ b/modules/db_sqlite/README @@ -135,14 +135,14 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Ionut Ionita (@ionutrazvanionita) 80 28 3744 1276 - 2. Razvan Crainea (@razvancrainea) 14 12 96 33 - 3. Liviu Chircu (@liviuchircu) 9 7 21 49 + 2. Razvan Crainea (@razvancrainea) 15 13 105 40 + 3. Liviu Chircu (@liviuchircu) 12 10 32 60 4. Jarrod Baumann (@jarrodb) 5 3 7 4 - 5. Vlad Patrascu (@rvlad-patrascu) 4 2 3 2 - 6. Aron Podrigal (@ar45) 3 1 10 1 - 7. Daniel Fussia 3 1 4 22 - 8. Maksym Sobolyev (@sobomax) 3 1 2 2 - 9. Bogdan-Andrei Iancu (@bogdan-iancu) 3 1 2 1 + 5. Bogdan-Andrei Iancu (@bogdan-iancu) 4 2 34 37 + 6. Vlad Patrascu (@rvlad-patrascu) 4 2 3 2 + 7. Aron Podrigal (@ar45) 3 1 10 1 + 8. Daniel Fussia 3 1 4 22 + 9. Maksym Sobolyev (@sobomax) 3 1 2 2 10. Eric Green 3 1 1 10 All remaining contributors: Peter Lemenkov (@lemenkov). @@ -167,11 +167,11 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Aug 2015 - Aug 2023 - 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 3. Liviu Chircu (@liviuchircu) May 2016 - Mar 2021 - 4. Eric Green Aug 2020 - Aug 2020 - 5. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2019 - Apr 2019 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2019 - Jan 2025 + 2. Razvan Crainea (@razvancrainea) Aug 2015 - Oct 2024 + 3. Liviu Chircu (@liviuchircu) May 2016 - Sep 2024 + 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 5. Eric Green Aug 2020 - Aug 2020 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 8. Ionut Ionita (@ionutrazvanionita) Apr 2015 - Feb 2017 diff --git a/modules/db_sqlite/db_sqlite.c b/modules/db_sqlite/db_sqlite.c index 301316aa1d0..9b1c3899a36 100644 --- a/modules/db_sqlite/db_sqlite.c +++ b/modules/db_sqlite/db_sqlite.c @@ -33,9 +33,6 @@ #define ALLOC_LIMIT 10 #define LDEXT_LIST_DELIM ';' -unsigned int db_sqlite_timeout_interval = 2; /* Default is 6 seconds */ -unsigned int db_sliqte_exec_query_threshold = 0; /* Warning in case DB query - takes too long disabled by default*/ int db_sqlite_alloc_limit=ALLOC_LIMIT; @@ -46,7 +43,7 @@ static int db_sqlite_add_extension(modparam_t type, void *val); struct db_sqlite_extension_list *extension_list=0; /* - * MySQL database module interface + * SQLite database module interface */ static const cmd_export_t cmds[] = { {"db_bind_api", (cmd_function)db_sqlite_bind_api, {{0,0,0}},0}, diff --git a/modules/db_sqlite/dbase.c b/modules/db_sqlite/dbase.c index 7eff6d3d593..98d0bd1f35c 100644 --- a/modules/db_sqlite/dbase.c +++ b/modules/db_sqlite/dbase.c @@ -34,7 +34,7 @@ #include "../../db/db_ut.h" #include "../../db/db_insertq.h" #include "../../db/db_res.h" -#include "my_con.h" +#include "sqlite_con.h" #include "val.h" #include "res.h" #include "row.h" @@ -93,7 +93,7 @@ static inline int db_copy_rest_of_count(const str* _qh, str* count_query) const str searched_str = {" from ", sizeof(" from ")-1}; count_query->len = sizeof(COUNT_QUERY)-1; - if ((found=str_strstr(_qh, &searched_str)) != NULL) { + if ((found=str_strcasestr(_qh, &searched_str)) != NULL) { const int len=_qh->len-(found-_qh->s); /* check for overflow */ if (len > COUNT_BUF_SIZE-(sizeof(COUNT_QUERY)-1)) { diff --git a/modules/db_sqlite/doc/contributors.xml b/modules/db_sqlite/doc/contributors.xml index 67b72b00cda..41187e7d01a 100644 --- a/modules/db_sqlite/doc/contributors.xml +++ b/modules/db_sqlite/doc/contributors.xml @@ -29,18 +29,18 @@ 2. Razvan Crainea (@razvancrainea) - 14 - 12 - 96 - 33 + 15 + 13 + 105 + 40 3. Liviu Chircu (@liviuchircu) - 9 - 7 - 21 - 49 + 12 + 10 + 32 + 60 4. @@ -52,6 +52,14 @@ 5. + Bogdan-Andrei Iancu (@bogdan-iancu) + 4 + 2 + 34 + 37 + + + 6. Vlad Patrascu (@rvlad-patrascu) 4 2 @@ -59,7 +67,7 @@ 2 - 6. + 7. Aron Podrigal (@ar45) 3 1 @@ -67,7 +75,7 @@ 1 - 7. + 8. Daniel Fussia 3 1 @@ -75,21 +83,13 @@ 22 - 8. + 9. Maksym Sobolyev (@sobomax) 3 1 2 2 - - 9. - Bogdan-Andrei Iancu (@bogdan-iancu) - 3 - 1 - 2 - 1 - 10. Eric Green @@ -128,28 +128,28 @@ 1. - Razvan Crainea (@razvancrainea) - Aug 2015 - Aug 2023 + Bogdan-Andrei Iancu (@bogdan-iancu) + Apr 2019 - Jan 2025 2. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Razvan Crainea (@razvancrainea) + Aug 2015 - Oct 2024 3. Liviu Chircu (@liviuchircu) - May 2016 - Mar 2021 + May 2016 - Sep 2024 4. - Eric Green - Aug 2020 - Aug 2020 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 5. - Bogdan-Andrei Iancu (@bogdan-iancu) - Apr 2019 - Apr 2019 + Eric Green + Aug 2020 - Aug 2020 6. diff --git a/modules/db_sqlite/res.c b/modules/db_sqlite/res.c index e6acebf0fc5..34295870664 100644 --- a/modules/db_sqlite/res.c +++ b/modules/db_sqlite/res.c @@ -34,7 +34,7 @@ #include "../../db/db_insertq.h" #include "../../db/db_res.h" #include "../../ut.h" -#include "my_con.h" +#include "sqlite_con.h" #include "row.h" @@ -299,29 +299,31 @@ int db_sqlite_realloc_rows(db_res_t* res, const unsigned int rows) struct db_row* res_rows; db_val_t *prev_values; - res->rows = pkg_realloc(RES_ROWS(res),rows * (sizeof(db_row_t))); - memset( res->rows + RES_ROW_N(res), 0 , - (rows - RES_ROW_N(res)) * (sizeof(db_row_t))); + if (RES_ROW_N(res) >= rows) + return 0; - res_rows = res->rows; + res_rows = res->rows = pkg_realloc(RES_ROWS(res),rows * sizeof *res_rows); if (!res_rows) { LM_ERR("no memory left\n"); return -1; } + memset(res_rows + RES_ROW_N(res), 0 , + (rows - RES_ROW_N(res)) * sizeof *res_rows); + prev_values = res_rows[0].values; res_rows[0].values = pkg_realloc(res_rows[0].values, rows * sizeof(db_val_t) * RES_COL_N(res)); - memset( res_rows[0].values + RES_COL_N(res)*RES_ROW_N(res), - 0, (rows - RES_ROW_N(res)) * sizeof(db_val_t) * RES_COL_N(res)); - if (! res_rows[0].values) { LM_ERR("no memory left\n"); res_rows[0].values = prev_values; return -1; } + memset( res_rows[0].values + RES_COL_N(res)*RES_ROW_N(res), + 0, (rows - RES_ROW_N(res)) * sizeof(db_val_t) * RES_COL_N(res)); + /* if the values was relocated, we need to re-point all values to the new block, * otherwise only fix the new ones */ start = (res_rows[0].values == prev_values?RES_ROW_N(res):0); @@ -330,7 +332,7 @@ int db_sqlite_realloc_rows(db_res_t* res, const unsigned int rows) for( i=start ; irows[i].n = RES_COL_N(res); + res_rows[i].n = RES_COL_N(res); } return 0; diff --git a/modules/db_sqlite/row.c b/modules/db_sqlite/row.c index a6d6066d715..9acc396dc87 100644 --- a/modules/db_sqlite/row.c +++ b/modules/db_sqlite/row.c @@ -29,7 +29,7 @@ #include "../../db/db_ut.h" #include "../../db/db_val.h" #include "../../db/db_row.h" -#include "my_con.h" +#include "sqlite_con.h" #include "val.h" #include "row.h" diff --git a/modules/db_sqlite/my_con.c b/modules/db_sqlite/sqlite_con.c similarity index 88% rename from modules/db_sqlite/my_con.c rename to modules/db_sqlite/sqlite_con.c index fe317e59ff3..11d04598def 100644 --- a/modules/db_sqlite/my_con.c +++ b/modules/db_sqlite/sqlite_con.c @@ -34,7 +34,7 @@ #include "../../db/db_insertq.h" #include "../../db/db_id.h" #include "../../mem/mem.h" -#include "my_con.h" +#include "sqlite_con.h" #include "db_sqlite.h" extern struct db_sqlite_extension_list *extension_list; @@ -43,7 +43,7 @@ extern struct db_sqlite_extension_list *extension_list; #define URL_BUFSIZ 1024 char url_buf[URL_BUFSIZ]; -int db_sqlite_connect(struct my_con* ptr) +int db_sqlite_connect(struct sqlite_con* ptr) { sqlite3* con; char* errmsg; @@ -60,7 +60,7 @@ int db_sqlite_connect(struct my_con* ptr) url_buf[ptr->id->url.len - (sizeof(SQLITE_ID)-1)] = '\0'; if (sqlite3_open(url_buf, &con) != SQLITE_OK) { - LM_ERR("Can't open database: %s\n", sqlite3_errmsg((sqlite3*)ptr->con)); + LM_ERR("Can't open database: %s\n", sqlite3_errmsg(con)); return -1; } @@ -80,6 +80,7 @@ int db_sqlite_connect(struct my_con* ptr) "Errmsg [%s]!\n", iter->ldpath, iter->entry_point, errmsg); + sqlite3_free(errmsg); goto out_free; } LM_DBG("Extension [%s] loaded!\n", iter->ldpath); @@ -91,8 +92,6 @@ int db_sqlite_connect(struct my_con* ptr) } } - - ptr->con = con; return 0; @@ -110,23 +109,23 @@ int db_sqlite_connect(struct my_con* ptr) * Create a new connection structure, * open the sqlite connection and set reference count to 1 */ -struct my_con* db_sqlite_new_connection(const struct db_id* id) +struct sqlite_con* db_sqlite_new_connection(const struct db_id* id) { - struct my_con* ptr; + struct sqlite_con* ptr; if (!id) { LM_ERR("invalid parameter value\n"); return 0; } - ptr = (struct my_con*)pkg_malloc(sizeof(struct my_con)); + ptr = (struct sqlite_con*)pkg_malloc(sizeof(struct sqlite_con)); if (!ptr) { LM_ERR("no private memory left\n"); return 0; } - memset(ptr, 0, sizeof(struct my_con)); + memset(ptr, 0, sizeof(struct sqlite_con)); ptr->ref = 1; ptr->id = (struct db_id*)id; @@ -149,8 +148,8 @@ void db_sqlite_free_connection(struct pool_con* con) { if (!con) return; - struct my_con * _c; - _c = (struct my_con*) con; + struct sqlite_con * _c; + _c = (struct sqlite_con*) con; if (_c->id) free_db_id(_c->id); if (_c->con) { diff --git a/modules/db_sqlite/my_con.h b/modules/db_sqlite/sqlite_con.h similarity index 66% rename from modules/db_sqlite/my_con.h rename to modules/db_sqlite/sqlite_con.h index 14d231a8847..d6f8c61c3dd 100644 --- a/modules/db_sqlite/my_con.h +++ b/modules/db_sqlite/sqlite_con.h @@ -22,14 +22,14 @@ * ------- * 2015-02-18 initial version (Ionut Ionita) */ -#ifndef MY_SQLITE_CON_H -#define MY_SQLITE_CON_H +#ifndef SQLITE_CON_H +#define SQLITE_CON_H #define PREP_STMT_VAL_LEN 1024 #include -struct my_con { +struct sqlite_con { struct db_id* id; /**< Connection identifier */ unsigned int ref; /**< Reference count */ struct pool_con *async_pool; /**< Subpool of identical database handles */ @@ -43,38 +43,38 @@ struct my_con { sqlite3* con; /* Connection representation */ sqlite3_stmt* curr_ps; int curr_ps_rows; - unsigned int init; /* If the mysql conn was initialized */ + unsigned int init; /* If the sqlite conn was initialized */ struct prep_stmt *ps_list; /* list of prepared statements */ }; -struct my_stmt_ctx { +struct sqlite_stmt_ctx { sqlite3_stmt *stmt; str query; int query_rows; - struct my_stmt_ctx *next; + struct sqlite_stmt_ctx *next; }; struct prep_stmt { - struct my_stmt_ctx *stmt_list; - struct my_stmt_ctx *ctx; + struct sqlite_stmt_ctx *stmt_list; + struct sqlite_stmt_ctx *ctx; }; -#define CON_CONNECTION(db_con) (((struct my_con*)((db_con)->tail))->con) -#define CON_ROW(db_con) (((struct my_con*)((db_con)->tail))->row) -#define CON_SQLITE_PS(db_con) (((struct my_con*)((db_con)->tail))->curr_ps) -#define CON_RAW_QUERY(db_con) (((struct my_con*)((db_con)->tail))->raw_query) -#define CON_PS_ROWS(db_con) (((struct my_con*)((db_con)->tail))->curr_ps_rows) -#define CON_DISCON(db_con) (((struct my_con*)((db_con)->tail))->disconnected) +#define CON_CONNECTION(db_con) (((struct sqlite_con*)((db_con)->tail))->con) +#define CON_ROW(db_con) (((struct sqlite_con*)((db_con)->tail))->row) +#define CON_SQLITE_PS(db_con) (((struct sqlite_con*)((db_con)->tail))->curr_ps) +#define CON_RAW_QUERY(db_con) (((struct sqlite_con*)((db_con)->tail))->raw_query) +#define CON_PS_ROWS(db_con) (((struct sqlite_con*)((db_con)->tail))->curr_ps_rows) +#define CON_DISCON(db_con) (((struct sqlite_con*)((db_con)->tail))->disconnected) -int db_sqlite_connect(struct my_con* ptr); -struct my_con* db_sqlite_new_connection(const struct db_id* id); +int db_sqlite_connect(struct sqlite_con* ptr); +struct sqlite_con* db_sqlite_new_connection(const struct db_id* id); void db_sqlite_free_connection(struct pool_con* con); -#endif /* MY_SQLITE_CON_H */ +#endif /* SQLITE_CON_H */ diff --git a/modules/db_sqlite/val.c b/modules/db_sqlite/val.c index 604f6fac459..1eec99ce9ed 100644 --- a/modules/db_sqlite/val.c +++ b/modules/db_sqlite/val.c @@ -27,7 +27,7 @@ #include "../../db/db_ut.h" #include "../../db/db_query.h" #include "val.h" -#include "my_con.h" +#include "sqlite_con.h" #include #include @@ -140,19 +140,21 @@ int db_sqlite_val2str(const db_con_t* _c, const db_val_t* _v, char* _s, int* _le case DB_BLOB: l = VAL_BLOB(_v).len; - if (*_len < l) + if (*_len < 3 + 2 * l) { LM_ERR("destination BLOB buffer too short (have %d, need %d)\n", - *_len, l); + *_len, 2 * l + 3); return -7; } else { - sqlite3_snprintf(SQL_BUF_LEN, _s, "'%.*q'", - VAL_BLOB(_v).len, VAL_BLOB(_v).s); - *_len = strlen(_s); - _s += strlen(_s); - + _s[0] = 'x'; + _s[1] = '\''; + _s += 2; + _s += string2hex(VAL_BLOB(_v).s, l, _s); + _s[0] = '\''; + _s++; + *_len = 3 + 2 * l; return 0; } break; diff --git a/modules/db_text/Makefile b/modules/db_text/Makefile index f7fc0325365..a1c8e1b6aac 100644 --- a/modules/db_text/Makefile +++ b/modules/db_text/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/db_text/README b/modules/db_text/README index d0a64bc2086..bdba59074ab 100644 --- a/modules/db_text/README +++ b/modules/db_text/README @@ -435,8 +435,8 @@ Chapter 3. Contributors 1. Daniel-Constantin Mierla (@miconda) 133 59 6126 1441 2. Bogdan-Andrei Iancu (@bogdan-iancu) 41 32 310 309 3. Henning Westerholt (@henningw) 25 15 252 410 - 4. Razvan Crainea (@razvancrainea) 20 17 121 95 - 5. Liviu Chircu (@liviuchircu) 20 17 71 108 + 4. Liviu Chircu (@liviuchircu) 21 18 71 110 + 5. Razvan Crainea (@razvancrainea) 20 17 121 95 6. Jan Janak (@janakj) 11 7 124 106 7. Vlad Patrascu (@rvlad-patrascu) 8 6 94 49 8. Ovidiu Sas (@ovidiusas) 7 5 61 8 @@ -469,7 +469,7 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2023 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 3. Razvan Crainea (@razvancrainea) Oct 2011 - Jan 2022 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Dec 2021 diff --git a/modules/db_text/doc/contributors.xml b/modules/db_text/doc/contributors.xml index aa9cf419d4b..eddebb0705f 100644 --- a/modules/db_text/doc/contributors.xml +++ b/modules/db_text/doc/contributors.xml @@ -44,19 +44,19 @@ 4. - Razvan Crainea (@razvancrainea) - 20 - 17 - 121 - 95 + Liviu Chircu (@liviuchircu) + 21 + 18 + 71 + 110 5. - Liviu Chircu (@liviuchircu) + Razvan Crainea (@razvancrainea) 20 17 - 71 - 108 + 121 + 95 6. @@ -129,7 +129,7 @@ 1. Liviu Chircu (@liviuchircu) - Mar 2014 - May 2023 + Mar 2014 - May 2024 2. diff --git a/modules/db_unixodbc/Makefile b/modules/db_unixodbc/Makefile index 3440a7fdd99..f484b39005b 100644 --- a/modules/db_unixodbc/Makefile +++ b/modules/db_unixodbc/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/db_unixodbc/README b/modules/db_unixodbc/README index 2d211f972e6..9104cb36632 100644 --- a/modules/db_unixodbc/README +++ b/modules/db_unixodbc/README @@ -163,7 +163,7 @@ Chapter 3. Contributors 2. Bogdan-Andrei Iancu (@bogdan-iancu) 44 31 617 418 3. Marco Lorrai 23 1 2660 0 4. Daniel-Constantin Mierla (@miconda) 20 15 221 140 - 5. Liviu Chircu (@liviuchircu) 18 10 136 313 + 5. Liviu Chircu (@liviuchircu) 19 11 136 315 6. Razvan Crainea (@razvancrainea) 10 8 63 26 7. Maksym Sobolyev (@sobomax) 4 2 4 4 8. Vlad Patrascu (@rvlad-patrascu) 4 2 3 3 @@ -195,12 +195,12 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Oct 2011 - Jan 2021 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2005 - Apr 2019 - 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 6. Liviu Chircu (@liviuchircu) Mar 2014 - Jun 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Oct 2011 - Jan 2021 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2005 - Apr 2019 + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Vlad Paiu (@vladpaiu) Jul 2011 - Jul 2011 8. Razvan Pistolea Jul 2009 - Jul 2009 9. Alex Massover Mar 2009 - Mar 2009 diff --git a/modules/db_unixodbc/doc/contributors.xml b/modules/db_unixodbc/doc/contributors.xml index 3337a7f356a..b2b64a627fe 100644 --- a/modules/db_unixodbc/doc/contributors.xml +++ b/modules/db_unixodbc/doc/contributors.xml @@ -53,10 +53,10 @@ 5. Liviu Chircu (@liviuchircu) - 18 - 10 + 19 + 11 136 - 313 + 315 6. @@ -128,34 +128,34 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Oct 2011 - Jan 2021 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2005 - Apr 2019 - 4. + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - 6. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jun 2018 - 7. Vlad Paiu (@vladpaiu) diff --git a/modules/dialog/Makefile b/modules/dialog/Makefile index 8cc7f3f8646..2fea3ff1e89 100644 --- a/modules/dialog/Makefile +++ b/modules/dialog/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/dialog/README b/modules/dialog/README index d2b437d6352..b04f1f39698 100644 --- a/modules/dialog/README +++ b/modules/dialog/README @@ -1046,6 +1046,14 @@ modparam("dialog", "profile_timeout", "43200") dialog-related events (creation, update and deletion) in the cluster. + This OpenSIPS cluster exposes the "dialog-dlg-repl" capability + in order to mark nodes as eligible for becoming data donors + during an arbitrary sync request. Consequently, the cluster + must have at least one node marked with the "seed" value as the + clusterer.flags column/property in order to be fully + functional. Consult the clusterer - Capabilities chapter for + more details. + Default value is “0” (no replication). Example 1.47. Set dialog_replication_cluster parameter @@ -2548,10 +2556,10 @@ Chapter 4. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 453 286 13279 3527 - 2. Razvan Crainea (@razvancrainea) 275 207 5092 1560 - 3. Vlad Paiu (@vladpaiu) 254 145 7206 3027 + 2. Razvan Crainea (@razvancrainea) 286 214 5212 1716 + 3. Vlad Paiu (@vladpaiu) 255 146 7208 3027 4. Vlad Patrascu (@rvlad-patrascu) 198 104 4330 3514 - 5. Liviu Chircu (@liviuchircu) 175 128 2949 1291 + 5. Liviu Chircu (@liviuchircu) 179 132 2959 1298 6. Ovidiu Sas (@ovidiusas) 34 26 601 161 7. Dan Pascu (@danpascu) 30 25 233 179 8. Eseanu Marius Cristian (@eseanucristian) 18 6 722 341 @@ -2568,9 +2576,9 @@ Chapter 4. Contributors Paquette, Ryan Bullock, Andrei Datcu (@andrei-datcu), Jeffrey Magder, Ron Winacott, Andy Pyles, Julián Moreno Patiño, Konstantin Bokarius, sergei lavrov, Alex Massover, Damien - Sandras (@dsandras), Alex Hermann, Dusan Klinec (@ph4r05), - Norman Brandinger (@NormB), UnixDev, Eliot Gable, Ryan Bullock - (@rrb3942), Edson Gellert Schubert. + Sandras (@dsandras), Alex Hermann, Alexandra Titoc, Dusan + Klinec (@ph4r05), Norman Brandinger (@NormB), UnixDev, Eliot + Gable, Ryan Bullock (@rrb3942), Edson Gellert Schubert. (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -2592,10 +2600,10 @@ Chapter 4. Contributors Table 4.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Aug 2010 - Jan 2024 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2006 - Dec 2023 - 3. Liviu Chircu (@liviuchircu) Aug 2012 - Nov 2023 - 4. Vlad Paiu (@vladpaiu) Oct 2010 - Nov 2023 + 1. Razvan Crainea (@razvancrainea) Aug 2010 - Apr 2025 + 2. Vlad Paiu (@vladpaiu) Oct 2010 - Sep 2024 + 3. Alexandra Titoc Sep 2024 - Sep 2024 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2006 - Dec 2023 5. Vlad Patrascu (@rvlad-patrascu) Jul 2016 - Jun 2023 6. Ovidiu Sas (@ovidiusas) Feb 2008 - Jun 2023 7. Ryan Bullock May 2023 - May 2023 @@ -2603,19 +2611,20 @@ Chapter 4. Contributors 9. Peter Lemenkov (@lemenkov) Jun 2018 - Sep 2022 10. Nick Altmann (@nikbyte) Oct 2013 - May 2021 - All remaining contributors: Walter Doekes (@wdoekes), sergei - lavrov, Zero King (@l2dy), Dan Pascu (@danpascu), Ionel Cerghit - (@ionel-cerghit), Jarrod Baumann (@jarrodb), Ionut Ionita - (@ionutrazvanionita), Julián Moreno Patiño, Dusan Klinec - (@ph4r05), Eseanu Marius Cristian (@eseanucristian), Andrei - Datcu (@andrei-datcu), Norman Brandinger (@NormB), Damien - Sandras (@dsandras), Ryan Bullock (@rrb3942), Anca Vamanu, Alex - Massover, Andrei Dragus, John Riordan, Hugues Mitonneau, - Richard Revels, UnixDev, Alex Hermann, Henning Westerholt - (@henningw), Carsten Bock, Klaus Darilion, Daniel-Constantin - Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, - Jerome Martin, Tavis Paquette, Michel Bensoussan, Eliot Gable, - Andy Pyles, Elena-Ramona Modroiu, Jeffrey Magder, Ron Winacott. + All remaining contributors: Walter Doekes (@wdoekes), Liviu + Chircu (@liviuchircu), sergei lavrov, Zero King (@l2dy), Dan + Pascu (@danpascu), Ionel Cerghit (@ionel-cerghit), Jarrod + Baumann (@jarrodb), Ionut Ionita (@ionutrazvanionita), Julián + Moreno Patiño, Dusan Klinec (@ph4r05), Eseanu Marius Cristian + (@eseanucristian), Andrei Datcu (@andrei-datcu), Norman + Brandinger (@NormB), Damien Sandras (@dsandras), Ryan Bullock + (@rrb3942), Anca Vamanu, Alex Massover, Andrei Dragus, John + Riordan, Hugues Mitonneau, Richard Revels, UnixDev, Alex + Hermann, Henning Westerholt (@henningw), Carsten Bock, Klaus + Darilion, Daniel-Constantin Mierla (@miconda), Konstantin + Bokarius, Edson Gellert Schubert, Jerome Martin, Tavis + Paquette, Michel Bensoussan, Eliot Gable, Andy Pyles, + Elena-Ramona Modroiu, Jeffrey Magder, Ron Winacott. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/dialog/dialog.c b/modules/dialog/dialog.c index 33c10a092d8..79a94729597 100644 --- a/modules/dialog/dialog.c +++ b/modules/dialog/dialog.c @@ -2563,6 +2563,6 @@ static int dlg_send_sequential(struct sip_msg* msg, str *method, int leg, LM_WARN("body without content type! This request might be rejected by uac!\n"); return send_indialog_request(dlg, method, (leg == DLG_CALLER_LEG?leg:callee_idx(dlg)), - body, ct, headers, NULL, NULL) == 0?1:-1; + body, ct, headers, NULL, NULL, NULL) == 0?1:-1; } diff --git a/modules/dialog/dlg_cb.c b/modules/dialog/dlg_cb.c index 75d2ad2ab77..70215ee30fc 100644 --- a/modules/dialog/dlg_cb.c +++ b/modules/dialog/dlg_cb.c @@ -31,7 +31,7 @@ static struct dlg_head_cbl* create_cbs = 0; static struct dlg_head_cbl* load_cbs = 0; -static struct dlg_cb_params params = {NULL, DLG_DIR_NONE, 1, NULL, NULL}; +static struct dlg_cb_params params = {NULL, DLG_DIR_NONE, -1, 1, NULL, NULL}; #define POINTER_CLOSED_MARKER ((void *)(-1)) @@ -232,13 +232,14 @@ void run_create_callbacks(struct dlg_cell *dlg, struct sip_msg *msg) void run_dlg_callbacks(int type , struct dlg_cell *dlg, struct sip_msg *msg, - unsigned int dir, void *dlg_data, int locked, - unsigned int is_active) + unsigned int dir, int dst_leg, void *dlg_data, + int locked, unsigned int is_active) { struct dlg_callback *cb; params.msg = msg; params.direction = dir; + params.dst_leg = dst_leg; params.is_active = is_active; params.dlg_data = dlg_data; diff --git a/modules/dialog/dlg_cb.h b/modules/dialog/dlg_cb.h index 7ef235c9355..738bcfb5908 100644 --- a/modules/dialog/dlg_cb.h +++ b/modules/dialog/dlg_cb.h @@ -29,6 +29,7 @@ struct dlg_cell; struct dlg_cb_params { struct sip_msg* msg; /* sip msg related to the callback event */ unsigned int direction; /* direction of the sip msg */ + int dst_leg; /* destination leg of the sip msg */ unsigned int is_active; /* state of the node (active/backup) for this dialog */ void *dlg_data; /* generic parameter, specific to callback */ void **param; /* parameter passed at callback registration*/ @@ -269,7 +270,7 @@ int register_dlgcb( struct dlg_cell* dlg, int types, dialog_cb f, void *param, p void run_create_callbacks(struct dlg_cell *dlg, struct sip_msg *msg); void run_dlg_callbacks( int type , struct dlg_cell *dlg, struct sip_msg *msg, - unsigned int dir, void *dlg_data, int locked, unsigned int is_active); + unsigned int dir, int leg, void *dlg_data, int locked, unsigned int is_active); void run_load_callback_per_dlg(struct dlg_cell *dlg); diff --git a/modules/dialog/dlg_db_handler.c b/modules/dialog/dlg_db_handler.c index 329eff2940a..90c7073e65b 100644 --- a/modules/dialog/dlg_db_handler.c +++ b/modules/dialog/dlg_db_handler.c @@ -719,7 +719,7 @@ static int load_dialog_info_from_db(int dlg_hash_size) } /* script flags */ - if (!VAL_NULL(values+19)) { + if (!VAL_NULL(values+19) && VAL_TYPE(values+19) != DB_INT) { GET_STR_VALUE(flag_list, values, 19, 0, 0); dlg->user_flags = flag_list_to_bitmask(&flag_list, FLAG_TYPE_DIALOG, FLAG_DELIM, 1); @@ -998,7 +998,7 @@ int remove_dialog_from_db(struct dlg_cell * cell) LM_DBG("callid was %.*s\n", cell->callid.len, cell->callid.s ); /* dialog saved */ - run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, NULL, 1, 1); + run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, -1, NULL, 1, 1); return 0; } @@ -1038,7 +1038,7 @@ int update_dialog_timeout_info(struct dlg_cell * cell) } /* dialog saved */ - run_dlg_callbacks( DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, NULL, 1, 1); + run_dlg_callbacks( DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, -1, NULL, 1, 1); cell->flags &= ~(DLG_FLAG_CHANGED); @@ -1151,7 +1151,7 @@ int update_dialog_dbinfo(struct dlg_cell * cell) } /* dialog saved */ - run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, NULL, 1, 1); + run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, -1, NULL, 1, 1); cell->flags &= ~(DLG_FLAG_NEW|DLG_FLAG_CHANGED|DLG_FLAG_VP_CHANGED); @@ -1192,7 +1192,7 @@ int update_dialog_dbinfo(struct dlg_cell * cell) } /* dialog saved */ - run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, NULL, 1, 1); + run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, -1, NULL, 1, 1); cell->flags &= ~(DLG_FLAG_CHANGED|DLG_FLAG_VP_CHANGED); } else if (cell->flags & DLG_FLAG_VP_CHANGED) { @@ -1217,7 +1217,7 @@ int update_dialog_dbinfo(struct dlg_cell * cell) goto error; } - run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, NULL, 1, 1); + run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, -1, NULL, 1, 1); cell->flags &= ~DLG_FLAG_VP_CHANGED; } else { @@ -1566,7 +1566,7 @@ static inline void set_final_update_cols(db_val_t *vals, struct dlg_cell *cell, /* it is very likely to flush the vals/profiles to DB, so trigger the * callback to see if other modules may want to add more vals/profiles before the actual writting */ - run_dlg_callbacks(DLGCB_WRITE_VP, cell, 0, DLG_DIR_NONE, NULL, 1, 1); + run_dlg_callbacks(DLGCB_WRITE_VP, cell, 0, DLG_DIR_NONE, -1, NULL, 1, 1); } if (persist_reinvite_pinging(cell) != 0) @@ -1761,7 +1761,7 @@ void dialog_update_db(unsigned int ticks, void *do_lock) /* dialog saved */ cell->locked_by = process_no; - run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, NULL, 1, 1); + run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, -1, NULL, 1, 1); cell->locked_by = 0; cell->flags &= ~(DLG_FLAG_NEW |DLG_FLAG_CHANGED|DLG_FLAG_VP_CHANGED); @@ -1804,7 +1804,7 @@ void dialog_update_db(unsigned int ticks, void *do_lock) /* dialog saved */ cell->locked_by = process_no; - run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, NULL, 1, 1); + run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, -1, NULL, 1, 1); cell->locked_by = 0; cell->flags &= ~(DLG_FLAG_CHANGED|DLG_FLAG_VP_CHANGED); @@ -1824,7 +1824,7 @@ void dialog_update_db(unsigned int ticks, void *do_lock) } cell->locked_by = process_no; - run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, NULL,1, 1); + run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, -1, NULL,1, 1); cell->locked_by = 0; cell->flags &= ~DLG_FLAG_VP_CHANGED; @@ -2253,7 +2253,7 @@ static int sync_dlg_db_mem(void) if (!VAL_NULL(values+10)) { cseq2.s = VAL_STR(values+10).s; - cseq2.len = strlen(cseq1.s); + cseq2.len = strlen(cseq2.s); callee_leg_idx = callee_idx(known_dlg); if (known_dlg->legs[callee_leg_idx].r_cseq.len < cseq2.len) { @@ -2458,7 +2458,7 @@ static int restore_dlg_db(void) ins_done = 1; /* dialog saved */ - run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, NULL, 1, 1); + run_dlg_callbacks(DLGCB_DB_SAVED, cell, 0, DLG_DIR_NONE, -1, NULL, 1, 1); cell->flags &= ~(DLG_FLAG_NEW |DLG_FLAG_CHANGED|DLG_FLAG_VP_CHANGED); } diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c index a6c6d217338..ecc77d09167 100644 --- a/modules/dialog/dlg_handlers.c +++ b/modules/dialog/dlg_handlers.c @@ -34,6 +34,7 @@ #include "../../parser/parse_rr.h" #include "../../parser/parse_hname2.h" #include "../../parser/parser_f.h" +#include "../../msg_callbacks.h" #include "../../redact_pii.h" #include "../tm/tm_load.h" #include "../rr/api.h" @@ -71,11 +72,34 @@ static inline int dlg_update_sdp(struct dlg_cell *dlg, struct sip_msg *msg, unsigned int leg, int tmp); static inline void dlg_merge_tmp_sdp(struct dlg_cell *dlg, unsigned int leg); +static void dlg_update_req_info(str *buffer, struct dlg_cell *dlg, int leg, + struct sip_msg *req, struct cell *t); + + +static void dlg_update_ack_sdp(struct sip_msg* req, str *buffer, int rpl_code, + union sockaddr_union *to, struct socket_info *sock, int proto) +{ + struct dlg_cell *dlg; + + dlg = get_current_dialog(); + if (!dlg) { + LM_BUG("dialog dissapeared while trying to update ACK SDP\n"); + return; + } + dlg_update_req_info(buffer, dlg, other_leg(dlg, ctx_lastdstleg_get()) , NULL, NULL); +} void init_dlg_handlers(int default_timeout_p) { default_timeout = default_timeout_p; + + /* statelessly forwarded ACK requests with SDP */ + if (register_slcb(SLCB_REQUEST_OUT, FL_ACK_WITH_BODY, + dlg_update_ack_sdp) != 0) { + LM_ERR("can't register callback for statelessly " + "forwarded ACK requests with body\n"); + } } @@ -645,7 +669,7 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param) } /* The state does not change, but the msg is mutable in this callback*/ run_dlg_callbacks(DLGCB_RESPONSE_FWDED, dlg, rpl, - DLG_DIR_UPSTREAM, (void *)leg_idx, 0, 1); + DLG_DIR_UPSTREAM, DLG_CALLER_LEG, (void *)leg_idx, 0, 1); return; } if (type==TMCB_TRANS_CANCELLED) { @@ -709,7 +733,8 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param) &unref, DLG_CALLER_LEG, 1); if (new_state==DLG_STATE_EARLY && old_state!=DLG_STATE_EARLY) { - run_dlg_callbacks(DLGCB_EARLY, dlg, rpl, DLG_DIR_UPSTREAM, NULL, 0, 1); + run_dlg_callbacks(DLGCB_EARLY, dlg, rpl, DLG_DIR_UPSTREAM, + DLG_CALLER_LEG, NULL, 0, 1); if_update_stat(dlg_enable_stats, early_dlgs, 1); return; } @@ -761,7 +786,7 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param) /* dialog confirmed */ run_dlg_callbacks(DLGCB_CONFIRMED, dlg, rpl, DLG_DIR_UPSTREAM, - NULL, 0, 1); + DLG_CALLER_LEG, NULL, 0, 1); if (ref_script_route_check_and_update(dlg->rt_on_answer)) { run_dlg_script_route( dlg, dlg->rt_on_answer->idx); @@ -787,7 +812,8 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param) /* dialog setup not completed (3456XX), but there is still a bit of * room to go *back* to 2XX if we're racing against a 200 OK! */ - run_dlg_callbacks(DLGCB_FAILED, dlg, rpl, DLG_DIR_UPSTREAM, NULL, 0, 1); + run_dlg_callbacks(DLGCB_FAILED, dlg, rpl, DLG_DIR_UPSTREAM, + DLG_CALLER_LEG, NULL, 0, 1); /* do unref */ if (unref) @@ -925,13 +951,34 @@ static void dlg_update_out_sdp(struct dlg_cell *dlg, int in_leg, int out_leg, st dlg_unlock_dlg(dlg); } +static void dlg_update_req_info(str *buffer, struct dlg_cell *dlg, int leg, + struct sip_msg *req, struct cell *t) +{ + struct sip_msg msg; + + memset(&msg, 0, sizeof(struct sip_msg)); + msg.buf = buffer->s; + msg.len = buffer->len; + + if (parse_msg(buffer->s, buffer->len, &msg) != 0) + return; + + if (req && req->REQ_METHOD != METHOD_ACK) + dlg_update_contact(dlg, req, leg); + if (t && is_invite(t)) + dlg_leg_push_cseq_map(dlg, t, DLG_CALLER_LEG, &msg); + dlg_update_out_sdp(dlg, leg, other_leg(dlg, leg), &msg, + msg.REQ_METHOD != METHOD_ACK); + free_sip_msg(&msg); +} + + static void dlg_update_callee_sdp(struct cell* t, int type, struct tmcb_params *ps) { - struct sip_msg *rpl,*msg; + struct sip_msg *rpl; int statuscode; struct dlg_cell *dlg; - str buffer; if(ps == NULL || ps->rpl == NULL) { LM_ERR("Wrong tmcb params\n"); @@ -955,39 +1002,16 @@ static void dlg_update_callee_sdp(struct cell* t, int type, if (statuscode == 200) { dlg_merge_tmp_sdp(dlg, DLG_CALLER_LEG); dlg_update_sdp(dlg, rpl, callee_idx(dlg), 0); - - buffer.s = ((str*)ps->extra1)->s; - buffer.len = ((str*)ps->extra1)->len; - - msg=pkg_malloc(sizeof(struct sip_msg)); - if (msg==0) { - LM_ERR("no pkg mem left for sip_msg\n"); - return; - } - - memset(msg,0, sizeof(struct sip_msg)); - msg->buf=buffer.s; - msg->len=buffer.len; - - if (parse_msg(buffer.s,buffer.len, msg)!=0) { - pkg_free(msg); - return; - } - - dlg_update_out_sdp(dlg, callee_idx(dlg), DLG_CALLER_LEG, msg, 0); - - free_sip_msg(msg); - pkg_free(msg); + dlg_update_req_info((str *)ps->extra1, dlg, callee_idx(dlg), NULL, NULL); } } static void dlg_update_caller_sdp(struct cell* t, int type, struct tmcb_params *ps) { - struct sip_msg *rpl,*msg; + struct sip_msg *rpl; int statuscode; struct dlg_cell *dlg; - str buffer; if(ps == NULL || ps->rpl == NULL) { LM_ERR("Wrong tmcb params\n"); @@ -1012,29 +1036,7 @@ static void dlg_update_caller_sdp(struct cell* t, int type, if (statuscode == 200) { dlg_merge_tmp_sdp(dlg, callee_idx(dlg)); dlg_update_sdp(dlg, rpl, DLG_CALLER_LEG, 0); - - buffer.s = ((str*)ps->extra1)->s; - buffer.len = ((str*)ps->extra1)->len; - - msg=pkg_malloc(sizeof(struct sip_msg)); - if (msg==0) { - LM_ERR("no pkg mem left for sip_msg\n"); - return; - } - - memset(msg,0, sizeof(struct sip_msg)); - msg->buf=buffer.s; - msg->len=buffer.len; - - if (parse_msg(buffer.s,buffer.len, msg)!=0) { - pkg_free(msg); - return; - } - - dlg_update_out_sdp(dlg, DLG_CALLER_LEG, callee_idx(dlg),msg, 0); - - free_sip_msg(msg); - pkg_free(msg); + dlg_update_req_info((str *)ps->extra1, dlg, DLG_CALLER_LEG, NULL, NULL); } } @@ -1128,7 +1130,7 @@ static void dlg_seq_up_onreply_mod_cseq(struct cell* t, int type, if (type==TMCB_RESPONSE_FWDED && (dlg->cbs.types)&DLGCB_RESPONSE_WITHIN) { run_dlg_callbacks(DLGCB_RESPONSE_WITHIN, dlg, param->rpl, - DLG_DIR_UPSTREAM, NULL, 0, 1); + DLG_DIR_UPSTREAM, ((dlg_cseq_wrapper *)*param->param)->dst_leg, NULL, 0, 1); return; } @@ -1147,7 +1149,7 @@ static void dlg_seq_up_onreply(struct cell* t, int type, if (type==TMCB_RESPONSE_FWDED && (dlg->cbs.types)&DLGCB_RESPONSE_WITHIN) { run_dlg_callbacks(DLGCB_RESPONSE_WITHIN, dlg, param->rpl, - DLG_DIR_UPSTREAM, NULL, 0, 1); + DLG_DIR_UPSTREAM, DLG_CALLER_LEG, NULL, 0, 1); return; } @@ -1172,7 +1174,7 @@ static void dlg_seq_down_onreply_mod_cseq(struct cell* t, int type, if (type==TMCB_RESPONSE_FWDED && (dlg->cbs.types)&DLGCB_RESPONSE_WITHIN) { run_dlg_callbacks(DLGCB_RESPONSE_WITHIN, dlg, param->rpl, - DLG_DIR_DOWNSTREAM, NULL, 0, 1); + DLG_DIR_DOWNSTREAM, ((dlg_cseq_wrapper *)*param->param)->dst_leg, NULL, 0, 1); return; } @@ -1211,7 +1213,7 @@ static void dlg_seq_down_onreply(struct cell* t, int type, if (type==TMCB_RESPONSE_FWDED && (dlg->cbs.types)&DLGCB_RESPONSE_WITHIN) { run_dlg_callbacks(DLGCB_RESPONSE_WITHIN, dlg, param->rpl, - DLG_DIR_DOWNSTREAM, NULL, 0, 1); + DLG_DIR_DOWNSTREAM, callee_idx(dlg), NULL, 0, 1); return; } @@ -1325,71 +1327,16 @@ static void dlg_onreply_out(struct cell* t, int type, struct tmcb_params *ps) static void dlg_caller_reinv_onreq_out(struct cell* t, int type, struct tmcb_params *ps) { - struct sip_msg *msg; - struct dlg_cell *dlg; - str buffer; - - buffer.s = ((str*)ps->extra1)->s; - buffer.len = ((str*)ps->extra1)->len; - - dlg = (struct dlg_cell *)(*ps->param); - - msg=pkg_malloc(sizeof(struct sip_msg)); - if (msg==0) { - LM_ERR("no pkg mem left for sip_msg\n"); - return; - } - - memset(msg,0, sizeof(struct sip_msg)); - msg->buf=buffer.s; - msg->len=buffer.len; + struct dlg_cell *dlg = (struct dlg_cell *)(*ps->param); - if (parse_msg(buffer.s,buffer.len, msg)!=0) { - pkg_free(msg); - return; - } - - /* we use the initial request, which already has the contact parsed/fixed */ - dlg_update_contact(dlg, ps->req, DLG_CALLER_LEG); - dlg_update_out_sdp(dlg, DLG_CALLER_LEG, callee_idx(dlg), msg, 1); - if (is_invite(t)) - dlg_leg_push_cseq_map(dlg, t, DLG_CALLER_LEG, msg); - free_sip_msg(msg); - pkg_free(msg); + dlg_update_req_info((str *)ps->extra1, dlg, DLG_CALLER_LEG, ps->req, t); } static void dlg_callee_reinv_onreq_out(struct cell* t, int type, struct tmcb_params *ps) { - struct sip_msg *msg; - struct dlg_cell *dlg; - str buffer; - - buffer.s = ((str*)ps->extra1)->s; - buffer.len = ((str*)ps->extra1)->len; - - dlg = (struct dlg_cell *)(*ps->param); + struct dlg_cell *dlg = (struct dlg_cell *)(*ps->param); - msg=pkg_malloc(sizeof(struct sip_msg)); - if (msg==0) { - LM_ERR("no pkg mem left for sip_msg\n"); - return; - } - - memset(msg,0, sizeof(struct sip_msg)); - msg->buf=buffer.s; - msg->len=buffer.len; - - if (parse_msg(buffer.s,buffer.len, msg)!=0) { - pkg_free(msg); - return; - } - - dlg_update_contact(dlg, ps->req, callee_idx(dlg)); - dlg_update_out_sdp(dlg, callee_idx(dlg), DLG_CALLER_LEG, msg, 1); - if (is_invite(t)) - dlg_leg_push_cseq_map(dlg, t, callee_idx(dlg), msg); - free_sip_msg(msg); - pkg_free(msg); + dlg_update_req_info((str *)ps->extra1, dlg, callee_idx(dlg), ps->req, t); } @@ -1477,12 +1424,12 @@ static void dlg_onreq_out(struct cell* t, int type, struct tmcb_params *ps) */ dlg_lock_dlg(dlg); - if (ensure_leg_array(dlg->legs_no[DLG_LEGS_USED] + 1, dlg) != 0) + callee_leg = d_tmb.get_branch_index() + 1; + if (ensure_leg_array(callee_leg + 1, dlg) != 0) goto out_free; /* store the caller SDP into each callee leg, useful for Re-INVITE pings */ - leg = &dlg->legs[dlg->legs_no[DLG_LEGS_USED]]; - callee_leg = dlg->legs_no[DLG_LEGS_USED]; + leg = &dlg->legs[callee_leg]; dlg_unlock_dlg(dlg); @@ -1809,11 +1756,12 @@ static inline void update_sequential_sdp(struct dlg_cell *dlg, struct sip_msg *r { int ret; - if (req->REQ_METHOD != METHOD_INVITE && req->REQ_METHOD != METHOD_UPDATE) + if ((req->REQ_METHOD & (METHOD_INVITE|METHOD_UPDATE|METHOD_ACK)) == 0) return; dlg_lock_dlg(dlg); - ret = dlg_update_sdp(dlg, req, leg, 1); + /* on ACK we have a final SDP, thus we need to store it permanently */ + ret = dlg_update_sdp(dlg, req, leg, (req->REQ_METHOD != METHOD_ACK)); dlg_unlock_dlg(dlg); /* if anything has changed in the meantime, also update replicate */ @@ -2074,7 +2022,7 @@ void dlg_onroute(struct sip_msg* req, str *route_params, void *param) if (new_state==DLG_STATE_DELETED && old_state==DLG_STATE_DELETED) { /* a request after dialog termination */ /* within dialog request */ - run_dlg_callbacks(DLGCB_REQ_WITHIN, dlg, req, dir, NULL, 0, 1); + run_dlg_callbacks(DLGCB_REQ_WITHIN, dlg, req, dir, dst_leg, NULL, 0, 1); /* update the cseq */ dlg_lock (d_table,d_entry); @@ -2195,7 +2143,7 @@ void dlg_onroute(struct sip_msg* req, str *route_params, void *param) } /* dialog terminated (BYE) */ - run_dlg_callbacks(DLGCB_TERMINATED, dlg, req, dir, NULL, 0, is_active); + run_dlg_callbacks(DLGCB_TERMINATED, dlg, req, dir, dst_leg, NULL, 0, is_active); /* delete the dialog from DB */ if (should_remove_dlg_db()) @@ -2220,7 +2168,7 @@ void dlg_onroute(struct sip_msg* req, str *route_params, void *param) } /* within dialog request */ - run_dlg_callbacks(DLGCB_REQ_WITHIN, dlg, req, dir, NULL, 0, 1); + run_dlg_callbacks(DLGCB_REQ_WITHIN, dlg, req, dir, dst_leg, NULL, 0, 1); /* update timer during sequential request? */ if (dlg->lifetime_dirty) { @@ -2332,20 +2280,27 @@ void dlg_onroute(struct sip_msg* req, str *route_params, void *param) LM_DBG("dlg_leg_get_cseq(dlg, [%d], req)\n", src_leg); update_val = dlg_leg_get_cseq(dlg, src_leg, req); if (update_val == 0) { - LM_DBG("dlg->legs[%d].last_gen_cseq=[%d]\n", - dst_leg, dlg->legs[dst_leg].last_gen_cseq); - update_val = dlg->legs[dst_leg].last_gen_cseq; + if (dlg->legs[dst_leg].last_gen_cseq) { + LM_DBG("dlg->legs[%d].last_gen_cseq=[%d]\n", + dst_leg, dlg->legs[dst_leg].last_gen_cseq); + update_val = dlg->legs[dst_leg].last_gen_cseq; + } } else { LM_DBG("update_val=[%d]\n", update_val); } dlg_unlock( d_table, d_entry ); - if (update_msg_cseq(req,0,update_val) != 0) { + if (update_val && update_msg_cseq(req,0,update_val) != 0) { LM_ERR("failed to update ACK msg cseq\n"); } } else dlg_unlock( d_table, d_entry ); + + /* if we have an SDP, it might be changed on the outgoing message, + * thus we need to save it's outgoing SDP */ + if (get_body(req, &val) == 0 && val.len != 0) + req->msg_flags |= FL_ACK_WITH_BODY; } if ( event!=DLG_EVENT_REQACK) { @@ -2377,6 +2332,7 @@ void dlg_onroute(struct sip_msg* req, str *route_params, void *param) } wrap->dlg = dlg; + wrap->dst_leg = dst_leg; wrap->cseq.s = (char *)(wrap + 1); wrap->cseq.len = msg_cseq->len; memcpy(wrap->cseq.s,msg_cseq->s,msg_cseq->len); @@ -2411,7 +2367,7 @@ void dlg_onroute(struct sip_msg* req, str *route_params, void *param) if ( (event==DLG_EVENT_REQPRACK || event == DLG_EVENT_REQ || event == DLG_EVENT_REQBYE) && new_state==DLG_STATE_EARLY) { /* within dialog request */ - run_dlg_callbacks(DLGCB_REQ_WITHIN, dlg, req, dir, NULL, 0, 1); + run_dlg_callbacks(DLGCB_REQ_WITHIN, dlg, req, dir, dst_leg, NULL, 0, 1); LM_DBG("EARLY event %d successfully processed (dst_leg=%d)\n", event,dst_leg); @@ -2589,7 +2545,7 @@ void dlg_ontimeout(struct dlg_tl *tl) if (push_new_processing_context(dlg, &old_ctx, &new_ctx, &fake_msg)==0) { if (do_expire_actions) run_dlg_callbacks(DLGCB_EXPIRED, dlg, fake_msg, - DLG_DIR_NONE, NULL, 0, do_expire_actions); + DLG_DIR_NONE, -1, NULL, 0, do_expire_actions); if (current_processing_ctx == NULL) *new_ctx = NULL; diff --git a/modules/dialog/dlg_handlers.h b/modules/dialog/dlg_handlers.h index 853c92ad2d4..a10537e3c93 100644 --- a/modules/dialog/dlg_handlers.h +++ b/modules/dialog/dlg_handlers.h @@ -64,6 +64,7 @@ static inline int dlg_match_mode_str_to_int(const str *in) struct _dlg_cseq{ struct dlg_cell *dlg; + int dst_leg; str cseq; }; @@ -106,9 +107,10 @@ typedef int (*terminate_dlg_f)(const str *callid, unsigned int h_entry, unsigned int h_id, const str *reason); typedef int (*indialog_reply_f) (struct sip_msg *msg, int statuscode, void *param); +typedef void (*indialog_release_f) (void *param); typedef int (*send_indialog_req_f)(struct dlg_cell *dlg, str *method, int leg, str *body, str *ct, str *hdrs, indialog_reply_f func, - void *param); + void *param, indialog_release_f release); void init_dlg_handlers(int default_timeout); @@ -136,7 +138,7 @@ int terminate_dlg(const str *callid, unsigned int h_entry, unsigned int h_id, int send_indialog_request(struct dlg_cell *dlg, str *method, int leg, str *body, str *ct, str *hdrs, indialog_reply_f func, - void *param); + void *param, indialog_release_f release); void unreference_dialog(void *dialog); diff --git a/modules/dialog/dlg_hash.c b/modules/dialog/dlg_hash.c index 47b635bca84..1a29f3702e4 100644 --- a/modules/dialog/dlg_hash.c +++ b/modules/dialog/dlg_hash.c @@ -267,7 +267,7 @@ void destroy_dlg(struct dlg_cell *dlg) dlg_leg_print_info( dlg, callee_idx(dlg), tag)); } - run_dlg_callbacks(DLGCB_DESTROY , dlg, 0, DLG_DIR_NONE, NULL, 0, 1); + run_dlg_callbacks(DLGCB_DESTROY , dlg, 0, DLG_DIR_NONE, -1, NULL, 0, 1); free_dlg_dlg(dlg); } @@ -1562,7 +1562,7 @@ static inline int internal_mi_print_dlg(mi_item_t *dialog_obj, /* print external context info */ run_dlg_callbacks(DLGCB_MI_CONTEXT, dlg, NULL, - DLG_DIR_NONE, (void *)context_obj, 0, 1); + DLG_DIR_NONE, -1, (void *)context_obj, 0, 1); } return 0; diff --git a/modules/dialog/dlg_profile.c b/modules/dialog/dlg_profile.c index fd97658aabb..38e8ff0e105 100644 --- a/modules/dialog/dlg_profile.c +++ b/modules/dialog/dlg_profile.c @@ -312,7 +312,7 @@ int init_cachedb(void) cdbc = cdbf.init(&cdb_url); if (!cdbc) { - LM_ERR("cannot connect to cachedb_url %.*s\n", cdb_url.len, cdb_url.s); + LM_ERR("cannot connect to cachedb_url %s\n", db_url_escape(&cdb_url)); return -1; } LM_DBG("Inited cachedb \n"); @@ -342,8 +342,8 @@ int init_cachedb_utils(void) return -1; } if (cachedb_bind_mod(&cdb_url, &cdbf) < 0) { - LM_ERR("cannot bind functions for cachedb_url %.*s\n", - cdb_url.len, cdb_url.s); + LM_ERR("cannot bind functions for cachedb_url %s\n", + db_url_escape(&cdb_url)); return -1; } if (!CACHEDB_CAPABILITY(&cdbf, @@ -354,7 +354,7 @@ int init_cachedb_utils(void) cdbc = cdbf.init(&cdb_url); if (!cdbc) { - LM_ERR("cannot connect to cachedb_url %.*s\n", cdb_url.len, cdb_url.s); + LM_ERR("cannot connect to cachedb_url %s\n", db_url_escape(&cdb_url)); return -1; } diff --git a/modules/dialog/dlg_replication.c b/modules/dialog/dlg_replication.c index 64bf30c8c3a..92c2f4045d0 100644 --- a/modules/dialog/dlg_replication.c +++ b/modules/dialog/dlg_replication.c @@ -346,7 +346,7 @@ int dlg_replicated_create(bin_packet_t *packet, struct dlg_cell *cell, if (vars.s && vars.len != 0) { read_dialog_vars(vars.s, vars.len, dlg); run_dlg_callbacks(DLGCB_PROCESS_VARS, dlg, - NULL, DLG_DIR_NONE, NULL, 1, 0); + NULL, DLG_DIR_NONE, -1, NULL, 1, 0); } dlg->locked_by = process_no; @@ -573,7 +573,7 @@ int dlg_replicated_update(bin_packet_t *packet) if (vars.s && vars.len != 0) { read_dialog_vars(vars.s, vars.len, dlg); run_dlg_callbacks(DLGCB_PROCESS_VARS, dlg, - NULL, DLG_DIR_NONE, NULL, 1, 0); + NULL, DLG_DIR_NONE, -1, NULL, 1, 0); } dlg->flags |= DLG_FLAG_VP_CHANGED; @@ -789,7 +789,7 @@ void bin_push_dlg(bin_packet_t *packet, struct dlg_cell *dlg) bin_push_str(packet, &dlg->legs[callee_leg].adv_contact); /* give modules the chance to write values/profiles before replicating */ - run_dlg_callbacks(DLGCB_WRITE_VP, dlg, NULL, DLG_DIR_NONE, NULL, 1, 1); + run_dlg_callbacks(DLGCB_WRITE_VP, dlg, NULL, DLG_DIR_NONE, -1, NULL, 1, 1); /* save sharing tag name as dlg val */ isval.s = dlg->shtag; diff --git a/modules/dialog/dlg_req_within.c b/modules/dialog/dlg_req_within.c index 886b1ab8c7f..ce64bb23021 100644 --- a/modules/dialog/dlg_req_within.c +++ b/modules/dialog/dlg_req_within.c @@ -259,7 +259,7 @@ static void dual_bye_event(struct dlg_cell* dlg, struct sip_msg *req, if (push_new_processing_context( dlg, &old_ctx, &new_ctx, &fake_msg)==0) { /* dialog terminated (BYE) */ run_dlg_callbacks( DLGCB_TERMINATED, dlg, fake_msg, - DLG_DIR_NONE, NULL, 0, is_active); + DLG_DIR_NONE, -1, NULL, 0, is_active); /* reset the processing context */ if (current_processing_ctx == NULL) *new_ctx = NULL; @@ -272,7 +272,7 @@ static void dual_bye_event(struct dlg_cell* dlg, struct sip_msg *req, /* we should have the msg and context from upper levels */ /* dialog terminated (BYE) */ run_dlg_callbacks( DLGCB_TERMINATED, dlg, req, - DLG_DIR_NONE, NULL, 0, is_active); + DLG_DIR_NONE, -1, NULL, 0, is_active); } LM_DBG("first final reply\n"); @@ -622,6 +622,8 @@ int send_leg_msg(struct dlg_cell *dlg,str *method,int src_leg,int dst_leg, if (push_new_processing_context( dlg, &old_ctx, &new_ctx, NULL)!=0) return -1; + ctx_lastdstleg_set(dst_leg); + dialog_info->T_flags=T_NO_AUTOACK_FLAG; result = d_tmb.t_request_within @@ -1007,11 +1009,14 @@ struct dlg_indialog_req_param { struct dlg_cell *dlg; indialog_reply_f func; void *param; + indialog_release_f release; }; static void dlg_indialog_reply_release(void *param) { struct dlg_indialog_req_param *p = (struct dlg_indialog_req_param *)param; + if (p->release) + p->release(p->param); unref_dlg(p->dlg, 1); shm_free(p); } @@ -1040,8 +1045,8 @@ static void dlg_indialog_reply(struct cell* t, int type, struct tmcb_params* ps) } -int send_indialog_request(struct dlg_cell *dlg, str *method, - int dstleg, str *body, str *ct, str *hdrs, indialog_reply_f func, void *param) +int send_indialog_request(struct dlg_cell *dlg, str *method, int dstleg, str *body, + str *ct, str *hdrs, indialog_reply_f func, void *param, indialog_release_f release) { str extra_headers; struct dlg_indialog_req_param *p; @@ -1064,6 +1069,7 @@ int send_indialog_request(struct dlg_cell *dlg, str *method, p->dlg = dlg; p->func = func; p->param = param; + p->release = release; p->leg = dstleg; ref_dlg(dlg, 1); diff --git a/modules/dialog/dlg_vals.c b/modules/dialog/dlg_vals.c index 48fe7d720c1..73fac7f05b1 100644 --- a/modules/dialog/dlg_vals.c +++ b/modules/dialog/dlg_vals.c @@ -309,9 +309,9 @@ int pv_get_dlg_val(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) isval.s = param->pvv; if (fetch_dlg_value(dlg, ¶m->pvn.u.isname.name.s, &type, &isval, 1)!=0) return pv_get_null(msg, param, res); - param->pvv = isval.s; if (type == DLG_VAL_TYPE_STR) { + param->pvv = isval.s; res->flags = PV_VAL_STR; res->rs = isval.s; } else { diff --git a/modules/dialog/doc/contributors.xml b/modules/dialog/doc/contributors.xml index b4065c2af4d..2c1d66a20fe 100644 --- a/modules/dialog/doc/contributors.xml +++ b/modules/dialog/doc/contributors.xml @@ -29,17 +29,17 @@ 2. Razvan Crainea (@razvancrainea) - 275 - 207 - 5092 - 1560 + 286 + 214 + 5212 + 1716 3. Vlad Paiu (@vladpaiu) - 254 - 145 - 7206 + 255 + 146 + 7208 3027 @@ -53,10 +53,10 @@ 5. Liviu Chircu (@liviuchircu) - 175 - 128 - 2949 - 1291 + 179 + 132 + 2959 + 1298 6. @@ -101,7 +101,7 @@ -All remaining contributors: Anca Vamanu, Walter Doekes (@wdoekes), Ionut Ionita (@ionutrazvanionita), Ionel Cerghit (@ionel-cerghit), Andrei Dragus, Maksym Sobolyev (@sobomax), John Riordan, Hugues Mitonneau, Carsten Bock, Peter Lemenkov (@lemenkov), Jerome Martin, Klaus Darilion, Jarrod Baumann (@jarrodb), Nick Altmann (@nikbyte), Zero King (@l2dy), Michel Bensoussan, Richard Revels, Elena-Ramona Modroiu, Tavis Paquette, Ryan Bullock, Andrei Datcu (@andrei-datcu), Jeffrey Magder, Ron Winacott, Andy Pyles, Julián Moreno Patiño, Konstantin Bokarius, sergei lavrov, Alex Massover, Damien Sandras (@dsandras), Alex Hermann, Dusan Klinec (@ph4r05), Norman Brandinger (@NormB), UnixDev, Eliot Gable, Ryan Bullock (@rrb3942), Edson Gellert Schubert. +All remaining contributors: Anca Vamanu, Walter Doekes (@wdoekes), Ionut Ionita (@ionutrazvanionita), Ionel Cerghit (@ionel-cerghit), Andrei Dragus, Maksym Sobolyev (@sobomax), John Riordan, Hugues Mitonneau, Carsten Bock, Peter Lemenkov (@lemenkov), Jerome Martin, Klaus Darilion, Jarrod Baumann (@jarrodb), Nick Altmann (@nikbyte), Zero King (@l2dy), Michel Bensoussan, Richard Revels, Elena-Ramona Modroiu, Tavis Paquette, Ryan Bullock, Andrei Datcu (@andrei-datcu), Jeffrey Magder, Ron Winacott, Andy Pyles, Julián Moreno Patiño, Konstantin Bokarius, sergei lavrov, Alex Massover, Damien Sandras (@dsandras), Alex Hermann, Alexandra Titoc, Dusan Klinec (@ph4r05), Norman Brandinger (@NormB), UnixDev, Eliot Gable, Ryan Bullock (@rrb3942), Edson Gellert Schubert. (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits) @@ -129,22 +129,22 @@ 1. Razvan Crainea (@razvancrainea) - Aug 2010 - Jan 2024 + Aug 2010 - Apr 2025 2. - Bogdan-Andrei Iancu (@bogdan-iancu) - Apr 2006 - Dec 2023 + Vlad Paiu (@vladpaiu) + Oct 2010 - Sep 2024 3. - Liviu Chircu (@liviuchircu) - Aug 2012 - Nov 2023 + Alexandra Titoc + Sep 2024 - Sep 2024 4. - Vlad Paiu (@vladpaiu) - Oct 2010 - Nov 2023 + Bogdan-Andrei Iancu (@bogdan-iancu) + Apr 2006 - Dec 2023 5. @@ -179,7 +179,7 @@ -All remaining contributors: Walter Doekes (@wdoekes), sergei lavrov, Zero King (@l2dy), Dan Pascu (@danpascu), Ionel Cerghit (@ionel-cerghit), Jarrod Baumann (@jarrodb), Ionut Ionita (@ionutrazvanionita), Julián Moreno Patiño, Dusan Klinec (@ph4r05), Eseanu Marius Cristian (@eseanucristian), Andrei Datcu (@andrei-datcu), Norman Brandinger (@NormB), Damien Sandras (@dsandras), Ryan Bullock (@rrb3942), Anca Vamanu, Alex Massover, Andrei Dragus, John Riordan, Hugues Mitonneau, Richard Revels, UnixDev, Alex Hermann, Henning Westerholt (@henningw), Carsten Bock, Klaus Darilion, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Jerome Martin, Tavis Paquette, Michel Bensoussan, Eliot Gable, Andy Pyles, Elena-Ramona Modroiu, Jeffrey Magder, Ron Winacott. +All remaining contributors: Walter Doekes (@wdoekes), Liviu Chircu (@liviuchircu), sergei lavrov, Zero King (@l2dy), Dan Pascu (@danpascu), Ionel Cerghit (@ionel-cerghit), Jarrod Baumann (@jarrodb), Ionut Ionita (@ionutrazvanionita), Julián Moreno Patiño, Dusan Klinec (@ph4r05), Eseanu Marius Cristian (@eseanucristian), Andrei Datcu (@andrei-datcu), Norman Brandinger (@NormB), Damien Sandras (@dsandras), Ryan Bullock (@rrb3942), Anca Vamanu, Alex Massover, Andrei Dragus, John Riordan, Hugues Mitonneau, Richard Revels, UnixDev, Alex Hermann, Henning Westerholt (@henningw), Carsten Bock, Klaus Darilion, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Jerome Martin, Tavis Paquette, Michel Bensoussan, Eliot Gable, Andy Pyles, Elena-Ramona Modroiu, Jeffrey Magder, Ron Winacott. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/dialog/doc/dialog.xml b/modules/dialog/doc/dialog.xml index 8aae9aaa238..1a494919c17 100644 --- a/modules/dialog/doc/dialog.xml +++ b/modules/dialog/doc/dialog.xml @@ -7,6 +7,8 @@ + + diff --git a/modules/dialog/doc/dialog_admin.xml b/modules/dialog/doc/dialog_admin.xml index 8a5b034e2c6..3a3210ba96e 100644 --- a/modules/dialog/doc/dialog_admin.xml +++ b/modules/dialog/doc/dialog_admin.xml @@ -1270,6 +1270,9 @@ modparam("dialog", "profile_timeout", "43200") and receiving all the dialog-related events (creation, update and deletion) in the cluster. + + &clusterer_sync_cap_para; + Default value is 0 (no replication). diff --git a/modules/dialplan/Makefile b/modules/dialplan/Makefile index 59218eb878c..59b9d45425e 100644 --- a/modules/dialplan/Makefile +++ b/modules/dialplan/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/dialplan/README b/modules/dialplan/README index 226cb683d7c..52d842374a6 100644 --- a/modules/dialplan/README +++ b/modules/dialplan/README @@ -612,12 +612,12 @@ Chapter 3. Contributors Table 3.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Bogdan-Andrei Iancu (@bogdan-iancu) 71 46 910 983 - 2. Liviu Chircu (@liviuchircu) 69 45 980 941 + 1. Liviu Chircu (@liviuchircu) 72 47 984 947 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) 71 46 910 983 3. Ionut Ionita (@ionutrazvanionita) 40 20 1149 579 4. Anca Vamanu 33 5 3263 19 5. Andrei Dragus 24 3 382 1029 - 6. Razvan Crainea (@razvancrainea) 21 17 92 132 + 6. Razvan Crainea (@razvancrainea) 23 19 98 162 7. Ovidiu Sas (@ovidiusas) 16 13 144 37 8. Vlad Patrascu (@rvlad-patrascu) 10 6 157 115 9. Maksym Sobolyev (@sobomax) 6 4 10 10 @@ -649,12 +649,12 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2008 - Sep 2022 - 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2022 - 4. Liviu Chircu (@liviuchircu) Jul 2012 - Mar 2022 - 5. Zero King (@l2dy) Mar 2020 - Mar 2020 - 6. Razvan Crainea (@razvancrainea) Dec 2010 - Sep 2019 + 1. Razvan Crainea (@razvancrainea) Dec 2010 - Sep 2024 + 2. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2008 - Sep 2022 + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2022 + 5. Liviu Chircu (@liviuchircu) Jul 2012 - Apr 2021 + 6. Zero King (@l2dy) Mar 2020 - Mar 2020 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 8. Ovidiu Sas (@ovidiusas) Sep 2008 - Nov 2015 9. Ionut Ionita (@ionutrazvanionita) Jul 2014 - Nov 2015 diff --git a/modules/dialplan/dialplan.c b/modules/dialplan/dialplan.c index 8c008d78e55..454f9a6caea 100644 --- a/modules/dialplan/dialplan.c +++ b/modules/dialplan/dialplan.c @@ -56,7 +56,6 @@ static int mod_init(void); static int child_init(int rank); -static int mi_child_init(void); static void mod_destroy(); static mi_response_t *mi_reload_rules(const mi_params_t *params, @@ -107,7 +106,7 @@ static const param_export_t mod_params[]={ }; static const mi_export_t mi_cmds[] = { - { "dp_reload", 0, 0, mi_child_init, { + { "dp_reload", 0, 0, NULL, { {mi_reload_rules, {0}}, {mi_reload_rules_1, {"partition", 0}}, {EMPTY_MI_RECIPE}} @@ -117,7 +116,7 @@ static const mi_export_t mi_cmds[] = { {mi_translate3, {"dpid", "input", "partition", 0}}, {EMPTY_MI_RECIPE}} }, - { "dp_show_partition", 0, 0, mi_child_init, { + { "dp_show_partition", 0, 0, NULL, { {mi_show_partition, {0}}, {mi_show_partition_1, {"partition", 0}}, {EMPTY_MI_RECIPE}} @@ -336,9 +335,9 @@ static void dp_print_list(void) LM_DBG("List is empty\n"); while (start != NULL) { - LM_DBG("Partition=[%.*s] url=[%.*s] table=[%.*s] next=[%p]\n", + LM_DBG("Partition=[%.*s] url=[%s] table=[%.*s] next=[%p]\n", start->partition.len, start->partition.s, - start->dp_db_url.len, start->dp_db_url.s, + db_url_escape(&start->dp_db_url), start->dp_table_name.len, start->dp_table_name.s, start->next); start = start->next; } @@ -420,10 +419,6 @@ static int child_init(int rank) { dp_connection_list_p el; - /* only process with rank 1 loads data */ - if (rank != 1) - return 0; - /* Connect to DBs.... */ for(el = dp_conns; el; el = el->next){ if (dp_connect_db(el) != 0) { @@ -433,6 +428,10 @@ static int child_init(int rank) } } + /* only process with rank 1 loads data */ + if (rank != 1) + return 0; + /* ...and fire the RPC to perform the data load in the * same process, but after child_init is done */ if (ipc_send_rpc( process_no, dp_rpc_data_load, NULL)<0) { @@ -444,29 +443,6 @@ static int child_init(int rank) } -static int mi_child_init(void) -{ - static int mi_child_initialized = 0; - dp_connection_list_p el; - - if (mi_child_initialized) - return 0; - - /* Connect to DB s */ - for(el = dp_conns; el; el = el->next){ - if (dp_connect_db(el) != 0) { - /* all el shall be freed in mod destroy */ - LM_ERR("Unable to init/connect db connection\n"); - return -1; - } - } - - mi_child_initialized = 1; - return 0; -} - - - static void mod_destroy(void) { /*destroy shared memory*/ diff --git a/modules/dialplan/doc/contributors.xml b/modules/dialplan/doc/contributors.xml index 5dac9218ea7..572fca9ca11 100644 --- a/modules/dialplan/doc/contributors.xml +++ b/modules/dialplan/doc/contributors.xml @@ -20,20 +20,20 @@ 1. + Liviu Chircu (@liviuchircu) + 72 + 47 + 984 + 947 + + + 2. Bogdan-Andrei Iancu (@bogdan-iancu) 71 46 910 983 - - 2. - Liviu Chircu (@liviuchircu) - 69 - 45 - 980 - 941 - 3. Ionut Ionita (@ionutrazvanionita) @@ -61,10 +61,10 @@ 6. Razvan Crainea (@razvancrainea) - 21 - 17 - 92 - 132 + 23 + 19 + 98 + 162 7. @@ -128,34 +128,34 @@ 1. + Razvan Crainea (@razvancrainea) + Dec 2010 - Sep 2024 + + + 2. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 2. + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2008 - Sep 2022 - 3. + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2022 - 4. + 5. Liviu Chircu (@liviuchircu) - Jul 2012 - Mar 2022 + Jul 2012 - Apr 2021 - 5. + 6. Zero King (@l2dy) Mar 2020 - Mar 2020 - - 6. - Razvan Crainea (@razvancrainea) - Dec 2010 - Sep 2019 - 7. Peter Lemenkov (@lemenkov) diff --git a/modules/dialplan/dp_db.c b/modules/dialplan/dp_db.c index a9ae5787e29..3301e8bee5c 100644 --- a/modules/dialplan/dp_db.c +++ b/modules/dialplan/dp_db.c @@ -87,8 +87,8 @@ int test_db(dp_connection_list_p dp_connection) } if (db_bind_mod(&dp_connection->db_url, &dp_connection->dp_dbf) < 0) { - LM_ERR("failed to find a client driver for DB URL: '%.*s'\n", - dp_connection->db_url.len, dp_connection->db_url.s); + LM_ERR("failed to find a client driver for DB URL: '%s'\n", + db_url_escape(&dp_connection->db_url)); return -1; } diff --git a/modules/dispatcher/Makefile b/modules/dispatcher/Makefile index 800265bd6d2..928d2741778 100644 --- a/modules/dispatcher/Makefile +++ b/modules/dispatcher/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/dispatcher/README b/modules/dispatcher/README index 9bb6d4d05e5..930e68852aa 100644 --- a/modules/dispatcher/README +++ b/modules/dispatcher/README @@ -611,8 +611,16 @@ modparam("dispatcher", "persistent_state", 0) which node in the cluster will perform the pinging/probing to destinations. See the cluster_sharing_tag option. + This OpenSIPS cluster exposes the "dispatcher-status-repl" + capability in order to mark nodes as eligible for becoming data + donors during an arbitrary sync request. Consequently, the + cluster must have at least one node marked with the "seed" + value as the clusterer.flags column/property in order to be + fully functional. Consult the clusterer - Capabilities chapter + for more details. + For more info on how to define and populate a cluster (with - OpenSIPS nodes) see the "clusterer" module. + OpenSIPS nodes) see the clusterer module. Default value is “0 (none)”. @@ -1496,7 +1504,7 @@ Chapter 3. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 169 107 3322 2023 - 2. Liviu Chircu (@liviuchircu) 106 68 1664 1429 + 2. Liviu Chircu (@liviuchircu) 109 71 1679 1440 3. Daniel-Constantin Mierla (@miconda) 81 39 3372 844 4. Andrei Datcu (@andrei-datcu) 47 15 2153 846 5. Razvan Crainea (@razvancrainea) 43 35 528 155 @@ -1537,11 +1545,11 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) May 2011 - Nov 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2005 - Oct 2023 - 3. wangdd Apr 2023 - May 2023 - 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 5. Liviu Chircu (@liviuchircu) Aug 2012 - Aug 2022 + 1. Liviu Chircu (@liviuchircu) Aug 2012 - Jan 2025 + 2. Razvan Crainea (@razvancrainea) May 2011 - Nov 2023 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2005 - Oct 2023 + 4. wangdd Apr 2023 - May 2023 + 5. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2022 7. John Burke (@john08burke) Feb 2021 - Jan 2022 8. Vlad Paiu (@vladpaiu) Mar 2012 - Apr 2020 @@ -1567,8 +1575,8 @@ Chapter 4. Documentation 4.1. Contributors - Last edited by: wangdd, Razvan Crainea (@razvancrainea), Liviu - Chircu (@liviuchircu), Vlad Patrascu (@rvlad-patrascu), + Last edited by: Liviu Chircu (@liviuchircu), wangdd, Razvan + Crainea (@razvancrainea), Vlad Patrascu (@rvlad-patrascu), Bogdan-Andrei Iancu (@bogdan-iancu), John Burke (@john08burke), Vlad Paiu (@vladpaiu), Roman Sevko, Peter Lemenkov (@lemenkov), Nick Altmann (@nikbyte), Ionel Cerghit (@ionel-cerghit), Jarrod diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c index 12d40c6e792..cce7b95ea51 100644 --- a/modules/dispatcher/dispatch.c +++ b/modules/dispatcher/dispatch.c @@ -571,9 +571,16 @@ ds_pvar_param_p ds_get_pvar_param(int id, str uri) int len = ds_pattern_prefix.len + ds_pattern_infix.len + ds_pattern_suffix.len + uri.len + str_id.len; - char buf[len]; /* XXX: check if this works for all compilers */ + char *buf; ds_pvar_param_p param; + param = shm_malloc(sizeof *param + len); + if (!param) { + LM_ERR("no more shm memory\n"); + return NULL; + } + buf = param->buf; + if (ds_pattern_one>DS_PATTERN_NONE) { name.len = 0; name.s = buf; @@ -599,12 +606,6 @@ ds_pvar_param_p ds_get_pvar_param(int id, str uri) name.len += ds_pattern_suffix.len; } - param = shm_malloc(sizeof(ds_pvar_param_t)); - if (!param) { - LM_ERR("no more shm memory\n"); - return NULL; - } - if (!pv_parse_spec(ds_pattern_one>DS_PATTERN_NONE ? &name : &ds_pattern_prefix, ¶m->pvar)) { LM_ERR("cannot parse pattern spec\n"); diff --git a/modules/dispatcher/dispatch.h b/modules/dispatcher/dispatch.h index f9222a0c429..bd5d8815a81 100644 --- a/modules/dispatcher/dispatch.h +++ b/modules/dispatcher/dispatch.h @@ -109,6 +109,7 @@ typedef struct _ds_pvar_param { pv_spec_t pvar; int value; + char buf[0]; } ds_pvar_param_t, *ds_pvar_param_p; diff --git a/modules/dispatcher/doc/contributors.xml b/modules/dispatcher/doc/contributors.xml index 5e5765cb26a..735b5455e88 100644 --- a/modules/dispatcher/doc/contributors.xml +++ b/modules/dispatcher/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 106 - 68 - 1664 - 1429 + 109 + 71 + 1679 + 1440 3. @@ -128,29 +128,29 @@ 1. + Liviu Chircu (@liviuchircu) + Aug 2012 - Jan 2025 + + + 2. Razvan Crainea (@razvancrainea) May 2011 - Nov 2023 - 2. + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2005 - Oct 2023 - 3. + 4. wangdd Apr 2023 - May 2023 - 4. + 5. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - - 5. - Liviu Chircu (@liviuchircu) - Aug 2012 - Aug 2022 - 6. Vlad Patrascu (@rvlad-patrascu) @@ -190,7 +190,7 @@ Documentation
Contributors - Last edited by: wangdd, Razvan Crainea (@razvancrainea), Liviu Chircu (@liviuchircu), Vlad Patrascu (@rvlad-patrascu), Bogdan-Andrei Iancu (@bogdan-iancu), John Burke (@john08burke), Vlad Paiu (@vladpaiu), Roman Sevko, Peter Lemenkov (@lemenkov), Nick Altmann (@nikbyte), Ionel Cerghit (@ionel-cerghit), Jarrod Baumann (@jarrodb), Ovidiu Sas (@ovidiusas), Ionut Ionita (@ionutrazvanionita), Andrei Datcu (@andrei-datcu), Walter Doekes (@wdoekes), Stanislaw Pitucha, Anca Vamanu, Klaus Darilion, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Carsten Bock, Edson Gellert Schubert, Elena-Ramona Modroiu. + Last edited by: Liviu Chircu (@liviuchircu), wangdd, Razvan Crainea (@razvancrainea), Vlad Patrascu (@rvlad-patrascu), Bogdan-Andrei Iancu (@bogdan-iancu), John Burke (@john08burke), Vlad Paiu (@vladpaiu), Roman Sevko, Peter Lemenkov (@lemenkov), Nick Altmann (@nikbyte), Ionel Cerghit (@ionel-cerghit), Jarrod Baumann (@jarrodb), Ovidiu Sas (@ovidiusas), Ionut Ionita (@ionutrazvanionita), Andrei Datcu (@andrei-datcu), Walter Doekes (@wdoekes), Stanislaw Pitucha, Anca Vamanu, Klaus Darilion, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Carsten Bock, Edson Gellert Schubert, Elena-Ramona Modroiu.
diff --git a/modules/dispatcher/doc/dispatcher.list b/modules/dispatcher/doc/dispatcher.list index f1106b5358b..55a8cf476ac 100644 --- a/modules/dispatcher/doc/dispatcher.list +++ b/modules/dispatcher/doc/dispatcher.list @@ -1,4 +1,3 @@ -# $Id$ # dispatcher destination sets # diff --git a/modules/dispatcher/doc/dispatcher.xml b/modules/dispatcher/doc/dispatcher.xml index 04fdf8f2252..57412aecf88 100644 --- a/modules/dispatcher/doc/dispatcher.xml +++ b/modules/dispatcher/doc/dispatcher.xml @@ -8,6 +8,8 @@ + + diff --git a/modules/dispatcher/doc/dispatcher_admin.xml b/modules/dispatcher/doc/dispatcher_admin.xml index e23d30ec54d..78513671057 100644 --- a/modules/dispatcher/doc/dispatcher_admin.xml +++ b/modules/dispatcher/doc/dispatcher_admin.xml @@ -680,9 +680,12 @@ modparam("dispatcher", "persistent_state", 0) destinations. See the option.
+ + &clusterer_sync_cap_para; + For more info on how to define and populate a cluster (with OpenSIPS - nodes) see the "clusterer" module. + nodes) see the clusterer module. diff --git a/modules/diversion/Makefile b/modules/diversion/Makefile index accbf2cf5ec..152f4ccc3df 100644 --- a/modules/diversion/Makefile +++ b/modules/diversion/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # Diversion Header Field Support2 # # diff --git a/modules/diversion/README b/modules/diversion/README index 68dc13d2faa..8a195d9eae0 100644 --- a/modules/diversion/README +++ b/modules/diversion/README @@ -187,7 +187,7 @@ Chapter 3. Contributors Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 17 15 62 32 2. Daniel-Constantin Mierla (@miconda) 15 13 28 20 - 3. Liviu Chircu (@liviuchircu) 10 8 16 45 + 3. Liviu Chircu (@liviuchircu) 11 9 16 47 4. Jan Janak (@janakj) 10 4 528 13 5. Razvan Crainea (@razvancrainea) 6 4 4 2 6. Vlad Patrascu (@rvlad-patrascu) 5 3 20 42 @@ -219,12 +219,12 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2019 - 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2005 - Apr 2019 - 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 6. Liviu Chircu (@liviuchircu) Mar 2014 - Jun 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2019 + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 + 5. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2005 - Apr 2019 + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Vlad Paiu (@vladpaiu) Jun 2012 - Jun 2012 8. Saúl Ibarra Corretgé (@saghul) May 2012 - Jun 2012 9. Henning Westerholt (@henningw) Apr 2007 - May 2008 diff --git a/modules/diversion/doc/contributors.xml b/modules/diversion/doc/contributors.xml index b119ac14cc5..b20804c2b1f 100644 --- a/modules/diversion/doc/contributors.xml +++ b/modules/diversion/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 10 - 8 + 11 + 9 16 - 45 + 47 4. @@ -128,34 +128,34 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2019 - 3. + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 4. + 5. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2005 - Apr 2019 - 5. + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - 6. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jun 2018 - 7. Vlad Paiu (@vladpaiu) diff --git a/modules/dns_cache/README b/modules/dns_cache/README index 39b79b8591a..307eb08fe50 100644 --- a/modules/dns_cache/README +++ b/modules/dns_cache/README @@ -95,9 +95,9 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Vlad Paiu (@vladpaiu) 15 5 1006 3 - 2. Liviu Chircu (@liviuchircu) 12 10 46 44 + 2. Liviu Chircu (@liviuchircu) 13 11 50 48 3. Razvan Crainea (@razvancrainea) 11 9 12 14 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) 8 6 16 7 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) 9 7 22 13 5. Maksym Sobolyev (@sobomax) 3 1 2 2 6. Peter Lemenkov (@lemenkov) 3 1 1 1 7. Vlad Patrascu (@rvlad-patrascu) 2 1 1 0 @@ -122,11 +122,11 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2012 - Mar 2020 - 3. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 - 4. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 5. Liviu Chircu (@liviuchircu) Mar 2014 - Jun 2018 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2012 - Dec 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Liviu Chircu (@liviuchircu) Mar 2014 - Apr 2021 + 4. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 + 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2017 7. Vlad Paiu (@vladpaiu) Feb 2012 - Oct 2012 diff --git a/modules/dns_cache/dns_cache.c b/modules/dns_cache/dns_cache.c index 5d4f0f4a321..203ccfc9572 100644 --- a/modules/dns_cache/dns_cache.c +++ b/modules/dns_cache/dns_cache.c @@ -149,7 +149,7 @@ static int mod_init(void) return -1; } else { cachedb_url.len = strlen(cachedb_url.s); - LM_DBG("using CacheDB URL: %s\n", cachedb_url.s); + LM_DBG("using CacheDB URL: %s\n", db_url_escape(&cachedb_url)); } /* set pointers that resolver will use for caching */ @@ -163,8 +163,8 @@ static int mod_init(void) static int child_init(int rank) { if (cachedb_bind_mod(&cachedb_url, &cdbf) < 0) { - LM_ERR("cannot bind functions for db_url %.*s\n", - cachedb_url.len, cachedb_url.s); + LM_ERR("cannot bind functions for db_url %s\n", + db_url_escape(&cachedb_url)); return -1; } @@ -176,7 +176,7 @@ static int child_init(int rank) cdbc = cdbf.init(&cachedb_url); if (!cdbc) { - LM_ERR("cannot connect to db_url %.*s\n", cachedb_url.len, cachedb_url.s); + LM_ERR("cannot connect to db_url %s\n", db_url_escape(&cachedb_url)); return -1; } @@ -199,6 +199,8 @@ static void destroy(void) static int rdata_struct_len=sizeof(struct rdata)-sizeof(void *) - sizeof(struct rdata *); +#define MAXALIASES 36 +#define MAXADDRS 36 static unsigned char *he_buf=NULL; static int he_buf_len=0; static char* serialize_he_rdata(struct hostent *he,int *buf_len,int do_encoding) @@ -214,7 +216,7 @@ static char* serialize_he_rdata(struct hostent *he,int *buf_len,int do_encoding) len+=strlen(he->h_name)+1; if (he->h_aliases) - for (i=0;he->h_aliases[i];i++) { + for (i=0;he->h_aliases[i]&&alias_noh_aliases[i])+1+sizeof(int); alias_no++; @@ -223,7 +225,7 @@ static char* serialize_he_rdata(struct hostent *he,int *buf_len,int do_encoding) i=0; if (he->h_addr_list) - for (i=0;he->h_addr_list[i];i++) { + for (i=0;he->h_addr_list[i]&&addr_noh_length; addr_no++; } @@ -266,7 +268,7 @@ static char* serialize_he_rdata(struct hostent *he,int *buf_len,int do_encoding) /* copy aliases, if any */ if (he->h_aliases) - for (i=0;he->h_aliases[i];i++) { + for (i=0;he->h_aliases[i];i++) { len=strlen(he->h_aliases[i])+1; /* copy alias length */ memcpy(p,&len,sizeof(int)); @@ -282,7 +284,7 @@ static char* serialize_he_rdata(struct hostent *he,int *buf_len,int do_encoding) /* copy addresses */ if (he->h_addr_list) - for (i=0;he->h_addr_list[i];i++) { + for (i=0;he->h_addr_list[i];i++) { /* copy addreses. length will be known from the addrtype field */ len=he->h_length; memcpy(p,he->h_addr_list[i],len); @@ -308,8 +310,6 @@ static char* serialize_he_rdata(struct hostent *he,int *buf_len,int do_encoding) static unsigned char *dec_he_buf=NULL; static int dec_he_buf_len=0; static struct hostent dec_global_he; -#define MAXALIASES 36 -#define MAXADDRS 36 static char *h_addr_ptrs[MAXADDRS]; static char *host_aliases[MAXALIASES]; static struct hostent* deserialize_he_rdata(char *buff,int buf_len,int do_decoding) @@ -338,10 +338,8 @@ static struct hostent* deserialize_he_rdata(char *buff,int buf_len,int do_decodi /* set pointer in dec_global_he */ ap = host_aliases; - *ap = NULL; dec_global_he.h_aliases = host_aliases; hap = h_addr_ptrs; - *hap = NULL; dec_global_he.h_addr_list = h_addr_ptrs; if (do_decoding) { @@ -378,6 +376,7 @@ static struct hostent* deserialize_he_rdata(char *buff,int buf_len,int do_decodi *ap++ = (char *)p; p+=len; } + *ap = NULL; /* get number of addresses */ memcpy(&addr_no,p,sizeof(int)); @@ -388,6 +387,7 @@ static struct hostent* deserialize_he_rdata(char *buff,int buf_len,int do_decodi *hap++ = (char *)p; p+=dec_global_he.h_length; } + *hap = NULL; return &dec_global_he; } diff --git a/modules/dns_cache/doc/contributors.xml b/modules/dns_cache/doc/contributors.xml index 9e22065f6f5..697c859ca9c 100644 --- a/modules/dns_cache/doc/contributors.xml +++ b/modules/dns_cache/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 12 - 10 - 46 - 44 + 13 + 11 + 50 + 48 3. @@ -45,10 +45,10 @@ 4. Bogdan-Andrei Iancu (@bogdan-iancu) - 8 - 6 - 16 + 9 7 + 22 + 13 5. @@ -104,28 +104,28 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Bogdan-Andrei Iancu (@bogdan-iancu) + Jun 2012 - Dec 2024 2. - Bogdan-Andrei Iancu (@bogdan-iancu) - Jun 2012 - Mar 2020 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 3. - Razvan Crainea (@razvancrainea) - Feb 2012 - Sep 2019 + Liviu Chircu (@liviuchircu) + Mar 2014 - Apr 2021 4. - Peter Lemenkov (@lemenkov) - Jun 2018 - Jun 2018 + Razvan Crainea (@razvancrainea) + Feb 2012 - Sep 2019 5. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jun 2018 + Peter Lemenkov (@lemenkov) + Jun 2018 - Jun 2018 6. diff --git a/modules/domain/README b/modules/domain/README index 7653219bcde..c9ac985b264 100644 --- a/modules/domain/README +++ b/modules/domain/README @@ -289,7 +289,7 @@ Chapter 3. Contributors 1. Bogdan-Andrei Iancu (@bogdan-iancu) 55 41 425 559 2. Jan Janak (@janakj) 32 21 999 113 3. Juha Heinanen (@juha-h) 30 20 700 233 - 4. Razvan Crainea (@razvancrainea) 20 13 287 221 + 4. Razvan Crainea (@razvancrainea) 21 14 288 222 5. Daniel-Constantin Mierla (@miconda) 19 16 92 79 6. Liviu Chircu (@liviuchircu) 11 8 45 109 7. Vlad Patrascu (@rvlad-patrascu) 9 5 96 123 @@ -324,10 +324,10 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. John Burke (@john08burke) Jan 2022 - Jan 2022 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2005 - Mar 2020 - 4. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 + 1. Razvan Crainea (@razvancrainea) Jun 2011 - Jun 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. John Burke (@john08burke) Jan 2022 - Jan 2022 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2005 - Mar 2020 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 6. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2018 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/domain/doc/contributors.xml b/modules/domain/doc/contributors.xml index 5736e357312..9659941b926 100644 --- a/modules/domain/doc/contributors.xml +++ b/modules/domain/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Razvan Crainea (@razvancrainea) - 20 - 13 - 287 - 221 + 21 + 14 + 288 + 222 5. @@ -128,24 +128,24 @@ 1. + Razvan Crainea (@razvancrainea) + Jun 2011 - Jun 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. John Burke (@john08burke) Jan 2022 - Jan 2022 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2005 - Mar 2020 - - 4. - Razvan Crainea (@razvancrainea) - Jun 2011 - Sep 2019 - 5. Vlad Patrascu (@rvlad-patrascu) diff --git a/modules/domain/domain_mod.c b/modules/domain/domain_mod.c index 344544c161e..08537cb50a8 100644 --- a/modules/domain/domain_mod.c +++ b/modules/domain/domain_mod.c @@ -250,7 +250,7 @@ static int mod_init(void) static int child_init(int rank) { /* Check if database is needed by worker processes only */ - if ( db_mode==0 && (rank>=1) ) { + if (rank >= 1) { if (domain_db_init(&db_url)<0) { LM_ERR("Unable to connect to the database\n"); return -1; diff --git a/modules/drouting/Makefile b/modules/drouting/Makefile index c14e1cf727e..72d79eff1ec 100644 --- a/modules/drouting/Makefile +++ b/modules/drouting/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/drouting/README b/modules/drouting/README index e44edda8b48..fe5c11ca394 100644 --- a/modules/drouting/README +++ b/modules/drouting/README @@ -817,8 +817,16 @@ modparam("drouting", "gw_socket_filter_mode", "ignore") which node in the cluster will perform the pinging/probing to gateways. See the cluster_sharing_tag option. + This OpenSIPS cluster exposes the "drouting-status-repl" + capability in order to mark nodes as eligible for becoming data + donors during an arbitrary sync request. Consequently, the + cluster must have at least one node marked with the "seed" + value as the clusterer.flags column/property in order to be + fully functional. Consult the clusterer - Capabilities chapter + for more details. + For more info on how to define and populate a cluster (with - OpenSIPS nodes) see the "clusterer" module. + OpenSIPS nodes) see the clusterer module. Default value is “0 (none)”. @@ -1881,8 +1889,8 @@ Chapter 3. Contributors Table 3.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Bogdan-Andrei Iancu (@bogdan-iancu) 408 200 13802 5820 - 2. Liviu Chircu (@liviuchircu) 156 92 2503 2608 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) 411 202 13810 5824 + 2. Liviu Chircu (@liviuchircu) 160 96 2513 2613 3. Razvan Crainea (@razvancrainea) 100 53 1171 2226 4. Mihai Tiganus (@tallicamike) 71 20 4301 910 5. Vlad Patrascu (@rvlad-patrascu) 41 20 1100 735 @@ -1920,16 +1928,16 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Nov 2012 - Dec 2023 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2008 - Nov 2024 2. Razvan Crainea (@razvancrainea) Sep 2010 - Oct 2023 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2008 - May 2023 - 4. wangdd May 2023 - May 2023 - 5. MayamaTakeshi Apr 2023 - Apr 2023 - 6. nexbridge Feb 2023 - Mar 2023 - 7. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 8. Vlad Patrascu (@rvlad-patrascu) Mar 2017 - Jul 2022 - 9. Nick Altmann (@nikbyte) Mar 2013 - May 2021 - 10. Walter Doekes (@wdoekes) May 2014 - Apr 2021 + 3. wangdd May 2023 - May 2023 + 4. MayamaTakeshi Apr 2023 - Apr 2023 + 5. nexbridge Feb 2023 - Mar 2023 + 6. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 + 7. Vlad Patrascu (@rvlad-patrascu) Mar 2017 - Jul 2022 + 8. Nick Altmann (@nikbyte) Mar 2013 - May 2021 + 9. Walter Doekes (@wdoekes) May 2014 - Apr 2021 + 10. Liviu Chircu (@liviuchircu) Nov 2012 - Apr 2021 All remaining contributors: Aron Podrigal (@ar45), Vlad Paiu (@vladpaiu), Alexey Vasilyev (@vasilevalex), Peter Lemenkov @@ -1947,8 +1955,8 @@ Chapter 4. Documentation 4.1. Contributors - Last edited by: Razvan Crainea (@razvancrainea), wangdd, Liviu - Chircu (@liviuchircu), Vlad Patrascu (@rvlad-patrascu), + Last edited by: Liviu Chircu (@liviuchircu), Razvan Crainea + (@razvancrainea), wangdd, Vlad Patrascu (@rvlad-patrascu), Bogdan-Andrei Iancu (@bogdan-iancu), Nick Altmann (@nikbyte), Alexey Vasilyev (@vasilevalex), Peter Lemenkov (@lemenkov), Ionut Ionita (@ionutrazvanionita), Vlad Paiu (@vladpaiu), Mihai diff --git a/modules/drouting/doc/contributors.xml b/modules/drouting/doc/contributors.xml index c04d8487e3a..ac9a11163fe 100644 --- a/modules/drouting/doc/contributors.xml +++ b/modules/drouting/doc/contributors.xml @@ -21,18 +21,18 @@ 1. Bogdan-Andrei Iancu (@bogdan-iancu) - 408 - 200 - 13802 - 5820 + 411 + 202 + 13810 + 5824 2. Liviu Chircu (@liviuchircu) - 156 - 92 - 2503 - 2608 + 160 + 96 + 2513 + 2613 3. @@ -128,8 +128,8 @@ 1. - Liviu Chircu (@liviuchircu) - Nov 2012 - Dec 2023 + Bogdan-Andrei Iancu (@bogdan-iancu) + Oct 2008 - Nov 2024 2. @@ -138,44 +138,44 @@ 3. - Bogdan-Andrei Iancu (@bogdan-iancu) - Oct 2008 - May 2023 - - - 4. wangdd May 2023 - May 2023 - 5. + 4. MayamaTakeshi Apr 2023 - Apr 2023 - 6. + 5. nexbridge Feb 2023 - Mar 2023 - 7. + 6. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 8. + 7. Vlad Patrascu (@rvlad-patrascu) Mar 2017 - Jul 2022 - 9. + 8. Nick Altmann (@nikbyte) Mar 2013 - May 2021 - 10. + 9. Walter Doekes (@wdoekes) May 2014 - Apr 2021 + + 10. + Liviu Chircu (@liviuchircu) + Nov 2012 - Apr 2021 + @@ -190,7 +190,7 @@ Documentation
Contributors - Last edited by: Razvan Crainea (@razvancrainea), wangdd, Liviu Chircu (@liviuchircu), Vlad Patrascu (@rvlad-patrascu), Bogdan-Andrei Iancu (@bogdan-iancu), Nick Altmann (@nikbyte), Alexey Vasilyev (@vasilevalex), Peter Lemenkov (@lemenkov), Ionut Ionita (@ionutrazvanionita), Vlad Paiu (@vladpaiu), Mihai Tiganus (@tallicamike), Andrei Datcu (@andrei-datcu), Matt Lehner, Anca Vamanu, Andrei Dragus, Sergio Gutierrez. + Last edited by: Liviu Chircu (@liviuchircu), Razvan Crainea (@razvancrainea), wangdd, Vlad Patrascu (@rvlad-patrascu), Bogdan-Andrei Iancu (@bogdan-iancu), Nick Altmann (@nikbyte), Alexey Vasilyev (@vasilevalex), Peter Lemenkov (@lemenkov), Ionut Ionita (@ionutrazvanionita), Vlad Paiu (@vladpaiu), Mihai Tiganus (@tallicamike), Andrei Datcu (@andrei-datcu), Matt Lehner, Anca Vamanu, Andrei Dragus, Sergio Gutierrez.
diff --git a/modules/drouting/doc/drouting.xml b/modules/drouting/doc/drouting.xml index 861b0f1ca44..400775c9df3 100644 --- a/modules/drouting/doc/drouting.xml +++ b/modules/drouting/doc/drouting.xml @@ -6,6 +6,8 @@ + + diff --git a/modules/drouting/doc/drouting_admin.xml b/modules/drouting/doc/drouting_admin.xml index 93036ecdc18..9c6f587653a 100644 --- a/modules/drouting/doc/drouting_admin.xml +++ b/modules/drouting/doc/drouting_admin.xml @@ -1011,9 +1011,12 @@ modparam("drouting", "gw_socket_filter_mode", "ignore") gateways. See the option.
+ + &clusterer_sync_cap_para; + For more info on how to define and populate a cluster (with OpenSIPS - nodes) see the "clusterer" module. + nodes) see the clusterer module. diff --git a/modules/drouting/dr_api_internal.c b/modules/drouting/dr_api_internal.c index 7e0ac5d1a7c..eded882aa34 100644 --- a/modules/drouting/dr_api_internal.c +++ b/modules/drouting/dr_api_internal.c @@ -77,6 +77,8 @@ rt_info_t* find_rule_by_prefix_unsafe(ptree_t *pt, ptree_node_t *noprefix, rt_info = get_prefix(pt, &prefix, grp_id,matched_len, &rule_idx); if (rt_info==NULL) { + *matched_len = 0; + LM_DBG("no matching for prefix \"%.*s\"\n", prefix.len, prefix.s); diff --git a/modules/drouting/dr_clustering.c b/modules/drouting/dr_clustering.c index 7a0ef9b3f0d..81cfe242c10 100644 --- a/modules/drouting/dr_clustering.c +++ b/modules/drouting/dr_clustering.c @@ -181,14 +181,16 @@ static int gw_status_update(bin_packet_t *packet, int raise_event) lock_start_read(part->ref_lock); gw = get_gw_by_id(part->rdata->pgw_tree, &gw_id); - if (gw && ((gw->flags&DR_DST_STAT_MASK)!=flags)) { - /* import the status flags */ - gw->flags = ((~DR_DST_STAT_MASK)&gw->flags) | (DR_DST_STAT_MASK&flags); - /* set the DIRTY flag to force flushing to DB */ - gw->flags |= DR_DST_STAT_DIRT_FLAG; - if (raise_event) - /* raise event for the status change */ - dr_raise_event(part, gw, MI_SSTR("replicated info")); + if (gw) { + if ((gw->flags&DR_DST_STAT_MASK)!=flags) { + /* import the status flags */ + gw->flags = ((~DR_DST_STAT_MASK)&gw->flags) | (DR_DST_STAT_MASK&flags); + /* set the DIRTY flag to force flushing to DB */ + gw->flags |= DR_DST_STAT_DIRT_FLAG; + if (raise_event) + /* raise event for the status change */ + dr_raise_event(part, gw, MI_SSTR("replicated info")); + } lock_stop_read(part->ref_lock); return 0; } @@ -218,12 +220,14 @@ static int cr_status_update(bin_packet_t *packet) lock_start_read(part->ref_lock); cr = get_carrier_by_id(part->rdata->carriers_tree, &cr_id); - if (cr && ((cr->flags&DR_CR_FLAG_IS_OFF)!=flags)) { - /* import the status flags */ - cr->flags = ((~DR_CR_FLAG_IS_OFF)&cr->flags)|(DR_CR_FLAG_IS_OFF&flags); - /* set the DIRTY flag to force flushing to DB */ - cr->flags |= DR_CR_FLAG_DIRTY; - dr_raise_cr_event( part, cr, MI_SSTR("replicated info")); + if (cr) { + if ((cr->flags&DR_CR_FLAG_IS_OFF)!=flags) { + /* import the status flags */ + cr->flags = ((~DR_CR_FLAG_IS_OFF)&cr->flags)|(DR_CR_FLAG_IS_OFF&flags); + /* set the DIRTY flag to force flushing to DB */ + cr->flags |= DR_CR_FLAG_DIRTY; + dr_raise_cr_event( part, cr, MI_SSTR("replicated info")); + } lock_stop_read(part->ref_lock); return 0; } diff --git a/modules/drouting/drouting.c b/modules/drouting/drouting.c index c946bde5623..c3542d46c5c 100644 --- a/modules/drouting/drouting.c +++ b/modules/drouting/drouting.c @@ -2012,8 +2012,8 @@ static int dr_init(void) if( (*db_part->db_con = db_part->db_funcs.init(&db_part->db_url)) == 0) { - LM_ERR("failed to connect to db url <%.*s>\n", - db_part->db_url.len, db_part->db_url.s); + LM_ERR("failed to connect to db url <%s>\n", + db_url_escape(&db_part->db_url)); goto error_cfg; } @@ -2926,11 +2926,11 @@ static int weight_based_sort(pgw_list_t *pgwl, int size, unsigned short *idx) } if (weight_sum) { /* randomly select number */ - rand_no = (unsigned int)(weight_sum*((double)rand()/((double)RAND_MAX))); + rand_no = (unsigned int)(weight_sum*((double)rand()/((double)1+RAND_MAX))); LM_DBG("random number is %d\n",rand_no); /* select the element */ for( i=first ; i=rand_no) break; + if (running_sum[i]>rand_no) break; if (i==size) { LM_CRIT("bug in weight sort, first=%u, size=%u, rand_no=%u, total weight=%u\n", first, size, rand_no, weight_sum); diff --git a/modules/event_kafka/README b/modules/event_kafka/README index beca286d4aa..aee2972323d 100644 --- a/modules/event_kafka/README +++ b/modules/event_kafka/README @@ -44,8 +44,7 @@ event_kafka Module 1.1. Set broker_id parameter 1.2. kafka_publish() function usage - 1.3. E_PIKE_BLOCKED event - 1.4. Kafka socket + 1.3. Kafka socket Chapter 1. Admin Guide @@ -178,18 +177,7 @@ vp(kafka_id)\n"); 1.7. Examples - Example 1.3. E_PIKE_BLOCKED event - -{ - "jsonrpc": "2.0", - "method": "E_PIKE_BLOCKED", - "params": { - "ip": "192.168.2.11" - } -} - - - Example 1.4. Kafka socket + Example 1.3. Kafka socket kafka:127.0.0.1:9092/topic1?t.message.timeout.ms=1000&key=callid @@ -202,8 +190,9 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Vlad Patrascu (@rvlad-patrascu) 25 8 1933 31 - 2. Maksym Sobolyev (@sobomax) 4 2 5 5 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) 3 1 25 21 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) 4 2 25 37 + 3. Maksym Sobolyev (@sobomax) 4 2 5 5 + 4. Razvan Crainea (@razvancrainea) 2 1 1 0 (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -225,9 +214,10 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Vlad Patrascu (@rvlad-patrascu) Aug 2020 - Jun 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) May 2023 - May 2023 - 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 1. Razvan Crainea (@razvancrainea) Jul 2024 - Jul 2024 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) May 2023 - Jun 2024 + 3. Vlad Patrascu (@rvlad-patrascu) Aug 2020 - Jun 2023 + 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 (1) including any documentation-related commits, excluding merge commits @@ -236,7 +226,8 @@ Chapter 3. Documentation 3.1. Contributors - Last edited by: Vlad Patrascu (@rvlad-patrascu). + Last edited by: Razvan Crainea (@razvancrainea), Bogdan-Andrei + Iancu (@bogdan-iancu), Vlad Patrascu (@rvlad-patrascu). Documentation Copyrights: diff --git a/modules/event_kafka/doc/contributors.xml b/modules/event_kafka/doc/contributors.xml index b9e56f15895..88cb0e41678 100644 --- a/modules/event_kafka/doc/contributors.xml +++ b/modules/event_kafka/doc/contributors.xml @@ -28,6 +28,14 @@
2. + Bogdan-Andrei Iancu (@bogdan-iancu) + 4 + 2 + 25 + 37 + + + 3. Maksym Sobolyev (@sobomax) 4 2 @@ -35,12 +43,12 @@ 5 - 3. - Bogdan-Andrei Iancu (@bogdan-iancu) - 3 + 4. + Razvan Crainea (@razvancrainea) + 2 1 - 25 - 21 + 1 + 0 @@ -72,16 +80,21 @@ 1. - Vlad Patrascu (@rvlad-patrascu) - Aug 2020 - Jun 2023 + Razvan Crainea (@razvancrainea) + Jul 2024 - Jul 2024 2. Bogdan-Andrei Iancu (@bogdan-iancu) - May 2023 - May 2023 + May 2023 - Jun 2024 3. + Vlad Patrascu (@rvlad-patrascu) + Aug 2020 - Jun 2023 + + + 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 @@ -99,7 +112,7 @@ Documentation
Contributors - Last edited by: Vlad Patrascu (@rvlad-patrascu). + Last edited by: Razvan Crainea (@razvancrainea), Bogdan-Andrei Iancu (@bogdan-iancu), Vlad Patrascu (@rvlad-patrascu).
diff --git a/modules/event_kafka/doc/event_kafka_admin.xml b/modules/event_kafka/doc/event_kafka_admin.xml index 8c0c47dbdca..9a2a15acb8c 100644 --- a/modules/event_kafka/doc/event_kafka_admin.xml +++ b/modules/event_kafka/doc/event_kafka_admin.xml @@ -230,21 +230,6 @@ modparam("event_kafka", "broker_id", "[k1]127.0.0.1:9092/topic1?g.linger.ms=100&
Examples - - E_PIKE_BLOCKED event - - - - - Kafka socket diff --git a/modules/event_route/README b/modules/event_route/README index f234d3a4411..c933447e7d5 100644 --- a/modules/event_route/README +++ b/modules/event_route/README @@ -177,7 +177,7 @@ Chapter 3. Contributors Table 3.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Razvan Crainea (@razvancrainea) 39 24 992 316 + 1. Razvan Crainea (@razvancrainea) 40 25 993 317 2. Bogdan-Andrei Iancu (@bogdan-iancu) 18 9 142 400 3. Liviu Chircu (@liviuchircu) 13 11 27 47 4. Ionut Ionita (@ionutrazvanionita) 8 5 138 51 @@ -210,10 +210,10 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jun 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - May 2023 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - Mar 2023 - 4. Razvan Crainea (@razvancrainea) Dec 2012 - Mar 2023 + 1. Razvan Crainea (@razvancrainea) Dec 2012 - Apr 2024 + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jun 2023 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - May 2023 + 4. Liviu Chircu (@liviuchircu) Mar 2014 - Mar 2023 5. Maksym Sobolyev (@sobomax) Feb 2021 - Feb 2023 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Vlad Paiu (@vladpaiu) Jun 2016 - Jun 2016 diff --git a/modules/event_route/doc/contributors.xml b/modules/event_route/doc/contributors.xml index acb1b2f995a..ab9f9224fbf 100644 --- a/modules/event_route/doc/contributors.xml +++ b/modules/event_route/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Razvan Crainea (@razvancrainea) - 39 - 24 - 992 - 316 + 40 + 25 + 993 + 317 2. @@ -128,24 +128,24 @@ 1. + Razvan Crainea (@razvancrainea) + Dec 2012 - Apr 2024 + + + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jun 2023 - 2. + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - May 2023 - 3. + 4. Liviu Chircu (@liviuchircu) Mar 2014 - Mar 2023 - - 4. - Razvan Crainea (@razvancrainea) - Dec 2012 - Mar 2023 - 5. Maksym Sobolyev (@sobomax) diff --git a/modules/event_route/event_route.c b/modules/event_route/event_route.c index 17d133b4f27..b79e519f752 100644 --- a/modules/event_route/event_route.c +++ b/modules/event_route/event_route.c @@ -324,7 +324,7 @@ int event_route_param_get(struct sip_msg *msg, pv_param_t *ip, /* parameter found - populate it */ if (it->flags & EVI_INT_VAL) { - res->rs.s = int2str(it->val.n, &res->rs.len); + res->rs.s = sint2str(it->val.n, &res->rs.len); res->ri = it->val.n; res->flags = PV_VAL_STR|PV_VAL_INT|PV_TYPE_INT; } else { diff --git a/modules/event_routing/README b/modules/event_routing/README index ff7b53dc127..baddf2f509f 100644 --- a/modules/event_routing/README +++ b/modules/event_routing/README @@ -376,14 +376,15 @@ Chapter 4. Contributors Table 4.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Bogdan-Andrei Iancu (@bogdan-iancu) 28 12 1801 52 - 2. Liviu Chircu (@liviuchircu) 27 19 487 198 + 1. Liviu Chircu (@liviuchircu) 29 20 494 220 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) 28 12 1801 52 3. Vlad Patrascu (@rvlad-patrascu) 9 5 75 148 4. Razvan Crainea (@razvancrainea) 6 4 9 5 5. Fabian Gast (@fgast) 4 2 27 7 6. Maksym Sobolyev (@sobomax) 4 2 5 6 - 7. Zero King (@l2dy) 3 1 2 2 - 8. Peter Lemenkov (@lemenkov) 3 1 1 1 + 7. Vlad Paiu (@vladpaiu) 3 1 8 1 + 8. Zero King (@l2dy) 3 1 2 2 + 9. Peter Lemenkov (@lemenkov) 3 1 1 1 (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -405,14 +406,15 @@ Chapter 4. Contributors Table 4.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Sep 2017 - May 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2017 - May 2023 - 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2020 - 5. Zero King (@l2dy) Mar 2020 - Mar 2020 - 6. Razvan Crainea (@razvancrainea) Apr 2017 - Sep 2019 - 7. Fabian Gast (@fgast) Nov 2018 - Dec 2018 - 8. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 + 1. Liviu Chircu (@liviuchircu) Sep 2017 - Nov 2024 + 2. Vlad Paiu (@vladpaiu) Nov 2024 - Nov 2024 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2017 - May 2023 + 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2020 + 6. Zero King (@l2dy) Mar 2020 - Mar 2020 + 7. Razvan Crainea (@razvancrainea) Apr 2017 - Sep 2019 + 8. Fabian Gast (@fgast) Nov 2018 - Dec 2018 + 9. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 (1) including any documentation-related commits, excluding merge commits diff --git a/modules/event_routing/doc/contributors.xml b/modules/event_routing/doc/contributors.xml index cf66fd8e0c5..3d269f246e3 100644 --- a/modules/event_routing/doc/contributors.xml +++ b/modules/event_routing/doc/contributors.xml @@ -20,20 +20,20 @@ 1. + Liviu Chircu (@liviuchircu) + 29 + 20 + 494 + 220 + + + 2. Bogdan-Andrei Iancu (@bogdan-iancu) 28 12 1801 52 - - 2. - Liviu Chircu (@liviuchircu) - 27 - 19 - 487 - 198 - 3. Vlad Patrascu (@rvlad-patrascu) @@ -68,6 +68,14 @@ 7. + Vlad Paiu (@vladpaiu) + 3 + 1 + 8 + 1 + + + 8. Zero King (@l2dy) 3 1 @@ -75,7 +83,7 @@ 2 - 8. + 9. Peter Lemenkov (@lemenkov) 3 1 @@ -113,40 +121,45 @@ 1. Liviu Chircu (@liviuchircu) - Sep 2017 - May 2023 + Sep 2017 - Nov 2024 2. + Vlad Paiu (@vladpaiu) + Nov 2024 - Nov 2024 + + + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2017 - May 2023 - 3. + 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 4. + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2020 - 5. + 6. Zero King (@l2dy) Mar 2020 - Mar 2020 - 6. + 7. Razvan Crainea (@razvancrainea) Apr 2017 - Sep 2019 - 7. + 8. Fabian Gast (@fgast) Nov 2018 - Dec 2018 - 8. + 9. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/event_routing/ebr_data.c b/modules/event_routing/ebr_data.c index 01e74ba8d94..0401342c708 100644 --- a/modules/event_routing/ebr_data.c +++ b/modules/event_routing/ebr_data.c @@ -476,9 +476,8 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params) /* check the EBR subscription on this event and apply the filters */ sub_prev = NULL; - sub_next = NULL; - for ( sub=ev->subs ; sub ; sub_prev=sub, - sub=sub_next?sub_next:(sub?sub->next:NULL) ) { + for ( sub=ev->subs ; sub ; sub_prev=sub, sub=sub_next) { + sub_next = sub->next; /* discard expired subscriptions */ if (sub->expirenext; + /* unlink it */ if (sub_prev) sub_prev->next = sub_next; else ev->subs = sub_next; @@ -522,7 +520,6 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params) /* run the filters */ matches = 1; - sub_next = NULL; for ( filter=sub->filters ; matches && filter ; filter=filter->next ) { /* look for the evi param with the same name */ @@ -593,9 +590,7 @@ int notify_ebr_subscriptions( ebr_event *ev, evi_params_t *params) LM_ERR("failed to send job via IPC, skipping...\n"); shm_free(job); } - /* remove the subscription, as it can be triggered only - * one time */ - sub_next = sub->next; + /* unlink it */ if (sub_prev) sub_prev->next = sub_next; else ev->subs = sub_next; @@ -649,9 +644,8 @@ void ebr_timeout(unsigned int ticks, void* param) /* check the EBR subscriptions on this event */ sub_prev = NULL; - sub_next = NULL; - for ( sub=ev->subs ; sub ; sub_prev=sub, - sub=sub_next?sub_next:(sub?sub->next:NULL) ) { + for ( sub=ev->subs ; sub ; sub_prev=sub, sub=sub_next ) { + sub_next = sub->next; /* skip valid and non WAIT subscriptions */ if ( (sub->flags&EBR_SUBS_TYPE_WAIT)==0 || sub->expire>my_time ) @@ -683,8 +677,6 @@ void ebr_timeout(unsigned int ticks, void* param) continue; /* with the next subscription */ } - /* remove the subscription */ - sub_next = sub->next; /* unlink it */ if (sub_prev) sub_prev->next = sub_next; else ev->subs = sub_next; diff --git a/modules/event_stream/README b/modules/event_stream/README index aaf1a5b23a6..c456015e1c7 100644 --- a/modules/event_stream/README +++ b/modules/event_stream/README @@ -294,7 +294,7 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Razvan Crainea (@razvancrainea) 31 14 1802 100 2. Vlad Patrascu (@rvlad-patrascu) 10 6 105 145 - 3. Liviu Chircu (@liviuchircu) 6 4 13 33 + 3. Liviu Chircu (@liviuchircu) 7 5 14 34 4. Bogdan-Andrei Iancu (@bogdan-iancu) 4 2 7 9 5. Maksym Sobolyev (@sobomax) 4 2 3 4 6. Peter Lemenkov (@lemenkov) 4 2 2 2 @@ -319,12 +319,12 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Vlad Patrascu (@rvlad-patrascu) May 2020 - Jun 2023 - 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 3. Peter Lemenkov (@lemenkov) Jun 2018 - Aug 2020 - 4. Razvan Crainea (@razvancrainea) Mar 2018 - Jan 2020 - 5. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2019 - Apr 2019 - 6. Liviu Chircu (@liviuchircu) Apr 2018 - Nov 2018 + 1. Liviu Chircu (@liviuchircu) Apr 2018 - Mar 2025 + 2. Vlad Patrascu (@rvlad-patrascu) May 2020 - Jun 2023 + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 4. Peter Lemenkov (@lemenkov) Jun 2018 - Aug 2020 + 5. Razvan Crainea (@razvancrainea) Mar 2018 - Jan 2020 + 6. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2019 - Apr 2019 (1) including any documentation-related commits, excluding merge commits diff --git a/modules/event_stream/doc/contributors.xml b/modules/event_stream/doc/contributors.xml index 57d6a7e4eb5..5c27583e8a5 100644 --- a/modules/event_stream/doc/contributors.xml +++ b/modules/event_stream/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 6 - 4 - 13 - 33 + 7 + 5 + 14 + 34 4. @@ -96,34 +96,34 @@ 1. + Liviu Chircu (@liviuchircu) + Apr 2018 - Mar 2025 + + + 2. Vlad Patrascu (@rvlad-patrascu) May 2020 - Jun 2023 - 2. + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 3. + 4. Peter Lemenkov (@lemenkov) Jun 2018 - Aug 2020 - 4. + 5. Razvan Crainea (@razvancrainea) Mar 2018 - Jan 2020 - 5. + 6. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2019 - Apr 2019 - - 6. - Liviu Chircu (@liviuchircu) - Apr 2018 - Nov 2018 - diff --git a/modules/event_stream/stream_send.c b/modules/event_stream/stream_send.c index 8df0a5c72b8..1d6967a5aa2 100644 --- a/modules/event_stream/stream_send.c +++ b/modules/event_stream/stream_send.c @@ -574,7 +574,7 @@ static void handle_reply_jsonrpc(struct stream_con *con) } } else if (con->pending_buffer.len) { pkg_free(con->pending_buffer.s); - con->pending_buffer.len = 0; + con->pending_buffer = STR_NULL; con->pending_reads = 0; } } while (reply && buf.len); diff --git a/modules/exec/Makefile b/modules/exec/Makefile index ed26c2d40de..62447639fd1 100644 --- a/modules/exec/Makefile +++ b/modules/exec/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # exec module makefile # # diff --git a/modules/exec/README b/modules/exec/README index b08ecdc7c1b..7c9f0c97ae6 100644 --- a/modules/exec/README +++ b/modules/exec/README @@ -247,7 +247,7 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 44 29 651 534 - 2. Liviu Chircu (@liviuchircu) 39 22 344 825 + 2. Liviu Chircu (@liviuchircu) 40 23 344 827 3. Jiri Kuthan (@jiriatipteldotorg) 27 11 1579 152 4. Daniel-Constantin Mierla (@miconda) 26 19 440 131 5. Razvan Crainea (@razvancrainea) 20 16 320 59 @@ -284,8 +284,8 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Liviu Chircu (@liviuchircu) Feb 2014 - Jul 2020 + 1. Liviu Chircu (@liviuchircu) Feb 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2004 - Apr 2020 4. Zero King (@l2dy) Mar 2020 - Mar 2020 5. Razvan Crainea (@razvancrainea) Jun 2011 - Jan 2020 diff --git a/modules/exec/doc/contributors.xml b/modules/exec/doc/contributors.xml index 2ade045f076..a8e2d4adde5 100644 --- a/modules/exec/doc/contributors.xml +++ b/modules/exec/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 39 - 22 + 40 + 23 344 - 825 + 827 3. @@ -128,13 +128,13 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Feb 2014 - May 2024 2. - Liviu Chircu (@liviuchircu) - Feb 2014 - Jul 2020 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 3. diff --git a/modules/freeswitch/README b/modules/freeswitch/README index c1e75e1ac95..05ed06cc6dd 100644 --- a/modules/freeswitch/README +++ b/modules/freeswitch/README @@ -124,7 +124,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Liviu Chircu (@liviuchircu) 108 49 4109 1519 + 1. Liviu Chircu (@liviuchircu) 110 51 4134 1528 2. Razvan Crainea (@razvancrainea) 12 10 30 21 3. Vlad Patrascu (@rvlad-patrascu) 5 3 21 41 4. Bogdan-Andrei Iancu (@bogdan-iancu) 5 3 8 5 @@ -152,7 +152,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Jan 2017 - Nov 2023 + 1. Liviu Chircu (@liviuchircu) Jan 2017 - May 2024 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 3. Razvan Crainea (@razvancrainea) Feb 2017 - Jul 2021 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2018 - Apr 2021 diff --git a/modules/freeswitch/doc/contributors.xml b/modules/freeswitch/doc/contributors.xml index bf19ac99ad4..108358cb6a4 100644 --- a/modules/freeswitch/doc/contributors.xml +++ b/modules/freeswitch/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Liviu Chircu (@liviuchircu) - 108 - 49 - 4109 - 1519 + 110 + 51 + 4134 + 1528 2. @@ -105,7 +105,7 @@ 1. Liviu Chircu (@liviuchircu) - Jan 2017 - Nov 2023 + Jan 2017 - May 2024 2. diff --git a/modules/freeswitch/fs_api.c b/modules/freeswitch/fs_api.c index 8f4c51474f8..8b563704b7e 100644 --- a/modules/freeswitch/fs_api.c +++ b/modules/freeswitch/fs_api.c @@ -29,6 +29,7 @@ #include "../../forward.h" #include "../../ut.h" #include "../../lib/url.h" +#include "../../status_report.h" #include "fs_api.h" #include "fs_ipc.h" @@ -152,6 +153,8 @@ void evs_free(fs_evs *sock) lock_destroy_rw(sock->lists_lk); memset(sock, 0, sizeof *sock); + + sock->invalid = 1; /* safety check against dangling fds in reactor */ shm_free(sock); } @@ -584,7 +587,7 @@ void put_evs(fs_evs *sock) * possible, since the main process brutally murders the FS connection * manager before it gets a chance to gracefully EOF its TCP connections. */ - if (is_main) + if (sr_get_core_status() == STATE_TERMINATING) return; lock_start_write(sockets_lock); diff --git a/modules/freeswitch/fs_api.h b/modules/freeswitch/fs_api.h index 350c774a79d..b5aa502534e 100644 --- a/modules/freeswitch/fs_api.h +++ b/modules/freeswitch/fs_api.h @@ -98,6 +98,7 @@ struct _fs_evs { fs_stats stats; int ref; + int invalid; rw_lock_t *lists_lk; /* protects all three internal lists */ diff --git a/modules/freeswitch/fs_proc.c b/modules/freeswitch/fs_proc.c index 934d33e9081..305b6b57d09 100644 --- a/modules/freeswitch/fs_proc.c +++ b/modules/freeswitch/fs_proc.c @@ -54,19 +54,31 @@ extern void fs_api_set_proc_no(void); extern void evs_free(fs_evs *sock); extern struct fs_event *get_event(fs_evs *sock, const str *name); -static void destroy_fs_evs(fs_evs *sock, int idx) +static void destroy_fs_evs(fs_evs *sock, int idx, int reactor_fd) { esl_status_t rc; + int fd; - LM_DBG("destroying sock %s:%d\n", sock->host.s, sock->port); + if (sock->invalid) { + LM_BUG("attempting to destroy dangling socket (fd: %d, idx: %d)\n", + reactor_fd, idx); + return; + } + + if (reactor_fd >= 0 && reactor_fd != sock->handle->sock) + LM_BUG("different reactor/esl-handle fds: %d/%d\n", + reactor_fd, sock->handle->sock); + + fd = (reactor_fd >= 0 ? reactor_fd : sock->handle->sock); + LM_DBG("destroying sock %s:%d (fd: %d)\n", sock->host.s, sock->port, fd); - if (idx > 0 && reactor_del_reader(sock->handle->sock, idx, IO_FD_CLOSING) != 0) { - LM_ERR("failed to delete sock %d, idx %d\n", sock->handle->sock, idx); + if (idx >= 0 && reactor_del_reader(fd, idx, IO_FD_CLOSING) != 0) { + LM_ERR("failed to delete sock %d, idx %d\n", fd, idx); idx = -1; } - if (idx < 0 && reactor_del_reader(sock->handle->sock, -1, IO_FD_CLOSING) != 0) - LM_DBG("failed to delete sock %d, idx -1\n", sock->handle->sock); + if (idx < 0 && reactor_del_reader(fd, -1, IO_FD_CLOSING) != 0) + LM_DBG("failed to delete sock %d, idx -1\n", fd); rc = esl_disconnect(sock->handle); if (rc != ESL_SUCCESS) @@ -208,7 +220,7 @@ inline static int handle_io(struct fd_map *fm, int idx, int event_type) /* ignore the event: nobody's using this socket anymore, close it */ lock_start_write(sockets_lock); if (sock->ref == 0) { - destroy_fs_evs(sock, idx); + destroy_fs_evs(sock, idx, fm->fd); lock_stop_write(sockets_lock); return 0; } @@ -474,7 +486,7 @@ void handle_reconnects(void) if (sock->handle) { if (sock->handle->connected && sock->handle->sock != ESL_SOCK_INVALID) { if (!SHOULD_KEEP_EVS(sock)) { - destroy_fs_evs(sock, -1); + destroy_fs_evs(sock, -1, -1); continue; } diff --git a/modules/gflags/Makefile b/modules/gflags/Makefile index d08b3988627..58703cb5a4a 100644 --- a/modules/gflags/Makefile +++ b/modules/gflags/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # print example module makefile # # diff --git a/modules/gflags/README b/modules/gflags/README index 32b23594e1c..13b00a2bdc7 100644 --- a/modules/gflags/README +++ b/modules/gflags/README @@ -221,7 +221,7 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 41 31 423 326 2. Daniel-Constantin Mierla (@miconda) 14 12 42 22 - 3. Liviu Chircu (@liviuchircu) 12 10 27 57 + 3. Liviu Chircu (@liviuchircu) 13 11 27 59 4. Razvan Crainea (@razvancrainea) 10 8 26 24 5. Henning Westerholt (@henningw) 8 6 42 31 6. Jiri Kuthan (@jiriatipteldotorg) 8 4 278 4 @@ -255,9 +255,9 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2005 - Oct 2022 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - Jan 2021 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2005 - Oct 2022 4. Razvan Crainea (@razvancrainea) Sep 2011 - Sep 2019 5. Dan Pascu (@danpascu) May 2019 - May 2019 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 diff --git a/modules/gflags/doc/contributors.xml b/modules/gflags/doc/contributors.xml index 3cf9153d108..25e458b5a2f 100644 --- a/modules/gflags/doc/contributors.xml +++ b/modules/gflags/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 12 - 10 + 13 + 11 27 - 57 + 59 4. @@ -128,18 +128,18 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Bogdan-Andrei Iancu (@bogdan-iancu) - Oct 2005 - Oct 2022 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jan 2021 + Bogdan-Andrei Iancu (@bogdan-iancu) + Oct 2005 - Oct 2022 4. diff --git a/modules/group/Makefile b/modules/group/Makefile index a1d8bff2d46..89f8e8eedbb 100644 --- a/modules/group/Makefile +++ b/modules/group/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # group example module makefile # # diff --git a/modules/group/README b/modules/group/README index 226329e54cb..12e7bfccf42 100644 --- a/modules/group/README +++ b/modules/group/README @@ -366,7 +366,7 @@ Chapter 2. Contributors 1. Bogdan-Andrei Iancu (@bogdan-iancu) 45 31 848 397 2. Jan Janak (@janakj) 35 20 1370 148 3. Daniel-Constantin Mierla (@miconda) 24 18 176 226 - 4. Liviu Chircu (@liviuchircu) 15 11 87 152 + 4. Liviu Chircu (@liviuchircu) 16 12 87 154 5. Razvan Crainea (@razvancrainea) 9 7 16 39 6. Irina-Maria Stanescu 9 4 466 59 7. Andrei Pelinescu-Onciul 7 5 101 40 @@ -400,10 +400,10 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Jun 2011 - Jun 2021 - 3. Walter Doekes (@wdoekes) Apr 2021 - Apr 2021 - 4. Liviu Chircu (@liviuchircu) Mar 2014 - May 2020 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Jun 2011 - Jun 2021 + 4. Walter Doekes (@wdoekes) Apr 2021 - Apr 2021 5. Peter Lemenkov (@lemenkov) Jun 2018 - May 2020 6. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2005 - Mar 2020 7. Dan Pascu (@danpascu) Oct 2007 - Apr 2019 diff --git a/modules/group/doc/contributors.xml b/modules/group/doc/contributors.xml index ddf128e99f7..98f6019e30b 100644 --- a/modules/group/doc/contributors.xml +++ b/modules/group/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 15 - 11 + 16 + 12 87 - 152 + 154 5. @@ -128,24 +128,24 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Jun 2011 - Jun 2021 - 3. + 4. Walter Doekes (@wdoekes) Apr 2021 - Apr 2021 - - 4. - Liviu Chircu (@liviuchircu) - Mar 2014 - May 2020 - 5. Peter Lemenkov (@lemenkov) diff --git a/modules/h350/Makefile b/modules/h350/Makefile index db7a0c1c419..11fb24012b7 100644 --- a/modules/h350/Makefile +++ b/modules/h350/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # H350 # # diff --git a/modules/h350/README b/modules/h350/README index 5b39243202f..03c0568c925 100644 --- a/modules/h350/README +++ b/modules/h350/README @@ -654,7 +654,7 @@ Chapter 2. Contributors 1. Christian Schlatter 21 3 1993 1 2. Bogdan-Andrei Iancu (@bogdan-iancu) 15 13 52 50 3. Daniel-Constantin Mierla (@miconda) 12 9 79 83 - 4. Liviu Chircu (@liviuchircu) 10 8 25 37 + 4. Liviu Chircu (@liviuchircu) 11 9 25 39 5. Vlad Patrascu (@rvlad-patrascu) 9 3 80 247 6. Razvan Crainea (@razvancrainea) 8 6 51 59 7. Maksym Sobolyev (@sobomax) 4 2 3 4 @@ -682,12 +682,12 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Jun 2011 - Jul 2020 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2008 - Mar 2020 - 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 6. Liviu Chircu (@liviuchircu) Mar 2014 - Jun 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Jun 2011 - Jul 2020 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2008 - Mar 2020 + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Daniel-Constantin Mierla (@miconda) Sep 2007 - Mar 2008 8. Konstantin Bokarius Mar 2008 - Mar 2008 9. Edson Gellert Schubert Feb 2008 - Feb 2008 diff --git a/modules/h350/doc/contributors.xml b/modules/h350/doc/contributors.xml index d2bf6f0a0bd..0bf8780628f 100644 --- a/modules/h350/doc/contributors.xml +++ b/modules/h350/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 10 - 8 + 11 + 9 25 - 37 + 39 5. @@ -128,34 +128,34 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Jun 2011 - Jul 2020 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2008 - Mar 2020 - 4. + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - 6. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jun 2018 - 7. Daniel-Constantin Mierla (@miconda) diff --git a/modules/identity/Makefile b/modules/identity/Makefile index 8186f3cccb2..6d159c2950d 100644 --- a/modules/identity/Makefile +++ b/modules/identity/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/identity/README b/modules/identity/README index d8168fc31db..e952402c474 100644 --- a/modules/identity/README +++ b/modules/identity/README @@ -348,8 +348,8 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Alexander Christ 22 1 2571 0 2. Bogdan-Andrei Iancu (@bogdan-iancu) 14 12 28 19 - 3. Razvan Crainea (@razvancrainea) 11 9 82 24 - 4. Liviu Chircu (@liviuchircu) 11 8 23 67 + 3. Liviu Chircu (@liviuchircu) 12 9 23 69 + 4. Razvan Crainea (@razvancrainea) 11 9 82 24 5. Vlad Patrascu (@rvlad-patrascu) 6 4 15 16 6. Sergio Gutierrez 4 2 7 2 7. Maksym Sobolyev (@sobomax) 4 2 3 20 @@ -379,9 +379,9 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Sep 2020 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Aug 2015 - Jan 2021 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - Apr 2020 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Sep 2020 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Aug 2015 - Jan 2021 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 5. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2009 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/identity/doc/contributors.xml b/modules/identity/doc/contributors.xml index 472b15e1262..cf1c6a8ed23 100644 --- a/modules/identity/doc/contributors.xml +++ b/modules/identity/doc/contributors.xml @@ -36,19 +36,19 @@ 3. - Razvan Crainea (@razvancrainea) - 11 + Liviu Chircu (@liviuchircu) + 12 9 - 82 - 24 + 23 + 69 4. - Liviu Chircu (@liviuchircu) + Razvan Crainea (@razvancrainea) 11 - 8 - 23 - 67 + 9 + 82 + 24 5. @@ -128,18 +128,18 @@ 1. - Maksym Sobolyev (@sobomax) - Sep 2020 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Razvan Crainea (@razvancrainea) - Aug 2015 - Jan 2021 + Maksym Sobolyev (@sobomax) + Sep 2020 - Feb 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - Apr 2020 + Razvan Crainea (@razvancrainea) + Aug 2015 - Jan 2021 4. diff --git a/modules/imc/Makefile b/modules/imc/Makefile index 40e1b2ad8da..1cf10300a54 100644 --- a/modules/imc/Makefile +++ b/modules/imc/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/imc/README b/modules/imc/README index 62fbfa16346..f36b5ea9ca6 100644 --- a/modules/imc/README +++ b/modules/imc/README @@ -322,7 +322,7 @@ Chapter 2. Contributors 2. Bogdan-Andrei Iancu (@bogdan-iancu) 41 29 308 548 3. Anca Vamanu 31 5 3014 16 4. Razvan Crainea (@razvancrainea) 17 15 31 38 - 5. Liviu Chircu (@liviuchircu) 13 10 38 63 + 5. Liviu Chircu (@liviuchircu) 15 12 39 66 6. Henning Westerholt (@henningw) 10 7 76 105 7. Vlad Patrascu (@rvlad-patrascu) 9 6 75 80 8. Elena-Ramona Modroiu 4 2 68 5 @@ -353,8 +353,8 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2023 - 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 2. Liviu Chircu (@liviuchircu) Mar 2014 - Apr 2021 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2006 - Apr 2020 4. Razvan Crainea (@razvancrainea) Sep 2011 - Sep 2019 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 diff --git a/modules/imc/doc/contributors.xml b/modules/imc/doc/contributors.xml index 07a4fc6a4af..fc00cbd81ec 100644 --- a/modules/imc/doc/contributors.xml +++ b/modules/imc/doc/contributors.xml @@ -53,10 +53,10 @@ 5. Liviu Chircu (@liviuchircu) - 13 - 10 - 38 - 63 + 15 + 12 + 39 + 66 6. @@ -128,13 +128,13 @@ 1. - Liviu Chircu (@liviuchircu) - Mar 2014 - May 2023 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 2. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - Apr 2021 3. diff --git a/modules/imc/imc.c b/modules/imc/imc.c index bfc89b703bd..b493b15b10f 100644 --- a/modules/imc/imc.c +++ b/modules/imc/imc.c @@ -380,7 +380,7 @@ static int mod_init(void) /* binding to mysql module */ init_db_url( db_url , 0 /*cannot be null*/); - LM_DBG("db_url=%s/%d/%p\n", ZSW(db_url.s), db_url.len, db_url.s); + LM_DBG("db_url=%s\n", db_url_escape(&db_url)); if (db_bind_mod(&db_url, &imc_dbf)) { diff --git a/modules/jabber/Makefile b/modules/jabber/Makefile index c4ce66611ef..4d2259a00da 100644 --- a/modules/jabber/Makefile +++ b/modules/jabber/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/jabber/README b/modules/jabber/README index 569b408f221..149654b13a7 100644 --- a/modules/jabber/README +++ b/modules/jabber/README @@ -506,7 +506,7 @@ Chapter 2. Contributors 3. Jan Janak (@janakj) 33 15 1007 498 4. Razvan Crainea (@razvancrainea) 22 20 70 50 5. Andrei Pelinescu-Onciul 19 12 101 336 - 6. Liviu Chircu (@liviuchircu) 14 10 72 134 + 6. Liviu Chircu (@liviuchircu) 15 11 72 136 7. Vlad Patrascu (@rvlad-patrascu) 6 4 35 12 8. Jiri Kuthan (@jiriatipteldotorg) 6 3 313 0 9. Maksym Sobolyev (@sobomax) 5 3 6 6 @@ -537,7 +537,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2023 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2023 3. Maksym Sobolyev (@sobomax) Oct 2022 - Feb 2023 4. Razvan Crainea (@razvancrainea) Aug 2015 - Jul 2020 diff --git a/modules/jabber/doc/contributors.xml b/modules/jabber/doc/contributors.xml index c6351652889..a4b94d90440 100644 --- a/modules/jabber/doc/contributors.xml +++ b/modules/jabber/doc/contributors.xml @@ -61,10 +61,10 @@ 6. Liviu Chircu (@liviuchircu) - 14 - 10 + 15 + 11 72 - 134 + 136 7. @@ -129,7 +129,7 @@ 1. Liviu Chircu (@liviuchircu) - Mar 2014 - May 2023 + Mar 2014 - May 2024 2. diff --git a/modules/json/README b/modules/json/README index 07a0e42287b..0bddd138306 100644 --- a/modules/json/README +++ b/modules/json/README @@ -12,6 +12,9 @@ JSON Module 1.2.2. External Libraries or Applications 1.3. Exported Parameters + + 1.3.1. enable_long_quoting (boolean) + 1.4. Exported Pseudo-Variables 1.4.1. $json(id) @@ -40,19 +43,20 @@ JSON Module List of Examples - 1.1. Accessing the $json variable - 1.2. Iterating through an array using variables - 1.3. iteration over $json object keys - 1.4. iteration over $json object values - 1.5. iteration over $json array values - 1.6. Appending integers to arrays - 1.7. Deleting the last element in an array - 1.8. Adding a string value to a json object - 1.9. Initializing an array - 1.10. Setting a boolean or null value - 1.11. Adding a json to another json - 1.12. Creating a reference - 1.13. [LOGICAL ERROR] Creating a circular reference + 1.1. Set enable_long_quoting parameter + 1.2. Accessing the $json variable + 1.3. Iterating through an array using variables + 1.4. iteration over $json object keys + 1.5. iteration over $json object values + 1.6. iteration over $json array values + 1.7. Appending integers to arrays + 1.8. Deleting the last element in an array + 1.9. Adding a string value to a json object + 1.10. Initializing an array + 1.11. Setting a boolean or null value + 1.12. Adding a json to another json + 1.13. Creating a reference + 1.14. [LOGICAL ERROR] Creating a circular reference Chapter 1. Admin Guide @@ -86,7 +90,24 @@ Chapter 1. Admin Guide 1.3. Exported Parameters - The module does not export any parameters. +1.3.1. enable_long_quoting (boolean) + + Enable this parameter if your input JSONs contain signed + integers which do not fit into 4 bytes (e.g. larger than + 2147483647, etc.). If the parameter is enabled, 4-byte integers + will continue to be returned as integers, while larger values + will be returned as strings, in order to avoid the integer + overflow. + + Default value is false. + + Example 1.1. Set enable_long_quoting parameter +... +modparam("json", "enable_long_quoting", true) +... +# normalize the "gateway_id" int/string value to be always a string +$var(gateway_id) = "" + $json(body/gateway_id); +... 1.4. Exported Pseudo-Variables @@ -139,7 +160,7 @@ Chapter 1. Admin Guide printed in the log describing the value of the json and the path used - Example 1.1. Accessing the $json variable + Example 1.2. Accessing the $json variable ... $json(obj1/key) = "value"; #replace or insert the (key,value) #pair into the json object; @@ -152,7 +173,7 @@ xlog("$json(name/key1[0][-1]/key2)"); # a more complex example ... - Example 1.2. Iterating through an array using variables + Example 1.3. Iterating through an array using variables ... $json(ar1) := "[1,2,3,4]"; @@ -188,14 +209,14 @@ while( $json(ar1[$var(i)]) ) values, you can use the .keys or .values suffix for the path specified in the id. - Example 1.3. iteration over $json object keys + Example 1.4. iteration over $json object keys ... $json(foo) := "{\"a\": 1, \"b\": 2, \"c\": 3}"; for ($var(k) in $(json(foo.keys)[*])) xlog("$var(k) "); ... - Example 1.4. iteration over $json object values + Example 1.5. iteration over $json object values ... $json(foo) := "{\"a\": 1, \"b\": 2, \"c\": 3}"; for ($var(v) in $(json(foo.values)[*])) @@ -208,7 +229,7 @@ for ($var(v) in $(json(foo)[*])) xlog("$var(v) "); ... - Example 1.5. iteration over $json array values + Example 1.6. iteration over $json array values ... $json(foo) := "[1, 2, 3]"; for ($var(v) in $(json(foo)[*])) @@ -243,17 +264,17 @@ for ($var(v) in $(json(foo)[*])) Setting a value to NULL will cause it to be deleted. - Example 1.6. Appending integers to arrays + Example 1.7. Appending integers to arrays ... $json(array1[]) = 1; ... - Example 1.7. Deleting the last element in an array + Example 1.8. Deleting the last element in an array ... $json(array1[-1]) = NULL; ... - Example 1.8. Adding a string value to a json object + Example 1.9. Adding a string value to a json object ... $json(object1/some_key) = "some_value"; ... @@ -264,19 +285,19 @@ $json(object1/some_key) = "some_value"; object ( e.g. this operator should be used to parse json inputs ). - Example 1.9. Initializing an array + Example 1.10. Initializing an array ... $json(array1) := "[]"; ... - Example 1.10. Setting a boolean or null value + Example 1.11. Setting a boolean or null value ... $json(array1[]) := "null"; $json(array1[]) := "true"; $json(array1[]) := "false"; ... - Example 1.11. Adding a json to another json + Example 1.12. Adding a json to another json ... $json(array) := "[1,2,3]"; @@ -323,7 +344,7 @@ $json(object/array) := $json(array) ; accidentally create a circular reference and try to get the value from the object you will crash OPENSIPS. - Example 1.12. Creating a reference + Example 1.13. Creating a reference ... $json(b) := "[{},{},{}]"; @@ -368,7 +389,7 @@ Test link : ... - Example 1.13. [LOGICAL ERROR] Creating a circular reference + Example 1.14. [LOGICAL ERROR] Creating a circular reference ... $json(b) := "[1]"; @@ -392,7 +413,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Liviu Chircu (@liviuchircu) 19 16 50 89 + 1. Liviu Chircu (@liviuchircu) 20 17 93 94 2. Andrei Dragus 18 4 1556 12 3. Razvan Crainea (@razvancrainea) 15 12 49 78 4. Bogdan-Andrei Iancu (@bogdan-iancu) 8 6 27 30 @@ -426,9 +447,9 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Feb 2012 - Nov 2023 - 2. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 3. Liviu Chircu (@liviuchircu) Oct 2013 - Jan 2021 + 1. Liviu Chircu (@liviuchircu) Oct 2013 - Dec 2024 + 2. Razvan Crainea (@razvancrainea) Feb 2012 - Nov 2023 + 3. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 4. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2010 - Apr 2019 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/json/doc/contributors.xml b/modules/json/doc/contributors.xml index 3bcc18f6f97..81d9eb9445c 100644 --- a/modules/json/doc/contributors.xml +++ b/modules/json/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Liviu Chircu (@liviuchircu) - 19 - 16 - 50 - 89 + 20 + 17 + 93 + 94 2. @@ -128,18 +128,18 @@ 1. - Razvan Crainea (@razvancrainea) - Feb 2012 - Nov 2023 + Liviu Chircu (@liviuchircu) + Oct 2013 - Dec 2024 2. - Maksym Sobolyev (@sobomax) - Jan 2021 - Feb 2023 + Razvan Crainea (@razvancrainea) + Feb 2012 - Nov 2023 3. - Liviu Chircu (@liviuchircu) - Oct 2013 - Jan 2021 + Maksym Sobolyev (@sobomax) + Jan 2021 - Feb 2023 4. diff --git a/modules/json/doc/json_admin.xml b/modules/json/doc/json_admin.xml index 49b7f695f2e..ea4b2b7d817 100644 --- a/modules/json/doc/json_admin.xml +++ b/modules/json/doc/json_admin.xml @@ -56,9 +56,32 @@
Exported Parameters +
+ <varname>enable_long_quoting</varname> (boolean) - The module does not export any parameters. + Enable this parameter if your input JSONs contain signed integers which + do not fit into 4 bytes (e.g. larger than 2147483647, etc.). If the + parameter is enabled, 4-byte integers will continue to be returned as + integers, while larger values will be returned as strings, in order to + avoid the integer overflow. + + + Default value is false. + + + + Set <varname>enable_long_quoting</varname> parameter + +... +modparam("json", "enable_long_quoting", true) +... +# normalize the "gateway_id" int/string value to be always a string +$var(gateway_id) = "" + $json(body/gateway_id); +... + + +
diff --git a/modules/json/json.c b/modules/json/json.c index 84475f93a61..8412ce0c07c 100644 --- a/modules/json/json.c +++ b/modules/json/json.c @@ -100,6 +100,7 @@ typedef struct _json_name pv_json_t * all; char buff[JSON_FILE_BUF_SIZE]; +int json_long_quoting; static int mod_init(void); static int child_init(int ); @@ -129,6 +130,13 @@ static const cmd_export_t cmds[]={ {0,0,{{0,0,0}},0} }; +static const param_export_t mod_params[]={ + { "enable_long_quoting", INT_PARAM, &json_long_quoting }, + { "disable_escape_forward_slash", INT_PARAM, &json_disable_escape_forward_slash }, + { 0,0,0 } +}; + + static const pv_export_t mod_items[] = { { {"json", sizeof("json")-1}, PVT_JSON, pv_get_json, pv_set_json, pv_parse_json_name, pv_parse_json_index, 0, 0}, @@ -139,26 +147,20 @@ static const pv_export_t mod_items[] = { { {0, 0}, 0, 0, 0, 0, 0, 0, 0 } }; -static const param_export_t params[] = { - {"disable_escape_forward_slash", INT_PARAM, &json_disable_escape_forward_slash}, - {0, 0, 0} -}; - - struct module_exports exports= { "json", /* module's name */ MOD_TYPE_DEFAULT,/* class of this module */ MODULE_VERSION, DEFAULT_DLFLAGS, /* dlopen flags */ - 0, /* load function */ + 0, /* load function */ NULL, /* OpenSIPS module dependencies */ cmds, /* exported functions */ 0, /* exported async functions */ - params, /* param exports */ - 0, /* exported statistics */ - 0, /* exported MI functions */ + mod_params, /* param exports */ + 0, /* exported statistics */ + 0, /* exported MI functions */ mod_items, /* exported pseudo-variables */ - 0, /* exported transformations */ + 0, /* exported transformations */ 0, /* extra processes */ 0, /* module pre-initialization function */ mod_init, /* module initialization function */ @@ -426,6 +428,7 @@ int pv_get_json_ext(struct sip_msg* msg, pv_param_t* pvp, pv_value_t* val, int json_t * obj; json_name * id = (json_name *) pvp->pvn.u.dname; UNUSED(id); + int64_t int_value; if( expand_tag_list( msg, ((json_name *)pvp->pvn.u.dname)->tags ) < 0) { @@ -468,10 +471,17 @@ int pv_get_json_ext(struct sip_msg* msg, pv_param_t* pvp, pv_value_t* val, int if( json_object_is_type(obj, json_type_int) ) { - val->rs.s = sint2str(json_object_get_int(obj), &val->rs.len); - val->ri = json_object_get_int(obj);; - val->flags |= PV_VAL_INT|PV_TYPE_INT|PV_VAL_STR; - + int_value = json_object_get_int64(obj); + val->rs.s = sint2str(int_value, &val->rs.len); + + if (!json_long_quoting || (int_value>=INT_MIN && int_value<=INT_MAX)) { + /* safe to store it as an INT in the pvar */ + val->ri = int_value; + val->flags |= PV_VAL_INT|PV_TYPE_INT|PV_VAL_STR; + } else { + /* we would overflow/underflow, store as string only */ + val->flags |= PV_VAL_STR; + } } else if( json_object_is_type(obj, json_type_string)) { diff --git a/modules/ldap/Makefile b/modules/ldap/Makefile index d8a8459739c..3fddc1cdfdd 100644 --- a/modules/ldap/Makefile +++ b/modules/ldap/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # LDAP_H350 # # diff --git a/modules/ldap/README b/modules/ldap/README index bf2238c90bf..9a58f820509 100644 --- a/modules/ldap/README +++ b/modules/ldap/README @@ -1346,12 +1346,12 @@ Chapter 3. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Christian Schlatter 57 6 5764 237 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) 25 20 150 140 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) 26 21 151 140 3. Ionut Ionita (@ionutrazvanionita) 22 5 1359 252 4. Razvan Crainea (@razvancrainea) 17 14 62 76 - 5. Daniel-Constantin Mierla (@miconda) 12 9 84 83 - 6. Vlad Patrascu (@rvlad-patrascu) 12 3 155 420 - 7. Liviu Chircu (@liviuchircu) 11 9 19 60 + 5. Liviu Chircu (@liviuchircu) 13 10 19 62 + 6. Daniel-Constantin Mierla (@miconda) 12 9 84 83 + 7. Vlad Patrascu (@rvlad-patrascu) 12 3 155 420 8. Maksym Sobolyev (@sobomax) 5 3 5 8 9. Razvan Pistolea 4 1 39 66 10. Anca Vamanu 3 1 14 14 @@ -1381,10 +1381,10 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2007 - Sep 2023 - 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 3. Petr Písař Mar 2022 - Mar 2022 - 4. Liviu Chircu (@liviuchircu) Mar 2014 - Jul 2021 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2007 - Oct 2024 + 2. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 4. Petr Písař Mar 2022 - Mar 2022 5. Razvan Crainea (@razvancrainea) Jun 2011 - Jan 2021 6. Zero King (@l2dy) Mar 2020 - Mar 2020 7. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 diff --git a/modules/ldap/doc/contributors.xml b/modules/ldap/doc/contributors.xml index 40e0508d938..56704623899 100644 --- a/modules/ldap/doc/contributors.xml +++ b/modules/ldap/doc/contributors.xml @@ -29,9 +29,9 @@ 2. Bogdan-Andrei Iancu (@bogdan-iancu) - 25 - 20 - 150 + 26 + 21 + 151 140 @@ -52,6 +52,14 @@ 5. + Liviu Chircu (@liviuchircu) + 13 + 10 + 19 + 62 + + + 6. Daniel-Constantin Mierla (@miconda) 12 9 @@ -59,21 +67,13 @@ 83 - 6. + 7. Vlad Patrascu (@rvlad-patrascu) 12 3 155 420 - - 7. - Liviu Chircu (@liviuchircu) - 11 - 9 - 19 - 60 - 8. Maksym Sobolyev (@sobomax) @@ -129,22 +129,22 @@ 1. Bogdan-Andrei Iancu (@bogdan-iancu) - Jul 2007 - Sep 2023 + Jul 2007 - Oct 2024 2. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 3. - Petr Písař - Mar 2022 - Mar 2022 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 4. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jul 2021 + Petr Písař + Mar 2022 - Mar 2022 5. diff --git a/modules/ldap/ldap_exp_fn.c b/modules/ldap/ldap_exp_fn.c index 9ceb1bb2f67..90fe632f640 100644 --- a/modules/ldap/ldap_exp_fn.c +++ b/modules/ldap/ldap_exp_fn.c @@ -159,7 +159,8 @@ int ldap_search_impl_async( return 1; error: - release_ldap_connection(conn); + if (conn) + release_ldap_connection(conn); return rc; } diff --git a/modules/load_balancer/Makefile b/modules/load_balancer/Makefile index 64dfc590f75..6b0f99d00ae 100644 --- a/modules/load_balancer/Makefile +++ b/modules/load_balancer/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/load_balancer/README b/modules/load_balancer/README index 7a98ff71169..a7050e8116a 100644 --- a/modules/load_balancer/README +++ b/modules/load_balancer/README @@ -361,6 +361,14 @@ modparam("load_balancer", "initial_freeswitch_load", 200) which node in the cluster will perform the pinging/probing to destinations. See the cluster_sharing_tag option. + This OpenSIPS cluster exposes the "load_balancer-status-repl" + capability in order to mark nodes as eligible for becoming data + donors during an arbitrary sync request. Consequently, the + cluster must have at least one node marked with the "seed" + value as the clusterer.flags column/property in order to be + fully functional. Consult the clusterer - Capabilities chapter + for more details. + For more info on how to define and populate a cluster (with OpenSIPS nodes) see the "clusterer" module. @@ -768,10 +776,10 @@ Chapter 4. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 123 74 4331 755 - 2. Liviu Chircu (@liviuchircu) 41 32 683 170 + 2. Liviu Chircu (@liviuchircu) 43 34 688 172 3. Vlad Patrascu (@rvlad-patrascu) 38 19 623 766 4. Sergey Khripchenko (@shripchenko) 28 10 1058 516 - 5. Razvan Crainea (@razvancrainea) 26 20 261 143 + 5. Razvan Crainea (@razvancrainea) 27 21 266 148 6. Vlad Paiu (@vladpaiu) 5 3 7 5 7. Maksym Sobolyev (@sobomax) 5 3 6 7 8. Walter Doekes (@wdoekes) 5 3 3 3 @@ -802,12 +810,12 @@ Chapter 4. Contributors Table 4.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2009 - Oct 2023 - 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 3. Razvan Crainea (@razvancrainea) Oct 2010 - Oct 2022 - 4. Vlad Patrascu (@rvlad-patrascu) Mar 2017 - Jul 2022 - 5. agree Jan 2022 - Jan 2022 - 6. Liviu Chircu (@liviuchircu) Sep 2012 - Sep 2020 + 1. Razvan Crainea (@razvancrainea) Oct 2010 - Oct 2024 + 2. Liviu Chircu (@liviuchircu) Sep 2012 - Sep 2024 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2009 - Oct 2023 + 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 5. Vlad Patrascu (@rvlad-patrascu) Mar 2017 - Jul 2022 + 6. agree Jan 2022 - Jan 2022 7. Zero King (@l2dy) Mar 2020 - Mar 2020 8. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 9. Jeremy Martinez (@JeremyMartinez51) Feb 2017 - Feb 2017 @@ -824,8 +832,8 @@ Chapter 5. Documentation 5.1. Contributors - Last edited by: agree, Zero King (@l2dy), Vlad Patrascu - (@rvlad-patrascu), Liviu Chircu (@liviuchircu), Razvan Crainea + Last edited by: Liviu Chircu (@liviuchircu), agree, Zero King + (@l2dy), Vlad Patrascu (@rvlad-patrascu), Razvan Crainea (@razvancrainea), Bogdan-Andrei Iancu (@bogdan-iancu), Peter Lemenkov (@lemenkov), Sergey Khripchenko (@shripchenko), Ezequiel Lovelle (@lovelle), Walter Doekes (@wdoekes), Vlad diff --git a/modules/load_balancer/doc/contributors.xml b/modules/load_balancer/doc/contributors.xml index ee173562c71..6fbd561b663 100644 --- a/modules/load_balancer/doc/contributors.xml +++ b/modules/load_balancer/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 41 - 32 - 683 - 170 + 43 + 34 + 688 + 172 3. @@ -53,10 +53,10 @@ 5. Razvan Crainea (@razvancrainea) - 26 - 20 - 261 - 143 + 27 + 21 + 266 + 148 6. @@ -128,33 +128,33 @@ 1. - Bogdan-Andrei Iancu (@bogdan-iancu) - Feb 2009 - Oct 2023 + Razvan Crainea (@razvancrainea) + Oct 2010 - Oct 2024 2. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Sep 2012 - Sep 2024 3. - Razvan Crainea (@razvancrainea) - Oct 2010 - Oct 2022 + Bogdan-Andrei Iancu (@bogdan-iancu) + Feb 2009 - Oct 2023 4. - Vlad Patrascu (@rvlad-patrascu) - Mar 2017 - Jul 2022 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 5. - agree - Jan 2022 - Jan 2022 + Vlad Patrascu (@rvlad-patrascu) + Mar 2017 - Jul 2022 6. - Liviu Chircu (@liviuchircu) - Sep 2012 - Sep 2020 + agree + Jan 2022 - Jan 2022 7. @@ -190,7 +190,7 @@ Documentation
Contributors - Last edited by: agree, Zero King (@l2dy), Vlad Patrascu (@rvlad-patrascu), Liviu Chircu (@liviuchircu), Razvan Crainea (@razvancrainea), Bogdan-Andrei Iancu (@bogdan-iancu), Peter Lemenkov (@lemenkov), Sergey Khripchenko (@shripchenko), Ezequiel Lovelle (@lovelle), Walter Doekes (@wdoekes), Vlad Paiu (@vladpaiu). + Last edited by: Liviu Chircu (@liviuchircu), agree, Zero King (@l2dy), Vlad Patrascu (@rvlad-patrascu), Razvan Crainea (@razvancrainea), Bogdan-Andrei Iancu (@bogdan-iancu), Peter Lemenkov (@lemenkov), Sergey Khripchenko (@shripchenko), Ezequiel Lovelle (@lovelle), Walter Doekes (@wdoekes), Vlad Paiu (@vladpaiu).
diff --git a/modules/load_balancer/doc/load_balancer.xml b/modules/load_balancer/doc/load_balancer.xml index 9d8504306ad..11f522d3547 100644 --- a/modules/load_balancer/doc/load_balancer.xml +++ b/modules/load_balancer/doc/load_balancer.xml @@ -7,6 +7,8 @@ + + diff --git a/modules/load_balancer/doc/load_balancer_admin.xml b/modules/load_balancer/doc/load_balancer_admin.xml index 90883d22b83..4a464b3b326 100644 --- a/modules/load_balancer/doc/load_balancer_admin.xml +++ b/modules/load_balancer/doc/load_balancer_admin.xml @@ -418,6 +418,9 @@ modparam("load_balancer", "initial_freeswitch_load", 200) destinations. See the option. + + &clusterer_sync_cap_para; + For more info on how to define and populate a cluster (with OpenSIPS nodes) see the "clusterer" module. diff --git a/modules/load_balancer/load_balancer.c b/modules/load_balancer/load_balancer.c index c545c2aa673..72722eb20b1 100644 --- a/modules/load_balancer/load_balancer.c +++ b/modules/load_balancer/load_balancer.c @@ -479,17 +479,17 @@ static int mod_init(void) static int child_init(int rank) { + /* init DB connection */ + if ( lb_connect_db(&db_url)!=0 ) { + LM_CRIT("cannot initialize database connection\n"); + return -1; + } return 0; } static int mi_child_init( void ) { - /* init DB connection */ - if ( lb_connect_db(&db_url)!=0 ) { - LM_CRIT("cannot initialize database connection\n"); - return -1; - } return 0; } diff --git a/modules/maxfwd/Makefile b/modules/maxfwd/Makefile index 2bcbf7f45b9..b4030344983 100644 --- a/modules/maxfwd/Makefile +++ b/modules/maxfwd/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/maxfwd/README b/modules/maxfwd/README index af6976ff136..37ddf56124b 100644 --- a/modules/maxfwd/README +++ b/modules/maxfwd/README @@ -160,10 +160,10 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Bogdan-Andrei Iancu (@bogdan-iancu) 46 30 864 484 - 2. Jan Janak (@janakj) 11 9 58 38 - 3. Daniel-Constantin Mierla (@miconda) 11 9 23 19 - 4. Liviu Chircu (@liviuchircu) 11 9 17 42 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) 47 31 868 490 + 2. Liviu Chircu (@liviuchircu) 12 10 17 44 + 3. Jan Janak (@janakj) 11 9 58 38 + 4. Daniel-Constantin Mierla (@miconda) 11 9 23 19 5. Andrei Pelinescu-Onciul 10 8 31 26 6. Jiri Kuthan (@jiriatipteldotorg) 9 7 93 7 7. Razvan Crainea (@razvancrainea) 8 6 9 8 @@ -196,11 +196,11 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 - 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2002 - Apr 2019 - 5. Liviu Chircu (@liviuchircu) Jan 2014 - Aug 2018 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2002 - Dec 2024 + 2. Liviu Chircu (@liviuchircu) Jan 2014 - May 2024 + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 4. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Walter Doekes (@wdoekes) May 2014 - May 2014 8. Daniel-Constantin Mierla (@miconda) Nov 2006 - Mar 2008 diff --git a/modules/maxfwd/doc/contributors.xml b/modules/maxfwd/doc/contributors.xml index 58b20e74693..3f68e6e67d7 100644 --- a/modules/maxfwd/doc/contributors.xml +++ b/modules/maxfwd/doc/contributors.xml @@ -21,13 +21,21 @@ 1. Bogdan-Andrei Iancu (@bogdan-iancu) - 46 - 30 - 864 - 484 + 47 + 31 + 868 + 490 2. + Liviu Chircu (@liviuchircu) + 12 + 10 + 17 + 44 + + + 3. Jan Janak (@janakj) 11 9 @@ -35,21 +43,13 @@ 38 - 3. + 4. Daniel-Constantin Mierla (@miconda) 11 9 23 19 - - 4. - Liviu Chircu (@liviuchircu) - 11 - 9 - 17 - 42 - 5. Andrei Pelinescu-Onciul @@ -128,28 +128,28 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Bogdan-Andrei Iancu (@bogdan-iancu) + Jan 2002 - Dec 2024 2. - Razvan Crainea (@razvancrainea) - Feb 2012 - Sep 2019 + Liviu Chircu (@liviuchircu) + Jan 2014 - May 2024 3. - Vlad Patrascu (@rvlad-patrascu) - May 2017 - Apr 2019 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 4. - Bogdan-Andrei Iancu (@bogdan-iancu) - Jan 2002 - Apr 2019 + Razvan Crainea (@razvancrainea) + Feb 2012 - Sep 2019 5. - Liviu Chircu (@liviuchircu) - Jan 2014 - Aug 2018 + Vlad Patrascu (@rvlad-patrascu) + May 2017 - Apr 2019 6. diff --git a/modules/maxfwd/maxfwd.c b/modules/maxfwd/maxfwd.c index c5dc5ecae0c..e186815b4ab 100644 --- a/modules/maxfwd/maxfwd.c +++ b/modules/maxfwd/maxfwd.c @@ -52,7 +52,7 @@ static int max_limit = MAXFWD_UPPER_LIMIT; static int fixup_maxfwd_header(void** param); static int w_process_maxfwd_header(struct sip_msg* msg, int* mval); -static int is_maxfwd_lt(struct sip_msg *msg, char *slimit, char *foo); +static int is_maxfwd_lt(struct sip_msg *msg, int *limit); static int mod_init(void); @@ -169,20 +169,18 @@ static int w_process_maxfwd_header(struct sip_msg* msg, int* mval) -static int is_maxfwd_lt(struct sip_msg *msg, char *slimit, char *foo) +static int is_maxfwd_lt(struct sip_msg *msg, int *limit) { str mf_value; - int limit; int val; - limit = (int)(long)slimit; val = is_maxfwd_present( msg, &mf_value); - LM_DBG("value = %d \n",val); + LM_DBG("value = %d, limit = %d\n", val, *limit); if ( val<0 ) { /* error or not found */ return val-1; - } else if ( val>=limit ) { + } else if ( val >= *limit ) { /* greater or equal than/to limit */ return -1; } diff --git a/modules/media_exchange/README b/modules/media_exchange/README index 2d619a41fb8..da890e5b3c1 100644 --- a/modules/media_exchange/README +++ b/modules/media_exchange/README @@ -502,11 +502,11 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Razvan Crainea (@razvancrainea) 151 61 6052 2429 + 1. Razvan Crainea (@razvancrainea) 160 68 6232 2502 2. Vlad Patrascu (@rvlad-patrascu) 6 4 19 11 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) 3 1 4 4 - 4. Maksym Sobolyev (@sobomax) 3 1 4 4 - 5. Liviu Chircu (@liviuchircu) 3 1 4 1 + 3. Liviu Chircu (@liviuchircu) 4 2 6 3 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) 3 1 4 4 + 5. Maksym Sobolyev (@sobomax) 3 1 4 4 6. Zero King (@l2dy) 3 1 1 1 (1) DevScore = author_commits + author_lines_added / @@ -529,9 +529,9 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Feb 2020 - Feb 2023 - 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 3. Liviu Chircu (@liviuchircu) Jul 2022 - Jul 2022 + 1. Razvan Crainea (@razvancrainea) Feb 2020 - Mar 2025 + 2. Liviu Chircu (@liviuchircu) Jul 2022 - Jul 2024 + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 4. Vlad Patrascu (@rvlad-patrascu) Mar 2020 - Jul 2021 5. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2021 - Apr 2021 6. Zero King (@l2dy) Mar 2020 - Mar 2020 diff --git a/modules/media_exchange/doc/contributors.xml b/modules/media_exchange/doc/contributors.xml index 329e5a053ef..76cbbe3216d 100644 --- a/modules/media_exchange/doc/contributors.xml +++ b/modules/media_exchange/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Razvan Crainea (@razvancrainea) - 151 - 61 - 6052 - 2429 + 160 + 68 + 6232 + 2502 2. @@ -36,15 +36,15 @@ 3. - Bogdan-Andrei Iancu (@bogdan-iancu) - 3 - 1 - 4 + Liviu Chircu (@liviuchircu) 4 + 2 + 6 + 3 4. - Maksym Sobolyev (@sobomax) + Bogdan-Andrei Iancu (@bogdan-iancu) 3 1 4 @@ -52,11 +52,11 @@ 5. - Liviu Chircu (@liviuchircu) + Maksym Sobolyev (@sobomax) 3 1 4 - 1 + 4 6. @@ -97,17 +97,17 @@ 1. Razvan Crainea (@razvancrainea) - Feb 2020 - Feb 2023 + Feb 2020 - Mar 2025 2. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Jul 2022 - Jul 2024 3. - Liviu Chircu (@liviuchircu) - Jul 2022 - Jul 2022 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 4. diff --git a/modules/media_exchange/media_exchange.c b/modules/media_exchange/media_exchange.c index f372b5edcfb..2225d7c49ce 100644 --- a/modules/media_exchange/media_exchange.c +++ b/modules/media_exchange/media_exchange.c @@ -31,6 +31,7 @@ struct rtp_relay_binds media_rtp; static str b2b_media_exchange_cap = str_init("media_exchange"); +static int mod_preinit(void); static int mod_init(void); static int media_fork_to_uri(struct sip_msg *msg, str *uri, int leg, str *headers, int *medianum); @@ -174,7 +175,7 @@ struct module_exports exports = { 0, /* exported pseudo-variables */ 0, /* extra processes */ 0, /* extra transformations */ - 0, /* module pre-initialization function */ + mod_preinit, /* module pre-initialization function */ mod_init, /* module initialization function */ NULL, /* response handling function */ NULL, /* destroy function */ @@ -182,13 +183,8 @@ struct module_exports exports = { 0 /* reload confirm function */ }; -/** - * init module function - */ -static int mod_init(void) +static int mod_preinit(void) { - LM_DBG("initializing media_exchange module ...\n"); - if (load_dlg_api(&media_dlg) != 0) { LM_ERR("dialog module not loaded! Cannot use media bridging module\n"); return -1; @@ -205,6 +201,24 @@ static int mod_init(void) return -1; } + if (load_rtp_relay(&media_rtp) != 0) + LM_DBG("rtp_relay module not loaded! Cannot use streaming module\n"); + + if (init_media_sessions() < 0) { + LM_ERR("could not initialize media sessions!\n"); + return -1; + } + + return 0; +} + +/** + * init module function + */ +static int mod_init(void) +{ + LM_DBG("initializing media_exchange module ...\n"); + if (media_b2b.register_cb(media_exchange_event_received, B2BCB_RECV_EVENT, &b2b_media_exchange_cap) < 0) { LM_ERR("could not register loaded callback!\n"); @@ -217,15 +231,6 @@ static int mod_init(void) return -1; } - - if (load_rtp_relay(&media_rtp) != 0) - LM_DBG("rtp_relay module not loaded! Cannot use streaming module\n"); - - if (init_media_sessions() < 0) { - LM_ERR("could not initialize media sessions!\n"); - return -1; - } - return 0; } @@ -675,9 +680,10 @@ static int media_exchange_from_uri(struct sip_msg *msg, str *uri, int leg, if (!body) { if (media_rtp.get_ctx_dlg) { ctx = media_rtp.get_ctx_dlg(dlg); - body = media_exchange_get_offer_sdp(ctx, dlg, leg, &release); + body = media_exchange_get_offer_sdp(ctx, dlg, + DLG_MEDIA_SESSION_LEG(dlg, leg), &release); } else { - sbody = dlg_get_out_sdp(dlg, req_leg); + sbody = dlg_get_out_sdp(dlg, DLG_MEDIA_SESSION_LEG(dlg, other_leg(dlg, leg))); body = &sbody; } } @@ -710,14 +716,34 @@ static int media_exchange_from_uri(struct sip_msg *msg, str *uri, int leg, return 1; } +static void media_session_exchange_server_release(void *param) +{ + struct media_session_leg **mslp = (struct media_session_leg **)param; + if (!mslp) { + LM_BUG("media_session_leg should be here!\n"); + return; + } + if (*mslp) { + MSL_UNREF((*mslp)); + *mslp = NULL; + } + shm_free(mslp); +} + +/* used just to indicate whether the session has been handled or not */ static int media_session_exchange_server_reply(struct sip_msg *msg, int status, void *param) { - struct media_session_leg *msl; + struct media_session_leg *msl, **mslp; str reason, body, *pbody; + int ret = -1; if (status < 200) /* don't mind about provisional */ return 0; - msl = (struct media_session_leg *)param; + mslp = (struct media_session_leg **)param; + + if (*mslp == NULL) + return 0; + msl = *mslp; /* final reply here - unref the session */ if (msg == FAKED_REPLY || status >= 300) @@ -740,7 +766,7 @@ static int media_session_exchange_server_reply(struct sip_msg *msg, int status, /* we need to put the other party on hold */ pbody = media_session_get_hold_sdp(msl); if (!pbody) - goto error; + return -1; /* we don't unref - a reply might get through */ /* XXX: should we care whether the other party is properly on hold? */ if (media_session_reinvite(msl, MEDIA_SESSION_DLG_OTHER_LEG(msl), pbody) < 0) @@ -749,23 +775,19 @@ static int media_session_exchange_server_reply(struct sip_msg *msg, int status, } /* finished processing this reply */ - MSL_UNREF(msl); - return 0; + ret = 0; + goto end; terminate: /* the client declined the invite - propagate the code */ reason.s = error_text(status); reason.len = strlen(reason.s); media_session_rpl(msl, METHOD_INVITE, status, &reason, NULL); - MSL_UNREF(msl); - /* no need of this session leg - remote it */ - media_session_leg_free(msl); - return -1; - -error: +end: + *mslp = NULL; MSL_UNREF(msl); - return -1; + return ret; } static int media_exchange_to_call(struct sip_msg *msg, str *callid, int leg, int *nohold) @@ -774,7 +796,7 @@ static int media_exchange_to_call(struct sip_msg *msg, str *callid, int leg, int str contact; str *b2b_key; struct dlg_cell *dlg; - struct media_session_leg *msl; + struct media_session_leg *msl, **mslp; static str inv = str_init("INVITE"); if (leg == MEDIA_LEG_UNSPEC) { @@ -823,10 +845,19 @@ static int media_exchange_to_call(struct sip_msg *msg, str *callid, int leg, int goto destroy; } msl->b2b_entity = B2B_SERVER; + + mslp = shm_malloc(sizeof *mslp); + if (!mslp) { + LM_ERR("oom for new mslp\n"); + goto destroy; + } + *mslp = msl; + /* all good - send the invite to the client */ MSL_REF(msl); - if (media_dlg.send_indialog_request(dlg, &inv, MEDIA_SESSION_DLG_LEG(msl), - &body, &msg->content_type->body, NULL, media_session_exchange_server_reply, msl) < 0) { + if (media_dlg.send_indialog_request(dlg, &inv, MEDIA_SESSION_DLG_LEG(msl), &body, + &msg->content_type->body, NULL, media_session_exchange_server_reply, mslp, + media_session_exchange_server_release) < 0) { LM_ERR("could not send indialog request for callid %.*s\n", callid->len, callid->s); MSL_UNREF(msl); goto destroy; @@ -1240,7 +1271,7 @@ static void handle_media_session_negative(struct media_session_leg *msl) body = &sbody; if (media_dlg.send_indialog_request(msl->ms->dlg, &inv, dlg_leg, body, &content_type_sdp, NULL, - media_session_exchange_negative_reply, msl) < 0) { + media_session_exchange_negative_reply, msl, NULL) < 0) { LM_ERR("could not forward INVITE!\n"); media_send_fail(p->t, msl->ms->dlg, dlg_leg); msl->params = NULL; @@ -1256,11 +1287,11 @@ static int handle_media_session_reply_exchange(struct media_session_leg *msl, str sbody; struct dlg_cell *dlg; + dlg = msl->ms->dlg; if (msl->ms->rtp) - body = media_exchange_get_answer_sdp(msl->ms->rtp, body, - msl->leg, &release); + body = media_exchange_get_answer_sdp(msl->ms->rtp, dlg, body, + MEDIA_SESSION_DLG_LEG(msl), &release); - dlg = msl->ms->dlg; if (!p) { /* here we were triggered outside of a request - simply reinvite the * other leg with the new body */ @@ -1434,6 +1465,11 @@ static int b2b_media_notify(struct sip_msg *msg, str *key, int type, MEDIA_LEG_LOCK(msl); initial_state = msl->state; MEDIA_LEG_UNLOCK(msl); + if (msg == FAKED_REPLY) { + LM_ERR("could not stream media due to timeout (callid=%.*s)\n", + msl->ms->dlg->callid.len, msl->ms->dlg->callid.s); + goto terminate; + } if (msg->REPLY_STATUS >= 300) { LM_ERR("could not stream media due to negative reply %d (callid=%.*s)\n", msg->REPLY_STATUS, msl->ms->dlg->callid.len, msl->ms->dlg->callid.s); @@ -1616,7 +1652,8 @@ static mi_response_t *mi_media_exchange_from_call_to_uri(const mi_params_t *para if (try_get_mi_string_param(params, "body", &body.s, &body.len) < 0) { if (media_rtp.get_ctx_dlg) { ctx = media_rtp.get_ctx_dlg(dlg); - pbody = media_exchange_get_offer_sdp(ctx, dlg, media_leg, &release); + pbody = media_exchange_get_offer_sdp(ctx, dlg, + DLG_MEDIA_SESSION_LEG(dlg, media_leg), &release); } else { body = dlg_get_out_sdp(dlg, DLG_MEDIA_SESSION_LEG(dlg, media_leg)); pbody = &body; @@ -1629,12 +1666,12 @@ static mi_response_t *mi_media_exchange_from_call_to_uri(const mi_params_t *para hdrs, nohold, ctx, NULL) < 0) { media_dlg.dlg_unref(dlg, 1); if (release) - pkg_free(&body.s); + pkg_free(pbody->s); return init_mi_error(500, MI_SSTR("Could not start media session")); } if (release) - pkg_free(&body.s); + pkg_free(pbody->s); /* all good now, unref the dialog as it is reffed by the ms */ media_dlg.dlg_unref(dlg, 1); return init_mi_result_ok(); diff --git a/modules/media_exchange/media_sessions.c b/modules/media_exchange/media_sessions.c index a3429e92f83..97fe5bb65e8 100644 --- a/modules/media_exchange/media_sessions.c +++ b/modules/media_exchange/media_sessions.c @@ -23,14 +23,29 @@ static int media_session_dlg_idx; -void media_session_unref(void *param) +#define MEDIA_SESSION_DETACHED(ms) (ms->dlg == NULL) +#define MEDIA_SESSION_HAS_LEGS(ms) (ms->legs != NULL) + +static void media_session_detach(struct media_session *ms) +{ + if (MEDIA_SESSION_DETACHED(ms)) + return; + media_dlg.dlg_ctx_put_ptr(ms->dlg, media_session_dlg_idx, NULL); + media_dlg.dlg_unref(ms->dlg, 1); + ms->dlg = NULL; +} + +static void media_session_unref(void *param) { struct media_session *ms = (struct media_session *)param; MEDIA_SESSION_LOCK(ms); - if (ms->legs) + media_session_detach(ms); + if (MEDIA_SESSION_HAS_LEGS(ms)) { LM_WARN("media session %p still in use %p!\n", ms, ms->legs); - else + MEDIA_SESSION_UNLOCK(ms); + } else { media_session_release(ms, 1); + } } int init_media_sessions(void) @@ -88,7 +103,7 @@ void media_session_leg_free(struct media_session_leg *msl) void media_session_release(struct media_session *ms, int unlock) { - int existing_legs = (ms->legs != NULL); + int existing_legs = MEDIA_SESSION_HAS_LEGS(ms); if (unlock) MEDIA_SESSION_UNLOCK(ms); @@ -96,16 +111,13 @@ void media_session_release(struct media_session *ms, int unlock) LM_DBG("media session %p has onhoing legs!\n", ms); return; } - media_session_free(ms); + /* release only if detached from the dialog */ + if (MEDIA_SESSION_DETACHED(ms)) + media_session_free(ms); } void media_session_free(struct media_session *ms) { - - if (ms->dlg) { - media_dlg.dlg_ctx_put_ptr(ms->dlg, media_session_dlg_idx, NULL); - media_dlg.dlg_unref(ms->dlg, 1); - } lock_destroy(&ms->lock); LM_DBG("releasing media_session=%p\n", ms); shm_free(ms); @@ -126,6 +138,7 @@ static void media_session_dlg_end(struct dlg_cell *dlg, int type, struct dlg_cb_ return; media_session_end(ms, MEDIA_LEG_BOTH, 0, 0); + media_session_unref(ms); } struct media_session *media_session_create(struct dlg_cell *dlg) @@ -149,6 +162,7 @@ struct media_session *media_session_create(struct dlg_cell *dlg) /* we are not storing media session in the dialog, as it might * dissapear along the way, if the playback ends */ LM_ERR("could not register media_session_termination!\n"); + media_session_detach(ms); media_session_free(ms); return NULL; } @@ -229,17 +243,64 @@ int media_session_resume_dlg(struct media_session_leg *msl) return 0; } -int media_session_reinvite(struct media_session_leg *msl, int leg, str *pbody) +struct media_session_reinvite_p { + struct media_session_leg *msl; + int leg; +}; + +static int media_session_reinvite_reply(struct sip_msg *msg, int statuscode, void *param) { - static str inv = str_init("INVITE"); + struct media_session_reinvite_p *p = param; + str body, *pbody; + int release; + + if (statuscode < 200) + return 0; + if (statuscode < 300) { + /* successfully completed the transaction */ + if (get_body(msg, &body) >= 0 && body.len > 0) { + pbody = media_exchange_get_answer_sdp(p->msl->ms->rtp, p->msl->ms->dlg, + &body, p->leg, &release); + if (pbody && release) + pkg_free(pbody->s); + } + } + MSL_UNREF(p->msl); + shm_free(p); + return 0; +} - str body; - if (pbody) - body = *pbody; - else - body = dlg_get_out_sdp(msl->ms->dlg, leg); - return media_dlg.send_indialog_request(msl->ms->dlg, - &inv, leg, &body, &content_type_sdp, NULL, NULL, NULL); +int media_session_reinvite(struct media_session_leg *msl, int leg, str *body) +{ + static str inv = str_init("INVITE"); + int ret, release = 0; + struct media_session_reinvite_p *p = NULL; + + if (!body) { + body = media_exchange_get_offer_sdp(msl->ms->rtp, msl->ms->dlg, + other_leg(msl->ms->dlg, leg), &release); + if (release) { + /* here we've got a body that has been offered by the media-server + * we need to answer it on its way back */ + p = shm_malloc(sizeof *p); + if (p) { + MSL_REF(msl); + p->msl = msl; + p->leg = leg; + } else { + LM_ERR("could not allocate reinvite parameter!\n"); + } + } + } + ret = media_dlg.send_indialog_request(msl->ms->dlg, &inv, leg, body, &content_type_sdp, NULL, + (p?media_session_reinvite_reply:NULL),p, NULL); + if (p && ret < 0) { + MSL_UNREF(msl); + shm_free(p); + } + if (release) + pkg_free(body->s); + return ret; } int media_session_req(struct media_session_leg *msl, const char *method, str *body) @@ -334,6 +395,8 @@ int media_session_end(struct media_session *ms, int leg, int nohold, int proxied MEDIA_SESSION_LOCK(ms); if (leg == MEDIA_LEG_BOTH) { + if (!ms->legs) + goto release; msl = ms->legs; nmsl = msl->next; if (nmsl) { diff --git a/modules/media_exchange/media_utils.c b/modules/media_exchange/media_utils.c index 0b98288ed88..50a25584de9 100644 --- a/modules/media_exchange/media_utils.c +++ b/modules/media_exchange/media_utils.c @@ -235,7 +235,7 @@ int media_fork_offer(struct media_session_leg *msl, { if (media_rtp.copy_offer(msl->ms->rtp, &media_exchange_name, NULL, mf->flags, - mf->streams, body) < 0) { + mf->streams, body, NULL) < 0) { LM_ERR("could not get copy SDP\n"); return -1; } @@ -290,7 +290,7 @@ int media_fork_pause_resume(struct media_session_leg *msl, int medianum, int res flags |= RTP_COPY_MODE_DISABLE; if (media_rtp.copy_offer(msl->ms->rtp, - &media_exchange_name, NULL, flags, todo, &body) < 0) { + &media_exchange_name, NULL, flags, todo, &body, NULL) < 0) { LM_ERR("could not get copy SDP\n"); MEDIA_LEG_STATE_SET_UNSAFE(msl, MEDIA_SESSION_STATE_RUNNING); return -1; @@ -524,34 +524,41 @@ void media_exchange_event_received(enum b2b_entity_type et, str *key, } str *media_exchange_get_offer_sdp(rtp_ctx ctx, struct dlg_cell *dlg, - int mleg, int *release) + int leg, int *release) { static str sbody; *release = 0; if (media_rtp.offer && ctx) { - sbody = dlg->legs[DLG_MEDIA_SESSION_LEG(dlg, mleg)].in_sdp; + sbody = dlg->legs[leg].in_sdp; if (media_rtp.offer(ctx, &media_exchange_name, - (mleg == MEDIA_LEG_CALLER? + (leg == DLG_CALLER_LEG? RTP_RELAY_CALLER:RTP_RELAY_CALLEE), &sbody) >= 0) { - *release = 1; - return &sbody; + /* the body towards the leg has changed, so we should update it */ + if (shm_str_sync(&dlg->legs[other_leg(dlg, leg)].out_sdp, &sbody) < 0) { + LM_ERR("could not update dialog's out_sdp\n"); + *release = 1; + return &sbody; + } + /* otherwise we return what has already been sync'ed */ } } - sbody = dlg_get_out_sdp(dlg, DLG_MEDIA_SESSION_LEG(dlg, mleg)); + sbody = dlg_get_out_sdp(dlg, other_leg(dlg, leg)); return &sbody; } -str *media_exchange_get_answer_sdp(rtp_ctx ctx, str *body, - int mleg, int *release) +str *media_exchange_get_answer_sdp(rtp_ctx ctx, struct dlg_cell *dlg, str *body, + int leg, int *release) { *release = 0; if (media_rtp.answer && ctx && media_rtp.answer(ctx, &media_exchange_name, - (mleg == MEDIA_LEG_CALLER? - RTP_RELAY_CALLER:RTP_RELAY_CALLEE), + (leg == DLG_CALLER_LEG? + RTP_RELAY_CALLEE:RTP_RELAY_CALLER), body) >= 0) { + if (dlg) + shm_str_sync(&dlg->legs[leg].out_sdp, body); *release = 1; return body; } diff --git a/modules/media_exchange/media_utils.h b/modules/media_exchange/media_utils.h index 33a84c77131..64a614132ab 100644 --- a/modules/media_exchange/media_utils.h +++ b/modules/media_exchange/media_utils.h @@ -53,8 +53,8 @@ void media_exchange_event_received(enum b2b_entity_type et, str *key, bin_packet_t *store, int backend); str *media_exchange_get_offer_sdp(rtp_ctx ctx, struct dlg_cell *dlg, - int mleg, int *release); -str *media_exchange_get_answer_sdp(rtp_ctx ctx, str *body, - int mleg, int *release); + int leg, int *release); +str *media_exchange_get_answer_sdp(rtp_ctx ctx, struct dlg_cell *dlg, str *body, + int leg, int *release); #endif /* _MEDIA_UTILS_H_ */ diff --git a/modules/mediaproxy/Makefile b/modules/mediaproxy/Makefile index 3bf32534456..d1c61f3a323 100644 --- a/modules/mediaproxy/Makefile +++ b/modules/mediaproxy/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # mediaproxy module makefile # # diff --git a/modules/mediaproxy/README b/modules/mediaproxy/README index 90e571253b1..af18c306173 100644 --- a/modules/mediaproxy/README +++ b/modules/mediaproxy/README @@ -355,7 +355,7 @@ Chapter 2. Contributors 1. Dan Pascu (@danpascu) 130 55 4241 2404 2. Bogdan-Andrei Iancu (@bogdan-iancu) 39 31 688 88 3. Saúl Ibarra Corretgé (@saghul) 21 14 504 71 - 4. Liviu Chircu (@liviuchircu) 13 11 41 47 + 4. Liviu Chircu (@liviuchircu) 14 12 41 49 5. Daniel-Constantin Mierla (@miconda) 13 11 37 33 6. Razvan Crainea (@razvancrainea) 9 7 22 41 7. Vlad Patrascu (@rvlad-patrascu) 4 2 8 4 @@ -390,11 +390,11 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Alexey Vasilyev (@vasilevalex) Mar 2022 - Mar 2022 - 3. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 - 4. Dan Pascu (@danpascu) Mar 2004 - Aug 2019 - 5. Liviu Chircu (@liviuchircu) Mar 2014 - May 2019 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Alexey Vasilyev (@vasilevalex) Mar 2022 - Mar 2022 + 4. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 + 5. Dan Pascu (@danpascu) Mar 2004 - Aug 2019 6. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2005 - Apr 2019 7. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 8. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/mediaproxy/doc/contributors.xml b/modules/mediaproxy/doc/contributors.xml index a6df7a8ab14..d986b598924 100644 --- a/modules/mediaproxy/doc/contributors.xml +++ b/modules/mediaproxy/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 13 - 11 + 14 + 12 41 - 47 + 49 5. @@ -128,29 +128,29 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Alexey Vasilyev (@vasilevalex) Mar 2022 - Mar 2022 - 3. + 4. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 - 4. + 5. Dan Pascu (@danpascu) Mar 2004 - Aug 2019 - - 5. - Liviu Chircu (@liviuchircu) - Mar 2014 - May 2019 - 6. Bogdan-Andrei Iancu (@bogdan-iancu) diff --git a/modules/mi_datagram/Makefile b/modules/mi_datagram/Makefile index 2e359b7272c..85906a1249b 100644 --- a/modules/mi_datagram/Makefile +++ b/modules/mi_datagram/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/mi_datagram/README b/modules/mi_datagram/README index 472dbe69ce5..4a5d6dca9d7 100644 --- a/modules/mi_datagram/README +++ b/modules/mi_datagram/README @@ -304,7 +304,7 @@ Chapter 3. Contributors 2. Ancuta Onofrei 27 2 2423 252 3. Vlad Patrascu (@rvlad-patrascu) 22 2 189 1049 4. Razvan Crainea (@razvancrainea) 12 10 50 34 - 5. Liviu Chircu (@liviuchircu) 11 9 27 56 + 5. Liviu Chircu (@liviuchircu) 12 10 27 58 6. Daniel-Constantin Mierla (@miconda) 9 7 18 16 7. Ionut Ionita (@ionutrazvanionita) 8 4 252 25 8. Henning Westerholt (@henningw) 5 3 9 11 @@ -335,9 +335,9 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2007 - Apr 2021 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - Jul 2020 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2007 - Apr 2021 4. Razvan Crainea (@razvancrainea) Oct 2011 - Sep 2019 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jan 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/mi_datagram/doc/contributors.xml b/modules/mi_datagram/doc/contributors.xml index e8221f7bb28..98a3db6d5ba 100644 --- a/modules/mi_datagram/doc/contributors.xml +++ b/modules/mi_datagram/doc/contributors.xml @@ -53,10 +53,10 @@ 5. Liviu Chircu (@liviuchircu) - 11 - 9 + 12 + 10 27 - 56 + 58 6. @@ -128,18 +128,18 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Bogdan-Andrei Iancu (@bogdan-iancu) - Jun 2007 - Apr 2021 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jul 2020 + Bogdan-Andrei Iancu (@bogdan-iancu) + Jun 2007 - Apr 2021 4. diff --git a/modules/mi_fifo/Makefile b/modules/mi_fifo/Makefile index 1a37bac6bc8..f5a5539d596 100644 --- a/modules/mi_fifo/Makefile +++ b/modules/mi_fifo/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # mi_fifo module makefile # # diff --git a/modules/mi_fifo/README b/modules/mi_fifo/README index 596f971be1c..a5a8402d4eb 100644 --- a/modules/mi_fifo/README +++ b/modules/mi_fifo/README @@ -265,7 +265,7 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 61 37 2289 248 2. Razvan Crainea (@razvancrainea) 42 19 582 1072 - 3. Liviu Chircu (@liviuchircu) 15 12 29 62 + 3. Liviu Chircu (@liviuchircu) 16 13 29 64 4. Daniel-Constantin Mierla (@miconda) 12 10 20 22 5. Ionut Ionita (@ionutrazvanionita) 7 4 211 22 6. Maksym Sobolyev (@sobomax) 5 3 16 18 @@ -299,9 +299,9 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2021 - Feb 2023 - 2. Alexey Vasilyev (@vasilevalex) Mar 2022 - Mar 2022 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - Mar 2022 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2021 - Feb 2023 + 3. Alexey Vasilyev (@vasilevalex) Mar 2022 - Mar 2022 4. Razvan Crainea (@razvancrainea) Feb 2012 - Jul 2021 5. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2006 - Apr 2021 6. Zero King (@l2dy) Mar 2020 - Mar 2020 diff --git a/modules/mi_fifo/doc/contributors.xml b/modules/mi_fifo/doc/contributors.xml index e06c277c3de..d539e584b65 100644 --- a/modules/mi_fifo/doc/contributors.xml +++ b/modules/mi_fifo/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 15 - 12 + 16 + 13 29 - 62 + 64 4. @@ -128,18 +128,18 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2021 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Alexey Vasilyev (@vasilevalex) - Mar 2022 - Mar 2022 + Maksym Sobolyev (@sobomax) + Feb 2021 - Feb 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - Mar 2022 + Alexey Vasilyev (@vasilevalex) + Mar 2022 - Mar 2022 4. diff --git a/modules/mi_script/README b/modules/mi_script/README index a1f92eea967..e5045f2b72c 100644 --- a/modules/mi_script/README +++ b/modules/mi_script/README @@ -283,7 +283,7 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Razvan Crainea (@razvancrainea) 17 6 1112 13 - 2. Liviu Chircu (@liviuchircu) 4 2 61 5 + 2. Liviu Chircu (@liviuchircu) 5 3 69 8 3. Maksym Sobolyev (@sobomax) 4 2 3 4 (1) DevScore = author_commits + author_lines_added / @@ -306,8 +306,8 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Liviu Chircu (@liviuchircu) Jun 2022 - Jan 2023 + 1. Liviu Chircu (@liviuchircu) Jun 2022 - Aug 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 3. Razvan Crainea (@razvancrainea) May 2021 - Sep 2022 (1) including any documentation-related commits, excluding diff --git a/modules/mi_script/doc/contributors.xml b/modules/mi_script/doc/contributors.xml index 038268d0c5e..8d8035c0f85 100644 --- a/modules/mi_script/doc/contributors.xml +++ b/modules/mi_script/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 4 - 2 - 61 5 + 3 + 69 + 8 3. @@ -72,13 +72,13 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Jun 2022 - Aug 2024 2. - Liviu Chircu (@liviuchircu) - Jun 2022 - Jan 2023 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 3. diff --git a/modules/mi_script/mi_script.c b/modules/mi_script/mi_script.c index 741502dd914..fbeb4c0719b 100644 --- a/modules/mi_script/mi_script.c +++ b/modules/mi_script/mi_script.c @@ -638,6 +638,7 @@ static void mi_script_async_start_job(int sender, void *param) struct mi_script_async_job *job = (struct mi_script_async_job *)param; struct mi_handler *hdl = NULL; mi_response_t *resp = NULL; + mi_request_t *req; if (job->cmd->flags & MI_ASYNC_RPL_FLAG) { hdl = shm_malloc(sizeof *hdl); @@ -649,13 +650,17 @@ static void mi_script_async_start_job(int sender, void *param) } } - resp = handle_mi_request(job->req, job->cmd, hdl); + /* backup @req now, before exposing @job to other procs */ + req = job->req; + job->req = NULL; + + resp = handle_mi_request(req, job->cmd, hdl); if (resp != MI_ASYNC_RPL) { mi_script_async_job(resp, job); free_mi_response(resp); } - mi_script_free_request(job->req, 1); - job->req = NULL; + + mi_script_free_request(req, 1); } /* we use this just for notifying that the request is terminated */ diff --git a/modules/mid_registrar/README b/modules/mid_registrar/README index e9fe59d8779..96c2efeb203 100644 --- a/modules/mid_registrar/README +++ b/modules/mid_registrar/README @@ -1031,7 +1031,8 @@ ownership_tag]]]]) * domain (static string) - logical domain within the registrar. If a database is used, then this must be name of the usrloc table which stores the contacts - * flags (string, optional) - string of the following flags: + * flags (string, optional) - string composed of one or more + of the following flags, comma-separated: + 'memory-only' - (old m flag) save the contacts only in memory cache without no DB operation; + 'no-reply' - (old r flag) do not generate a SIP reply @@ -1179,7 +1180,8 @@ if (is_method("REGISTER")) { * domain (static string) - logical domain within the registrar. If a database is used, then this must be name of the usrloc table which stores the contacts - * flags (string, optional) + * flags (string, optional) - string composed of one or more + of the following flags, comma-separated: + 'no-branches' - (old b flag) this flag controls how the mid_registrar_lookup() function processes multiple contacts. If there are multiple contacts for the given @@ -1353,7 +1355,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Liviu Chircu (@liviuchircu) 500 200 16307 10208 + 1. Liviu Chircu (@liviuchircu) 503 203 16332 10230 2. Vlad Patrascu (@rvlad-patrascu) 14 7 127 248 3. Bogdan-Andrei Iancu (@bogdan-iancu) 10 7 103 111 4. Razvan Crainea (@razvancrainea) 9 7 23 18 @@ -1384,7 +1386,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Jul 2016 - Nov 2023 + 1. Liviu Chircu (@liviuchircu) Jul 2016 - May 2024 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2023 3. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 4. Razvan Crainea (@razvancrainea) Mar 2017 - Jan 2023 diff --git a/modules/mid_registrar/doc/contributors.xml b/modules/mid_registrar/doc/contributors.xml index 487ff6f4367..89c5c9d978d 100644 --- a/modules/mid_registrar/doc/contributors.xml +++ b/modules/mid_registrar/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Liviu Chircu (@liviuchircu) - 500 - 200 - 16307 - 10208 + 503 + 203 + 16332 + 10230 2. @@ -129,7 +129,7 @@ 1. Liviu Chircu (@liviuchircu) - Jul 2016 - Nov 2023 + Jul 2016 - May 2024 2. diff --git a/modules/mid_registrar/doc/mid_registrar_admin.xml b/modules/mid_registrar/doc/mid_registrar_admin.xml index 85aa061acf8..d27ea5761bb 100644 --- a/modules/mid_registrar/doc/mid_registrar_admin.xml +++ b/modules/mid_registrar/doc/mid_registrar_admin.xml @@ -859,8 +859,8 @@ modparam("mid_registrar", "gruu_secret", "my_secret") - flags (string, optional) - string of - the following flags: + flags (string, optional) - string composed of + one or more of the following flags, comma-separated: &save_common_flags; diff --git a/modules/mid_registrar/save.c b/modules/mid_registrar/save.c index 867fc033025..67ea0026804 100644 --- a/modules/mid_registrar/save.c +++ b/modules/mid_registrar/save.c @@ -1395,7 +1395,7 @@ static inline int save_restore_rpl_contacts(struct sip_msg *req, ci->pre_replicate_info = &ct_data; } - LM_DBG("INSERTING contact with expires %lu\n", ci->expires); + LM_DBG("INSERTING contact with expires %lld\n", (long long)ci->expires); if (ul.insert_ucontact(r, &ctmap->req_ct_uri, ci, &mri->cmatch, 0, &c) < 0) { @@ -1526,6 +1526,7 @@ static inline int save_restore_req_contacts(struct sip_msg *req, ucontact_t* c; urecord_t *r = NULL; contact_t *_c; + str esc_aor; unsigned int cseq; int e_out = -1, vct = 0, was_valid; int e_max = 0; @@ -1547,8 +1548,14 @@ static inline int save_restore_req_contacts(struct sip_msg *req, LM_DBG("saving + restoring all contact URIs ... \n"); - /* in MID_REG_THROTTLE_AOR mode, any reply will only contain 1 contact */ - _c = get_first_contact(rpl); + if (mid_reg_escape_aor(&mri->aor, &esc_aor) < 0) { + rerrno = R_INTERNAL; + LM_ERR("failed to escape AoR string: '%.*s'\n", mri->aor.len, mri->aor.s); + return -1; + } + + /* in MID_REG_THROTTLE_AOR mode, replies should contain only 1 contact */ + _c = get_first_contact_matching(rpl, &esc_aor); if (_c) calc_contact_expires(rpl, _c->expires, &e_out, 0); @@ -1584,17 +1591,13 @@ static inline int save_restore_req_contacts(struct sip_msg *req, } } - if (_c) { - /** - * we now replace the single reply Contact hf with all Contact hfs - * present in the initial request - */ - if (del_lump(rpl, rpl->contact->name.s - rpl->buf, - rpl->contact->len, HDR_CONTACT_T) == NULL) { - LM_ERR("failed to delete contact '%.*s'\n", rpl->contact->name.len, - redact_pii(rpl->contact->name.s)); - goto out_clear_err; - } + /** + * replace the single reply Contact hf with all Contact hfs + * present in the initial request (perform a global delete, to be sure) + */ + if (delete_headers(rpl, rpl->contact) != 0) { + LM_ERR("failed to delete all contact hfs\n"); + goto out_clear_err; } #ifdef EXTRA_DEBUG @@ -1661,7 +1664,7 @@ static inline int save_restore_req_contacts(struct sip_msg *req, ci->pre_replicate_info = &ct_data; } - LM_DBG("INSERTING contact with expires %lu\n", ci->expires); + LM_DBG("INSERTING contact with expires %lld\n", (long long)ci->expires); if (ul.insert_ucontact( r, &ctmap->req_ct_uri, ci, &mri->cmatch, 0, &c) < 0) { @@ -2219,8 +2222,8 @@ static int process_contacts_by_ct(struct sip_msg *msg, urecord_t *urec, } else if (ret == -2) { /* duplicate or lower cseq */ continue; } else if (ret == 0) { /* found */ - LM_DBG("found >> %d --- [ %ld, %ld ]\n", e, - c->expires_in, c->expires_out); + LM_DBG("found >> %d --- [ %lld, %lld ]\n", e, + (long long)c->expires_in, (long long)c->expires_out); valuep = ul.get_ucontact_key(c, &ul_key_last_reg_ts); if (!valuep) { @@ -2237,8 +2240,8 @@ static int process_contacts_by_ct(struct sip_msg *msg, urecord_t *urec, expires_out = valuep->i; if (get_act_time() - last_reg_ts >= expires_out - e) { - LM_DBG("forwarding REGISTER (%ld - %d >= %d - %d)\n", - get_act_time(), last_reg_ts, expires_out, e); + LM_DBG("forwarding REGISTER (%lld - %u >= %d - %d)\n", + (long long)get_act_time(), last_reg_ts, expires_out, e); /* FIXME: should update "last_reg_out_ts" for all cts? */ return 1; } else { @@ -2419,8 +2422,8 @@ static int process_contacts_by_aor(struct sip_msg *req, urecord_t *urec, deregisters_only = 0; - LM_DBG("found >> [ %ld, %ld ], e=%d, e_out=%d\n", - c->expires_in, c->expires_out, e, e_out); + LM_DBG("found >> [ %lld, %lld ], e=%d, e_out=%d\n", + (long long)c->expires_in, (long long)c->expires_out, e, e_out); if (!VALID_CONTACT(c, get_act_time())) vct++; @@ -2510,8 +2513,8 @@ static int process_contacts_by_aor(struct sip_msg *req, urecord_t *urec, if (!deregisters_only) { max_diff = calc_max_ct_diff(urec); - LM_DBG("max diff: %d, absorb until=%d, current time=%ld\n", - max_diff, last_reg_ts + max_diff, get_act_time()); + LM_DBG("max diff: %d, absorb until=%d, current time=%lld\n", + max_diff, last_reg_ts + max_diff, (long long)get_act_time()); if (max_diff < 0 || last_reg_ts + max_diff <= get_act_time()) return 1; } else if (ctno >= 2 && !urec->contacts) { diff --git a/modules/msilo/Makefile b/modules/msilo/Makefile index 2bd26adb30a..7450ae70b9c 100644 --- a/modules/msilo/Makefile +++ b/modules/msilo/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/msilo/README b/modules/msilo/README index 4e2f2bea270..ab7b2e6edf8 100644 --- a/modules/msilo/README +++ b/modules/msilo/README @@ -726,7 +726,7 @@ Chapter 2. Contributors 1. Daniel-Constantin Mierla (@miconda) 124 66 4163 1410 2. Bogdan-Andrei Iancu (@bogdan-iancu) 45 38 191 277 3. Andrei Pelinescu-Onciul 18 10 115 382 - 4. Liviu Chircu (@liviuchircu) 16 13 73 87 + 4. Liviu Chircu (@liviuchircu) 17 14 73 89 5. Jan Janak (@janakj) 16 11 126 168 6. Razvan Crainea (@razvancrainea) 12 10 33 28 7. Jiri Kuthan (@jiriatipteldotorg) 9 6 180 33 @@ -761,7 +761,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2023 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 3. Ovidiu Sas (@ovidiusas) Apr 2022 - Apr 2022 4. Bogdan-Andrei Iancu (@bogdan-iancu) Sep 2002 - Oct 2021 diff --git a/modules/msilo/doc/contributors.xml b/modules/msilo/doc/contributors.xml index f24b31a6a9b..1c851ddeef5 100644 --- a/modules/msilo/doc/contributors.xml +++ b/modules/msilo/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 16 - 13 + 17 + 14 73 - 87 + 89 5. @@ -129,7 +129,7 @@ 1. Liviu Chircu (@liviuchircu) - Mar 2014 - May 2023 + Mar 2014 - May 2024 2. diff --git a/modules/nat_traversal/Makefile b/modules/nat_traversal/Makefile index c4f828a05a3..8f14afe69bf 100644 --- a/modules/nat_traversal/Makefile +++ b/modules/nat_traversal/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # nat_traversal module makefile # # diff --git a/modules/nat_traversal/README b/modules/nat_traversal/README index ea1932bedf6..838ef9b261c 100644 --- a/modules/nat_traversal/README +++ b/modules/nat_traversal/README @@ -863,7 +863,7 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Dan Pascu (@danpascu) 54 26 3085 115 2. Bogdan-Andrei Iancu (@bogdan-iancu) 37 31 306 128 - 3. Liviu Chircu (@liviuchircu) 16 13 59 81 + 3. Liviu Chircu (@liviuchircu) 18 15 61 84 4. Razvan Crainea (@razvancrainea) 9 7 11 6 5. Saúl Ibarra Corretgé (@saghul) 9 5 188 102 6. Vlad Patrascu (@rvlad-patrascu) 7 5 27 16 @@ -896,15 +896,15 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2023 - 2. okhowang Mar 2023 - Mar 2023 - 3. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 4. Peter Lemenkov (@lemenkov) Jun 2018 - Apr 2022 - 5. Alexey Vasilyev (@vasilevalex) Mar 2022 - Mar 2022 - 6. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2008 - Apr 2020 - 7. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 - 8. Dan Pascu (@danpascu) May 2008 - Aug 2019 - 9. Liviu Chircu (@liviuchircu) Mar 2014 - Aug 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2023 + 3. okhowang Mar 2023 - Mar 2023 + 4. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 + 5. Peter Lemenkov (@lemenkov) Jun 2018 - Apr 2022 + 6. Alexey Vasilyev (@vasilevalex) Mar 2022 - Mar 2022 + 7. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2008 - Apr 2020 + 8. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 + 9. Dan Pascu (@danpascu) May 2008 - Aug 2019 10. Saúl Ibarra Corretgé (@saghul) Aug 2011 - Nov 2014 All remaining contributors: David Sanders, Vlad Paiu diff --git a/modules/nat_traversal/doc/contributors.xml b/modules/nat_traversal/doc/contributors.xml index 20ba2cb9a96..ef10b27663d 100644 --- a/modules/nat_traversal/doc/contributors.xml +++ b/modules/nat_traversal/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 16 - 13 - 59 - 81 + 18 + 15 + 61 + 84 4. @@ -128,49 +128,49 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2023 - 2. + 3. okhowang Mar 2023 - Mar 2023 - 3. + 4. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 4. + 5. Peter Lemenkov (@lemenkov) Jun 2018 - Apr 2022 - 5. + 6. Alexey Vasilyev (@vasilevalex) Mar 2022 - Mar 2022 - 6. + 7. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2008 - Apr 2020 - 7. + 8. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 - 8. + 9. Dan Pascu (@danpascu) May 2008 - Aug 2019 - - 9. - Liviu Chircu (@liviuchircu) - Mar 2014 - Aug 2018 - 10. Saúl Ibarra Corretgé (@saghul) diff --git a/modules/nat_traversal/nat_traversal.c b/modules/nat_traversal/nat_traversal.c index 1ee124dddc2..109653131f5 100644 --- a/modules/nat_traversal/nat_traversal.c +++ b/modules/nat_traversal/nat_traversal.c @@ -1720,7 +1720,8 @@ restore_keepalive_state(void) res = fscanf(f, STATE_FILE_HEADER); // skip header while (True) { - res = fscanf(f, "%63s %63s %ld %ld", uri, socket, &rtime, &stime); + res = fscanf(f, "%63s %63s %lld %lld", uri, socket, + (long long *)&rtime, (long long *)&stime); if (res == EOF) { if (ferror(f)) LM_ERR("error while reading keepalive state file: %s\n", strerror(errno)); diff --git a/modules/nathelper/Makefile b/modules/nathelper/Makefile index 1b8e20a5308..e0710a5bdb5 100644 --- a/modules/nathelper/Makefile +++ b/modules/nathelper/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # print example module makefile # # diff --git a/modules/nathelper/README b/modules/nathelper/README index 5bc730724d7..07c61b4bdd0 100644 --- a/modules/nathelper/README +++ b/modules/nathelper/README @@ -215,18 +215,19 @@ modparam("nathelper", "natping_socket", "192.168.1.1:5006") 1.4.5. received_avp (str) The name of the Attribute-Value-Pair (AVP) used to store the - URI containing the received IP, port, and protocol. The URI is - created by fix_nated_register function of nathelper module and - the attribute is then used by the registrar to store the - received parameters. Do not forget to change the value of - corresponding parameter in registrar module if you change the - value of this parameter. + URI containing the received IP, port and protocol. The URI is + created by the fix_nated_register() function and this data may + then be also picked up by the registrar module, which will + attach a "Received=" attribute to the registration. Do not + forget to change the value of corresponding parameter in the + registrar module whenever you change the value of this + parameter. Note - You must set this parameter if you use "fix_nated_register". In - such case you must set the parameter with same name of - "registrar" module to same value. + You must set this parameter if you use fix_nated_register(). + Additionally, if you are using registrar, you must also set its + symmetric received_avp module parameter to the same value. Default value is "NULL" (disabled). @@ -544,10 +545,11 @@ add_rcv_param(1); # add the parameter to the Contact URI 1.5.4. fix_nated_register() - The function creates a URI consisting of the source IP, port, - and protocol and stores the URI in an Attribute-Value-Pair. The - URI will be appended as "received" parameter to Contact in 200 - OK and registrar will store it in the user location database. + The function creates a URI consisting of the source IP, port + and protocol and stores it in the received_avp AVP. The URI + will be appended as "received" parameter to Contact in 200 OK + and may also be stored in the user location database if the + same AVP is also configured for the registrar module. This function can be used from REQUEST_ROUTE. @@ -657,9 +659,9 @@ Chapter 3. Contributors Table 3.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Bogdan-Andrei Iancu (@bogdan-iancu) 153 121 2044 866 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) 154 122 2050 872 2. Maksym Sobolyev (@sobomax) 152 44 3552 4786 - 3. Liviu Chircu (@liviuchircu) 48 38 438 307 + 3. Liviu Chircu (@liviuchircu) 50 40 452 324 4. Ionut Ionita (@ionutrazvanionita) 40 15 1598 627 5. Razvan Crainea (@razvancrainea) 33 27 158 240 6. Daniel-Constantin Mierla (@miconda) 22 17 142 124 @@ -699,14 +701,14 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Jan 2013 - Jan 2024 - 2. Vlad Paiu (@vladpaiu) Aug 2010 - Jul 2023 - 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2023 - 4. Maksym Sobolyev (@sobomax) May 2003 - Feb 2023 - 5. Nick Altmann (@nikbyte) May 2022 - May 2022 - 6. Peter Lemenkov (@lemenkov) Jun 2018 - Apr 2022 - 7. Razvan Crainea (@razvancrainea) Dec 2010 - Jan 2021 - 8. Bogdan-Andrei Iancu (@bogdan-iancu) Nov 2003 - Jul 2020 + 1. Liviu Chircu (@liviuchircu) Jan 2013 - Nov 2024 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) Nov 2003 - Jun 2024 + 3. Vlad Paiu (@vladpaiu) Aug 2010 - Jul 2023 + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2023 + 5. Maksym Sobolyev (@sobomax) May 2003 - Feb 2023 + 6. Nick Altmann (@nikbyte) May 2022 - May 2022 + 7. Peter Lemenkov (@lemenkov) Jun 2018 - Apr 2022 + 8. Razvan Crainea (@razvancrainea) Dec 2010 - Jan 2021 9. Jasper Hafkenscheid (@hafkensite) Mar 2020 - Mar 2020 10. Dan Pascu (@danpascu) May 2019 - May 2019 diff --git a/modules/nathelper/doc/contributors.xml b/modules/nathelper/doc/contributors.xml index 418fe1eef90..7322784cade 100644 --- a/modules/nathelper/doc/contributors.xml +++ b/modules/nathelper/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Bogdan-Andrei Iancu (@bogdan-iancu) - 153 - 121 - 2044 - 866 + 154 + 122 + 2050 + 872 2. @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 48 - 38 - 438 - 307 + 50 + 40 + 452 + 324 4. @@ -129,43 +129,43 @@ 1. Liviu Chircu (@liviuchircu) - Jan 2013 - Jan 2024 + Jan 2013 - Nov 2024 2. + Bogdan-Andrei Iancu (@bogdan-iancu) + Nov 2003 - Jun 2024 + + + 3. Vlad Paiu (@vladpaiu) Aug 2010 - Jul 2023 - 3. + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2023 - 4. + 5. Maksym Sobolyev (@sobomax) May 2003 - Feb 2023 - 5. + 6. Nick Altmann (@nikbyte) May 2022 - May 2022 - 6. + 7. Peter Lemenkov (@lemenkov) Jun 2018 - Apr 2022 - 7. + 8. Razvan Crainea (@razvancrainea) Dec 2010 - Jan 2021 - - 8. - Bogdan-Andrei Iancu (@bogdan-iancu) - Nov 2003 - Jul 2020 - 9. Jasper Hafkenscheid (@hafkensite) diff --git a/modules/nathelper/doc/nathelper_admin.xml b/modules/nathelper/doc/nathelper_admin.xml index f29cf474950..a24295bb1a6 100644 --- a/modules/nathelper/doc/nathelper_admin.xml +++ b/modules/nathelper/doc/nathelper_admin.xml @@ -218,17 +218,19 @@ modparam("nathelper", "natping_socket", "192.168.1.1:5006") <varname>received_avp</varname> (str) The name of the Attribute-Value-Pair (AVP) used to store the URI - containing the received IP, port, and protocol. The URI is created - by fix_nated_register function of nathelper module and the attribute - is then used by the registrar to store the received parameters. Do - not forget to change the value of corresponding parameter in - registrar module if you change the value of this parameter. + containing the received IP, port and protocol. The URI is created + by the function and this data + may then be also picked up by the registrar module, which will attach a + "Received=" attribute to the registration. Do not forget to change the + value of corresponding parameter in the registrar + module whenever you change the value of this parameter. - You must set this parameter if you use "fix_nated_register". In such - case you must set the parameter with same name of "registrar" - module to same value. + You must set this parameter if you use . + Additionally, if you are using registrar, you must also set its symmetric + received_avp module parameter + to the same value. @@ -750,10 +752,11 @@ add_rcv_param(1); # add the parameter to the Contact URI fix_nated_register() - The function creates a URI consisting of the source IP, port, and - protocol and stores the URI in an Attribute-Value-Pair. The URI will + The function creates a URI consisting of the source IP, port and + protocol and stores it in the AVP. The URI will be appended as "received" parameter to Contact in 200 OK and - registrar will store it in the user location database. + may also be stored in the user location database if the same AVP + is also configured for the registrar module. This function can be used from REQUEST_ROUTE. diff --git a/modules/nathelper/examples/4to6.cfg b/modules/nathelper/examples/4to6.cfg index b39fd8db5b1..6a12a93e145 100644 --- a/modules/nathelper/examples/4to6.cfg +++ b/modules/nathelper/examples/4to6.cfg @@ -1,5 +1,3 @@ -# $Id$ -# # Simple application level gateway config script. # # Assumes that SER/rtpproxy run on a machine, which connected to diff --git a/modules/nathelper/examples/alg.cfg b/modules/nathelper/examples/alg.cfg index 417684ff6d4..77ffe8c363a 100644 --- a/modules/nathelper/examples/alg.cfg +++ b/modules/nathelper/examples/alg.cfg @@ -1,5 +1,3 @@ -# $Id$ -# # Simple application level gateway config script. # # Assumes that SER/rtpproxy run on a machine, which connected to diff --git a/modules/nathelper/sip_pinger.h b/modules/nathelper/sip_pinger.h index 89fcc5b1bd1..a34069d647e 100644 --- a/modules/nathelper/sip_pinger.h +++ b/modules/nathelper/sip_pinger.h @@ -392,8 +392,8 @@ build_sipping(udomain_t *d, str *curi, struct socket_info* s,str *path, s_len("Via: SIP/2.0/") + st.len + address->len + 1 + port->len + strlen(branch) + (path->len ? (s_len(CRLF"Route: ") + path->len) : 0) + - s_len(CRLF"From: ") + sipping_from.len + s_len(";tag=") + 8 + - s_len(CRLF"To: ") + curi->len + + s_len(CRLF"From: ") + 2 + sipping_from.len + s_len(";tag=") + 8 + + s_len(CRLF"To: ") + 2 + curi->len + s_len(CRLF"Call-ID: ") + sipping_callid.len + 1 + 8 + 1 + 8 + 1 + address->len + s_len(CRLF"CSeq: 1 ") + sipping_method.len + @@ -419,14 +419,14 @@ build_sipping(udomain_t *d, str *curi, struct socket_info* s,str *path, append_fix( p, CRLF"Route: "); append_str( p, *path); } - append_fix( p, CRLF"From: "); + append_fix( p, CRLF"From: <"); append_str( p, sipping_from); - append_fix( p, ";tag="); + append_fix( p, ">;tag="); len = 8; int2reverse_hex( &p, &len, sipping_fromtag++ ); - append_fix( p, CRLF"To: "); + append_fix( p, CRLF"To: <"); append_str( p, *curi); - append_fix( p, CRLF"Call-ID: "); + append_fix( p, ">"CRLF"Call-ID: "); append_str( p, sipping_callid); *(p++) = '-'; len = 8; diff --git a/modules/options/Makefile b/modules/options/Makefile index 23782c7dd8f..5c1dd72fea1 100644 --- a/modules/options/Makefile +++ b/modules/options/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # opt_rpl module makefile # # diff --git a/modules/options/README b/modules/options/README index 0a11d357dbe..afc38cc2133 100644 --- a/modules/options/README +++ b/modules/options/README @@ -175,8 +175,8 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 20 18 52 35 2. Daniel-Constantin Mierla (@miconda) 14 12 41 31 - 3. Nils Ohlmeier 10 3 630 4 - 4. Liviu Chircu (@liviuchircu) 9 7 29 43 + 3. Liviu Chircu (@liviuchircu) 10 8 29 45 + 4. Nils Ohlmeier 10 3 630 4 5. Razvan Crainea (@razvancrainea) 8 5 85 88 6. Vlad Patrascu (@rvlad-patrascu) 5 3 9 6 7. Elena-Ramona Modroiu 4 2 4 4 @@ -207,12 +207,12 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Nov 2012 - Sep 2019 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Nov 2003 - Apr 2019 - 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 6. Liviu Chircu (@liviuchircu) Jul 2014 - Jun 2018 + 1. Liviu Chircu (@liviuchircu) Jul 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Nov 2012 - Sep 2019 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Nov 2003 - Apr 2019 + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Daniel-Constantin Mierla (@miconda) Jul 2006 - Mar 2008 8. Konstantin Bokarius Mar 2008 - Mar 2008 9. Edson Gellert Schubert Feb 2008 - Feb 2008 diff --git a/modules/options/doc/contributors.xml b/modules/options/doc/contributors.xml index 007d5aaa320..d4c58409edd 100644 --- a/modules/options/doc/contributors.xml +++ b/modules/options/doc/contributors.xml @@ -36,20 +36,20 @@ 3. + Liviu Chircu (@liviuchircu) + 10 + 8 + 29 + 45 + + + 4. Nils Ohlmeier 10 3 630 4 - - 4. - Liviu Chircu (@liviuchircu) - 9 - 7 - 29 - 43 - 5. Razvan Crainea (@razvancrainea) @@ -128,34 +128,34 @@ 1. + Liviu Chircu (@liviuchircu) + Jul 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Nov 2012 - Sep 2019 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Nov 2003 - Apr 2019 - 4. + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - 6. - Liviu Chircu (@liviuchircu) - Jul 2014 - Jun 2018 - 7. Daniel-Constantin Mierla (@miconda) diff --git a/modules/path/Makefile b/modules/path/Makefile index 7bcc3bc16dc..2aff2a8d3a1 100644 --- a/modules/path/Makefile +++ b/modules/path/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # path module makefile # # diff --git a/modules/path/README b/modules/path/README index 30aa973e105..64ac62deed5 100644 --- a/modules/path/README +++ b/modules/path/README @@ -188,7 +188,7 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 20 16 239 79 - 2. Liviu Chircu (@liviuchircu) 17 11 96 265 + 2. Liviu Chircu (@liviuchircu) 18 12 96 267 3. Andreas Granig 13 4 863 22 4. Daniel-Constantin Mierla (@miconda) 12 10 25 21 5. Razvan Crainea (@razvancrainea) 9 7 10 8 @@ -221,12 +221,12 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Aug 2010 - Sep 2019 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2006 - Jul 2019 - 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 6. Liviu Chircu (@liviuchircu) Mar 2014 - Jun 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Aug 2010 - Sep 2019 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2006 - Jul 2019 + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Daniel-Constantin Mierla (@miconda) Nov 2006 - Mar 2008 8. Konstantin Bokarius Mar 2008 - Mar 2008 9. Edson Gellert Schubert Feb 2008 - Feb 2008 diff --git a/modules/path/doc/contributors.xml b/modules/path/doc/contributors.xml index 2f5e4449b93..e3a9ce1c97b 100644 --- a/modules/path/doc/contributors.xml +++ b/modules/path/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 17 - 11 + 18 + 12 96 - 265 + 267 3. @@ -128,34 +128,34 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Aug 2010 - Sep 2019 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2006 - Jul 2019 - 4. + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - 6. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jun 2018 - 7. Daniel-Constantin Mierla (@miconda) diff --git a/modules/perl/README b/modules/perl/README index 8b418a1eabc..0e7a7767786 100644 --- a/modules/perl/README +++ b/modules/perl/README @@ -1379,7 +1379,7 @@ Chapter 5. Contributors 1. Bastian Friedrich 113 38 8597 284 2. Bogdan-Andrei Iancu (@bogdan-iancu) 47 29 702 682 3. Razvan Crainea (@razvancrainea) 23 21 99 60 - 4. Liviu Chircu (@liviuchircu) 20 17 62 73 + 4. Liviu Chircu (@liviuchircu) 22 18 62 133 5. Vlad Patrascu (@rvlad-patrascu) 20 10 264 408 6. Daniel-Constantin Mierla (@miconda) 19 14 164 125 7. Maksym Sobolyev (@sobomax) 5 3 10 42 @@ -1389,8 +1389,8 @@ Chapter 5. Contributors All remaining contributors: Ancuta Onofrei, Konstantin Bokarius, Boris Ratner, Julián Moreno Patiño, Klaus Darilion, - Fabian Gast (@fgast), Peter Lemenkov (@lemenkov), Ovidiu Sas - (@ovidiusas), Dan Pascu (@danpascu). + Fabian Gast (@fgast), Peter Lemenkov (@lemenkov), Aaron + Meriwether, Ovidiu Sas (@ovidiusas), Dan Pascu (@danpascu). (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -1412,21 +1412,22 @@ Chapter 5. Contributors Table 5.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Oct 2022 - Feb 2023 - 2. Liviu Chircu (@liviuchircu) Mar 2014 - Jul 2022 - 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jan 2020 - 4. Fabian Gast (@fgast) Jan 2020 - Jan 2020 - 5. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 - 6. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2006 - Jun 2019 - 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 8. Julián Moreno Patiño Feb 2016 - Feb 2016 - 9. Ionut Ionita (@ionutrazvanionita) Oct 2015 - Oct 2015 - 10. Boris Ratner Jan 2013 - Jan 2013 - - All remaining contributors: Ovidiu Sas (@ovidiusas), Dan Pascu - (@danpascu), Klaus Darilion, Daniel-Constantin Mierla - (@miconda), Konstantin Bokarius, Edson Gellert Schubert, - Bastian Friedrich, Ancuta Onofrei, Julien Blache. + 1. Aaron Meriwether May 2024 - May 2024 + 2. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 3. Maksym Sobolyev (@sobomax) Oct 2022 - Feb 2023 + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jan 2020 + 5. Fabian Gast (@fgast) Jan 2020 - Jan 2020 + 6. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 + 7. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2006 - Jun 2019 + 8. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 + 9. Julián Moreno Patiño Feb 2016 - Feb 2016 + 10. Ionut Ionita (@ionutrazvanionita) Oct 2015 - Oct 2015 + + All remaining contributors: Boris Ratner, Ovidiu Sas + (@ovidiusas), Dan Pascu (@danpascu), Klaus Darilion, + Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson + Gellert Schubert, Bastian Friedrich, Ancuta Onofrei, Julien + Blache. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/perl/doc/contributors.xml b/modules/perl/doc/contributors.xml index d4ba9341c17..aec455e69b3 100644 --- a/modules/perl/doc/contributors.xml +++ b/modules/perl/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 20 - 17 + 22 + 18 62 - 73 + 133 5. @@ -101,7 +101,7 @@ -All remaining contributors: Ancuta Onofrei, Konstantin Bokarius, Boris Ratner, Julián Moreno Patiño, Klaus Darilion, Fabian Gast (@fgast), Peter Lemenkov (@lemenkov), Ovidiu Sas (@ovidiusas), Dan Pascu (@danpascu). +All remaining contributors: Ancuta Onofrei, Konstantin Bokarius, Boris Ratner, Julián Moreno Patiño, Klaus Darilion, Fabian Gast (@fgast), Peter Lemenkov (@lemenkov), Aaron Meriwether, Ovidiu Sas (@ovidiusas), Dan Pascu (@danpascu). (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits) @@ -128,58 +128,58 @@ 1. - Maksym Sobolyev (@sobomax) - Oct 2022 - Feb 2023 + Aaron Meriwether + May 2024 - May 2024 2. Liviu Chircu (@liviuchircu) - Mar 2014 - Jul 2022 + Mar 2014 - May 2024 3. + Maksym Sobolyev (@sobomax) + Oct 2022 - Feb 2023 + + + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jan 2020 - 4. + 5. Fabian Gast (@fgast) Jan 2020 - Jan 2020 - 5. + 6. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 - 6. + 7. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2006 - Jun 2019 - 7. + 8. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 8. + 9. Julián Moreno Patiño Feb 2016 - Feb 2016 - 9. + 10. Ionut Ionita (@ionutrazvanionita) Oct 2015 - Oct 2015 - - 10. - Boris Ratner - Jan 2013 - Jan 2013 - -All remaining contributors: Ovidiu Sas (@ovidiusas), Dan Pascu (@danpascu), Klaus Darilion, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Bastian Friedrich, Ancuta Onofrei, Julien Blache. +All remaining contributors: Boris Ratner, Ovidiu Sas (@ovidiusas), Dan Pascu (@danpascu), Klaus Darilion, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Bastian Friedrich, Ancuta Onofrei, Julien Blache. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/perl/lib/perl/OpenSIPS.pm b/modules/perl/lib/perl/OpenSIPS.pm index 7b2d39fb910..ce148720a89 100644 --- a/modules/perl/lib/perl/OpenSIPS.pm +++ b/modules/perl/lib/perl/OpenSIPS.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/Constants.pm b/modules/perl/lib/perl/OpenSIPS/Constants.pm index d1c3b50cde9..be59da897c0 100644 --- a/modules/perl/lib/perl/OpenSIPS/Constants.pm +++ b/modules/perl/lib/perl/OpenSIPS/Constants.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/LDAPUtils/LDAPConf.pm b/modules/perl/lib/perl/OpenSIPS/LDAPUtils/LDAPConf.pm index 3a9aebabdd0..bcc3db97c41 100644 --- a/modules/perl/lib/perl/OpenSIPS/LDAPUtils/LDAPConf.pm +++ b/modules/perl/lib/perl/OpenSIPS/LDAPUtils/LDAPConf.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/LDAPUtils/LDAPConnection.pm b/modules/perl/lib/perl/OpenSIPS/LDAPUtils/LDAPConnection.pm index c69f10a0b61..c6bababd56f 100644 --- a/modules/perl/lib/perl/OpenSIPS/LDAPUtils/LDAPConnection.pm +++ b/modules/perl/lib/perl/OpenSIPS/LDAPUtils/LDAPConnection.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/Message.pm b/modules/perl/lib/perl/OpenSIPS/Message.pm index 0d1a0d6bdd4..28973909d6a 100644 --- a/modules/perl/lib/perl/OpenSIPS/Message.pm +++ b/modules/perl/lib/perl/OpenSIPS/Message.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/Utils/Debug.pm b/modules/perl/lib/perl/OpenSIPS/Utils/Debug.pm index c033bd0cf0f..a6010fc04c6 100644 --- a/modules/perl/lib/perl/OpenSIPS/Utils/Debug.pm +++ b/modules/perl/lib/perl/OpenSIPS/Utils/Debug.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2007 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/Utils/PhoneNumbers.pm b/modules/perl/lib/perl/OpenSIPS/Utils/PhoneNumbers.pm index 6e4a254a441..3ee1286ada9 100644 --- a/modules/perl/lib/perl/OpenSIPS/Utils/PhoneNumbers.pm +++ b/modules/perl/lib/perl/OpenSIPS/Utils/PhoneNumbers.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB.pm b/modules/perl/lib/perl/OpenSIPS/VDB.pm index 64ba230b148..338aadc117c 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/AccountingSIPtrace.pm b/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/AccountingSIPtrace.pm index 9fb0abef4cf..d4f629ec28a 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/AccountingSIPtrace.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/AccountingSIPtrace.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2007 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Alias.pm b/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Alias.pm index 7d88b346d18..3e6f4392019 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Alias.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Alias.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2007 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Auth.pm b/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Auth.pm index 32fd32b7fb9..2292dc7eee6 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Auth.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Auth.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2007 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Describe.pm b/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Describe.pm index 90794e0a866..87e637d1e33 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Describe.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Describe.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2007 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Speeddial.pm b/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Speeddial.pm index 0e11f395fec..ac12606ec6a 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Speeddial.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/Speeddial.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2007 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/TableVersions.pm b/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/TableVersions.pm index 0a05f4cc42c..8e2359ed266 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/TableVersions.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB/Adapter/TableVersions.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2007 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB/Column.pm b/modules/perl/lib/perl/OpenSIPS/VDB/Column.pm index 832ea6aee52..42d193604f2 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB/Column.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB/Column.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB/Pair.pm b/modules/perl/lib/perl/OpenSIPS/VDB/Pair.pm index 70073b614a9..5aea0c27c43 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB/Pair.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB/Pair.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB/ReqCond.pm b/modules/perl/lib/perl/OpenSIPS/VDB/ReqCond.pm index 7e275a3c755..38c7e16f1dc 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB/ReqCond.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB/ReqCond.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB/Result.pm b/modules/perl/lib/perl/OpenSIPS/VDB/Result.pm index 7bdaab1f403..3e9275fecce 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB/Result.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB/Result.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB/VTab.pm b/modules/perl/lib/perl/OpenSIPS/VDB/VTab.pm index 3a7cdba8813..0a72b21ad6e 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB/VTab.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB/VTab.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/lib/perl/OpenSIPS/VDB/Value.pm b/modules/perl/lib/perl/OpenSIPS/VDB/Value.pm index 750a713b344..e6822579b08 100644 --- a/modules/perl/lib/perl/OpenSIPS/VDB/Value.pm +++ b/modules/perl/lib/perl/OpenSIPS/VDB/Value.pm @@ -1,6 +1,3 @@ -# -# $Id$ -# # Perl module for OpenSIPS # # Copyright (C) 2006 Collax GmbH diff --git a/modules/perl/perlfunc.c b/modules/perl/perlfunc.c index b7553587ff3..3988dee288c 100644 --- a/modules/perl/perlfunc.c +++ b/modules/perl/perlfunc.c @@ -81,7 +81,11 @@ int perl_exec_simple(struct sip_msg* _msg, str *_fnc_s, str *_param_s) if (perl_checkfnc(fnc)) { LM_DBG("running perl function \"%s\"\n", fnc); + ENTER; + SAVETMPS; call_argv(fnc, flags, args); + FREETMPS; + LEAVE; ret = 1; } else { LM_ERR("unknown function '%s' called.\n", fnc); diff --git a/modules/permissions/Makefile b/modules/permissions/Makefile index 7198294411f..0effd41c408 100644 --- a/modules/permissions/Makefile +++ b/modules/permissions/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # PERMISSIONS module makefile # # WARNING: do not run this directly, it should be run by the master Makefile diff --git a/modules/permissions/README b/modules/permissions/README index ab179f92b8c..00964a5cd49 100644 --- a/modules/permissions/README +++ b/modules/permissions/README @@ -752,8 +752,8 @@ Chapter 2. Contributors 2. Juha Heinanen (@juha-h) 61 21 3406 729 3. Jan Janak (@janakj) 56 21 2871 621 4. Irina-Maria Stanescu 51 9 1218 1908 - 5. Liviu Chircu (@liviuchircu) 29 19 412 361 - 6. Razvan Crainea (@razvancrainea) 25 21 176 114 + 5. Liviu Chircu (@liviuchircu) 31 20 412 369 + 6. Razvan Crainea (@razvancrainea) 26 22 178 116 7. Daniel-Constantin Mierla (@miconda) 17 11 126 221 8. Henning Westerholt (@henningw) 15 10 136 148 9. Ionut Ionita (@ionutrazvanionita) 15 4 970 175 @@ -788,10 +788,10 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 2. Liviu Chircu (@liviuchircu) Mar 2014 - Aug 2022 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2005 - Sep 2020 - 4. Razvan Crainea (@razvancrainea) Jan 2011 - Jul 2020 + 1. Razvan Crainea (@razvancrainea) Jan 2011 - Sep 2024 + 2. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 3. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2005 - Sep 2020 5. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 6. Dan Pascu (@danpascu) Nov 2006 - May 2019 7. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 diff --git a/modules/permissions/config/register.allow b/modules/permissions/config/register.allow index ddd8f61ddac..3d3c6eee83e 100644 --- a/modules/permissions/config/register.allow +++ b/modules/permissions/config/register.allow @@ -1,6 +1,3 @@ -# -# $Id$ -# # Files register.allow and register.deny could be used # by allow_register function to prevent registration of # certain IP addresses. This (allow) file is empty because diff --git a/modules/permissions/config/register.deny b/modules/permissions/config/register.deny index ec0e1661cf5..87bbd9f72a5 100644 --- a/modules/permissions/config/register.deny +++ b/modules/permissions/config/register.deny @@ -1,6 +1,3 @@ -# -# $Id$ -# # Suppose that we have a PSTN gateway with IP address 1.2.3.4 # We should prevent REGISTER messages that contain that IP # address in Contact header field because that can cause serious diff --git a/modules/permissions/doc/contributors.xml b/modules/permissions/doc/contributors.xml index 11cd1fd0633..4d22c6e3709 100644 --- a/modules/permissions/doc/contributors.xml +++ b/modules/permissions/doc/contributors.xml @@ -53,18 +53,18 @@ 5. Liviu Chircu (@liviuchircu) - 29 - 19 + 31 + 20 412 - 361 + 369 6. Razvan Crainea (@razvancrainea) - 25 - 21 - 176 - 114 + 26 + 22 + 178 + 116 7. @@ -128,23 +128,23 @@ 1. - Maksym Sobolyev (@sobomax) - Jan 2021 - Feb 2023 + Razvan Crainea (@razvancrainea) + Jan 2011 - Sep 2024 2. Liviu Chircu (@liviuchircu) - Mar 2014 - Aug 2022 + Mar 2014 - May 2024 3. - Bogdan-Andrei Iancu (@bogdan-iancu) - Jan 2005 - Sep 2020 + Maksym Sobolyev (@sobomax) + Jan 2021 - Feb 2023 4. - Razvan Crainea (@razvancrainea) - Jan 2011 - Jul 2020 + Bogdan-Andrei Iancu (@bogdan-iancu) + Jan 2005 - Sep 2020 5. diff --git a/modules/permissions/permissions.c b/modules/permissions/permissions.c index 124cb6bc0a9..260f0cbfa6e 100644 --- a/modules/permissions/permissions.c +++ b/modules/permissions/permissions.c @@ -642,16 +642,16 @@ static int mod_init(void) static int child_init(int rank) { - return 0; + int res = mi_init_address(); + if_update_stat(mod_stat_enabled, subnet_count_stat, current_subnet_count); + if_update_stat(mod_stat_enabled, address_count_stat, current_address_count); + return res; } static int mi_address_child_init(void) { - int res = mi_init_address(); - if_update_stat(mod_stat_enabled, subnet_count_stat, current_subnet_count); - if_update_stat(mod_stat_enabled, address_count_stat, current_address_count); - return res; + return 0; } /* diff --git a/modules/pike/Makefile b/modules/pike/Makefile index 925276f8222..bc6c91bae3d 100644 --- a/modules/pike/Makefile +++ b/modules/pike/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/pike/README b/modules/pike/README index a7a39c412c0..6e086b5b352 100644 --- a/modules/pike/README +++ b/modules/pike/README @@ -337,7 +337,7 @@ Chapter 3. Contributors 1. Bogdan-Andrei Iancu (@bogdan-iancu) 138 59 4217 2675 2. Andrei Pelinescu-Onciul 15 8 120 336 3. Razvan Crainea (@razvancrainea) 13 11 94 18 - 4. Liviu Chircu (@liviuchircu) 12 9 29 67 + 4. Liviu Chircu (@liviuchircu) 13 10 29 69 5. Daniel-Constantin Mierla (@miconda) 11 9 24 20 6. Jan Janak (@janakj) 9 4 386 34 7. Vlad Patrascu (@rvlad-patrascu) 8 6 73 52 @@ -370,9 +370,9 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2002 - May 2023 - 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2020 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2002 - May 2023 + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 4. Razvan Crainea (@razvancrainea) May 2011 - Sep 2019 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/pike/doc/contributors.xml b/modules/pike/doc/contributors.xml index 017d9a2227a..38a28d25669 100644 --- a/modules/pike/doc/contributors.xml +++ b/modules/pike/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 12 - 9 + 13 + 10 29 - 67 + 69 5. @@ -128,18 +128,18 @@ 1. - Bogdan-Andrei Iancu (@bogdan-iancu) - Jun 2002 - May 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Bogdan-Andrei Iancu (@bogdan-iancu) + Jun 2002 - May 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2020 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 4. diff --git a/modules/presence/Makefile b/modules/presence/Makefile index abac30604f8..061bbe4c4e9 100644 --- a/modules/presence/Makefile +++ b/modules/presence/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # Presence Agent # # diff --git a/modules/presence/README b/modules/presence/README index aec147bd30f..2e05a144407 100644 --- a/modules/presence/README +++ b/modules/presence/README @@ -19,24 +19,25 @@ Presence Module 1.4.3. cluster_id (int) 1.4.4. cluster_federation_mode (str) 1.4.5. cluster_pres_events (str) - 1.4.6. expires_offset (int) - 1.4.7. max_expires_subscribe (int) - 1.4.8. max_expires_publish (int) - 1.4.9. contact_user (str) - 1.4.10. enable_sphere_check (int) - 1.4.11. waiting_subs_daysno (int) - 1.4.12. mix_dialog_presence (int) - 1.4.13. bla_presentity_spec (str) - 1.4.14. bla_fix_remote_target (int) - 1.4.15. notify_offline_body (int) - 1.4.16. end_sub_on_timeout (int) - 1.4.17. clean_period (int) - 1.4.18. db_update_period (int) - 1.4.19. presentity_table(str) - 1.4.20. active_watchers_table(str) - 1.4.21. watchers_table(str) - 1.4.22. subs_htable_size (int) - 1.4.23. pres_htable_size (int) + 1.4.6. cluster_be_active_shtag (str) + 1.4.7. expires_offset (int) + 1.4.8. max_expires_subscribe (int) + 1.4.9. max_expires_publish (int) + 1.4.10. contact_user (str) + 1.4.11. enable_sphere_check (int) + 1.4.12. waiting_subs_daysno (int) + 1.4.13. mix_dialog_presence (int) + 1.4.14. bla_presentity_spec (str) + 1.4.15. bla_fix_remote_target (int) + 1.4.16. notify_offline_body (int) + 1.4.17. end_sub_on_timeout (int) + 1.4.18. clean_period (int) + 1.4.19. db_update_period (int) + 1.4.20. presentity_table(str) + 1.4.21. active_watchers_table(str) + 1.4.22. watchers_table(str) + 1.4.23. subs_htable_size (int) + 1.4.24. pres_htable_size (int) 1.5. Exported Functions @@ -101,26 +102,27 @@ Presence Module 1.3. Set cluster_id parameter 1.4. Set cluster_federation_mode parameter 1.5. Set cluster_pres_events parameter - 1.6. Set expires_offset parameter - 1.7. Set max_expires_subscribe parameter - 1.8. Set max_expires_publish parameter - 1.9. Set contact_user parameter - 1.10. Set enable_sphere_check parameter - 1.11. Set waiting_subs_daysno parameter - 1.12. Set mix_dialog_presence parameter - 1.13. Set bla_presentity_spec parameter - 1.14. Set bla_fix_remote_target parameter - 1.15. Set notify_offline_body parameter - 1.16. Set end_sub_on_timeout parameter - 1.17. Set clean_period parameter - 1.18. Set db_update_period parameter - 1.19. Set presentity_table parameter - 1.20. Set active_watchers_table parameter - 1.21. Set watchers_table parameter - 1.22. Set subs_htable_size parameter - 1.23. Set pres_htable_size parameter - 1.24. handle_publish usage - 1.25. handle_subscribe usage + 1.6. Set cluster_be_active_shtag parameter + 1.7. Set expires_offset parameter + 1.8. Set max_expires_subscribe parameter + 1.9. Set max_expires_publish parameter + 1.10. Set contact_user parameter + 1.11. Set enable_sphere_check parameter + 1.12. Set waiting_subs_daysno parameter + 1.13. Set mix_dialog_presence parameter + 1.14. Set bla_presentity_spec parameter + 1.15. Set bla_fix_remote_target parameter + 1.16. Set notify_offline_body parameter + 1.17. Set end_sub_on_timeout parameter + 1.18. Set clean_period parameter + 1.19. Set db_update_period parameter + 1.20. Set presentity_table parameter + 1.21. Set active_watchers_table parameter + 1.22. Set watchers_table parameter + 1.23. Set subs_htable_size parameter + 1.24. Set pres_htable_size parameter + 1.25. handle_publish usage + 1.26. handle_subscribe usage 2.1. presence_api_t structure Chapter 1. Admin Guide @@ -224,6 +226,14 @@ modparam("presence", "fallback2db", 1) order to understand th concept of a cluster ID, please see the clusterer module. + This OpenSIPS cluster exposes the "presence" capability in + order to mark nodes as eligible for becoming data donors during + an arbitrary sync request. Consequently, the cluster must have + at least one node marked with the "seed" value as the + clusterer.flags column/property in order to be fully + functional. Consult the clusterer - Capabilities chapter for + more details. + For more on presence clustering see the Section 1.2, “Presence clustering” chapter. @@ -283,41 +293,67 @@ modparam("presence", "cluster_pres_events" ,"presence, dialog;sla, messa ge-summary") ... -1.4.6. expires_offset (int) +1.4.6. cluster_be_active_shtag (str) + + The name of a cluster sharing tag to be used to indicate when + this node (as part of the cluster) should be active or not. If + the sharing tag is off (or as backup), the node will become + inactive from clustering perspective, meaning not sending and + not accepting any presence related cluster traffic. + + This ability of a node to become inactive may be used when + creating a federated cluster where 2 nodes are acting as a + local active-backup setup (for local High Availability + purposes). + + This parameter has meaning only in clustering mode. If not + defined, the node will be active all the time. + + For more on presence clustering see the Section 1.2, “Presence + clustering” chapter. + + Default value is “empty” (not tag define). + + Example 1.6. Set cluster_be_active_shtag parameter +... +modparam("presence", "cluster_be_active_shtag" ,"local_ha") +... + +1.4.7. expires_offset (int) The extra time to store a subscription/publication. Default value is “0”. - Example 1.6. Set expires_offset parameter + Example 1.7. Set expires_offset parameter ... modparam("presence", "expires_offset", 10) ... -1.4.7. max_expires_subscribe (int) +1.4.8. max_expires_subscribe (int) The the maximum admissible expires value for SUBSCRIBE messages. Default value is “3600”. - Example 1.7. Set max_expires_subscribe parameter + Example 1.8. Set max_expires_subscribe parameter ... modparam("presence", "max_expires_subscribe", 3600) ... -1.4.8. max_expires_publish (int) +1.4.9. max_expires_publish (int) The the maximum admissible expires value for PUBLISH messages. Default value is “3600”. - Example 1.8. Set max_expires_publish parameter + Example 1.9. Set max_expires_publish parameter ... modparam("presence", "max_expires_publish", 3600) ... -1.4.9. contact_user (str) +1.4.10. contact_user (str) This is the username that will be used in the Contact header for the 200 OK replies to SUBSCRIBE and in the following @@ -331,12 +367,12 @@ modparam("presence", "max_expires_publish", 3600) Default value is “presence”. - Example 1.9. Set contact_user parameter + Example 1.10. Set contact_user parameter ... modparam("presence", "contact_user", "presence") ... -1.4.10. enable_sphere_check (int) +1.4.11. enable_sphere_check (int) This parameter is a flag that should be set if permission rules include sphere checking. The sphere information is expected to @@ -347,12 +383,12 @@ modparam("presence", "contact_user", "presence") Default value is “0 ”. - Example 1.10. Set enable_sphere_check parameter + Example 1.11. Set enable_sphere_check parameter ... modparam("presence", "enable_sphere_check", 1) ... -1.4.11. waiting_subs_daysno (int) +1.4.12. waiting_subs_daysno (int) The number of days to keep the record of a subscription in server database if the subscription is in pending or waiting @@ -362,12 +398,12 @@ modparam("presence", "enable_sphere_check", 1) Default value is “3” days. Maximum accepted value is 30 days. - Example 1.11. Set waiting_subs_daysno parameter + Example 1.12. Set waiting_subs_daysno parameter ... modparam("presence", "waiting_subs_daysno", 2) ... -1.4.12. mix_dialog_presence (int) +1.4.13. mix_dialog_presence (int) This module parameter enables a very nice feature in the presence server - generating presence information from dialogs @@ -379,12 +415,12 @@ modparam("presence", "waiting_subs_daysno", 2) Default value is “0”. - Example 1.12. Set mix_dialog_presence parameter + Example 1.13. Set mix_dialog_presence parameter ... modparam("presence", "mix_dialog_presence", 1) ... -1.4.13. bla_presentity_spec (str) +1.4.14. bla_presentity_spec (str) By default the presentity uri for BLA subscribes (event=dialog;sla) is computed from contact username + from @@ -398,12 +434,12 @@ modparam("presence", "mix_dialog_presence", 1) Default value is “NULL”. - Example 1.13. Set bla_presentity_spec parameter + Example 1.14. Set bla_presentity_spec parameter ... modparam("presence", "bla_presentity_spec", "$var(bla_pres)") ... -1.4.14. bla_fix_remote_target (int) +1.4.15. bla_fix_remote_target (int) Polycom has a bug in the bla implementation. It inserts the remote IP contact in the Notify body and when a phone picks up @@ -418,12 +454,12 @@ modparam("presence", "bla_presentity_spec", "$var(bla_pres)") Default value is “1”. - Example 1.14. Set bla_fix_remote_target parameter + Example 1.15. Set bla_fix_remote_target parameter ... modparam("presence", "bla_fix_remote_target", 0) ... -1.4.15. notify_offline_body (int) +1.4.16. notify_offline_body (int) If this parameter is set, when no published info is found for a user, the presence server will generate a dummy body with @@ -432,12 +468,12 @@ modparam("presence", "bla_fix_remote_target", 0) Default value is “0”. - Example 1.15. Set notify_offline_body parameter + Example 1.16. Set notify_offline_body parameter ... modparam("presence", "notify_offline_body", 1) ... -1.4.16. end_sub_on_timeout (int) +1.4.17. end_sub_on_timeout (int) If a presence subscription should be automatically terminated (destroyed) when receiving a SIP timeout (408) for a sent @@ -445,24 +481,24 @@ modparam("presence", "notify_offline_body", 1) Default value is “1” (enabled). - Example 1.16. Set end_sub_on_timeout parameter + Example 1.17. Set end_sub_on_timeout parameter ... modparam("presence", "end_sub_on_timeout", 0) ... -1.4.17. clean_period (int) +1.4.18. clean_period (int) The period at which to clean the expired subscription dialogs. Default value is “100”. A zero or negative value disables this activity. - Example 1.17. Set clean_period parameter + Example 1.18. Set clean_period parameter ... modparam("presence", "clean_period", 100) ... -1.4.18. db_update_period (int) +1.4.19. db_update_period (int) The period at which to synchronize cached subscriber info with the database. @@ -470,46 +506,46 @@ modparam("presence", "clean_period", 100) Default value is “100”. A zero or negative value disables synchronization. - Example 1.18. Set db_update_period parameter + Example 1.19. Set db_update_period parameter ... modparam("presence", "db_update_period", 100) ... -1.4.19. presentity_table(str) +1.4.20. presentity_table(str) The name of the db table where Publish information are stored. Default value is “presentity”. - Example 1.19. Set presentity_table parameter + Example 1.20. Set presentity_table parameter ... modparam("presence", "presentity_table", "presentity") ... -1.4.20. active_watchers_table(str) +1.4.21. active_watchers_table(str) The name of the db table where active subscription information are stored. Default value is “active_watchers”. - Example 1.20. Set active_watchers_table parameter + Example 1.21. Set active_watchers_table parameter ... modparam("presence", "active_watchers_table", "active_watchers") ... -1.4.21. watchers_table(str) +1.4.22. watchers_table(str) The name of the db table where subscription states are stored. Default value is “watchers”. - Example 1.21. Set watchers_table parameter + Example 1.22. Set watchers_table parameter ... modparam("presence", "watchers_table", "watchers") ... -1.4.22. subs_htable_size (int) +1.4.23. subs_htable_size (int) The size of the hash table to store subscription dialogs. This parameter will be used as the power of 2 when computing table @@ -517,12 +553,12 @@ modparam("presence", "watchers_table", "watchers") Default value is “9 (512)”. - Example 1.22. Set subs_htable_size parameter + Example 1.23. Set subs_htable_size parameter ... modparam("presence", "subs_htable_size", 11) ... -1.4.23. pres_htable_size (int) +1.4.24. pres_htable_size (int) The size of the hash table to store publish records. This parameter will be used as the power of 2 when computing table @@ -530,7 +566,7 @@ modparam("presence", "subs_htable_size", 11) Default value is “9 (512)”. - Example 1.23. Set pres_htable_size parameter + Example 1.24. Set pres_htable_size parameter ... modparam("presence", "pres_htable_size", 11) ... @@ -561,7 +597,7 @@ modparam("presence", "pres_htable_size", 11) The module sends an appropriate stateless reply in all cases. - Example 1.24. handle_publish usage + Example 1.25. handle_publish usage ... if(is_method("PUBLISH")) { @@ -614,7 +650,7 @@ modparam("presence", "pres_htable_size", 11) The module sends an appropriate stateless reply in all cases. - Example 1.25. handle_subscribe usage + Example 1.26. handle_subscribe usage ... if($rm=="SUBSCRIBE") handle_subscribe(); @@ -1034,10 +1070,10 @@ Chapter 3. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Anca Vamanu 651 247 24146 12623 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) 147 91 3098 1815 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) 150 93 3219 1832 3. Razvan Crainea (@razvancrainea) 35 28 423 163 - 4. Vlad Patrascu (@rvlad-patrascu) 33 19 631 481 - 5. Liviu Chircu (@liviuchircu) 31 21 257 375 + 4. Liviu Chircu (@liviuchircu) 35 25 287 397 + 5. Vlad Patrascu (@rvlad-patrascu) 33 19 631 481 6. Ovidiu Sas (@ovidiusas) 29 20 618 170 7. Daniel-Constantin Mierla (@miconda) 24 19 174 165 8. Dan Pascu (@danpascu) 20 14 162 201 @@ -1074,13 +1110,13 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2022 - 3. Jasper Hafkenscheid Jul 2022 - Jul 2022 - 4. Liviu Chircu (@liviuchircu) Mar 2014 - Dec 2021 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2006 - Apr 2024 + 2. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 + 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2022 + 4. Jasper Hafkenscheid Jul 2022 - Jul 2022 5. Razvan Crainea (@razvancrainea) Sep 2011 - Jun 2021 - 6. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2006 - Jun 2021 - 7. Walter Doekes (@wdoekes) Apr 2010 - Apr 2021 + 6. Walter Doekes (@wdoekes) Apr 2010 - Apr 2021 + 7. Liviu Chircu (@liviuchircu) Mar 2014 - Apr 2021 8. Ovidiu Sas (@ovidiusas) Sep 2010 - Sep 2020 9. Dan Pascu (@danpascu) Nov 2007 - Feb 2020 10. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 @@ -1102,15 +1138,15 @@ Chapter 4. Documentation 4.1. Contributors - Last edited by: Jasper Hafkenscheid, Ovidiu Sas (@ovidiusas), - Vlad Patrascu (@rvlad-patrascu), Walter Doekes (@wdoekes), Dan - Pascu (@danpascu), Liviu Chircu (@liviuchircu), Bogdan-Andrei - Iancu (@bogdan-iancu), Razvan Crainea (@razvancrainea), Peter - Lemenkov (@lemenkov), Saúl Ibarra Corretgé (@saghul), Anca - Vamanu, Kennard White, Angel Marin, Kobi Eshun (@ekobi), Klaus - Darilion, Henning Westerholt (@henningw), Daniel-Constantin - Mierla (@miconda), Edson Gellert Schubert, Juha Heinanen - (@juha-h), Elena-Ramona Modroiu. + Last edited by: Liviu Chircu (@liviuchircu), Bogdan-Andrei + Iancu (@bogdan-iancu), Jasper Hafkenscheid, Ovidiu Sas + (@ovidiusas), Vlad Patrascu (@rvlad-patrascu), Walter Doekes + (@wdoekes), Dan Pascu (@danpascu), Razvan Crainea + (@razvancrainea), Peter Lemenkov (@lemenkov), Saúl Ibarra + Corretgé (@saghul), Anca Vamanu, Kennard White, Angel Marin, + Kobi Eshun (@ekobi), Klaus Darilion, Henning Westerholt + (@henningw), Daniel-Constantin Mierla (@miconda), Edson Gellert + Schubert, Juha Heinanen (@juha-h), Elena-Ramona Modroiu. Documentation Copyrights: diff --git a/modules/presence/clustering.c b/modules/presence/clustering.c index e9724e7262d..d927f6bd946 100644 --- a/modules/presence/clustering.c +++ b/modules/presence/clustering.c @@ -32,6 +32,8 @@ int cluster_federation = 0; str clustering_events = {NULL,0}; +int *cluster_active = NULL; + static unsigned char clustered_events[EVENT_LINE_SEIZE]; struct clusterer_binds c_api; @@ -49,10 +51,36 @@ static void bin_packet_handler(bin_packet_t *packet); static void cluster_event_handler(enum clusterer_event ev, int node_id); -int init_pres_clustering(void) +void cluster_active_shtag_cb(str *tag, int state, int c_id, void *param) +{ + if (cluster_active) { + *cluster_active = (state==SHTAG_STATE_ACTIVE)? 1 : 0; + if (cluster_federation == FEDERATION_FULL_SHARING && *cluster_active && + c_api.request_sync(&presence_capability, pres_cluster_id, 0) < 0) + LM_ERR("Sync request failed\n"); + } +} + +int init_pres_clustering(char *federation_mode_str, + char *cluster_active_shtag_str) { csv_record *list, *it; event_t e; + str sh_tag; + int shtag_state; + + if (!federation_mode_str || !strcasecmp(federation_mode_str, "disabled")) { + cluster_federation = FEDERATION_DISABLED; + pres_cluster_id = 0; + return 0; + } else if (!strcasecmp(federation_mode_str, "on-demand-sharing")) { + cluster_federation = FEDERATION_ON_DEMAND; + } else if (!strcasecmp(federation_mode_str, "full-sharing")) { + cluster_federation = FEDERATION_FULL_SHARING; + } else { + LM_ERR("invalid cluster_federation_mode: '%s'\n", federation_mode_str); + return -1; + } /* is clustering needed ? */ if (!is_presence_cluster_enabled()) @@ -64,6 +92,13 @@ int init_pres_clustering(void) return -1; } + cluster_active = (int*)shm_malloc( sizeof(int) ); + if (cluster_active==NULL) { + LM_ERR("not enough shm mem for cluster_active variable\n"); + return -1; + } + *cluster_active = 1; /* default is active */ + /* register handler for receiving packets from the clusterer module */ if (c_api.register_capability( &presence_capability, bin_packet_handler, cluster_event_handler, pres_cluster_id, @@ -73,6 +108,25 @@ int init_pres_clustering(void) return -1; } + if (cluster_active_shtag_str) { + sh_tag.s = cluster_active_shtag_str; + sh_tag.len = strlen(cluster_active_shtag_str); + if ((shtag_state=c_api.shtag_get( &sh_tag, pres_cluster_id))<0) { + LM_ERR("failed to lookup the <%.*s> active sharing tag\n", + sh_tag.len, sh_tag.s); + return -1; + } + /* inherite the active status*/ + *cluster_active = (shtag_state==SHTAG_STATE_ACTIVE)? 1 : 0; + + if (c_api.shtag_register_callback( &sh_tag, pres_cluster_id, + NULL, cluster_active_shtag_cb) < 0) { + LM_ERR("failed to register callbacks for <%.*s> sharing tag\n", + sh_tag.len, sh_tag.s); + return -1; + } + } + if (clustering_events.s) { /* parse the event list */ clustering_events.len = strlen(clustering_events.s); @@ -96,7 +150,7 @@ int init_pres_clustering(void) memset( clustered_events, 1, sizeof(clustered_events) ); } - if (cluster_federation == FEDERATION_FULL_SHARING && + if (cluster_federation == FEDERATION_FULL_SHARING && *cluster_active && c_api.request_sync(&presence_capability, pres_cluster_id, 0) < 0) LM_ERR("Sync request failed\n"); @@ -234,6 +288,12 @@ void replicate_publish_on_cluster(presentity_t *pres) { bin_packet_t packet; + /* am I active from clustering perspective? */ + if (*cluster_active==0) { + LM_ERR("trying to do query cluster, but in inactive mode (according to sharing tag) :-/\n"); + return; + } + memset( &packet, 0, sizeof(bin_packet_t) ); if (bin_init(&packet, &presence_capability, CL_PRESENCE_PUBLISH, BIN_VERSION, 0) < 0) @@ -258,6 +318,12 @@ void query_cluster_for_presentity(str *pres_uri, event_t *evp) cluster_query_entry_t* p; int step=0; + /* am I active from clustering perspective? */ + if (*cluster_active==0) { + LM_ERR("trying to do query cluster, but in inactive mode (according to sharing tag) :-/\n"); + return; + } + /* check if the presentity is not in the pending list */ hash_code= core_hash( pres_uri, NULL, phtable_size); lock_get( &pres_htable[hash_code].lock ); @@ -607,6 +673,10 @@ static void bin_packet_handler(bin_packet_t *pkt) { int rc; + /* am I active from clustering perspective? */ + if (*cluster_active==0) + return; + switch (pkt->type) { case CL_PRESENCE_PUBLISH: ensure_bin_version(pkt, BIN_VERSION); @@ -686,6 +756,10 @@ static int receive_sync_request(int node_id) static void cluster_event_handler(enum clusterer_event ev, int node_id) { + /* am I active from clustering perspective? */ + if (*cluster_active==0) + return; + if (ev == SYNC_REQ_RCV && receive_sync_request(node_id) < 0) LM_ERR("Failed to send sync data to node: %d\n", node_id); } diff --git a/modules/presence/clustering.h b/modules/presence/clustering.h index 1d36ba8ff90..898c4418bca 100644 --- a/modules/presence/clustering.h +++ b/modules/presence/clustering.h @@ -53,7 +53,8 @@ extern str clustering_events; /* the clusterer api / functions */ extern struct clusterer_binds c_api; -int init_pres_clustering(void); +int init_pres_clustering(char *federation_mode_str, + char* cluster_mute_shtag_str); int is_event_clustered( int event_parsed ); diff --git a/modules/presence/doc/contributors.xml b/modules/presence/doc/contributors.xml index f1908481966..473f562a9f0 100644 --- a/modules/presence/doc/contributors.xml +++ b/modules/presence/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Bogdan-Andrei Iancu (@bogdan-iancu) - 147 - 91 - 3098 - 1815 + 150 + 93 + 3219 + 1832 3. @@ -44,20 +44,20 @@ 4. + Liviu Chircu (@liviuchircu) + 35 + 25 + 287 + 397 + + + 5. Vlad Patrascu (@rvlad-patrascu) 33 19 631 481 - - 5. - Liviu Chircu (@liviuchircu) - 31 - 21 - 257 - 375 - 6. Ovidiu Sas (@ovidiusas) @@ -128,24 +128,24 @@ 1. + Bogdan-Andrei Iancu (@bogdan-iancu) + Oct 2006 - Apr 2024 + + + 2. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 2. + 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2022 - 3. + 4. Jasper Hafkenscheid Jul 2022 - Jul 2022 - - 4. - Liviu Chircu (@liviuchircu) - Mar 2014 - Dec 2021 - 5. Razvan Crainea (@razvancrainea) @@ -153,13 +153,13 @@ 6. - Bogdan-Andrei Iancu (@bogdan-iancu) - Oct 2006 - Jun 2021 + Walter Doekes (@wdoekes) + Apr 2010 - Apr 2021 7. - Walter Doekes (@wdoekes) - Apr 2010 - Apr 2021 + Liviu Chircu (@liviuchircu) + Mar 2014 - Apr 2021 8. @@ -190,7 +190,7 @@ Documentation
Contributors - Last edited by: Jasper Hafkenscheid, Ovidiu Sas (@ovidiusas), Vlad Patrascu (@rvlad-patrascu), Walter Doekes (@wdoekes), Dan Pascu (@danpascu), Liviu Chircu (@liviuchircu), Bogdan-Andrei Iancu (@bogdan-iancu), Razvan Crainea (@razvancrainea), Peter Lemenkov (@lemenkov), Saúl Ibarra Corretgé (@saghul), Anca Vamanu, Kennard White, Angel Marin, Kobi Eshun (@ekobi), Klaus Darilion, Henning Westerholt (@henningw), Daniel-Constantin Mierla (@miconda), Edson Gellert Schubert, Juha Heinanen (@juha-h), Elena-Ramona Modroiu. + Last edited by: Liviu Chircu (@liviuchircu), Bogdan-Andrei Iancu (@bogdan-iancu), Jasper Hafkenscheid, Ovidiu Sas (@ovidiusas), Vlad Patrascu (@rvlad-patrascu), Walter Doekes (@wdoekes), Dan Pascu (@danpascu), Razvan Crainea (@razvancrainea), Peter Lemenkov (@lemenkov), Saúl Ibarra Corretgé (@saghul), Anca Vamanu, Kennard White, Angel Marin, Kobi Eshun (@ekobi), Klaus Darilion, Henning Westerholt (@henningw), Daniel-Constantin Mierla (@miconda), Edson Gellert Schubert, Juha Heinanen (@juha-h), Elena-Ramona Modroiu.
diff --git a/modules/presence/doc/presence.xml b/modules/presence/doc/presence.xml index 914ed63280d..c95bad2c244 100644 --- a/modules/presence/doc/presence.xml +++ b/modules/presence/doc/presence.xml @@ -6,6 +6,8 @@ + + diff --git a/modules/presence/doc/presence_admin.xml b/modules/presence/doc/presence_admin.xml index 4a391c2fcd4..958913a3a2b 100644 --- a/modules/presence/doc/presence_admin.xml +++ b/modules/presence/doc/presence_admin.xml @@ -163,6 +163,9 @@ modparam("presence", "fallback2db", 1) understand th concept of a cluster ID, please see the clusterer module.
+ + &clusterer_sync_cap_para; + For more on presence clustering see the chapter. @@ -264,6 +267,44 @@ modparam("presence", "cluster_pres_events" ,"presence, dialog;sla, message-summa
+
+ <varname>cluster_be_active_shtag</varname> (str) + + The name of a cluster sharing tag to be used to indicate when this + node (as part of the cluster) should be active or not. If the sharing + tag is off (or as backup), the node will become inactive from + clustering perspective, meaning not sending and not accepting any + presence related cluster traffic. + + + This ability of a node to become inactive may be used when creating a + federated cluster where 2 nodes are acting as a local active-backup + setup (for local High Availability purposes). + + + This parameter has meaning only in clustering mode. If not defined, the + node will be active all the time. + + + For more on presence clustering see the + chapter. + + + Default value is empty (not tag define). + + + + Set <varname>cluster_be_active_shtag</varname> parameter + +... +modparam("presence", "cluster_be_active_shtag" ,"local_ha") +... + + +
+ + +
<varname>expires_offset</varname> (int) diff --git a/modules/presence/presence.c b/modules/presence/presence.c index 4b50ac9c264..747add1da14 100644 --- a/modules/presence/presence.c +++ b/modules/presence/presence.c @@ -134,7 +134,8 @@ int end_sub_on_timeout= 1; pres_ev_t** pres_event_p= NULL; pres_ev_t** dialog_event_p= NULL; -char *federation_mode_str; +char *federation_mode_str = NULL; +char *cluster_active_shtag_str = NULL; int phtable_size= 9; phtable_t* pres_htable = NULL; @@ -186,6 +187,7 @@ static const param_export_t params[]={ { "end_sub_on_timeout", INT_PARAM, &end_sub_on_timeout}, { "cluster_id", INT_PARAM, &pres_cluster_id}, { "cluster_federation_mode",STR_PARAM, &federation_mode_str}, + { "cluster_be_active_shtag",STR_PARAM, &cluster_active_shtag_str}, { "cluster_pres_events", STR_PARAM, &clustering_events.s}, {0,0,0} }; @@ -265,7 +267,8 @@ struct module_exports exports= { static int mod_init(void) { db_url.len = db_url.s ? strlen(db_url.s) : 0; - LM_DBG("db_url=%s/%d/%p\n", ZSW(db_url.s), db_url.len,db_url.s); + LM_DBG("db_url=%s\n", db_url_escape(&db_url)); + presentity_table.len = strlen(presentity_table.s); active_watchers_table.len = strlen(active_watchers_table.s); watchers_table.len = strlen(watchers_table.s); @@ -328,18 +331,7 @@ static int mod_init(void) return -1; } - if (!federation_mode_str || !strcasecmp(federation_mode_str, "disabled")) { - cluster_federation = FEDERATION_DISABLED; - } else if (!strcasecmp(federation_mode_str, "on-demand-sharing")) { - cluster_federation = FEDERATION_ON_DEMAND; - } else if (!strcasecmp(federation_mode_str, "full-sharing")) { - cluster_federation = FEDERATION_FULL_SHARING; - } else { - LM_ERR("invalid cluster_federation_mode: '%s'\n", federation_mode_str); - return -1; - } - - if (init_pres_clustering()<0) { + if (init_pres_clustering(federation_mode_str, cluster_active_shtag_str)<0) { LM_ERR("failed to init clustering support\n"); return -1; } diff --git a/modules/presence/subscribe.c b/modules/presence/subscribe.c index 5c128d7bee3..dc70443b956 100644 --- a/modules/presence/subscribe.c +++ b/modules/presence/subscribe.c @@ -601,7 +601,7 @@ int handle_subscribe(struct sip_msg* msg, int* force_active_param, str* tag) reply_code= 500; reply_str= pu_500_rpl; - if (tag) { + if (is_presence_cluster_enabled() && tag) { subs.sh_tag = *tag; if (c_api.shtag_get( &subs.sh_tag, pres_cluster_id)<0) { LM_ERR("failed to lookup the <%.*s> sharing tag\n", @@ -1529,6 +1529,8 @@ void update_db_subs(db_con_t *db,db_func_t *dbf, shtable_t hash_table, for(i=0; iexpires < (int)time(NULL)) { LM_DBG("Found expired record\n"); @@ -1548,21 +1550,8 @@ void update_db_subs(db_con_t *db,db_func_t *dbf, shtable_t hash_table, s= s->next; prev_s->next= s; - if(!no_lock) - lock_release(&hash_table[i].lock); - - /* if sharing tags (from clustering) are present, run the - * del callback only if the subscription's tag is active */ - if (sh_tags==NULL || del_s->sh_tag.len==0 || - is_shtag_active( &del_s->sh_tag, sh_tags)) { - if (handle_expired_func(del_s)< 0) - LM_ERR("in function handle_expired_record\n"); - } - - free_subs(del_s); - - if(!no_lock) - lock_get(&hash_table[i].lock); + del_s->next = expired_subs; + expired_subs = del_s; continue; } @@ -1663,6 +1652,23 @@ void update_db_subs(db_con_t *db,db_func_t *dbf, shtable_t hash_table, } if(!no_lock) lock_release(&hash_table[i].lock); + + /* walk and delete all expired subscriptions */ + + while (expired_subs) { + del_s = expired_subs; + expired_subs = expired_subs->next; + + /* if sharing tags (from clustering) are present, run the + * del callback only if the subscription's tag is active */ + if (sh_tags==NULL || del_s->sh_tag.len==0 || + is_shtag_active( &del_s->sh_tag, sh_tags)) { + if (handle_expired_func(del_s)< 0) + LM_ERR("in function handle_expired_record\n"); + } + + free_subs(del_s); + } } /* now that all records were updated, delete whatever diff --git a/modules/presence_callinfo/README b/modules/presence_callinfo/README index b1eac855f65..089aa49adea 100644 --- a/modules/presence_callinfo/README +++ b/modules/presence_callinfo/README @@ -302,7 +302,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Bogdan-Andrei Iancu (@bogdan-iancu) 20 7 1407 58 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) 21 8 1409 60 2. Ovidiu Sas (@ovidiusas) 12 6 577 7 3. Razvan Crainea (@razvancrainea) 10 8 22 14 4. Liviu Chircu (@liviuchircu) 9 7 42 52 @@ -331,10 +331,10 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 - 2. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 3. Razvan Crainea (@razvancrainea) Oct 2011 - Sep 2019 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2013 - Apr 2019 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2013 - Apr 2024 + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 + 3. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 + 4. Razvan Crainea (@razvancrainea) Oct 2011 - Sep 2019 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 6. Liviu Chircu (@liviuchircu) Mar 2014 - Jun 2018 7. Walter Doekes (@wdoekes) Mar 2014 - Mar 2014 diff --git a/modules/presence_callinfo/doc/contributors.xml b/modules/presence_callinfo/doc/contributors.xml index 393a77f9974..2580c902ec9 100644 --- a/modules/presence_callinfo/doc/contributors.xml +++ b/modules/presence_callinfo/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Bogdan-Andrei Iancu (@bogdan-iancu) - 20 - 7 - 1407 - 58 + 21 + 8 + 1409 + 60 2. @@ -112,24 +112,24 @@ 1. + Bogdan-Andrei Iancu (@bogdan-iancu) + Jan 2013 - Apr 2024 + + + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 - 2. + 3. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 3. + 4. Razvan Crainea (@razvancrainea) Oct 2011 - Sep 2019 - - 4. - Bogdan-Andrei Iancu (@bogdan-iancu) - Jan 2013 - Apr 2019 - 5. Peter Lemenkov (@lemenkov) diff --git a/modules/presence_callinfo/presence_callinfo.c b/modules/presence_callinfo/presence_callinfo.c index 00dac0054e0..3dafc8bdd30 100644 --- a/modules/presence_callinfo/presence_callinfo.c +++ b/modules/presence_callinfo/presence_callinfo.c @@ -67,10 +67,10 @@ int sca_set_called_line(struct sip_msg *msg, str *line); /* module exported commands */ static const cmd_export_t cmds[] ={ {"sca_set_calling_line", (cmd_function)sca_set_calling_line, { - {CMD_PARAM_STR,0,0}, {0,0,0}}, + {CMD_PARAM_STR|CMD_PARAM_OPT,0,0}, {0,0,0}}, REQUEST_ROUTE}, {"sca_set_called_line", (cmd_function)sca_set_called_line, { - {CMD_PARAM_STR,0,0}, {0,0,0}}, + {CMD_PARAM_STR|CMD_PARAM_OPT,0,0}, {0,0,0}}, REQUEST_ROUTE}, {0,0,{{0,0,0}},0} }; diff --git a/modules/presence_xml/Makefile b/modules/presence_xml/Makefile index 2997c89bc1e..b1f4c758a5e 100644 --- a/modules/presence_xml/Makefile +++ b/modules/presence_xml/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # Presence_XML # # diff --git a/modules/presence_xml/README b/modules/presence_xml/README index 59439f453d2..2342dc86611 100644 --- a/modules/presence_xml/README +++ b/modules/presence_xml/README @@ -199,7 +199,7 @@ Chapter 3. Contributors 2. Saúl Ibarra Corretgé (@saghul) 30 9 1499 471 3. Bogdan-Andrei Iancu (@bogdan-iancu) 27 23 78 128 4. Razvan Crainea (@razvancrainea) 15 13 40 32 - 5. Liviu Chircu (@liviuchircu) 13 10 45 69 + 5. Liviu Chircu (@liviuchircu) 14 11 45 71 6. Daniel-Constantin Mierla (@miconda) 8 6 15 14 7. Henning Westerholt (@henningw) 6 4 45 50 8. Maksym Sobolyev (@sobomax) 4 2 4 4 @@ -232,9 +232,9 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Feb 2012 - Jul 2020 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - Apr 2020 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Feb 2012 - Jul 2020 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2007 - Mar 2020 5. Zero King (@l2dy) Mar 2020 - Mar 2020 6. Dan Pascu (@danpascu) Oct 2007 - Nov 2018 diff --git a/modules/presence_xml/doc/contributors.xml b/modules/presence_xml/doc/contributors.xml index 8e925806c20..aeb7938dade 100644 --- a/modules/presence_xml/doc/contributors.xml +++ b/modules/presence_xml/doc/contributors.xml @@ -53,10 +53,10 @@ 5. Liviu Chircu (@liviuchircu) - 13 - 10 + 14 + 11 45 - 69 + 71 6. @@ -128,18 +128,18 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Razvan Crainea (@razvancrainea) - Feb 2012 - Jul 2020 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - Apr 2020 + Razvan Crainea (@razvancrainea) + Feb 2012 - Jul 2020 4. diff --git a/modules/proto_bin/README b/modules/proto_bin/README index 0dd1dd642ce..0ce521e8379 100644 --- a/modules/proto_bin/README +++ b/modules/proto_bin/README @@ -143,11 +143,11 @@ modparam("proto_bin", "bin_async", 0) the connection pending writes exceed this number, the connection will be marked as broken and dropped. - Default value is 32. + Default value is 1024. Example 1.5. Set bin_async_max_postponed_chunks parameter ... -modparam("proto_bin", "bin_async_max_postponed_chunks", 16) +modparam("proto_bin", "bin_async_max_postponed_chunks", 1024) ... 1.3.6. bin_async_local_connect_timeout (integer) @@ -190,7 +190,7 @@ Chapter 2. Contributors 1. Razvan Crainea (@razvancrainea) 28 19 60 467 2. Vlad Patrascu (@rvlad-patrascu) 15 4 954 140 3. Ionel Cerghit (@ionel-cerghit) 14 3 1196 38 - 4. Liviu Chircu (@liviuchircu) 11 9 60 60 + 4. Liviu Chircu (@liviuchircu) 13 10 63 63 5. Bogdan-Andrei Iancu (@bogdan-iancu) 9 7 29 9 6. Maksym Sobolyev (@sobomax) 4 2 6 8 7. Eseanu Marius Cristian (@eseanucristian) 4 2 1 5 @@ -217,9 +217,9 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Aug 2015 - Jul 2023 - 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 3. Liviu Chircu (@liviuchircu) Mar 2016 - Apr 2022 + 1. Liviu Chircu (@liviuchircu) Mar 2016 - Dec 2024 + 2. Razvan Crainea (@razvancrainea) Aug 2015 - Jul 2023 + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Oct 2021 5. Nick Altmann (@nikbyte) May 2021 - May 2021 6. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2017 - Apr 2021 diff --git a/modules/proto_bin/doc/contributors.xml b/modules/proto_bin/doc/contributors.xml index b3a5b27de38..136961a6b6e 100644 --- a/modules/proto_bin/doc/contributors.xml +++ b/modules/proto_bin/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 11 - 9 - 60 - 60 + 13 + 10 + 63 + 63 5. @@ -120,18 +120,18 @@ 1. - Razvan Crainea (@razvancrainea) - Aug 2015 - Jul 2023 + Liviu Chircu (@liviuchircu) + Mar 2016 - Dec 2024 2. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Razvan Crainea (@razvancrainea) + Aug 2015 - Jul 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2016 - Apr 2022 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 4. diff --git a/modules/proto_bin/doc/proto_bin_admin.xml b/modules/proto_bin/doc/proto_bin_admin.xml index e5815d386de..6f63f34dc91 100644 --- a/modules/proto_bin/doc/proto_bin_admin.xml +++ b/modules/proto_bin/doc/proto_bin_admin.xml @@ -159,14 +159,14 @@ modparam("proto_bin", "bin_async", 0) - Default value is 32. + Default value is 1024. Set <varname>bin_async_max_postponed_chunks</varname> parameter ... -modparam("proto_bin", "bin_async_max_postponed_chunks", 16) +modparam("proto_bin", "bin_async_max_postponed_chunks", 1024) ... diff --git a/modules/proto_bin/proto_bin.c b/modules/proto_bin/proto_bin.c index 2aaf35eaac1..71af4de8ad0 100644 --- a/modules/proto_bin/proto_bin.c +++ b/modules/proto_bin/proto_bin.c @@ -57,7 +57,7 @@ static int bin_send_timeout = 100; static struct tcp_req bin_current_req; static int bin_max_msg_chunks = 32; static int bin_async = 1; -static int bin_async_max_postponed_chunks = 32; +static int bin_async_max_postponed_chunks = 1024; static int bin_async_local_connect_timeout = 100; static int bin_async_local_write_timeout = 10; diff --git a/modules/proto_hep/README b/modules/proto_hep/README index 6ee67d8eee1..25e14e7e715 100644 --- a/modules/proto_hep/README +++ b/modules/proto_hep/README @@ -351,7 +351,7 @@ Chapter 3. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Ionut Ionita (@ionutrazvanionita) 149 66 8047 998 - 2. Razvan Crainea (@razvancrainea) 37 28 84 487 + 2. Razvan Crainea (@razvancrainea) 38 29 85 488 3. Bogdan-Andrei Iancu (@bogdan-iancu) 26 19 384 170 4. Liviu Chircu (@liviuchircu) 18 15 81 92 5. Vlad Patrascu (@rvlad-patrascu) 7 4 36 84 @@ -381,7 +381,7 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Nov 2015 - Oct 2023 + 1. Razvan Crainea (@razvancrainea) Nov 2015 - Feb 2024 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 3. Liviu Chircu (@liviuchircu) Mar 2016 - Oct 2022 4. Nick Altmann (@nikbyte) May 2021 - May 2021 diff --git a/modules/proto_hep/doc/contributors.xml b/modules/proto_hep/doc/contributors.xml index 303f009b488..57c389920b0 100644 --- a/modules/proto_hep/doc/contributors.xml +++ b/modules/proto_hep/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Razvan Crainea (@razvancrainea) - 37 - 28 - 84 - 487 + 38 + 29 + 85 + 488 3. @@ -129,7 +129,7 @@ 1. Razvan Crainea (@razvancrainea) - Nov 2015 - Oct 2023 + Nov 2015 - Feb 2024 2. diff --git a/modules/proto_hep/proto_hep.c b/modules/proto_hep/proto_hep.c index 23ad335bc1b..df89a38c15f 100644 --- a/modules/proto_hep/proto_hep.c +++ b/modules/proto_hep/proto_hep.c @@ -1075,12 +1075,12 @@ static int hep_udp_read_req(struct socket_info* si, int* bytes_read) * to hep context; this way callbacks will have all the data * needed */ set_global_context(ctx); - ret = run_hep_cbs(); + ret=run_hep_cbs(); + set_global_context(NULL); if (ret < 0) { LM_ERR("failed to run hep callbacks\n"); return -1; } - set_global_context(NULL); if (hep_ctx->h.version == 3) { /* HEPv3 */ diff --git a/modules/proto_tls/README b/modules/proto_tls/README index 19a1195f865..405936065ed 100644 --- a/modules/proto_tls/README +++ b/modules/proto_tls/README @@ -586,7 +586,7 @@ Chapter 3. Contributors 3. Eseanu Marius Cristian (@eseanucristian) 41 5 55 2133 4. Ionut Ionita (@ionutrazvanionita) 35 14 1232 576 5. Vlad Patrascu (@rvlad-patrascu) 20 14 186 213 - 6. Liviu Chircu (@liviuchircu) 13 10 44 112 + 6. Liviu Chircu (@liviuchircu) 15 12 49 118 7. Maksym Sobolyev (@sobomax) 5 3 7 22 8. Bogdan Chifor 5 2 141 1 9. Vlad Paiu (@vladpaiu) 4 2 84 3 @@ -615,10 +615,10 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2015 - Dec 2023 - 2. Maksym Sobolyev (@sobomax) Jul 2017 - Feb 2023 - 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Feb 2023 - 4. Liviu Chircu (@liviuchircu) Mar 2015 - Apr 2022 + 1. Liviu Chircu (@liviuchircu) Mar 2015 - Jul 2024 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2015 - Dec 2023 + 3. Maksym Sobolyev (@sobomax) Jul 2017 - Feb 2023 + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Feb 2023 5. Nick Altmann (@nikbyte) May 2021 - May 2021 6. Razvan Crainea (@razvancrainea) Feb 2015 - Jan 2021 7. Zero King (@l2dy) Mar 2020 - Mar 2020 diff --git a/modules/proto_tls/TODO.TLS b/modules/proto_tls/TODO.TLS index d93452a5dbc..d117bc7c797 100644 --- a/modules/proto_tls/TODO.TLS +++ b/modules/proto_tls/TODO.TLS @@ -1,5 +1,3 @@ -$Id$ - * Finish up the documentation item date: 16 June 2005 diff --git a/modules/proto_tls/doc/contributors.xml b/modules/proto_tls/doc/contributors.xml index a4725d752c2..1668de9cb43 100644 --- a/modules/proto_tls/doc/contributors.xml +++ b/modules/proto_tls/doc/contributors.xml @@ -61,10 +61,10 @@ 6. Liviu Chircu (@liviuchircu) - 13 - 10 - 44 - 112 + 15 + 12 + 49 + 118 7. @@ -128,24 +128,24 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2015 - Jul 2024 + + + 2. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2015 - Dec 2023 - 2. + 3. Maksym Sobolyev (@sobomax) Jul 2017 - Feb 2023 - 3. + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Feb 2023 - - 4. - Liviu Chircu (@liviuchircu) - Mar 2015 - Apr 2022 - 5. Nick Altmann (@nikbyte) diff --git a/modules/proto_ws/README b/modules/proto_ws/README index 74b881cdecc..16b87fa611e 100644 --- a/modules/proto_ws/README +++ b/modules/proto_ws/README @@ -291,7 +291,7 @@ Chapter 3. Contributors Name DevScore Commits Lines ++ Lines -- 1. Razvan Crainea (@razvancrainea) 96 48 4084 827 2. Ionut Ionita (@ionutrazvanionita) 21 14 609 114 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) 18 15 136 49 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) 19 16 138 51 4. Liviu Chircu (@liviuchircu) 16 11 128 141 5. Vlad Patrascu (@rvlad-patrascu) 8 5 97 74 6. Maksym Sobolyev (@sobomax) 6 4 12 11 @@ -323,8 +323,8 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Mar 2015 - Sep 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2017 - May 2023 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2017 - Apr 2024 + 2. Razvan Crainea (@razvancrainea) Mar 2015 - Sep 2023 3. James Stanley Mar 2023 - Mar 2023 4. Maksym Sobolyev (@sobomax) Feb 2017 - Feb 2023 5. Liviu Chircu (@liviuchircu) Mar 2015 - Apr 2022 diff --git a/modules/proto_ws/doc/contributors.xml b/modules/proto_ws/doc/contributors.xml index 4552e15b6f6..bc4ef52cf5f 100644 --- a/modules/proto_ws/doc/contributors.xml +++ b/modules/proto_ws/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Bogdan-Andrei Iancu (@bogdan-iancu) - 18 - 15 - 136 - 49 + 19 + 16 + 138 + 51 4. @@ -128,13 +128,13 @@ 1. - Razvan Crainea (@razvancrainea) - Mar 2015 - Sep 2023 + Bogdan-Andrei Iancu (@bogdan-iancu) + Mar 2017 - Apr 2024 2. - Bogdan-Andrei Iancu (@bogdan-iancu) - Mar 2017 - May 2023 + Razvan Crainea (@razvancrainea) + Mar 2015 - Sep 2023 3. diff --git a/modules/proto_ws/ws_handshake_common.h b/modules/proto_ws/ws_handshake_common.h index e6fe09a4845..51c3716492b 100644 --- a/modules/proto_ws/ws_handshake_common.h +++ b/modules/proto_ws/ws_handshake_common.h @@ -847,7 +847,7 @@ static int ws_parse_req_handshake(struct tcp_connection *c, char *msg, int len) tmp_msg.buf = tmp_msg.unparsed = msg; if (parse_headers(&tmp_msg, HDR_EOH_F, 0) < 0) { LM_ERR("cannot parse headers\n%.*s\n", len, msg); - goto error; + goto ws_error; } /* verify headers according to RFC6455 */ for (hf = tmp_msg.headers; hf; hf = hf->next) { @@ -1125,7 +1125,7 @@ static int ws_parse_rpl_handshake(struct tcp_connection *c, char *msg, int len) tmp_msg.buf = tmp_msg.unparsed = msg; if (parse_headers(&tmp_msg, HDR_EOH_F, 0) < 0) { LM_ERR("cannot parse headers\n%.*s\n", len, msg); - goto error; + goto ws_error; } /* verify headers according to RFC6455 */ for (hf = tmp_msg.headers; hf; hf = hf->next) { diff --git a/modules/pua/Makefile b/modules/pua/Makefile index 288576330c8..213e38a3756 100644 --- a/modules/pua/Makefile +++ b/modules/pua/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # PUBLISH # # diff --git a/modules/pua/README b/modules/pua/README index f53565f3109..73549557015 100644 --- a/modules/pua/README +++ b/modules/pua/README @@ -513,8 +513,8 @@ Chapter 3. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Anca Vamanu 276 106 11549 4540 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) 70 52 1100 546 - 3. Liviu Chircu (@liviuchircu) 21 11 256 383 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) 72 53 1114 550 + 3. Liviu Chircu (@liviuchircu) 22 12 256 395 4. Ovidiu Sas (@ovidiusas) 17 13 230 109 5. Daniel-Constantin Mierla (@miconda) 12 8 144 97 6. Razvan Crainea (@razvancrainea) 10 7 76 83 @@ -552,11 +552,11 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2007 - Jan 2023 - 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Sep 2021 - 4. Razvan Crainea (@razvancrainea) Feb 2012 - Jan 2021 - 5. Liviu Chircu (@liviuchircu) Mar 2014 - Jul 2020 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2007 - Apr 2024 + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Sep 2021 + 5. Razvan Crainea (@razvancrainea) Feb 2012 - Jan 2021 6. Zero King (@l2dy) Mar 2020 - Mar 2020 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 8. Ovidiu Sas (@ovidiusas) Nov 2010 - Feb 2016 diff --git a/modules/pua/doc/contributors.xml b/modules/pua/doc/contributors.xml index 90d8ebc7934..777b14e3d33 100644 --- a/modules/pua/doc/contributors.xml +++ b/modules/pua/doc/contributors.xml @@ -29,18 +29,18 @@ 2. Bogdan-Andrei Iancu (@bogdan-iancu) - 70 - 52 - 1100 - 546 + 72 + 53 + 1114 + 550 3. Liviu Chircu (@liviuchircu) - 21 - 11 + 22 + 12 256 - 383 + 395 4. @@ -128,28 +128,28 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. Bogdan-Andrei Iancu (@bogdan-iancu) - Jan 2007 - Jan 2023 + Jan 2007 - Apr 2024 3. - Vlad Patrascu (@rvlad-patrascu) - May 2017 - Sep 2021 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 4. - Razvan Crainea (@razvancrainea) - Feb 2012 - Jan 2021 + Vlad Patrascu (@rvlad-patrascu) + May 2017 - Sep 2021 5. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jul 2020 + Razvan Crainea (@razvancrainea) + Feb 2012 - Jan 2021 6. diff --git a/modules/pua/pua.c b/modules/pua/pua.c index 7987b7d4f32..53ef97fa4c7 100644 --- a/modules/pua/pua.c +++ b/modules/pua/pua.c @@ -874,16 +874,17 @@ int update_pua(ua_pres_t* p, unsigned int hash_code, unsigned int final) static void db_update(unsigned int ticks,void *param) { ua_pres_t* p= NULL; - db_key_t q_cols[19]; - db_val_t q_vals[19]; + db_key_t q_cols[20]; + db_val_t q_vals[20]; db_key_t db_cols[5]; db_val_t db_vals[5]; db_op_t db_ops[1] ; int n_query_cols= 0, n_query_update= 0; int n_update_cols= 0; int i; - int puri_col,touri_col,pid_col,expires_col,flag_col,etag_col,tuple_col,event_col; - int watcher_col,callid_col,totag_col,fromtag_col,record_route_col,cseq_col; + int puri_col,touri_col,pid_col,expires_col,flag_col,etag_col,tuple_col; + int event_col, watcher_col, callid_col, totag_col, fromtag_col; + int record_route_col, cseq_col, shtag_col; int no_lock= 0, contact_col, desired_expires_col, extra_headers_col; int remote_contact_col, version_col; @@ -981,6 +982,11 @@ static void db_update(unsigned int ticks,void *param) q_vals[touri_col].nul = 0; n_query_cols++; + q_cols[shtag_col= n_query_cols] = &str_sh_tag_col; + q_vals[shtag_col].type = DB_STR; + q_vals[shtag_col].nul = 0; + n_query_cols++; + /* must keep this the last column to be inserted */ q_cols[extra_headers_col= n_query_cols] = &str_extra_headers_col; q_vals[extra_headers_col].type = DB_STR; @@ -1121,6 +1127,10 @@ static void db_update(unsigned int ticks,void *param) q_vals[record_route_col].val.str_val = p->record_route; q_vals[contact_col].val.str_val = p->contact; q_vals[remote_contact_col].val.str_val = p->remote_contact; + if (is_pua_cluster_enabled() && p->sh_tag.len) + q_vals[shtag_col].val.str_val = p->sh_tag; + else + q_vals[shtag_col].nul = 1; q_vals[extra_headers_col].val.str_val = p->extra_headers; if(pua_dbf.insert(pua_db, q_cols, q_vals, n_query_cols)< 0) diff --git a/modules/pua_bla/Makefile b/modules/pua_bla/Makefile index ac5e69fa014..edb23489cbe 100644 --- a/modules/pua_bla/Makefile +++ b/modules/pua_bla/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # PUA_BLA # # diff --git a/modules/pua_bla/README b/modules/pua_bla/README index 0a77a7f3202..09b5844e8b6 100644 --- a/modules/pua_bla/README +++ b/modules/pua_bla/README @@ -172,7 +172,7 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Anca Vamanu 56 27 1961 779 - 2. Liviu Chircu (@liviuchircu) 16 13 58 71 + 2. Liviu Chircu (@liviuchircu) 17 14 58 73 3. Bogdan-Andrei Iancu (@bogdan-iancu) 14 12 42 60 4. Daniel-Constantin Mierla (@miconda) 9 7 17 15 5. Razvan Crainea (@razvancrainea) 8 6 12 13 @@ -206,11 +206,11 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Feb 2012 - Jan 2023 - 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2007 - Apr 2019 - 5. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Feb 2012 - Jan 2023 + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 + 5. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2007 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Ezequiel Lovelle (@lovelle) Oct 2014 - Oct 2014 8. Ovidiu Sas (@ovidiusas) Dec 2010 - Jan 2013 diff --git a/modules/pua_bla/doc/contributors.xml b/modules/pua_bla/doc/contributors.xml index 4aadb38fe48..e32d0c8e1bb 100644 --- a/modules/pua_bla/doc/contributors.xml +++ b/modules/pua_bla/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 16 - 13 + 17 + 14 58 - 71 + 73 3. @@ -128,29 +128,29 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Feb 2012 - Jan 2023 - 3. + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 4. + 5. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2007 - Apr 2019 - - 5. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2018 - 6. Peter Lemenkov (@lemenkov) diff --git a/modules/pua_dialoginfo/Makefile b/modules/pua_dialoginfo/Makefile index 52c79adaa90..ca0cd50f9f5 100644 --- a/modules/pua_dialoginfo/Makefile +++ b/modules/pua_dialoginfo/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # PUBLISH # # diff --git a/modules/pua_dialoginfo/README b/modules/pua_dialoginfo/README index b622b156355..301bc1812eb 100644 --- a/modules/pua_dialoginfo/README +++ b/modules/pua_dialoginfo/README @@ -523,8 +523,8 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 57 34 1205 742 2. Anca Vamanu 26 16 713 231 - 3. Razvan Crainea (@razvancrainea) 12 10 19 18 - 4. Liviu Chircu (@liviuchircu) 12 9 44 76 + 3. Liviu Chircu (@liviuchircu) 13 10 44 78 + 4. Razvan Crainea (@razvancrainea) 12 10 19 18 5. Klaus Darilion 11 1 1109 0 6. Vlad Patrascu (@rvlad-patrascu) 9 6 117 120 7. Ovidiu Sas (@ovidiusas) 7 5 104 9 @@ -556,14 +556,14 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 - 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2009 - Jun 2021 - 4. Razvan Crainea (@razvancrainea) Feb 2012 - Jul 2020 - 5. Zero King (@l2dy) Mar 2020 - Mar 2020 - 6. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 - 7. Aron Podrigal (@ar45) Jan 2019 - Jan 2019 - 8. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2009 - Jun 2021 + 5. Razvan Crainea (@razvancrainea) Feb 2012 - Jul 2020 + 6. Zero King (@l2dy) Mar 2020 - Mar 2020 + 7. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 + 8. Aron Podrigal (@ar45) Jan 2019 - Jan 2019 9. Ovidiu Sas (@ovidiusas) Sep 2010 - Jan 2014 10. Damien Sandras (@dsandras) Jul 2013 - Aug 2013 diff --git a/modules/pua_dialoginfo/doc/contributors.xml b/modules/pua_dialoginfo/doc/contributors.xml index 0a420119c9e..3a43171b129 100644 --- a/modules/pua_dialoginfo/doc/contributors.xml +++ b/modules/pua_dialoginfo/doc/contributors.xml @@ -36,19 +36,19 @@ 3. - Razvan Crainea (@razvancrainea) - 12 + Liviu Chircu (@liviuchircu) + 13 10 - 19 - 18 + 44 + 78 4. - Liviu Chircu (@liviuchircu) + Razvan Crainea (@razvancrainea) 12 - 9 - 44 - 76 + 10 + 19 + 18 5. @@ -128,44 +128,44 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 - 2. + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2009 - Jun 2021 - 4. + 5. Razvan Crainea (@razvancrainea) Feb 2012 - Jul 2020 - 5. + 6. Zero King (@l2dy) Mar 2020 - Mar 2020 - 6. + 7. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 - 7. + 8. Aron Podrigal (@ar45) Jan 2019 - Jan 2019 - - 8. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2018 - 9. Ovidiu Sas (@ovidiusas) diff --git a/modules/pua_mi/Makefile b/modules/pua_mi/Makefile index 549471cae22..6fa26fc362b 100644 --- a/modules/pua_mi/Makefile +++ b/modules/pua_mi/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # PUBLISH # # diff --git a/modules/pua_mi/README b/modules/pua_mi/README index dfba7147452..196acffa6a8 100644 --- a/modules/pua_mi/README +++ b/modules/pua_mi/README @@ -147,10 +147,10 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Anca Vamanu 31 15 1246 267 2. Bogdan-Andrei Iancu (@bogdan-iancu) 15 13 42 53 - 3. Razvan Crainea (@razvancrainea) 11 9 16 17 - 4. Juha Heinanen (@juha-h) 11 7 160 73 - 5. Vlad Patrascu (@rvlad-patrascu) 11 4 293 226 - 6. Liviu Chircu (@liviuchircu) 10 8 26 41 + 3. Liviu Chircu (@liviuchircu) 11 9 26 43 + 4. Razvan Crainea (@razvancrainea) 11 9 16 17 + 5. Juha Heinanen (@juha-h) 11 7 160 73 + 6. Vlad Patrascu (@rvlad-patrascu) 11 4 293 226 7. Daniel-Constantin Mierla (@miconda) 9 7 32 29 8. Ovidiu Sas (@ovidiusas) 3 1 13 2 9. Maksym Sobolyev (@sobomax) 3 1 3 3 @@ -179,12 +179,12 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Nov 2020 - 3. Razvan Crainea (@razvancrainea) Sep 2011 - Sep 2019 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2006 - Apr 2019 - 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 6. Liviu Chircu (@liviuchircu) Mar 2014 - Jun 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Nov 2020 + 4. Razvan Crainea (@razvancrainea) Sep 2011 - Sep 2019 + 5. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2006 - Apr 2019 + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Ovidiu Sas (@ovidiusas) Jan 2013 - Jan 2013 8. Anca Vamanu Nov 2006 - Aug 2010 9. Juha Heinanen (@juha-h) Apr 2007 - May 2008 diff --git a/modules/pua_mi/doc/contributors.xml b/modules/pua_mi/doc/contributors.xml index bc7747a4c97..134ec761a03 100644 --- a/modules/pua_mi/doc/contributors.xml +++ b/modules/pua_mi/doc/contributors.xml @@ -36,6 +36,14 @@ 3. + Liviu Chircu (@liviuchircu) + 11 + 9 + 26 + 43 + + + 4. Razvan Crainea (@razvancrainea) 11 9 @@ -43,7 +51,7 @@ 17 - 4. + 5. Juha Heinanen (@juha-h) 11 7 @@ -51,21 +59,13 @@ 73 - 5. + 6. Vlad Patrascu (@rvlad-patrascu) 11 4 293 226 - - 6. - Liviu Chircu (@liviuchircu) - 10 - 8 - 26 - 41 - 7. Daniel-Constantin Mierla (@miconda) @@ -128,34 +128,34 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Nov 2020 - 3. + 4. Razvan Crainea (@razvancrainea) Sep 2011 - Sep 2019 - 4. + 5. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2006 - Apr 2019 - 5. + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - 6. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jun 2018 - 7. Ovidiu Sas (@ovidiusas) diff --git a/modules/pua_usrloc/Makefile b/modules/pua_usrloc/Makefile index 17da53179c1..d381c1f9d42 100644 --- a/modules/pua_usrloc/Makefile +++ b/modules/pua_usrloc/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # PUBLISH # # diff --git a/modules/pua_usrloc/README b/modules/pua_usrloc/README index a2527e6e6e8..3a737a2e70f 100644 --- a/modules/pua_usrloc/README +++ b/modules/pua_usrloc/README @@ -129,7 +129,7 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Anca Vamanu 34 17 1245 365 - 2. Liviu Chircu (@liviuchircu) 15 13 54 55 + 2. Liviu Chircu (@liviuchircu) 16 14 54 57 3. Bogdan-Andrei Iancu (@bogdan-iancu) 15 13 46 60 4. Razvan Crainea (@razvancrainea) 13 11 14 22 5. Daniel-Constantin Mierla (@miconda) 10 8 25 19 @@ -163,10 +163,10 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Feb 2012 - Jan 2023 - 3. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 - 4. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2019 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Feb 2012 - Jan 2023 + 4. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 5. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2007 - Apr 2019 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 7. Ovidiu Sas (@ovidiusas) Jan 2013 - Mar 2014 diff --git a/modules/pua_usrloc/doc/contributors.xml b/modules/pua_usrloc/doc/contributors.xml index 4d82ae625e7..b50ed747c34 100644 --- a/modules/pua_usrloc/doc/contributors.xml +++ b/modules/pua_usrloc/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 15 - 13 + 16 + 14 54 - 55 + 57 3. @@ -128,24 +128,24 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Feb 2012 - Jan 2023 - 3. + 4. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 - - 4. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2019 - 5. Bogdan-Andrei Iancu (@bogdan-iancu) diff --git a/modules/pua_xmpp/Makefile b/modules/pua_xmpp/Makefile index cbf30a58b45..6db2515aa9f 100644 --- a/modules/pua_xmpp/Makefile +++ b/modules/pua_xmpp/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # PUBLISH # # diff --git a/modules/pua_xmpp/README b/modules/pua_xmpp/README index f04a06f32f3..4abfaaa19fc 100644 --- a/modules/pua_xmpp/README +++ b/modules/pua_xmpp/README @@ -167,8 +167,8 @@ Chapter 3. Contributors Name DevScore Commits Lines ++ Lines -- 1. Anca Vamanu 58 17 3287 806 2. Bogdan-Andrei Iancu (@bogdan-iancu) 16 13 59 81 - 3. Razvan Crainea (@razvancrainea) 13 11 24 33 - 4. Liviu Chircu (@liviuchircu) 12 10 40 61 + 3. Liviu Chircu (@liviuchircu) 14 11 40 63 + 4. Razvan Crainea (@razvancrainea) 13 11 24 33 5. Daniel-Constantin Mierla (@miconda) 10 8 27 21 6. Vlad Patrascu (@rvlad-patrascu) 7 4 34 69 7. Ovidiu Sas (@ovidiusas) 3 1 14 2 @@ -200,9 +200,9 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Feb 2012 - Jul 2020 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - Jan 2020 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Feb 2012 - Jul 2020 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 5. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2007 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/pua_xmpp/doc/contributors.xml b/modules/pua_xmpp/doc/contributors.xml index dfa7ee2e98f..612ab0b5941 100644 --- a/modules/pua_xmpp/doc/contributors.xml +++ b/modules/pua_xmpp/doc/contributors.xml @@ -36,20 +36,20 @@ 3. + Liviu Chircu (@liviuchircu) + 14 + 11 + 40 + 63 + + + 4. Razvan Crainea (@razvancrainea) 13 11 24 33 - - 4. - Liviu Chircu (@liviuchircu) - 12 - 10 - 40 - 61 - 5. Daniel-Constantin Mierla (@miconda) @@ -128,18 +128,18 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Razvan Crainea (@razvancrainea) - Feb 2012 - Jul 2020 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jan 2020 + Razvan Crainea (@razvancrainea) + Feb 2012 - Jul 2020 4. diff --git a/modules/python/README b/modules/python/README index b92158495b3..b0182ccb3a4 100644 --- a/modules/python/README +++ b/modules/python/README @@ -189,7 +189,7 @@ Chapter 2. Contributors 2. Razvan Crainea (@razvancrainea) 20 13 500 99 3. Vlad Patrascu (@rvlad-patrascu) 13 9 204 113 4. Liviu Chircu (@liviuchircu) 8 6 30 61 - 5. Bogdan-Andrei Iancu (@bogdan-iancu) 6 4 36 48 + 5. Bogdan-Andrei Iancu (@bogdan-iancu) 7 5 38 50 6. Peter Lemenkov (@lemenkov) 4 2 2 2 7. importos 3 1 104 4 @@ -213,13 +213,13 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Dec 2009 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Mar 2015 - Jan 2021 - 3. importos Nov 2020 - Nov 2020 - 4. Liviu Chircu (@liviuchircu) Jul 2014 - Jan 2020 - 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Nov 2019 - 6. Peter Lemenkov (@lemenkov) Jun 2018 - Oct 2019 - 7. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Apr 2019 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Oct 2024 + 2. Maksym Sobolyev (@sobomax) Dec 2009 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Mar 2015 - Jan 2021 + 4. importos Nov 2020 - Nov 2020 + 5. Liviu Chircu (@liviuchircu) Jul 2014 - Jan 2020 + 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Nov 2019 + 7. Peter Lemenkov (@lemenkov) Jun 2018 - Oct 2019 (1) including any documentation-related commits, excluding merge commits diff --git a/modules/python/doc/contributors.xml b/modules/python/doc/contributors.xml index 0d9ee938747..46615eac990 100644 --- a/modules/python/doc/contributors.xml +++ b/modules/python/doc/contributors.xml @@ -53,10 +53,10 @@ 5. Bogdan-Andrei Iancu (@bogdan-iancu) - 6 - 4 - 36 - 48 + 7 + 5 + 38 + 50 6. @@ -104,39 +104,39 @@ 1. + Bogdan-Andrei Iancu (@bogdan-iancu) + Oct 2014 - Oct 2024 + + + 2. Maksym Sobolyev (@sobomax) Dec 2009 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Mar 2015 - Jan 2021 - 3. + 4. importos Nov 2020 - Nov 2020 - 4. + 5. Liviu Chircu (@liviuchircu) Jul 2014 - Jan 2020 - 5. + 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Nov 2019 - 6. + 7. Peter Lemenkov (@lemenkov) Jun 2018 - Oct 2019 - - 7. - Bogdan-Andrei Iancu (@bogdan-iancu) - Oct 2014 - Apr 2019 - diff --git a/modules/python/python_mod.c b/modules/python/python_mod.c index 0dc4cf855ab..1f582ad525a 100644 --- a/modules/python/python_mod.c +++ b/modules/python/python_mod.c @@ -101,9 +101,9 @@ mod_init(void) bname = basename(script_name.s); i = strlen(bname); - if (bname[i - 1] == 'c' || bname[i - 1] == 'o') + if (i > 4 && (bname[i - 1] == 'c' || bname[i - 1] == 'o')) i -= 1; - if (bname[i - 3] == '.' && bname[i - 2] == 'p' && bname[i - 1] == 'y') { + if (i > 3 && memcmp(&bname[i - 3], ".py", 3) == 0) { bname[i - 3] = '\0'; } else { LM_ERR("%s: script_name doesn't look like a python script\n", diff --git a/modules/qos/Makefile b/modules/qos/Makefile index e6b304a7f11..f95ded7899f 100644 --- a/modules/qos/Makefile +++ b/modules/qos/Makefile @@ -1,6 +1,3 @@ -# -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile # # Copyright (C) 2006 SOMA Networks, Inc. diff --git a/modules/qos/README b/modules/qos/README index 8a414563719..950a4ee6de5 100644 --- a/modules/qos/README +++ b/modules/qos/README @@ -190,7 +190,7 @@ Chapter 3. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Ovidiu Sas (@ovidiusas) 22 3 2152 13 - 2. Liviu Chircu (@liviuchircu) 15 12 41 69 + 2. Liviu Chircu (@liviuchircu) 16 13 41 72 3. Bogdan-Andrei Iancu (@bogdan-iancu) 10 8 25 16 4. Razvan Crainea (@razvancrainea) 9 7 19 19 5. Vlad Patrascu (@rvlad-patrascu) 8 5 99 96 @@ -219,10 +219,10 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Oct 2011 - Jul 2020 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2009 - May 2020 - 4. Liviu Chircu (@liviuchircu) Jan 2013 - May 2019 + 1. Liviu Chircu (@liviuchircu) Jan 2013 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Oct 2011 - Jul 2020 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2009 - May 2020 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Ezequiel Lovelle (@lovelle) Oct 2014 - Oct 2014 diff --git a/modules/qos/doc/contributors.xml b/modules/qos/doc/contributors.xml index 09387d90827..b985b5ed4e5 100644 --- a/modules/qos/doc/contributors.xml +++ b/modules/qos/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 15 - 12 + 16 + 13 41 - 69 + 72 3. @@ -120,24 +120,24 @@ 1. + Liviu Chircu (@liviuchircu) + Jan 2013 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Oct 2011 - Jul 2020 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2009 - May 2020 - - 4. - Liviu Chircu (@liviuchircu) - Jan 2013 - May 2019 - 5. Vlad Patrascu (@rvlad-patrascu) diff --git a/modules/qrouting/Makefile b/modules/qrouting/Makefile index 28d944eca20..f461d7b72f1 100644 --- a/modules/qrouting/Makefile +++ b/modules/qrouting/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/qrouting/README b/modules/qrouting/README index ce216bbc02e..06aaae4cf76 100644 --- a/modules/qrouting/README +++ b/modules/qrouting/README @@ -498,7 +498,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Liviu Chircu (@liviuchircu) 148 63 4815 2741 + 1. Liviu Chircu (@liviuchircu) 150 65 4818 2748 2. Mihai Tiganus (@tallicamike) 49 15 2955 509 3. Maksym Sobolyev (@sobomax) 6 4 6 7 4. Zero King (@l2dy) 3 1 1 1 @@ -526,7 +526,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity 1. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 2. Liviu Chircu (@liviuchircu) Jan 2020 - Dec 2021 + 2. Liviu Chircu (@liviuchircu) Jan 2020 - Apr 2021 3. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2020 - Mar 2020 4. Zero King (@l2dy) Mar 2020 - Mar 2020 5. Razvan Crainea (@razvancrainea) Feb 2020 - Feb 2020 diff --git a/modules/qrouting/doc/contributors.xml b/modules/qrouting/doc/contributors.xml index a4b9413afbf..e7542b684ad 100644 --- a/modules/qrouting/doc/contributors.xml +++ b/modules/qrouting/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Liviu Chircu (@liviuchircu) - 148 - 63 - 4815 - 2741 + 150 + 65 + 4818 + 2748 2. @@ -102,7 +102,7 @@ 2. Liviu Chircu (@liviuchircu) - Jan 2020 - Dec 2021 + Jan 2020 - Apr 2021 3. diff --git a/modules/qrouting/qrouting.c b/modules/qrouting/qrouting.c index 93f989737cd..a34375dc739 100644 --- a/modules/qrouting/qrouting.c +++ b/modules/qrouting/qrouting.c @@ -288,10 +288,8 @@ static int qr_child_init(int rank) return -1; } - if (!(qr_db_hdl = qr_dbf.init(&db_url))) { - LM_ERR("failed to load db url %.*s\n", db_url.len, db_url.s); - return -1; - } + if (!(qr_db_hdl = qr_dbf.init(&db_url))) + LM_ERR("failed to load db url %s\n", db_url_escape(&db_url)); if (rank == 1 && ipc_send_rpc(process_no, rpc_qr_reload, NULL) < 0) { LM_CRIT("failed to send RPC for data loading\n"); @@ -551,7 +549,7 @@ static int qr_check_db(void) } if (!(qr_db_hdl = qr_dbf.init(&db_url))) { - LM_ERR("failed to load db url %.*s\n", db_url.len, db_url.s); + LM_ERR("failed to load db url %s\n", db_url_escape(&db_url)); return -1; } diff --git a/modules/rabbitmq_consumer/README b/modules/rabbitmq_consumer/README index 01143826888..e68133d8fc1 100644 --- a/modules/rabbitmq_consumer/README +++ b/modules/rabbitmq_consumer/README @@ -201,11 +201,12 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) - Name DevScore Commits Lines ++ Lines -- - 1. Vlad Patrascu (@rvlad-patrascu) 18 5 1375 9 - 2. Maksym Sobolyev (@sobomax) 6 4 6 6 - 3. Razvan Crainea (@razvancrainea) 6 4 6 1 - 4. Liviu Chircu (@liviuchircu) 3 1 1 1 + Name DevScore Commits Lines ++ Lines -- + 1. Vlad Patrascu (@rvlad-patrascu) 18 5 1375 9 + 2. Maksym Sobolyev (@sobomax) 6 4 6 6 + 3. Razvan Crainea (@razvancrainea) 6 4 6 1 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) 3 1 1 2 + 5. Liviu Chircu (@liviuchircu) 3 1 1 1 (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -226,11 +227,12 @@ Chapter 2. Contributors 2.2. By Commit Activity Table 2.2. Most recently active contributors^(1) to this module - Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 2. Vlad Patrascu (@rvlad-patrascu) Apr 2019 - Dec 2020 - 3. Razvan Crainea (@razvancrainea) May 2019 - Jul 2020 - 4. Liviu Chircu (@liviuchircu) Jul 2019 - Jul 2019 + Name Commit Activity + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2024 - Jun 2024 + 2. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 + 3. Vlad Patrascu (@rvlad-patrascu) Apr 2019 - Dec 2020 + 4. Razvan Crainea (@razvancrainea) May 2019 - Jul 2020 + 5. Liviu Chircu (@liviuchircu) Jul 2019 - Jul 2019 (1) including any documentation-related commits, excluding merge commits diff --git a/modules/rabbitmq_consumer/doc/contributors.xml b/modules/rabbitmq_consumer/doc/contributors.xml index ba2afc0e0f5..75fedb5608e 100644 --- a/modules/rabbitmq_consumer/doc/contributors.xml +++ b/modules/rabbitmq_consumer/doc/contributors.xml @@ -44,6 +44,14 @@ 4. + Bogdan-Andrei Iancu (@bogdan-iancu) + 3 + 1 + 1 + 2 + + + 5. Liviu Chircu (@liviuchircu) 3 1 @@ -80,21 +88,26 @@ 1. + Bogdan-Andrei Iancu (@bogdan-iancu) + Jun 2024 - Jun 2024 + + + 2. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 2. + 3. Vlad Patrascu (@rvlad-patrascu) Apr 2019 - Dec 2020 - 3. + 4. Razvan Crainea (@razvancrainea) May 2019 - Jul 2020 - 4. + 5. Liviu Chircu (@liviuchircu) Jul 2019 - Jul 2019 diff --git a/modules/rabbitmq_consumer/rabbitmq_consumer.c b/modules/rabbitmq_consumer/rabbitmq_consumer.c index c4bbcdc2b88..6462f5708ce 100644 --- a/modules/rabbitmq_consumer/rabbitmq_consumer.c +++ b/modules/rabbitmq_consumer/rabbitmq_consumer.c @@ -41,8 +41,7 @@ static const param_export_t params[] = { }; static const proc_export_t procs[] = { - { "RabbitMQ Consumer", 0, 0, rmq_cons_process, 1, - PROC_FLAG_HAS_IPC }, + { "RabbitMQ Consumer", 0, 0, rmq_cons_process, 1, 0}, { 0, 0, 0, 0, 0, 0 }, }; diff --git a/modules/ratelimit/README b/modules/ratelimit/README index a286800470e..fea9e5edbab 100644 --- a/modules/ratelimit/README +++ b/modules/ratelimit/README @@ -654,7 +654,7 @@ Chapter 2. Contributors 2. Ovidiu Sas (@ovidiusas) 39 17 2481 44 3. Bogdan-Andrei Iancu (@bogdan-iancu) 35 29 299 137 4. Vlad Patrascu (@rvlad-patrascu) 30 17 359 558 - 5. Liviu Chircu (@liviuchircu) 20 17 59 121 + 5. Liviu Chircu (@liviuchircu) 23 19 67 129 6. Eseanu Marius Cristian (@eseanucristian) 13 6 329 195 7. Daniel-Constantin Mierla (@miconda) 9 7 24 18 8. Maksym Sobolyev (@sobomax) 5 3 7 8 @@ -689,8 +689,8 @@ Chapter 2. Contributors Name Commit Activity 1. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2008 - Jul 2023 2. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - Apr 2022 - 4. Razvan Crainea (@razvancrainea) Sep 2011 - Oct 2021 + 3. Razvan Crainea (@razvancrainea) Sep 2011 - Oct 2021 + 4. Liviu Chircu (@liviuchircu) Mar 2014 - Apr 2021 5. Robert Moss Feb 2021 - Feb 2021 6. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 7. Vlad Patrascu (@rvlad-patrascu) Jul 2016 - Apr 2019 diff --git a/modules/ratelimit/doc/contributors.xml b/modules/ratelimit/doc/contributors.xml index ae47574f78f..959f38c565c 100644 --- a/modules/ratelimit/doc/contributors.xml +++ b/modules/ratelimit/doc/contributors.xml @@ -53,10 +53,10 @@ 5. Liviu Chircu (@liviuchircu) - 20 - 17 - 59 - 121 + 23 + 19 + 67 + 129 6. @@ -138,13 +138,13 @@ 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - Apr 2022 + Razvan Crainea (@razvancrainea) + Sep 2011 - Oct 2021 4. - Razvan Crainea (@razvancrainea) - Sep 2011 - Oct 2021 + Liviu Chircu (@liviuchircu) + Mar 2014 - Apr 2021 5. diff --git a/modules/ratelimit/ratelimit.c b/modules/ratelimit/ratelimit.c index 3652d1a9515..402f826bb79 100644 --- a/modules/ratelimit/ratelimit.c +++ b/modules/ratelimit/ratelimit.c @@ -390,7 +390,7 @@ static int mod_init(void) if (db_url.s) { db_url.len = strlen(db_url.s); db_prefix.len = strlen(db_prefix.s); - LM_DBG("using CacheDB url: %s\n", db_url.s); + LM_DBG("using CacheDB url: %s\n", db_url_escape(&db_url)); } RL_SHM_MALLOC(rl_network_count, sizeof(int)); diff --git a/modules/ratelimit/ratelimit_helper.c b/modules/ratelimit/ratelimit_helper.c index a216a01f7b4..6081aa64d50 100644 --- a/modules/ratelimit/ratelimit_helper.c +++ b/modules/ratelimit/ratelimit_helper.c @@ -172,8 +172,8 @@ static int rl_get_counter(str *name, rl_pipe_t * pipe) int init_cachedb(str * db_url) { if (cachedb_bind_mod(db_url, &cdbf) < 0) { - LM_ERR("cannot bind functions for db_url %.*s\n", - db_url->len, db_url->s); + LM_ERR("cannot bind functions for db_url %s\n", + db_url_escape(db_url)); return -1; } if (!CACHEDB_CAPABILITY(&cdbf, @@ -183,7 +183,7 @@ int init_cachedb(str * db_url) } cdbc = cdbf.init(db_url); if (!cdbc) { - LM_ERR("cannot connect to db_url %.*s\n", db_url->len, db_url->s); + LM_ERR("cannot connect to db_url %s\n", db_url_escape(db_url)); return -1; } /* guessing that the name is not larger than 32 */ @@ -459,8 +459,8 @@ int w_rl_check(struct sip_msg *_m, str *name, int *limit, str *algorithm) if ((*pipe)->algo == PIPE_ALGO_NETWORK) should_update = 1; } else { - LM_DBG("Pipe %.*s found: %p - last used %lu\n", - pipe_name.len, pipe_name.s, *pipe, (*pipe)->last_used); + LM_DBG("Pipe %.*s found: %p - last used %lld\n", + pipe_name.len, pipe_name.s, *pipe, (long long)(*pipe)->last_used); if (algo != PIPE_ALGO_NOP && (*pipe)->algo != algo) { LM_WARN("algorithm %d different from the initial one %d for pipe " "%.*s\n", algo, (*pipe)->algo, pipe_name.len, pipe_name.s); @@ -912,8 +912,8 @@ void rl_rcv_bin(bin_packet_t *packet) LM_DBG("Pipe %.*s doesn't exist, but was created %p\n", name.len, name.s, *pipe); } else { - LM_DBG("Pipe %.*s found: %p - last used %lu\n", - name.len, name.s, *pipe, (*pipe)->last_used); + LM_DBG("Pipe %.*s found: %p - last used %lld\n", + name.len, name.s, *pipe, (long long)(*pipe)->last_used); if ((*pipe)->algo != algo) LM_WARN("algorithm %d different from the initial one %d for " "pipe %.*s", algo, (*pipe)->algo, name.len, name.s); diff --git a/modules/registrar/README b/modules/registrar/README index c969ec6ad6c..a7d251b01ab 100644 --- a/modules/registrar/README +++ b/modules/registrar/README @@ -791,7 +791,8 @@ modparam("registrar", "pn_enable_purr", true) * domain (static string) - Logical domain within registrar. If database is used then this must be name of the table which stores the contacts. - * flags (string, optional) - string of the following flags: + * flags (string, optional) - string composed of one or more + of the following flags, comma-separated: + 'memory-only' - (old m flag) save the contacts only in memory cache without no DB operation; + 'no-reply' - (old r flag) do not generate a SIP reply @@ -1004,7 +1005,8 @@ remove_ip_port("8.8.8.8",43213,"location","sip:bob@atlanta.com"); Meaning of the parameters is as follows: * domain (static string) - Name of table that should be used for the lookup. - * flags (string, optional) + * flags (string, optional) - string composed of one or more + of the following flags, comma-separated: + 'no-branches' - (old b flag) this flag controls how the lookup() function processes multiple contacts. If there are multiple contacts for the given username in @@ -1182,17 +1184,18 @@ if (is_registered("location",$fu)) { Example 1.35. is_contact_registered usage ... -/*let's say you want to block users that are not registered*/ +/* block users which are not registered... */ if (is_method("INVITE")) { if (!is_contact_registered("location")) { sl_send_reply(401, "Unauthorized"); - ... + ... } } -/* you want to check the second contact from the message whether it is -registered or not */ -if(is_method("INVITE")) { - if (is_contact_registered("location",$fu,$(ct[1]),)) + +/* ... or check whether the 2nd Contact URI is registered or not */ +if (is_method("INVITE")) { + if (is_contact_registered("location", $fu, $(ct.fields(uri)[1])) +) xlog("caller is registered\n"); } ... @@ -1447,7 +1450,7 @@ Chapter 3. Contributors Table 3.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Liviu Chircu (@liviuchircu) 193 119 2849 3017 + 1. Liviu Chircu (@liviuchircu) 195 121 2856 3024 2. Bogdan-Andrei Iancu (@bogdan-iancu) 168 114 2383 2031 3. Jan Janak (@janakj) 120 73 3465 1102 4. Daniel-Constantin Mierla (@miconda) 23 19 160 105 @@ -1490,8 +1493,8 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2023 - 2. Liviu Chircu (@liviuchircu) Mar 2013 - May 2023 + 1. Liviu Chircu (@liviuchircu) Mar 2013 - Jan 2025 + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2023 3. Razvan Crainea (@razvancrainea) Apr 2011 - Apr 2023 4. Maksym Sobolyev (@sobomax) Jul 2004 - Feb 2023 5. Vlad Paiu (@vladpaiu) Sep 2011 - Nov 2022 diff --git a/modules/registrar/doc/contributors.xml b/modules/registrar/doc/contributors.xml index 004c0319361..cc6eca095ec 100644 --- a/modules/registrar/doc/contributors.xml +++ b/modules/registrar/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Liviu Chircu (@liviuchircu) - 193 - 119 - 2849 - 3017 + 195 + 121 + 2856 + 3024 2. @@ -128,13 +128,13 @@ 1. - Vlad Patrascu (@rvlad-patrascu) - May 2017 - May 2023 + Liviu Chircu (@liviuchircu) + Mar 2013 - Jan 2025 2. - Liviu Chircu (@liviuchircu) - Mar 2013 - May 2023 + Vlad Patrascu (@rvlad-patrascu) + May 2017 - May 2023 3. diff --git a/modules/registrar/doc/registrar_admin.xml b/modules/registrar/doc/registrar_admin.xml index ab04ae9fb13..204a6d7946b 100644 --- a/modules/registrar/doc/registrar_admin.xml +++ b/modules/registrar/doc/registrar_admin.xml @@ -481,8 +481,8 @@ modparam("registrar", "disable_gruu", 0) - flags (string, optional) - string of - the following flags: + flags (string, optional) - string composed of + one or more of the following flags, comma-separated: &save_common_flags; @@ -888,17 +888,17 @@ if (is_registered("location",$fu)) { <function>is_contact_registered</function> usage ... -/*let's say you want to block users that are not registered*/ +/* block users which are not registered... */ if (is_method("INVITE")) { if (!is_contact_registered("location")) { sl_send_reply(401, "Unauthorized"); - ... + ... } } -/* you want to check the second contact from the message whether it is -registered or not */ -if(is_method("INVITE")) { - if (is_contact_registered("location",$fu,$(ct[1]),)) + +/* ... or check whether the 2nd Contact URI is registered or not */ +if (is_method("INVITE")) { + if (is_contact_registered("location", $fu, $(ct.fields(uri)[1]))) xlog("caller is registered\n"); } ... diff --git a/modules/rest_client/README b/modules/rest_client/README index 1e1affd87f0..04c6895499e 100644 --- a/modules/rest_client/README +++ b/modules/rest_client/README @@ -720,7 +720,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Liviu Chircu (@liviuchircu) 144 82 3988 1755 + 1. Liviu Chircu (@liviuchircu) 149 86 4034 1785 2. Ionut Ionita (@ionutrazvanionita) 23 12 663 262 3. Vlad Patrascu (@rvlad-patrascu) 17 8 336 345 4. Razvan Crainea (@razvancrainea) 15 13 41 17 @@ -729,10 +729,11 @@ Chapter 2. Contributors 7. Agalya Ramachandran (@AgalyaR) 6 2 354 1 8. Callum Guy (@spacetourist) 6 2 281 8 9. Ryan Bullock (@rrb3942) 5 2 91 77 - 10. Maksym Sobolyev (@sobomax) 4 2 7 7 + 10. Aron Podrigal (@ar45) 4 2 15 7 - All remaining contributors: John Burke (@john08burke), Peter - Lemenkov (@lemenkov), Andrey Vorobiev (@andrey-vorobiev). + All remaining contributors: Maksym Sobolyev (@sobomax), John + Burke (@john08burke), Peter Lemenkov (@lemenkov), Andrey + Vorobiev (@andrey-vorobiev). (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -754,19 +755,20 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Mar 2013 - Dec 2023 - 2. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 3. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2021 - 4. John Burke (@john08burke) Apr 2021 - Apr 2021 - 5. Callum Guy (@spacetourist) Jan 2020 - Jan 2020 - 6. Razvan Crainea (@razvancrainea) Aug 2015 - Nov 2019 - 7. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Apr 2019 - 8. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 9. Ionut Ionita (@ionutrazvanionita) Feb 2017 - Mar 2017 - 10. Andrey Vorobiev (@andrey-vorobiev) Feb 2017 - Feb 2017 - - All remaining contributors: Ryan Bullock (@rrb3942), Agalya - Ramachandran (@AgalyaR), Jarrod Baumann (@jarrodb). + 1. Liviu Chircu (@liviuchircu) Mar 2013 - Sep 2024 + 2. Aron Podrigal (@ar45) Sep 2024 - Sep 2024 + 3. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2021 + 5. John Burke (@john08burke) Apr 2021 - Apr 2021 + 6. Callum Guy (@spacetourist) Jan 2020 - Jan 2020 + 7. Razvan Crainea (@razvancrainea) Aug 2015 - Nov 2019 + 8. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Apr 2019 + 9. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 + 10. Ionut Ionita (@ionutrazvanionita) Feb 2017 - Mar 2017 + + All remaining contributors: Andrey Vorobiev (@andrey-vorobiev), + Ryan Bullock (@rrb3942), Agalya Ramachandran (@AgalyaR), Jarrod + Baumann (@jarrodb). (1) including any documentation-related commits, excluding merge commits diff --git a/modules/rest_client/doc/contributors.xml b/modules/rest_client/doc/contributors.xml index e74e6a46d5b..cfb9222496c 100644 --- a/modules/rest_client/doc/contributors.xml +++ b/modules/rest_client/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Liviu Chircu (@liviuchircu) - 144 - 82 - 3988 - 1755 + 149 + 86 + 4034 + 1785 2. @@ -92,16 +92,16 @@ 10. - Maksym Sobolyev (@sobomax) + Aron Podrigal (@ar45) 4 2 - 7 + 15 7 -All remaining contributors: John Burke (@john08burke), Peter Lemenkov (@lemenkov), Andrey Vorobiev (@andrey-vorobiev). +All remaining contributors: Maksym Sobolyev (@sobomax), John Burke (@john08burke), Peter Lemenkov (@lemenkov), Andrey Vorobiev (@andrey-vorobiev). (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits) @@ -129,57 +129,57 @@ 1. Liviu Chircu (@liviuchircu) - Mar 2013 - Dec 2023 + Mar 2013 - Sep 2024 2. + Aron Podrigal (@ar45) + Sep 2024 - Sep 2024 + + + 3. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 3. + 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2021 - 4. + 5. John Burke (@john08burke) Apr 2021 - Apr 2021 - 5. + 6. Callum Guy (@spacetourist) Jan 2020 - Jan 2020 - 6. + 7. Razvan Crainea (@razvancrainea) Aug 2015 - Nov 2019 - 7. + 8. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Apr 2019 - 8. + 9. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 9. + 10. Ionut Ionita (@ionutrazvanionita) Feb 2017 - Mar 2017 - - 10. - Andrey Vorobiev (@andrey-vorobiev) - Feb 2017 - Feb 2017 - -All remaining contributors: Ryan Bullock (@rrb3942), Agalya Ramachandran (@AgalyaR), Jarrod Baumann (@jarrodb). +All remaining contributors: Andrey Vorobiev (@andrey-vorobiev), Ryan Bullock (@rrb3942), Agalya Ramachandran (@AgalyaR), Jarrod Baumann (@jarrodb). (1) including any documentation-related commits, excluding merge commits diff --git a/modules/rest_client/rest_client.c b/modules/rest_client/rest_client.c index 1bb37a2a31c..5f563147be6 100644 --- a/modules/rest_client/rest_client.c +++ b/modules/rest_client/rest_client.c @@ -616,6 +616,9 @@ int async_rest_method(enum rest_client_method method, struct sip_msg *msg, if (no_concurrent_connects && (lrc=rcl_acquire_url(url, &host)) < RCL_OK) return lrc; + param->timeout_s = (ctx->timeout_s && ctx->timeout_s < curl_timeout) ? + ctx->timeout_s : curl_timeout; + rc = start_async_http_req(msg, method, url, body, ctype, param, ¶m->body, ctype_pv ? ¶m->ctype : NULL, &read_fd); @@ -632,7 +635,7 @@ int async_rest_method(enum rest_client_method method, struct sip_msg *msg, /* keep default async status of NO_IO */ pkg_free(param); - return rc; + goto done; /* no need for async - transfer already completed! */ } else if (read_fd == ASYNC_SYNC) { @@ -644,7 +647,8 @@ int async_rest_method(enum rest_client_method method, struct sip_msg *msg, val.ri = (int)http_rc; if (pv_set_value(msg, (pv_spec_p)code_pv, 0, &val) != 0) { LM_ERR("failed to set output code pv\n"); - return RCL_INTERNAL_ERR; + rc = RCL_INTERNAL_ERR; + goto done; } } @@ -652,14 +656,16 @@ int async_rest_method(enum rest_client_method method, struct sip_msg *msg, val.rs = param->body; if (pv_set_value(msg, (pv_spec_p)body_pv, 0, &val) != 0) { LM_ERR("failed to set output body pv\n"); - return RCL_INTERNAL_ERR; + rc = RCL_INTERNAL_ERR; + goto done; } if (ctype_pv) { val.rs = param->ctype; if (pv_set_value(msg, (pv_spec_p)ctype_pv, 0, &val) != 0) { LM_ERR("failed to set output ctype pv\n"); - return RCL_INTERNAL_ERR; + rc = RCL_INTERNAL_ERR; + goto done; } } @@ -670,7 +676,7 @@ int async_rest_method(enum rest_client_method method, struct sip_msg *msg, pkg_free(param); async_status = ASYNC_SYNC; - return rc; + goto done; } /* the TCP connection is established, async started with success */ @@ -679,8 +685,8 @@ int async_rest_method(enum rest_client_method method, struct sip_msg *msg, rcl_release_url(host, rc == RCL_OK); ctx->resume_f = resume_async_http_req; - ctx->timeout_s = curl_timeout; ctx->timeout_f = time_out_async_http_req; + ctx->timeout_s = param->timeout_s; param->method = method; param->body_pv = (pv_spec_p)body_pv; @@ -690,6 +696,11 @@ int async_rest_method(enum rest_client_method method, struct sip_msg *msg, async_status = read_fd; return 1; + +done: + if (lrc == RCL_OK_LOCKED) + rcl_release_url(host, rc == RCL_OK); + return rc; } static int w_async_rest_get(struct sip_msg *msg, async_ctx *ctx, str *url, diff --git a/modules/rest_client/rest_methods.c b/modules/rest_client/rest_methods.c index 9bdf800c35e..2febdb51a42 100644 --- a/modules/rest_client/rest_methods.c +++ b/modules/rest_client/rest_methods.c @@ -92,7 +92,7 @@ static int multi_pool_sz; static map_t rcl_connections; static gen_hash_t *rcl_parallel_connects; int no_concurrent_connects; -int curl_conn_lifetime; +unsigned int curl_conn_lifetime; static inline int rest_trace_enabled(void); static int trace_rest_message( rest_trace_param_t* tparam ); @@ -399,7 +399,7 @@ static inline int get_easy_status(CURL *handle, CURLM *multi, CURLcode *code) return -1; } -static int init_transfer(CURL *handle, char *url) +static int init_transfer(CURL *handle, char *url, unsigned long timeout_s) { CURLcode rc; @@ -414,8 +414,10 @@ static int init_transfer(CURL *handle, char *url) tls_dom = NULL; } - w_curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT, connection_timeout); - w_curl_easy_setopt(handle, CURLOPT_TIMEOUT, curl_timeout); + w_curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT, + timeout_s && timeout_s < connection_timeout ? timeout_s : connection_timeout); + w_curl_easy_setopt(handle, CURLOPT_TIMEOUT, + timeout_s && timeout_s < curl_timeout ? timeout_s : curl_timeout); w_curl_easy_setopt(handle, CURLOPT_VERBOSE, 1); w_curl_easy_setopt(handle, CURLOPT_STDERR, stdout); @@ -579,7 +581,7 @@ int rcl_acquire_url(const char *url, char **url_host) } if (*connected_ts != 0 && (get_ticks() - - (unsigned int)*(unsigned long *)(*connected_ts) < curl_conn_lifetime)) { + (unsigned int)*(unsigned long *)connected_ts < curl_conn_lifetime)) { new_connection = 0; } else { new_connection = 1; @@ -702,7 +704,7 @@ int rest_sync_transfer(enum rest_client_method method, struct sip_msg *msg, str st = STR_NULL, res_body = STR_NULL, tbody, ttype; curl_easy_reset(sync_handle); - if (init_transfer(sync_handle, url) != 0) { + if (init_transfer(sync_handle, url, 0) != 0) { LM_ERR("failed to init transfer to %s\n", url); goto cleanup; } @@ -802,7 +804,7 @@ int rest_sync_transfer(enum rest_client_method method, struct sip_msg *msg, * @url: HTTP URL to be queried * @req_body: Body of the request (NULL if not needed) * @req_ctype: Value for the "Content-Type: " header of the request (same as ^) - * @async_parm: output param, will contain async handles + * @async_parm: in/out param, will contain async handles * @body: reply body; gradually reallocated as data arrives * @ctype: will eventually hold the last "Content-Type" header of the reply * @out_fd: the fd to poll on, or a negative error code @@ -819,7 +821,7 @@ int start_async_http_req(struct sip_msg *msg, enum rest_client_method method, CURLMcode mrc; fd_set rset, wset, eset; int max_fd, fd, http_rc, ret = RCL_INTERNAL_ERR; - long busy_wait, timeout; + long busy_wait, timeout, connect_timeout; long retry_time; OSS_CURLM *multi_list; CURLM *multi_handle; @@ -835,7 +837,7 @@ int start_async_http_req(struct sip_msg *msg, enum rest_client_method method, goto cleanup; } - if (init_transfer(handle, url) != 0) { + if (init_transfer(handle, url, async_parm->timeout_s) != 0) { LM_ERR("failed to init transfer to %s\n", url); goto cleanup; } @@ -889,18 +891,27 @@ int start_async_http_req(struct sip_msg *msg, enum rest_client_method method, multi_handle = multi_list->multi_handle; curl_multi_add_handle(multi_handle, handle); - timeout = connection_timeout_ms; + connect_timeout = (async_parm->timeout_s*1000) < connection_timeout_ms ? + (async_parm->timeout_s*1000) : connection_timeout_ms; + timeout = connect_timeout; busy_wait = connect_poll_interval; /* obtain a read fd in "connection_timeout" seconds at worst */ - for (timeout = connection_timeout_ms; timeout > 0; timeout -= busy_wait) { + for (timeout = connect_timeout; timeout > 0; timeout -= busy_wait) { + double connect = -1; + long req_sz = -1; + mrc = curl_multi_perform(multi_handle, &running_handles); if (mrc != CURLM_OK && mrc != CURLM_CALL_MULTI_PERFORM) { LM_ERR("curl_multi_perform: %s\n", curl_multi_strerror(mrc)); goto error; } - LM_DBG("perform code: %d, handles: %d\n", mrc, running_handles); + curl_easy_getinfo(handle, CURLINFO_CONNECT_TIME, &connect); + curl_easy_getinfo(handle, CURLINFO_REQUEST_SIZE, &req_sz); + + LM_DBG("perform code: %d, handles: %d, connect: %.3lfs, reqsz: %ldB\n", + mrc, running_handles, connect, req_sz); /* transfer completed! But how well? */ if (running_handles == 0) { @@ -923,8 +934,8 @@ int start_async_http_req(struct sip_msg *msg, enum rest_client_method method, case CURLE_OPERATION_TIMEDOUT: if (http_rc == 0) { - LM_ERR("connect timeout on %s (%lds)\n", url, - connection_timeout); + LM_ERR("connect timeout on %s (%ldms)\n", url, + connect_timeout); ret = RCL_CONNECT_TIMEOUT; goto error; } @@ -962,9 +973,8 @@ int start_async_http_req(struct sip_msg *msg, enum rest_client_method method, if (max_fd != -1) { for (fd = 0; fd <= max_fd; fd++) { if (FD_ISSET(fd, &rset)) { - LM_DBG("ongoing transfer on fd %d\n", fd); - if (is_new_transfer(fd)) { + if (connect > 0 && req_sz > 0 && is_new_transfer(fd)) { LM_DBG(">>> add fd %d to ongoing transfers\n", fd); add_transfer(fd); goto success; @@ -981,7 +991,7 @@ int start_async_http_req(struct sip_msg *msg, enum rest_client_method method, LM_DBG("libcurl TCP connect: we should wait up to %ldms " "(timeout=%ldms, poll=%ldms)!\n", retry_time, - connection_timeout_ms, connect_poll_interval); + connect_timeout, connect_poll_interval); /* from curl_multi_timeout() docs: @@ -1055,8 +1065,8 @@ static enum async_ret_code _resume_async_http_req(int fd, struct sip_msg *msg, if (timed_out) { char *url = NULL; curl_easy_getinfo(param->handle, CURLINFO_EFFECTIVE_URL, &url); - LM_ERR("async %s timed out, URL: %s\n", - rest_client_method_str(param->method), url); + LM_ERR("async %s timed out, URL: %s (timeout: %lds)\n", + rest_client_method_str(param->method), url, param->timeout_s); goto cleanup; } @@ -1069,10 +1079,12 @@ static enum async_ret_code _resume_async_http_req(int fd, struct sip_msg *msg, LM_DBG("perform result: %d, running: %d (break: %d)\n", mrc, running, mrc != CURLM_CALL_MULTI_PERFORM && (mrc != CURLM_OK || !running)); - if (mrc == CURLM_OK && running) { + if (mrc == CURLM_OK) { + if (!running) + break; + async_status = ASYNC_CONTINUE; return 1; - /* this rc has been removed since cURL 7.20.0 (Feb 2010), but it's not * yet marked as deprecated, so let's keep the do/while loop */ } else if (mrc != CURLM_CALL_MULTI_PERFORM) { diff --git a/modules/rest_client/rest_methods.h b/modules/rest_client/rest_methods.h index 3e2774d1ff3..781d0f69f49 100644 --- a/modules/rest_client/rest_methods.h +++ b/modules/rest_client/rest_methods.h @@ -47,7 +47,7 @@ extern int ssl_verifyhost; extern int curl_http_version; extern int no_concurrent_connects; -extern int curl_conn_lifetime; +extern unsigned int curl_conn_lifetime; /* handle for use with synchronous reqs */ extern CURL *sync_handle; @@ -115,6 +115,7 @@ typedef struct rest_async_param_ { struct curl_slist *header_list; str body; str ctype; + unsigned long timeout_s; /* max possible duration for the entire cURL op */ rest_trace_param_t* tparam; diff --git a/modules/rls/Makefile b/modules/rls/Makefile index 4157963e048..80b2d9a31af 100644 --- a/modules/rls/Makefile +++ b/modules/rls/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # Resource List Server # # diff --git a/modules/rls/README b/modules/rls/README index d760ba7cf85..8b5cd799ba5 100644 --- a/modules/rls/README +++ b/modules/rls/README @@ -363,7 +363,7 @@ Chapter 3. Contributors 3. Bogdan-Andrei Iancu (@bogdan-iancu) 25 21 110 137 4. Dan Pascu (@danpascu) 15 10 127 138 5. Razvan Crainea (@razvancrainea) 14 12 20 38 - 6. Liviu Chircu (@liviuchircu) 13 10 58 77 + 6. Liviu Chircu (@liviuchircu) 14 11 58 79 7. Daniel-Constantin Mierla (@miconda) 9 7 18 15 8. Vlad Patrascu (@rvlad-patrascu) 7 5 28 35 9. Henning Westerholt (@henningw) 7 3 164 114 @@ -395,12 +395,12 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Feb 2012 - Jul 2020 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2008 - Mar 2020 - 4. Dan Pascu (@danpascu) Aug 2008 - Jul 2019 - 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 6. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Feb 2012 - Jul 2020 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2008 - Mar 2020 + 5. Dan Pascu (@danpascu) Aug 2008 - Jul 2019 + 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 8. Julián Moreno Patiño Feb 2016 - Feb 2016 9. Ovidiu Sas (@ovidiusas) Jan 2013 - Jan 2013 diff --git a/modules/rls/doc/contributors.xml b/modules/rls/doc/contributors.xml index 23d1aefd5cf..ef2f1c75c77 100644 --- a/modules/rls/doc/contributors.xml +++ b/modules/rls/doc/contributors.xml @@ -61,10 +61,10 @@ 6. Liviu Chircu (@liviuchircu) - 13 - 10 + 14 + 11 58 - 77 + 79 7. @@ -128,34 +128,34 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Feb 2012 - Jul 2020 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2008 - Mar 2020 - 4. + 5. Dan Pascu (@danpascu) Aug 2008 - Jul 2019 - 5. + 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - - 6. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2018 - 7. Peter Lemenkov (@lemenkov) diff --git a/modules/rr/Makefile b/modules/rr/Makefile index c5d8d72a258..4b89c37f1a0 100644 --- a/modules/rr/Makefile +++ b/modules/rr/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # rr module makefile # # diff --git a/modules/rr/README b/modules/rr/README index 8cb2b582a9c..9c78ea51299 100644 --- a/modules/rr/README +++ b/modules/rr/README @@ -541,7 +541,7 @@ Chapter 4. Contributors Name DevScore Commits Lines ++ Lines -- 1. Jan Janak (@janakj) 141 59 4374 2763 2. Bogdan-Andrei Iancu (@bogdan-iancu) 95 65 1915 843 - 3. Liviu Chircu (@liviuchircu) 18 15 72 103 + 3. Liviu Chircu (@liviuchircu) 19 16 72 105 4. Daniel-Constantin Mierla (@miconda) 18 14 244 92 5. Vlad Paiu (@vladpaiu) 15 10 333 88 6. Jiri Kuthan (@jiriatipteldotorg) 15 10 250 64 @@ -577,9 +577,9 @@ Chapter 4. Contributors Table 4.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2002 - Nov 2022 - 3. Liviu Chircu (@liviuchircu) Oct 2013 - Jan 2021 + 1. Liviu Chircu (@liviuchircu) Oct 2013 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jan 2002 - Nov 2022 4. Razvan Crainea (@razvancrainea) Aug 2010 - Sep 2019 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/rr/doc/contributors.xml b/modules/rr/doc/contributors.xml index 8bdfff12bcf..9101a08c622 100644 --- a/modules/rr/doc/contributors.xml +++ b/modules/rr/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 18 - 15 + 19 + 16 72 - 103 + 105 4. @@ -128,18 +128,18 @@ 1. - Maksym Sobolyev (@sobomax) - Feb 2023 - Feb 2023 + Liviu Chircu (@liviuchircu) + Oct 2013 - May 2024 2. - Bogdan-Andrei Iancu (@bogdan-iancu) - Jan 2002 - Nov 2022 + Maksym Sobolyev (@sobomax) + Feb 2023 - Feb 2023 3. - Liviu Chircu (@liviuchircu) - Oct 2013 - Jan 2021 + Bogdan-Andrei Iancu (@bogdan-iancu) + Jan 2002 - Nov 2022 4. diff --git a/modules/rtp_relay/README b/modules/rtp_relay/README index 93c46828dee..3bf8ae56163 100644 --- a/modules/rtp_relay/README +++ b/modules/rtp_relay/README @@ -269,9 +269,10 @@ $ opensips-cli -x mi rtp_relay_update_callid callid=1-3758963@127.0.0.1 1.6.1. $rtp_relay Is used to provision the RTP back-end flags for the current - peer - if used in the initial INVITE REQUEST/BRANCH route, it + peer - if used in the initial INVITE REQUEST route, it provisions the flags of the caller, whereas if used in the - initial INVITE REPLY, it provisions the callee's flags. + initial INVITE BRANCH/REPLY route, it provisions the callee's + flags. For a sequential request, the variable represents the flags used for the UAC that generated the request. When used in a @@ -332,7 +333,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Razvan Crainea (@razvancrainea) 143 77 5730 1108 + 1. Razvan Crainea (@razvancrainea) 163 95 5846 1170 2. Maksym Sobolyev (@sobomax) 5 3 7 8 3. Vlad Patrascu (@rvlad-patrascu) 3 1 11 7 4. Vlad Paiu (@vladpaiu) 2 1 5 0 @@ -357,7 +358,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Apr 2021 - Jan 2024 + 1. Razvan Crainea (@razvancrainea) Apr 2021 - Mar 2025 2. Vlad Patrascu (@rvlad-patrascu) Mar 2023 - Mar 2023 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 4. Vlad Paiu (@vladpaiu) Oct 2022 - Oct 2022 diff --git a/modules/rtp_relay/doc/contributors.xml b/modules/rtp_relay/doc/contributors.xml index f0110e6ec41..6cb7f96a1d1 100644 --- a/modules/rtp_relay/doc/contributors.xml +++ b/modules/rtp_relay/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Razvan Crainea (@razvancrainea) - 143 - 77 - 5730 - 1108 + 163 + 95 + 5846 + 1170 2. @@ -81,7 +81,7 @@ 1. Razvan Crainea (@razvancrainea) - Apr 2021 - Jan 2024 + Apr 2021 - Mar 2025 2. diff --git a/modules/rtp_relay/doc/rtp_relay_admin.xml b/modules/rtp_relay/doc/rtp_relay_admin.xml index de32f64d1bb..e4b9212287c 100644 --- a/modules/rtp_relay/doc/rtp_relay_admin.xml +++ b/modules/rtp_relay/doc/rtp_relay_admin.xml @@ -350,9 +350,9 @@ $ opensips-cli -x mi rtp_relay_update_callid callid=1-3758963@127.0.0.1 \ Is used to provision the RTP back-end flags for the current peer - if used in the initial INVITE - REQUEST/BRANCH route, it provisions the flags of the - caller, whereas if used in the initial INVITE REPLY, - it provisions the callee's flags. + REQUEST route, it provisions the flags of the + caller, whereas if used in the initial INVITE BRANCH/REPLY + route, it provisions the callee's flags. For a sequential request, the variable represents the diff --git a/modules/rtp_relay/rtp_relay.c b/modules/rtp_relay/rtp_relay.c index aada6bc3c22..ee2c0e4b0e2 100644 --- a/modules/rtp_relay/rtp_relay.c +++ b/modules/rtp_relay/rtp_relay.c @@ -243,20 +243,25 @@ struct rtp_relay_leg *rtp_relay_get_leg(struct rtp_relay_ctx *ctx, LM_RTP_DBG("searching for tag [%.*s] idx [%d]\n", tag?tag->len:0, tag?tag->s:"", idx); - list_for_each(it, &ctx->legs) { - leg = list_entry(it, struct rtp_relay_leg, list); - if (tag) { + if (tag) { + /* search only by tag */ + list_for_each(it, &ctx->legs) { + leg = list_entry(it, struct rtp_relay_leg, list); /* match by tag */ - if (leg->tag.len) { - if (str_match(tag, &leg->tag)) - return leg; - continue; - } + if (str_match(tag, &leg->tag)) + return leg; } - if (leg->index != PV_IDX_ALL && leg->index == idx) + if (idx == RTP_RELAY_ALL_BRANCHES) + goto not_found; + } + /* search by index */ + list_for_each(it, &ctx->legs) { + leg = list_entry(it, struct rtp_relay_leg, list); + if (leg->index == idx) return leg; } +not_found: LM_RTP_DBG("no leg for tag [%.*s] idx [%d]\n", tag?tag->len:0, tag?tag->s:"", idx); return NULL; } @@ -275,7 +280,7 @@ struct rtp_relay_leg *rtp_relay_new_leg(struct rtp_relay_ctx *ctx, leg->index = idx; leg->ref = 1; list_add(&leg->list, &ctx->legs); - LM_RTP_DBG("new leg=%p index=%d\n", leg, idx); + LM_RTP_DBG("new leg=%p index=%d tag=[%.*s]\n", leg, idx, tag?tag->len:0, tag->s); return leg; } @@ -540,7 +545,7 @@ static int pv_set_rtp_relay_var(struct sip_msg *msg, pv_param_t *param, if (flag == RTP_RELAY_FLAGS_DISABLED) { /* disabled is treated differently */ - if (val->flags & PV_VAL_NULL) + if (!val || (val->flags & PV_VAL_NULL)) disabled = 0; else if (pvv_is_int(val)) disabled = val->ri; @@ -551,7 +556,7 @@ static int pv_set_rtp_relay_var(struct sip_msg *msg, pv_param_t *param, rtp_leg_set_disabled(leg, disabled); goto end; } - if (!(val->flags & PV_VAL_NULL)) { + if (val && !(val->flags & PV_VAL_NULL)) { if (pvv_is_int(val)) s.s = int2str(val->ri, &s.len); else @@ -710,7 +715,7 @@ static int pv_set_rtp_relay_ctx(struct sip_msg *msg, pv_param_t *param, break; } if (sync) { - if (!(val->flags & PV_VAL_NULL)) { + if (val && !(val->flags & PV_VAL_NULL)) { if (pvv_is_int(val)) s.s = int2str(val->ri, &s.len); else diff --git a/modules/rtp_relay/rtp_relay.h b/modules/rtp_relay/rtp_relay.h index 662dc576929..d971f0cc7c1 100644 --- a/modules/rtp_relay/rtp_relay.h +++ b/modules/rtp_relay/rtp_relay.h @@ -57,7 +57,8 @@ struct rtp_relay_funcs { int (*copy_offer)(struct rtp_relay_session *sess, struct rtp_relay_server *server, void **ctx, str *flags, - unsigned int copy_flags, unsigned int streams, str *ret); + unsigned int copy_flags, unsigned int streams, str *ret, + struct rtp_relay_streams *streams_map); int (*copy_answer)(struct rtp_relay_session *sess, struct rtp_relay_server *server, void *ctx, str *flags, str *body); @@ -65,6 +66,7 @@ struct rtp_relay_funcs { struct rtp_relay_server *server, void *ctx, str *flags); int (*copy_serialize)(void *ctx, bin_packet_t *packet); int (*copy_deserialize)(void **ctx, bin_packet_t *packet); + void (*copy_release)(void **ctx); }; struct rtp_relay_hooks { diff --git a/modules/rtp_relay/rtp_relay_common.h b/modules/rtp_relay/rtp_relay_common.h index 441f00e62bb..d260d02b8b7 100644 --- a/modules/rtp_relay/rtp_relay_common.h +++ b/modules/rtp_relay/rtp_relay_common.h @@ -32,5 +32,17 @@ #define RTP_COPY_LEG_CALLEE (1<<3) #define RTP_COPY_LEG_BOTH \ (RTP_COPY_LEG_CALLER|RTP_COPY_LEG_CALLEE) +#define RTP_COPY_MAX_STREAMS 32 + +struct rtp_relay_stream { + int leg; + int medianum; + int label; +}; + +struct rtp_relay_streams { + int count; + struct rtp_relay_stream streams[RTP_COPY_MAX_STREAMS]; +}; #endif /* _RTP_RELAY_COMMON_H_ */ diff --git a/modules/rtp_relay/rtp_relay_ctx.c b/modules/rtp_relay/rtp_relay_ctx.c index 47db1742828..f4beb2dc7f7 100644 --- a/modules/rtp_relay/rtp_relay_ctx.c +++ b/modules/rtp_relay/rtp_relay_ctx.c @@ -82,6 +82,14 @@ static struct { { str_init("disabled"), RTP_RELAY_FLAGS_DISABLED }, }; +typedef struct rtp_copy_ctx { + str id; + void *ctx; + struct rtp_relay *relay; + struct list_head list; +} rtp_copy_ctx; + + static int rtp_relay_offer(struct rtp_relay_session *info, struct rtp_relay_ctx *ctx, struct rtp_relay_sess *sess, int leg, str *body); @@ -91,7 +99,7 @@ static int rtp_relay_answer(struct rtp_relay_session *info, static int rtp_relay_delete(struct rtp_relay_session *info, struct rtp_relay_ctx *ctx, struct rtp_relay_sess *sess, int leg); static int handle_rtp_relay_ctx_leg_reply(struct rtp_relay_ctx *ctx, - struct sip_msg *msg, struct rtp_relay_sess *sess, int type); + struct sip_msg *rpl, struct sip_msg *req, struct rtp_relay_sess *sess, int type); static void rtp_relay_fill_dlg(struct rtp_relay_ctx *ctx, str *dlg_callid, unsigned id, unsigned entry, str *callid, str *from_tag, str *to_tag); static void rtp_relay_delete_ctx(struct rtp_relay_ctx *ctx, @@ -226,8 +234,20 @@ static void rtp_relay_ctx_release_leg(struct rtp_relay_leg *leg) rtp_relay_ctx_free_leg(leg); } -static void rtp_relay_ctx_free_sess(struct rtp_relay_sess *s) +static void rtp_copy_ctx_free(struct rtp_copy_ctx *copy_ctx) { + if (!copy_ctx) + return; + if (copy_ctx->ctx) + copy_ctx->relay->funcs.copy_release(©_ctx->ctx); + list_del(©_ctx->list); + shm_free(copy_ctx); +}; + +static void rtp_relay_ctx_free_sess(struct rtp_relay_ctx *ctx, struct rtp_relay_sess *s) +{ + if (ctx->established == s) + ctx->established = NULL; rtp_relay_ctx_release_leg(s->legs[RTP_RELAY_CALLER]); rtp_relay_ctx_release_leg(s->legs[RTP_RELAY_CALLEE]); if (s->server.node.s) @@ -258,7 +278,9 @@ static void rtp_relay_ctx_free(struct rtp_relay_ctx *ctx) shm_free(ctx->delete.s); list_for_each_safe(it, safe, &ctx->sessions) - rtp_relay_ctx_free_sess(list_entry(it, struct rtp_relay_sess, list)); + rtp_relay_ctx_free_sess(ctx, list_entry(it, struct rtp_relay_sess, list)); + list_for_each_safe(it, safe, &ctx->copy_contexts) + rtp_copy_ctx_free(list_entry(it, struct rtp_copy_ctx, list)); lock_start_write(rtp_relay_contexts_lock); if (list_is_valid(&ctx->list)) @@ -395,6 +417,7 @@ static void rtp_relay_b2b_local_reply(struct cell* t, int type, } memset(&info, 0, sizeof info); info.body = body; + info.msg = ps->rpl; LM_RTP_DBG("sess=%p late=%d ongoing=%d index=%d\n", sess, rtp_sess_late(sess), rtp_sess_ongoing(sess), leg->index); @@ -515,6 +538,8 @@ static inline void rtp_relay_push_sess_leg(struct rtp_relay_sess *sess, return; if (sess->legs[type]) rtp_relay_ctx_release_leg(sess->legs[type]); + LM_RTP_DBG("pushing sess=%p index=%d type=%d leg=%p(%d/%.*s)\n", + sess, sess->index, type, leg, leg->index, leg->tag.len, leg->tag.s); sess->legs[type] = leg; leg->peer = sess->legs[RTP_RELAY_PEER(type)]; if (leg->peer) @@ -526,7 +551,8 @@ static inline void rtp_relay_fill_sess_leg(struct rtp_relay_ctx *ctx, struct rtp_relay_sess *sess, int type, str *tag, int index) { struct rtp_relay_leg *leg = rtp_relay_get_leg(ctx, tag, index); - if (!leg && index != RTP_RELAY_ALL_BRANCHES) + if ((leg && index != RTP_RELAY_ALL_BRANCHES && sess->legs[RTP_RELAY_PEER(type)] == leg) || + (!leg && index != RTP_RELAY_ALL_BRANCHES)) leg = rtp_relay_get_leg(ctx, tag, RTP_RELAY_ALL_BRANCHES); rtp_relay_push_sess_leg(sess, leg, type); } @@ -587,7 +613,7 @@ static void rtp_relay_b2b_reply_free(void *param) static void rtp_relay_b2b_tm_reply(struct cell* t, int type, struct tmcb_params *p) { struct rtp_relay_b2b_reply *rpl = (*p->param); - handle_rtp_relay_ctx_leg_reply(rpl->ctx, p->rpl, rpl->sess, rpl->type); + handle_rtp_relay_ctx_leg_reply(rpl->ctx, p->rpl, NULL, rpl->sess, rpl->type); } static void rtp_relay_b2b_tm_req(struct cell* t, int type, struct tmcb_params *p) @@ -750,12 +776,6 @@ static void rtp_relay_b2b_new_local(struct cell* t, int type, struct tmcb_params } \ } while (0) -typedef struct rtp_copy_ctx { - str id; - void *ctx; - struct list_head list; -} rtp_copy_ctx; - rtp_copy_ctx *rtp_copy_ctx_get(struct rtp_relay_ctx *ctx, str *id) { struct list_head *it; @@ -769,7 +789,7 @@ rtp_copy_ctx *rtp_copy_ctx_get(struct rtp_relay_ctx *ctx, str *id) return NULL; } -rtp_copy_ctx *rtp_copy_ctx_new(struct rtp_relay_ctx *ctx, str *id) +rtp_copy_ctx *rtp_copy_ctx_new(struct rtp_relay_ctx *ctx, struct rtp_relay *relay, str *id) { rtp_copy_ctx *copy_ctx = shm_malloc(sizeof(*copy_ctx) + id->len); @@ -779,6 +799,7 @@ rtp_copy_ctx *rtp_copy_ctx_new(struct rtp_relay_ctx *ctx, str *id) copy_ctx->id.s = (char *)(copy_ctx + 1); copy_ctx->id.len = id->len; memcpy(copy_ctx->id.s, id->s, id->len); + copy_ctx->relay = relay; list_add(©_ctx->list, &ctx->copy_contexts); return copy_ctx; }; @@ -940,12 +961,10 @@ static void rtp_relay_loaded_callback(struct dlg_cell *dlg, int type, RTP_RELAY_BIN_POP(int, &index); while (index-- > 0) { RTP_RELAY_BIN_POP(str, &tmp); - copy_ctx = rtp_copy_ctx_new(ctx, &tmp); + copy_ctx = rtp_copy_ctx_new(ctx, relay, &tmp); if (copy_ctx && - !relay->funcs.copy_deserialize(©_ctx->ctx, &packet)) { - list_del(©_ctx->list); - shm_free(copy_ctx); - } + !relay->funcs.copy_deserialize(©_ctx->ctx, &packet)) + rtp_copy_ctx_free(copy_ctx); } RTP_RELAY_BIN_POP(str, &tmp); @@ -1152,9 +1171,10 @@ static int rtp_relay_offer(struct rtp_relay_session *info, if (!info->from_tag && ctx->to_tag.len) info->from_tag = &ctx->to_tag; } - LM_DBG("callid=[%.*s] ftag=[%.*s] ttag=[%.*s] " + LM_DBG("leg=%s callid=[%.*s] ftag=[%.*s] ttag=[%.*s] " "type=[%.*s] in-iface=[%.*s] out-iface=[%.*s] ctx-flags=[%.*s] " "flags=[%.*s] peer-flags=[%.*s]\n", + (leg==RTP_RELAY_CALLER?"caller":"callee"), RTP_RELAY_S(info->callid), RTP_RELAY_S(info->from_tag), RTP_RELAY_S(info->to_tag), @@ -1223,10 +1243,10 @@ static int rtp_relay_answer(struct rtp_relay_session *info, body = &ret_body; } } - - LM_DBG("callid=[%.*s] ftag=[%.*s] ttag=[%.*s] " + LM_DBG("leg=%s callid=[%.*s] ftag=[%.*s] ttag=[%.*s] " "type=[%.*s] in-iface=[%.*s] out-iface=[%.*s] ctx-flags=[%.*s] " "flags=[%.*s] peer-flags=[%.*s]\n", + (leg==RTP_RELAY_CALLER?"caller":"callee"), RTP_RELAY_S(info->callid), RTP_RELAY_S(info->from_tag), RTP_RELAY_S(info->to_tag), @@ -1429,7 +1449,7 @@ static void rtp_relay_delete_ctx(struct rtp_relay_ctx *ctx, info.callid = &ctx->dlg_callid; info.from_tag = &ctx->from_tag; info.to_tag = &ctx->to_tag; - info.branch = sess->index; + info.branch = RTP_RELAY_ALL_BRANCHES /* sess->index, but we need to remove everything */; rtp_relay_delete(&info, ctx, sess, leg); } @@ -1449,6 +1469,8 @@ static int rtp_relay_indlg_get_type(struct sip_msg *msg, RTP_RELAY_ALL_BRANCHES); if (!leg) return -1; + if (!leg->tag.s) + shm_str_sync(&leg->tag, &get_from(msg)->tag_value); for (ltype = RTP_RELAY_CALLER; ltype <= RTP_RELAY_CALLEE; ltype++) if (leg == ctx->established->legs[ltype]) return ltype; @@ -1471,7 +1493,8 @@ static void rtp_relay_dlg_end(struct dlg_cell* dlg, int type, struct dlg_cb_para rtp_relay_delete_ctx(ctx, ctx->established, ltype); RTP_RELAY_CTX_UNLOCK(ctx); lock_start_write(rtp_relay_contexts_lock); - list_del(&ctx->list); + if (list_is_valid(&ctx->list)) + list_del(&ctx->list); lock_stop_write(rtp_relay_contexts_lock); } @@ -1569,7 +1592,7 @@ static void rtp_relay_indlg(struct dlg_cell* dlg, int type, struct dlg_cb_params } else { rtp_sess_set_late(sess); } - } else if (body && msg->REQ_METHOD == METHOD_INVITE) { + } else if (sess && body && msg->REQ_METHOD == METHOD_INVITE) { rtp_sess_reset_late(ctx->established); } RTP_RELAY_CTX_UNLOCK(ctx); @@ -1712,44 +1735,52 @@ static int rtp_relay_sess_success(struct rtp_relay_ctx *ctx, } rtp_relay_ctx_set_established(ctx); } + LM_RTP_DBG("success %p(%d) %p(%d/%.*s)/%p(%d/%.*s)\n", + ctx->established, ctx->established->index, + sess->legs[0], sess->legs[0]?sess->legs[0]->index:-2, + sess->legs[0]?sess->legs[0]->tag.len:0, + sess->legs[0]?sess->legs[0]->tag.s:"", + sess->legs[1], sess->legs[1]?sess->legs[1]->index:-2, + sess->legs[1]?sess->legs[1]->tag.len:0, + sess->legs[1]?sess->legs[1]->tag.s:""); return 0; } static int handle_rtp_relay_ctx_leg_reply(struct rtp_relay_ctx *ctx, - struct sip_msg *msg, struct rtp_relay_sess *sess, int type) + struct sip_msg *rpl, struct sip_msg *req, struct rtp_relay_sess *sess, int type) { struct rtp_relay_session info; memset(&info, 0, sizeof info); - info.msg = msg; - if (msg == FAKED_REPLY || msg->REPLY_STATUS >= 300) { + info.msg = rpl; + if (rpl == FAKED_REPLY || rpl->REPLY_STATUS >= 300) { if (!rtp_sess_late(sess)) { - if (msg == FAKED_REPLY) - info.msg = NULL; + if (rpl == FAKED_REPLY) + info.msg = req; rtp_relay_delete(&info, ctx, sess, type); } else { /* nothing to do */ LM_DBG("negative reply on late branch\n"); } - rtp_relay_ctx_free_sess(sess); + rtp_relay_ctx_free_sess(ctx, sess); return 1; } /* fill in tag's tag */ if (sess->legs[type] && sess->legs[type]->tag.len) return 0; - if (parse_headers(msg, HDR_TO_F, 0) < 0 || !msg->to || parse_from_header(msg) < 0) { + if (parse_headers(rpl, HDR_TO_F, 0) < 0 || !rpl->to || parse_from_header(rpl) < 0) { LM_ERR("bad request or missing To header\n"); return -1; } else { if (!sess->legs[type]) { rtp_relay_push_sess_leg(sess, rtp_relay_new_leg(ctx, - &get_to(msg)->tag_value, sess->index), type); + &get_to(rpl)->tag_value, sess->index), type); if (!sess->legs[type]) { LM_ERR("could not create new leg\n"); return -1; } } else { shm_str_sync(&sess->legs[type]->tag, - &get_to(msg)->tag_value); + &get_to(rpl)->tag_value); } } return 0; @@ -1801,10 +1832,11 @@ static void rtp_relay_ctx_initial_cb(struct cell* t, int type, struct tmcb_param RTP_RELAY_CTX_LOCK(ctx); switch (type) { case TMCB_RESPONSE_FWDED: + case TMCB_ON_FAILURE: /* first check if there's anything setup on this branch */ sess = rtp_relay_get_sess(ctx, rtp_relay_ctx_branch()); if (sess) { - if (!rtp_sess_pending(sess)) { + if (!rtp_sess_pending(sess) && !rtp_sess_late(sess)) { LM_DBG("no pending session on branch %d\n", rtp_relay_ctx_branch()); goto end; @@ -1818,7 +1850,7 @@ static void rtp_relay_ctx_initial_cb(struct cell* t, int type, struct tmcb_param rtp_sess_disabled(sess), rtp_sess_pending(sess)); goto end; } - switch (handle_rtp_relay_ctx_leg_reply(ctx, p->rpl, sess, RTP_RELAY_CALLEE)) { + switch (handle_rtp_relay_ctx_leg_reply(ctx, p->rpl, p->req, sess, RTP_RELAY_CALLEE)) { case 0: rtp_relay_ctx_leg_reply(ctx, p->rpl, t, sess, RTP_RELAY_CALLEE); break; @@ -1900,7 +1932,7 @@ int rtp_relay_ctx_engage(struct sip_msg *msg, /* handles the replies to the original INVITE */ if (rtp_relay_tmb.register_tmcb(msg, 0, - TMCB_RESPONSE_FWDED|TMCB_REQUEST_FWDED, + TMCB_RESPONSE_FWDED|TMCB_REQUEST_FWDED|TMCB_ON_FAILURE, rtp_relay_ctx_initial_cb, ctx, 0)!=1) { LM_ERR("failed to install TM reply callback\n"); return -1; @@ -2105,7 +2137,7 @@ static struct rtp_relay_tmp *rtp_relay_new_tmp(struct rtp_relay_ctx *ctx, return tmp; error: if (tmp->sess) - rtp_relay_ctx_free_sess(tmp->sess); + rtp_relay_ctx_free_sess(ctx, tmp->sess); shm_free(tmp); return NULL; } @@ -2122,7 +2154,7 @@ static int rtp_relay_release_tmp(struct rtp_relay_tmp *tmp, int success) if (tmp->ctx->ref == 0) { RTP_RELAY_CTX_UNLOCK(tmp->ctx); rtp_relay_ctx_free(tmp->ctx); - rtp_relay_ctx_free_sess(tmp->sess); + rtp_relay_ctx_free_sess(tmp->ctx, tmp->sess); tmp->ctx = NULL; } else { if (success) { @@ -2136,12 +2168,12 @@ static int rtp_relay_release_tmp(struct rtp_relay_tmp *tmp, int success) INIT_LIST_HEAD(&del_sess->list); } else { /* otherwise cleanup the structure now */ - rtp_relay_ctx_free_sess(tmp->ctx->established); + rtp_relay_ctx_free_sess(tmp->ctx, tmp->ctx->established); } tmp->ctx->established = tmp->sess; list_add(&tmp->sess->list, &tmp->ctx->sessions); } else { - rtp_relay_ctx_free_sess(tmp->sess); + rtp_relay_ctx_free_sess(tmp->ctx, tmp->sess); } RTP_RELAY_CTX_UNLOCK(tmp->ctx); } @@ -2168,7 +2200,7 @@ static int rtp_relay_release_tmp(struct rtp_relay_tmp *tmp, int success) if (tmp->dlg) rtp_relay_delete_ctx(tmp->ctx, del_sess, (tmp->state == RTP_RELAY_TMP_OFFER?RTP_RELAY_CALLER:RTP_RELAY_CALLEE)); - rtp_relay_ctx_free_sess(del_sess); + rtp_relay_ctx_free_sess(tmp->ctx, del_sess); } if (tmp->dlg) rtp_relay_dlg.dlg_unref(tmp->dlg, 1); @@ -2283,7 +2315,7 @@ static int rtp_relay_reinvite(struct rtp_relay_tmp *tmp, int leg, int ret = rtp_relay_dlg.send_indialog_request(tmp->dlg, &inv, leg, body, &content_type_sdp, NULL, - rtp_relay_reinvite_reply, tmp); + rtp_relay_reinvite_reply, tmp, NULL); if (body && release_body) pkg_free(body->s); return ret; @@ -2567,7 +2599,7 @@ mi_response_t *mi_rtp_relay_update_callid(const mi_params_t *params, if (rtp_relay_ctx_pending(ctx)) { RTP_RELAY_CTX_UNLOCK(ctx); lock_stop_read(rtp_relay_contexts_lock); - goto error; + return 0; } ctmp = rtp_relay_new_tmp(ctx, set, node); @@ -2686,7 +2718,8 @@ int rtp_relay_api_delete(rtp_ctx _ctx, str *id, unsigned int flags) } int rtp_relay_copy_offer(rtp_ctx _ctx, str *id, str *flags, - unsigned int copy_flags, unsigned int streams, str *ret_body) + unsigned int copy_flags, unsigned int streams, str *ret_body, + struct rtp_relay_streams *ret_streams) { int release = 0; struct rtp_relay_session info; @@ -2712,7 +2745,7 @@ int rtp_relay_copy_offer(rtp_ctx _ctx, str *id, str *flags, } rtp_copy = rtp_copy_ctx_get(ctx, id); if (!rtp_copy) { - rtp_copy = rtp_copy_ctx_new(ctx, id); + rtp_copy = rtp_copy_ctx_new(ctx, sess->relay, id); if (!rtp_copy) { LM_ERR("oom for rtp copy context!\n"); return -1; @@ -2727,7 +2760,8 @@ int rtp_relay_copy_offer(rtp_ctx _ctx, str *id, str *flags, info.to_tag = &ctx->to_tag; info.branch = sess->index; if (sess->relay->funcs.copy_offer(&info, &sess->server, - &rtp_copy->ctx, flags, copy_flags, streams, ret_body) < 0) { + &rtp_copy->ctx, flags, copy_flags, streams, ret_body, + ret_streams) < 0) { if (release) { list_del(&rtp_copy->list); shm_free(rtp_copy); @@ -2818,8 +2852,7 @@ int rtp_relay_copy_delete(rtp_ctx _ctx, str *id, str *flags) ret = sess->relay->funcs.copy_delete( &info, &sess->server, copy_ctx->ctx, flags); - list_del(©_ctx->list); - shm_free(copy_ctx); + rtp_copy_ctx_free(copy_ctx); return ret; } diff --git a/modules/rtp_relay/rtp_relay_load.h b/modules/rtp_relay/rtp_relay_load.h index be1fa68ea5b..19c2677761f 100644 --- a/modules/rtp_relay/rtp_relay_load.h +++ b/modules/rtp_relay/rtp_relay_load.h @@ -37,7 +37,8 @@ struct rtp_relay_binds { int (*answer)(rtp_ctx ctx, str *id, unsigned int flags, str *body); int (*delete)(rtp_ctx ctx, str *id, unsigned int flags); int (*copy_offer)(rtp_ctx ctx, str *id, str *flags, - unsigned int copy_flags, unsigned int streams, str *ret_body); + unsigned int copy_flags, unsigned int streams, str *ret_body, + struct rtp_relay_streams *ret_streams); int (*copy_answer)(rtp_ctx ctx, str *id, str *flags, str *body); int (*copy_delete)(rtp_ctx ctx, str *id, @@ -68,7 +69,8 @@ int rtp_relay_api_offer(rtp_ctx ctx, str *id, unsigned int flags, str *body); int rtp_relay_api_answer(rtp_ctx ctx, str *id, unsigned int flags, str *body); int rtp_relay_api_delete(rtp_ctx ctx, str *id, unsigned int flags); int rtp_relay_copy_offer(rtp_ctx ctx, str *id, str *flags, - unsigned int copy_flags, unsigned int streams, str *ret_body); + unsigned int copy_flags, unsigned int streams, str *ret_body, + struct rtp_relay_streams *ret_streams); int rtp_relay_copy_answer(rtp_ctx ctx, str *id, str *flags, str *body); int rtp_relay_copy_delete(rtp_ctx ctx, str *id, diff --git a/modules/rtpengine/README b/modules/rtpengine/README index fef4991d7e1..366178a5ed8 100644 --- a/modules/rtpengine/README +++ b/modules/rtpengine/README @@ -734,7 +734,7 @@ rtpengine_offer("... codec-mask-PCMA codec-strip-opus transcode-opus ... 1.5.4. rtpengine_delete([flags[, sock_var]]) - Tears down the RTPProxy session for the current call. + Tears down the RTPEngine session for the current call. See rtpengine_offer() function description above for the meaning of the parameters. Note that not all flags make sense @@ -749,7 +749,7 @@ rtpengine_delete(); 1.5.5. rtpengine_manage([flags[, sock_var[, sdp_var[, body]]]]) - Manage the RTPProxy session - it combines the functionality of + Manage the RTPEngine session - it combines the functionality of rtpengine_offer(), rtpengine_answer() and rtpengine_delete(), detecting internally based on message type and method which one to execute. @@ -1266,7 +1266,7 @@ Chapter 3. Contributors Table 3.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Razvan Crainea (@razvancrainea) 214 114 5948 3065 + 1. Razvan Crainea (@razvancrainea) 224 123 6040 3091 2. Bogdan-Andrei Iancu (@bogdan-iancu) 31 17 423 595 3. John Burke (@john08burke) 25 17 647 102 4. Liviu Chircu (@liviuchircu) 20 16 91 173 @@ -1279,7 +1279,8 @@ Chapter 3. Contributors All remaining contributors: Maksym Sobolyev (@sobomax), Zero King (@l2dy), Rob Gagnon (@rgagnon24), Flavio E. Goncalves, Dan - Pascu (@danpascu), Oliver Severin Mulelid-Tynes (@olivermt). + Pascu (@danpascu), Oliver Severin Mulelid-Tynes (@olivermt), + Peter Kelly. (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -1301,21 +1302,21 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Jun 2014 - Nov 2023 - 2. Liviu Chircu (@liviuchircu) Jul 2014 - May 2023 - 3. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 4. Peter Lemenkov (@lemenkov) Jun 2018 - Apr 2022 - 5. John Burke (@john08burke) Jun 2019 - Apr 2022 - 6. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2014 - Apr 2022 - 7. Nick Altmann (@nikbyte) May 2021 - May 2021 - 8. Flavio E. Goncalves Oct 2020 - Oct 2020 - 9. Zero King (@l2dy) Mar 2020 - Sep 2020 - 10. Ovidiu Sas (@ovidiusas) Jun 2020 - Jun 2020 - - All remaining contributors: Vlad Patrascu (@rvlad-patrascu), - Dan Pascu (@danpascu), Oliver Severin Mulelid-Tynes - (@olivermt), Rob Gagnon (@rgagnon24), Eric Tamme (@etamme), - Richard Fuchs. + 1. Razvan Crainea (@razvancrainea) Jun 2014 - Mar 2025 + 2. Peter Kelly Feb 2025 - Feb 2025 + 3. Liviu Chircu (@liviuchircu) Jul 2014 - May 2023 + 4. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 + 5. Peter Lemenkov (@lemenkov) Jun 2018 - Apr 2022 + 6. John Burke (@john08burke) Jun 2019 - Apr 2022 + 7. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2014 - Apr 2022 + 8. Nick Altmann (@nikbyte) May 2021 - May 2021 + 9. Flavio E. Goncalves Oct 2020 - Oct 2020 + 10. Zero King (@l2dy) Mar 2020 - Sep 2020 + + All remaining contributors: Ovidiu Sas (@ovidiusas), Vlad + Patrascu (@rvlad-patrascu), Dan Pascu (@danpascu), Oliver + Severin Mulelid-Tynes (@olivermt), Rob Gagnon (@rgagnon24), + Eric Tamme (@etamme), Richard Fuchs. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/rtpengine/doc/contributors.xml b/modules/rtpengine/doc/contributors.xml index 1113c398617..0a562215935 100644 --- a/modules/rtpengine/doc/contributors.xml +++ b/modules/rtpengine/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Razvan Crainea (@razvancrainea) - 214 - 114 - 5948 - 3065 + 224 + 123 + 6040 + 3091 2. @@ -101,7 +101,7 @@ -All remaining contributors: Maksym Sobolyev (@sobomax), Zero King (@l2dy), Rob Gagnon (@rgagnon24), Flavio E. Goncalves, Dan Pascu (@danpascu), Oliver Severin Mulelid-Tynes (@olivermt). +All remaining contributors: Maksym Sobolyev (@sobomax), Zero King (@l2dy), Rob Gagnon (@rgagnon24), Flavio E. Goncalves, Dan Pascu (@danpascu), Oliver Severin Mulelid-Tynes (@olivermt), Peter Kelly. (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits) @@ -129,57 +129,57 @@ 1. Razvan Crainea (@razvancrainea) - Jun 2014 - Nov 2023 + Jun 2014 - Mar 2025 2. + Peter Kelly + Feb 2025 - Feb 2025 + + + 3. Liviu Chircu (@liviuchircu) Jul 2014 - May 2023 - 3. + 4. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 4. + 5. Peter Lemenkov (@lemenkov) Jun 2018 - Apr 2022 - 5. + 6. John Burke (@john08burke) Jun 2019 - Apr 2022 - 6. + 7. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2014 - Apr 2022 - 7. + 8. Nick Altmann (@nikbyte) May 2021 - May 2021 - 8. + 9. Flavio E. Goncalves Oct 2020 - Oct 2020 - 9. + 10. Zero King (@l2dy) Mar 2020 - Sep 2020 - - 10. - Ovidiu Sas (@ovidiusas) - Jun 2020 - Jun 2020 - -All remaining contributors: Vlad Patrascu (@rvlad-patrascu), Dan Pascu (@danpascu), Oliver Severin Mulelid-Tynes (@olivermt), Rob Gagnon (@rgagnon24), Eric Tamme (@etamme), Richard Fuchs. +All remaining contributors: Ovidiu Sas (@ovidiusas), Vlad Patrascu (@rvlad-patrascu), Dan Pascu (@danpascu), Oliver Severin Mulelid-Tynes (@olivermt), Rob Gagnon (@rgagnon24), Eric Tamme (@etamme), Richard Fuchs. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/rtpengine/doc/rtpengine_admin.xml b/modules/rtpengine/doc/rtpengine_admin.xml index 895e7aded70..864d38a6a5e 100644 --- a/modules/rtpengine/doc/rtpengine_admin.xml +++ b/modules/rtpengine/doc/rtpengine_admin.xml @@ -811,7 +811,7 @@ rtpengine_offer("... codec-mask-PCMA codec-strip-opus transcode-opus ..."); rtpengine_delete([flags[, sock_var]]) - Tears down the RTPProxy session for the current call. + Tears down the RTPEngine session for the current call. See rtpengine_offer() function description above for the meaning of the @@ -835,7 +835,7 @@ rtpengine_delete(); rtpengine_manage([flags[, sock_var[, sdp_var[, body]]]]) - Manage the RTPProxy session - it combines the functionality of + Manage the RTPEngine session - it combines the functionality of rtpengine_offer(), rtpengine_answer() and rtpengine_delete(), detecting internally based on message type and method which one to execute. diff --git a/modules/rtpengine/rtpengine.c b/modules/rtpengine/rtpengine.c index 033cc2ba3f9..a9e0e32df39 100644 --- a/modules/rtpengine/rtpengine.c +++ b/modules/rtpengine/rtpengine.c @@ -298,13 +298,15 @@ static int rtpengine_api_delete(struct rtp_relay_session *sess, struct rtp_relay str *flags, str *extra); static int rtpengine_api_copy_offer(struct rtp_relay_session *sess, struct rtp_relay_server *server, void **_ctx, str *flags, - unsigned int copy_flags, unsigned int streams, str *body); + unsigned int copy_flags, unsigned int streams, str *body, + struct rtp_relay_streams *streams_map); static int rtpengine_api_copy_answer(struct rtp_relay_session *sess, struct rtp_relay_server *server, void *_ctx, str *flags, str *body); static int rtpengine_api_copy_delete(struct rtp_relay_session *sess, struct rtp_relay_server *server, void *_ctx, str *flags); static int rtpengine_api_copy_serialize(void *_ctx, bin_packet_t *packet); static int rtpengine_api_copy_deserialize(void **_ctx, bin_packet_t *packet); +static void rtpengine_api_copy_release(void **_ctx); static int parse_flags(struct ng_flags_parse *, struct sip_msg *, enum rtpe_operation *, const char *); @@ -1487,6 +1489,7 @@ static int mod_preinit(void) .copy_delete = rtpengine_api_copy_delete, .copy_serialize = rtpengine_api_copy_serialize, .copy_deserialize = rtpengine_api_copy_deserialize, + .copy_release = rtpengine_api_copy_release, }; if (!pv_parse_spec(&rtpengine_relay_pvar_str, &media_pvar)) return -1; @@ -1501,12 +1504,13 @@ mod_init(void) pv_spec_t avp_spec; unsigned short avp_flags; str s; + int count = count_child_processes(); rtpe_ctx_idx = context_register_ptr(CONTEXT_GLOBAL, rtpe_ctx_free); rtpe_no = (unsigned int*)shm_malloc(sizeof(unsigned int)); list_version = (unsigned int*)shm_malloc(sizeof(unsigned int)); - child_versions=(unsigned int*)shm_malloc((1/*non-SIP at head*/ + udp_workers_no + tcp_workers_no) * sizeof(unsigned int)); + child_versions=(unsigned int*)shm_malloc(count * sizeof(unsigned int)); child_versions_no = (unsigned int*)shm_malloc(sizeof(unsigned int)); rtpe_versions = (struct rtpe_version_head **)shm_malloc(sizeof(struct rtpe_version_head *)); @@ -1517,7 +1521,7 @@ mod_init(void) *rtpe_no = 0; *list_version = 0; - *child_versions_no = 1/*non-SIP at head*/ + udp_workers_no + tcp_workers_no; + *child_versions_no = count; *rtpe_versions = 0; my_version = 0; @@ -1851,7 +1855,10 @@ static int update_rtpengines(int force_test) my_version = crt_version->version; } - child_versions[myrank] = my_version; + if (myrank < *child_versions_no) + child_versions[myrank] = my_version; + else + LM_BUG("rank overflow %d vs %d\n", myrank, *child_versions_no); /* close all sockets if any versions required @@ -2232,6 +2239,12 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, continue; } else if (str_eq(&key, "directional")) { ng_flags->directional = 1; + bitem = bencode_str(bencode_item_buffer(ng_flags->flags), &key); + if (!bitem) { + err = "no more memory for list value"; + goto error; + } + BCHECK(bencode_list_add(ng_flags->flags, bitem)); continue; } break; @@ -2431,7 +2444,8 @@ static struct rtpe_node *get_rtpe_node(str *node, struct rtpe_set *set) for (rnode = set->rn_first; rnode; rnode = rnode->rn_next) if (node->len == rnode->rn_url.len && !memcmp(node->s, rnode->rn_url.s, node->len)) { - return rnode; + rnode->rn_disabled = rtpe_test(rnode, rnode->rn_disabled, 0); + return (rnode->rn_disabled?NULL:rnode); } return NULL; } @@ -2478,21 +2492,15 @@ static bencode_item_t *rtpe_function_call(bencode_buffer_t *bencbuf, struct sip_ if (ng_flags.to_tag.len) to_tag_exist = 1; } + if (!flags_exist) + ng_flags.flags = bencode_list(bencbuf); if (op == OP_OFFER || op == OP_ANSWER) { - if (!flags_exist) - ng_flags.flags = bencode_list(bencbuf); ng_flags.direction = bencode_list(bencbuf); ng_flags.replace = bencode_list(bencbuf); ng_flags.rtcp_mux = bencode_list(bencbuf); bencode_dictionary_add_str(ng_flags.dict, "sdp", body_in); - } else if (!flags_exist && - (op == OP_BLOCK_DTMF || op == OP_UNBLOCK_DTMF || - op == OP_BLOCK_MEDIA || op == OP_UNBLOCK_MEDIA || - op == OP_START_FORWARD || op == OP_STOP_FORWARD)) { - ng_flags.flags = bencode_list(bencbuf); } else if (op == OP_SUBSCRIBE_ANSWER) { - ng_flags.flags = bencode_list(bencbuf); bencode_dictionary_add_str(ng_flags.dict, "sdp", body_in); } @@ -2950,9 +2958,12 @@ send_rtpe_command(struct rtpe_node *node, bencode_item_t *dict, int *outlen) v[0].iov_base = gencookie(); v[0].iov_len = strlen(v[0].iov_base); for (i = 0; i < rtpengine_retr; i++) { - if (rtpe_socks[node->idx] == -1 && !rtpengine_connect_node(node)) { - LM_ERR("cannot reconnect RTP engine socket!\n"); - goto badproxy; + if (rtpe_socks[node->idx] == -1) { + if (!rtpengine_connect_node(node)) { + LM_ERR("cannot reconnect RTP engine socket!\n"); + goto badproxy; + } + fds[0].fd = rtpe_socks[node->idx]; } do { len = writev(rtpe_socks[node->idx], v, vcnt); @@ -4401,11 +4412,64 @@ static str *rtpengine_new_subs(str *tag) return to_tag; } +static void rtpengine_copy_streams(bencode_item_t *streams, struct rtp_relay_streams *ret) +{ + bencode_item_t *item, *medias; + str tmp = STR_NULL; + struct dlg_cell *dlg; + int leg = RTP_RELAY_CALLER, medianum, label, s; + if (!ret || !streams) + return; + ret->count = 0; + dlg = dlgb.get_dlg(); + if (!dlg) + LM_WARN("could not fetch dialog - legs might not match\n"); + s = 0; + for (item = streams->child; item; item = item->sibling) { + if (dlg) { + tmp.s = bencode_dictionary_get_string(item, "tag", &tmp.len); + if (!tmp.s) + LM_WARN("could not retrieve tag - placing to %s\n", + (leg == RTP_RELAY_CALLER?"caller":"callee")); + else if (!str_match(&tmp, &dlg->legs[DLG_CALLER_LEG].tag)) + leg = RTP_RELAY_CALLEE; + else + leg = RTP_RELAY_CALLER; + } else if (leg == RTP_RELAY_CALLER) { + /* first try caller, then callee */ + leg = RTP_RELAY_CALLEE; + } + medias = bencode_dictionary_get_expect(item, "medias", BENCODE_LIST); + if (!medias) + continue; + for (medias = medias->child; medias; medias = medias->sibling) { + s = ret->count; + if (s == RTP_COPY_MAX_STREAMS) { + LM_WARN("maximum amount of streams %d reached!\n", + RTP_COPY_MAX_STREAMS); + return; + } + medianum = bencode_dictionary_get_integer(item, "index", 0); + tmp.s = bencode_dictionary_get_string(medias, "label", &tmp.len); + if (str2sint(&tmp, &label) < 0) { + LM_WARN("invalid label %.*s - not integer - skipping\n", + tmp.len, tmp.s); + continue; + } + ret->streams[s].leg = leg; + ret->streams[s].label = label; + ret->streams[s].medianum = medianum; + ret->count++; + } + } +} + static int rtpengine_api_copy_offer(struct rtp_relay_session *sess, struct rtp_relay_server *server, void **_ctx, str *flags, - unsigned int copy_flags, unsigned int streams, str *ret_body) + unsigned int copy_flags, unsigned int streams, str *ret_body, + struct rtp_relay_streams *ret_streams) { - str tmp, *to_tag; + str tmp; bencode_item_t *ret; ret = rtpengine_api_copy_op(sess, OP_SUBSCRIBE_REQUEST, server, *_ctx, flags, copy_flags, NULL); @@ -4413,10 +4477,12 @@ static int rtpengine_api_copy_offer(struct rtp_relay_session *sess, return -1; if (!bencode_dictionary_get_str_dup(ret, "sdp", ret_body)) LM_ERR("failed to extract sdp body from proxy reply\n"); + if (ret_streams) + rtpengine_copy_streams(bencode_dictionary_get(ret, "tag-medias"), ret_streams); if (!bencode_dictionary_get_str(ret, "to-tag", &tmp)) LM_ERR("failed to extract to-tag from proxy reply\n"); - to_tag = rtpengine_new_subs(&tmp); - *_ctx = to_tag; + else + *_ctx = rtpengine_new_subs(&tmp); bencode_buffer_free(bencode_item_buffer(ret)); return 0; } @@ -4439,8 +4505,6 @@ static int rtpengine_api_copy_delete(struct rtp_relay_session *sess, bencode_item_t *ret; ret = rtpengine_api_copy_op(sess, OP_UNSUBSCRIBE, server, subs, flags, 0, NULL); - if (subs) - shm_free(subs); if (!ret) return -1; bencode_buffer_free(bencode_item_buffer(ret)); @@ -4469,6 +4533,14 @@ static int rtpengine_api_copy_deserialize(void **_ctx, bin_packet_t *packet) return 1; } +static void rtpengine_api_copy_release(void **ctx) +{ + if (*ctx) { + shm_free(*ctx); + *ctx = NULL; + } +} + static inline void raise_rtpengine_status_event(struct rtpe_node *node) { static str status_connected = str_init("active"); diff --git a/modules/rtpproxy/README b/modules/rtpproxy/README index 4b390bd9220..214e692673f 100644 --- a/modules/rtpproxy/README +++ b/modules/rtpproxy/README @@ -975,7 +975,7 @@ Chapter 3. Contributors Table 3.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Razvan Crainea (@razvancrainea) 256 159 6098 2857 + 1. Razvan Crainea (@razvancrainea) 261 163 6150 2874 2. Maksym Sobolyev (@sobomax) 59 12 5054 280 3. Liviu Chircu (@liviuchircu) 28 22 228 243 4. Bogdan-Andrei Iancu (@bogdan-iancu) 27 23 123 116 @@ -1012,7 +1012,7 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Mar 2011 - Nov 2023 + 1. Razvan Crainea (@razvancrainea) Mar 2011 - Jan 2025 2. Liviu Chircu (@liviuchircu) Jul 2012 - May 2023 3. Maksym Sobolyev (@sobomax) Mar 2011 - Mar 2023 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 diff --git a/modules/rtpproxy/doc/contributors.xml b/modules/rtpproxy/doc/contributors.xml index cfdee6e3722..e05654a93a8 100644 --- a/modules/rtpproxy/doc/contributors.xml +++ b/modules/rtpproxy/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Razvan Crainea (@razvancrainea) - 256 - 159 - 6098 - 2857 + 261 + 163 + 6150 + 2874 2. @@ -129,7 +129,7 @@ 1. Razvan Crainea (@razvancrainea) - Mar 2011 - Nov 2023 + Mar 2011 - Jan 2025 2. diff --git a/modules/rtpproxy/rtpproxy.c b/modules/rtpproxy/rtpproxy.c index 371a345a4d6..c43341f4cc7 100644 --- a/modules/rtpproxy/rtpproxy.c +++ b/modules/rtpproxy/rtpproxy.c @@ -188,7 +188,6 @@ #include "rtpproxy_vcmd.h" #include "rtppn_connect.h" #include "../rtp_relay/rtp_relay.h" - #define NH_TABLE_VERSION 0 #define DEFAULT_RTPP_SET_ID 0 @@ -322,13 +321,16 @@ static int rtpproxy_api_delete(struct rtp_relay_session *sess, struct rtp_relay_ str *flags, str *extra); static int rtpproxy_api_copy_offer(struct rtp_relay_session *sess, struct rtp_relay_server *server, void **_ctx, str *flags, - unsigned int copy_flags, unsigned int streams, str *body); + unsigned int copy_flags, unsigned int streams, str *body, + struct rtp_relay_streams *streams_map); static int rtpproxy_api_copy_answer(struct rtp_relay_session *sess, struct rtp_relay_server *server, void *_ctx, str *flags, str *body); static int rtpproxy_api_copy_delete(struct rtp_relay_session *sess, struct rtp_relay_server *server, void *_ctx, str *flags); static int rtpproxy_api_copy_serialize(void *_ctx, bin_packet_t *packet); static int rtpproxy_api_copy_deserialize(void **_ctx, bin_packet_t *packet); +static void rtpproxy_api_copy_release(void **_ctx); + int connect_rtpproxies(struct rtpp_set *filter); int update_rtpp_proxies(struct rtpp_set *filter); @@ -1106,6 +1108,7 @@ static int mod_preinit(void) .copy_delete = rtpproxy_api_copy_delete, .copy_serialize = rtpproxy_api_copy_serialize, .copy_deserialize = rtpproxy_api_copy_deserialize, + .copy_release = rtpproxy_api_copy_release, }; if (!pv_parse_spec(&rtpproxy_relay_pvar_str, &media_pvar)) return -1; @@ -2674,17 +2677,6 @@ rtpproxy_offer6_f(struct sip_msg *msg, str *param1, str *param2, nh_set_param_t *param3, pv_spec_t *param4, pv_spec_t *param5, pv_spec_t *param6) { - if(rtpp_notify_socket.s) - { - if ( (!msg->to && parse_headers(msg, HDR_TO_F,0)<0) || !msg->to ) { - LM_ERR("bad request or missing TO hdr\n"); - return -1; - } - - /* if an initial request - create a new dialog */ - if(get_to(msg)->tag_value.s == NULL && dlg_api.create_dlg) - dlg_api.create_dlg(msg,0); - } return rtpproxy_offer_answer6_f(msg, param1, param2, param3, param4, param5, param6, 1); } @@ -3780,6 +3772,16 @@ static int rtpproxy_offer_answer(struct sip_msg *msg, struct rtpp_args *args, if (opts.s.s[0] == 'U') { if(enable_notification && dlg_api.get_dlg) { + + if ( (!msg->to && parse_headers(msg, HDR_TO_F,0)<0) || !msg->to ) { + LM_ERR("bad request or missing TO hdr\n"); + goto error; + } + + /* if an initial request - create a new dialog */ + if(get_to(msg)->tag_value.s == NULL && dlg_api.create_dlg) + dlg_api.create_dlg(msg,0); + dlg = dlg_api.get_dlg(); if(dlg == NULL) { @@ -4790,7 +4792,7 @@ static int w_rtpproxy_recording(struct sip_msg *msg, str *callid, else while (media_start <= media_stop) { vrec.vu[9].iov_base = int2str(media_start, (int *)&vrec.vu[9].iov_len); - vrec.vu[13] = vrec.vu[9]; + memcpy(&vrec.vu[13], &vrec.vu[9], sizeof *vrec.vu); send_rtpp_command(node, &vrec, nitems); media_start++; } @@ -4831,7 +4833,7 @@ static int w_rtpproxy_stop_recording(struct sip_msg *msg, str *callid, STR2IOVEC(*to_tag, vstrec.vu[7]); vstrec.vu[5].iov_base = int2str(medianum, (int *)&vstrec.vu[5].iov_len); - vstrec.vu[9] = vstrec.vu[5]; + memcpy(&vstrec.vu[9], &vstrec.vu[5], sizeof *vstrec.vu); send_rtpp_command(node, &vstrec, vstrec.useritems); return 1; @@ -5592,9 +5594,34 @@ static int rtpproxy_gen_sdp_medias(struct rtpproxy_sdp_buf *buf, return 0; } +static void rtpproxy_api_copy_fill_streams( + struct rtpproxy_copy_ctx *ctx, struct rtp_relay_streams* streams) +{ + struct rtpproxy_copy_stream *stream; + struct list_head *it; + int leg, s; + streams->count = 0; + for (leg = RTP_RELAY_CALLER; leg <= RTP_RELAY_CALLEE; leg++) { + list_for_each(it, &ctx->streams[leg]) { + stream = list_entry(it, struct rtpproxy_copy_stream, list); + s = streams->count; + if (s == RTP_COPY_MAX_STREAMS) { + LM_WARN("maximum amount of streams %d reached!\n", + RTP_COPY_MAX_STREAMS); + return; + } + streams->streams[s].leg = leg; + streams->streams[s].label = stream->index; + streams->streams[s].medianum = stream->medianum; + streams->count++; + } + } +} + static int rtpproxy_api_copy_offer(struct rtp_relay_session *sess, struct rtp_relay_server *server, void **_ctx, str *flags, - unsigned int copy_flags, unsigned int streams, str *body) + unsigned int copy_flags, unsigned int streams, str *body, + struct rtp_relay_streams *streams_map) { str *media_ip; struct rtpproxy_sdp_buf *buf; @@ -5619,6 +5646,9 @@ static int rtpproxy_api_copy_offer(struct rtp_relay_session *sess, if (rtpproxy_gen_sdp_medias(buf, ctx, sess) < 0) goto error; + if (streams_map) + rtpproxy_api_copy_fill_streams(ctx, streams_map); + *body = buf->buffer; *_ctx = ctx; return 0; @@ -5902,7 +5932,6 @@ static int rtpproxy_api_copy_delete(struct rtp_relay_session *sess, if (nh_lock) lock_stop_read(nh_lock); rtpproxy_free_call_args(&args); - rtpproxy_copy_ctx_free(_ctx); return ret <= 0?-1:1; } @@ -5997,3 +6026,9 @@ static int rtpproxy_api_copy_deserialize(void **_ctx, bin_packet_t *packet) *_ctx = ctx; return -1; } + +static void rtpproxy_api_copy_release(void **_ctx) +{ + rtpproxy_copy_ctx_free(*_ctx); + *_ctx = NULL; +} diff --git a/modules/script_helper/Makefile b/modules/script_helper/Makefile index 3d536853bda..9fa85e66d0d 100644 --- a/modules/script_helper/Makefile +++ b/modules/script_helper/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/script_helper/README b/modules/script_helper/README index abe75e2fe40..b48b32d6ae0 100644 --- a/modules/script_helper/README +++ b/modules/script_helper/README @@ -139,7 +139,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Liviu Chircu (@liviuchircu) 18 12 499 44 + 1. Liviu Chircu (@liviuchircu) 19 13 499 46 2. Bogdan-Andrei Iancu (@bogdan-iancu) 7 5 13 10 3. Razvan Crainea (@razvancrainea) 7 5 10 8 4. Vlad Patrascu (@rvlad-patrascu) 6 4 9 13 @@ -166,10 +166,10 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - May 2023 - 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 4. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2020 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2023 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - May 2023 + 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/script_helper/doc/contributors.xml b/modules/script_helper/doc/contributors.xml index ccfc8f2261d..9d868c099d2 100644 --- a/modules/script_helper/doc/contributors.xml +++ b/modules/script_helper/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Liviu Chircu (@liviuchircu) - 18 - 12 + 19 + 13 499 - 44 + 46 2. @@ -96,24 +96,24 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2023 - 2. + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - May 2023 - 3. + 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - - 4. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2020 - 5. Vlad Patrascu (@rvlad-patrascu) diff --git a/modules/signaling/Makefile b/modules/signaling/Makefile index dfac0c21ecf..001f6511a3e 100644 --- a/modules/signaling/Makefile +++ b/modules/signaling/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/signaling/README b/modules/signaling/README index 588012b30bc..fead6dbeb77 100644 --- a/modules/signaling/README +++ b/modules/signaling/README @@ -156,8 +156,8 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Bogdan-Andrei Iancu (@bogdan-iancu) 12 9 131 23 - 2. Liviu Chircu (@liviuchircu) 11 9 28 35 + 1. Liviu Chircu (@liviuchircu) 12 10 28 37 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) 12 9 131 23 3. Anca Vamanu 9 3 524 2 4. Razvan Crainea (@razvancrainea) 7 5 6 4 5. Vlad Patrascu (@rvlad-patrascu) 6 3 23 76 @@ -185,12 +185,12 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Aug 2015 - Dec 2020 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Nov 2008 - May 2020 - 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 6. Liviu Chircu (@liviuchircu) Mar 2014 - Jun 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Aug 2015 - Dec 2020 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Nov 2008 - May 2020 + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. zhangst Jul 2014 - Jul 2014 8. Anca Vamanu Nov 2008 - Mar 2010 diff --git a/modules/signaling/doc/contributors.xml b/modules/signaling/doc/contributors.xml index 21878120dad..cf4a89526de 100644 --- a/modules/signaling/doc/contributors.xml +++ b/modules/signaling/doc/contributors.xml @@ -20,19 +20,19 @@ 1. - Bogdan-Andrei Iancu (@bogdan-iancu) + Liviu Chircu (@liviuchircu) 12 - 9 - 131 - 23 + 10 + 28 + 37 2. - Liviu Chircu (@liviuchircu) - 11 + Bogdan-Andrei Iancu (@bogdan-iancu) + 12 9 - 28 - 35 + 131 + 23 3. @@ -112,34 +112,34 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Aug 2015 - Dec 2020 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Nov 2008 - May 2020 - 4. + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - 6. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jun 2018 - 7. zhangst diff --git a/modules/sip_i/README b/modules/sip_i/README index 363fc8a85ec..b64dc9d63d6 100644 --- a/modules/sip_i/README +++ b/modules/sip_i/README @@ -761,8 +761,8 @@ Chapter 2. Contributors 1. Vlad Patrascu (@rvlad-patrascu) 126 44 6684 1643 2. Razvan Crainea (@razvancrainea) 11 9 21 20 3. Liviu Chircu (@liviuchircu) 8 6 24 31 - 4. Maksym Sobolyev (@sobomax) 6 4 11 12 - 5. Bogdan-Andrei Iancu (@bogdan-iancu) 5 3 82 10 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) 6 4 83 11 + 5. Maksym Sobolyev (@sobomax) 6 4 11 12 6. Rustam Safargalin 3 1 80 1 7. Walter Doekes (@wdoekes) 3 1 16 20 8. Peter Lemenkov (@lemenkov) 3 1 1 1 @@ -787,12 +787,12 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Feb 2017 - Jul 2021 - 3. Vlad Patrascu (@rvlad-patrascu) Oct 2016 - Dec 2020 - 4. Rustam Safargalin Apr 2020 - Apr 2020 - 5. Walter Doekes (@wdoekes) Apr 2019 - Apr 2019 - 6. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2018 - Apr 2019 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2018 - Jan 2025 + 2. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Feb 2017 - Jul 2021 + 4. Vlad Patrascu (@rvlad-patrascu) Oct 2016 - Dec 2020 + 5. Rustam Safargalin Apr 2020 - Apr 2020 + 6. Walter Doekes (@wdoekes) Apr 2019 - Apr 2019 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 8. Liviu Chircu (@liviuchircu) Apr 2018 - Jun 2018 diff --git a/modules/sip_i/doc/contributors.xml b/modules/sip_i/doc/contributors.xml index 81ef136cc43..e740cd1e15b 100644 --- a/modules/sip_i/doc/contributors.xml +++ b/modules/sip_i/doc/contributors.xml @@ -44,19 +44,19 @@ 4. - Maksym Sobolyev (@sobomax) + Bogdan-Andrei Iancu (@bogdan-iancu) 6 4 + 83 11 - 12 5. - Bogdan-Andrei Iancu (@bogdan-iancu) - 5 - 3 - 82 - 10 + Maksym Sobolyev (@sobomax) + 6 + 4 + 11 + 12 6. @@ -112,34 +112,34 @@ 1. + Bogdan-Andrei Iancu (@bogdan-iancu) + Mar 2018 - Jan 2025 + + + 2. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Feb 2017 - Jul 2021 - 3. + 4. Vlad Patrascu (@rvlad-patrascu) Oct 2016 - Dec 2020 - 4. + 5. Rustam Safargalin Apr 2020 - Apr 2020 - 5. + 6. Walter Doekes (@wdoekes) Apr 2019 - Apr 2019 - - 6. - Bogdan-Andrei Iancu (@bogdan-iancu) - Mar 2018 - Apr 2019 - 7. Peter Lemenkov (@lemenkov) diff --git a/modules/sip_i/sip_i.c b/modules/sip_i/sip_i.c index f49c1f2b03d..cff8517c540 100644 --- a/modules/sip_i/sip_i.c +++ b/modules/sip_i/sip_i.c @@ -1320,7 +1320,7 @@ static int init_iam_default(struct sip_msg *sip_msg, struct isup_parsed_struct * goto cgpn_err; } pai = get_pai(sip_msg); - if (parse_uri(pai->uri.s, pai->uri.len, &pai->parsed_uri) < 0) { + if (parse_to_body_uri(pai) < 0) { LM_ERR("Unable to parse P-Asserted-Identity URI\n"); goto cgpn_err; } diff --git a/modules/sipcapture/Makefile b/modules/sipcapture/Makefile index ec01c319259..822b82e6ce5 100644 --- a/modules/sipcapture/Makefile +++ b/modules/sipcapture/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # sipcapture module makefile # # diff --git a/modules/sipcapture/README b/modules/sipcapture/README index 0900f3c8489..82b83556781 100644 --- a/modules/sipcapture/README +++ b/modules/sipcapture/README @@ -751,7 +751,7 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Ionut Ionita (@ionutrazvanionita) 201 45 5927 6525 - 2. Liviu Chircu (@liviuchircu) 42 22 473 927 + 2. Liviu Chircu (@liviuchircu) 44 24 477 933 3. Bogdan-Andrei Iancu (@bogdan-iancu) 29 24 202 180 4. Razvan Crainea (@razvancrainea) 24 21 86 64 5. Alexandr Dubovikov (@adubovikov) 22 2 2360 0 @@ -785,10 +785,10 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Aug 2012 - May 2023 - 3. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 4. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2022 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2023 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Aug 2012 - May 2023 + 4. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 5. Razvan Crainea (@razvancrainea) Aug 2015 - Apr 2021 6. Walter Doekes (@wdoekes) May 2014 - Apr 2021 7. Zero King (@l2dy) Mar 2020 - Mar 2020 diff --git a/modules/sipcapture/doc/contributors.xml b/modules/sipcapture/doc/contributors.xml index 889f8292d45..1ddf755dd48 100644 --- a/modules/sipcapture/doc/contributors.xml +++ b/modules/sipcapture/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 42 - 22 - 473 - 927 + 44 + 24 + 477 + 933 3. @@ -128,24 +128,24 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2023 - 2. + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Aug 2012 - May 2023 - 3. + 4. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - - 4. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2022 - 5. Razvan Crainea (@razvancrainea) diff --git a/modules/sipcapture/sipcapture.c b/modules/sipcapture/sipcapture.c index a2bb7b668ab..3547236eb1a 100644 --- a/modules/sipcapture/sipcapture.c +++ b/modules/sipcapture/sipcapture.c @@ -421,13 +421,13 @@ static char payload_buf[MAX_PAYLOAD]; -#define VALUES_STR "(%ld,%lld,'%.*s','%.*s','%.*s','%.*s','%.*s','%.*s'," \ +#define VALUES_STR "(%lld,%lld,'%.*s','%.*s','%.*s','%.*s','%.*s','%.*s'," \ "'%.*s','%.*s','%.*s','%.*s','%.*s','%.*s','%.*s','%.*s','%.*s'," \ "'%.*s','%.*s','%.*s','%.*s','%.*s','%.*s',%d,'%.*s',%d," \ "'%.*s',%d,'%.*s',%d,%d,%d,'%.*s',%d,'%.*s','%.*s','%.*s'," \ "'%.*s', '%.*s', '%.*s', '%.*s', '%.*s', '%.*s')" -#define RTCP_VALUES_STR "(%ld, %lld, '%.*s', '%.*s', %d, '%.*s', %d," \ +#define RTCP_VALUES_STR "(%lld, %lld, '%.*s', '%.*s', %d, '%.*s', %d," \ "%d, %d, %d, '%.*s', '%.*s')" int max_async_queries=5; @@ -2791,7 +2791,7 @@ static inline int append_sc_values(char* buf, int max_len, db_val_t* db_vals) int len; len = snprintf(buf, max_len, VALUES_STR, - VAL_TIME(db_vals+1), VAL_BIGINT(db_vals+2), + (long long)VAL_TIME(db_vals+1), VAL_BIGINT(db_vals+2), VAL_STR(db_vals+3).len, VAL_STR(db_vals+3).s, VAL_STR(db_vals+4).len, VAL_STR(db_vals+4).s, VAL_STR(db_vals+5).len, VAL_STR(db_vals+5).s, @@ -4496,7 +4496,7 @@ static inline int append_rc_values(char* buf, int max_len, db_val_t* db_vals) int len; len = snprintf(buf, max_len, RTCP_VALUES_STR, - VAL_TIME(db_vals+0), VAL_BIGINT(db_vals+1), + (long long)VAL_TIME(db_vals+0), VAL_BIGINT(db_vals+1), VAL_STR(db_vals+2).len, VAL_STR(db_vals+2).s, VAL_STR(db_vals+3).len, VAL_STR(db_vals+3).s, VAL_INT(db_vals+4), diff --git a/modules/sipmsgops/README b/modules/sipmsgops/README index 64f151172c7..82991e4dba7 100644 --- a/modules/sipmsgops/README +++ b/modules/sipmsgops/README @@ -1115,7 +1115,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Bogdan-Andrei Iancu (@bogdan-iancu) 68 38 2118 693 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) 71 41 2130 721 2. Liviu Chircu (@liviuchircu) 59 27 809 1510 3. Razvan Crainea (@razvancrainea) 48 21 2968 105 4. Vlad Paiu (@vladpaiu) 15 7 530 123 @@ -1152,10 +1152,10 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Vlad Paiu (@vladpaiu) Feb 2012 - Jun 2023 - 2. Razvan Crainea (@razvancrainea) Feb 2012 - Jun 2023 - 3. Maksym Sobolyev (@sobomax) Mar 2021 - Feb 2023 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2012 - Feb 2023 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2012 - Mar 2025 + 2. Vlad Paiu (@vladpaiu) Feb 2012 - Jun 2023 + 3. Razvan Crainea (@razvancrainea) Feb 2012 - Jun 2023 + 4. Maksym Sobolyev (@sobomax) Mar 2021 - Feb 2023 5. Liviu Chircu (@liviuchircu) Nov 2012 - Oct 2022 6. Dan Pascu (@danpascu) May 2019 - May 2019 7. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 diff --git a/modules/sipmsgops/doc/contributors.xml b/modules/sipmsgops/doc/contributors.xml index ddda47fad8f..3c17e9960a9 100644 --- a/modules/sipmsgops/doc/contributors.xml +++ b/modules/sipmsgops/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Bogdan-Andrei Iancu (@bogdan-iancu) - 68 - 38 - 2118 - 693 + 71 + 41 + 2130 + 721 2. @@ -128,23 +128,23 @@ 1. - Vlad Paiu (@vladpaiu) - Feb 2012 - Jun 2023 + Bogdan-Andrei Iancu (@bogdan-iancu) + Feb 2012 - Mar 2025 2. - Razvan Crainea (@razvancrainea) + Vlad Paiu (@vladpaiu) Feb 2012 - Jun 2023 3. - Maksym Sobolyev (@sobomax) - Mar 2021 - Feb 2023 + Razvan Crainea (@razvancrainea) + Feb 2012 - Jun 2023 4. - Bogdan-Andrei Iancu (@bogdan-iancu) - Feb 2012 - Feb 2023 + Maksym Sobolyev (@sobomax) + Mar 2021 - Feb 2023 5. diff --git a/modules/sipmsgops/sipmsgops.c b/modules/sipmsgops/sipmsgops.c index 2d0e84d78ac..834c3ed2f2e 100644 --- a/modules/sipmsgops/sipmsgops.c +++ b/modules/sipmsgops/sipmsgops.c @@ -985,8 +985,8 @@ static int add_body_part_f(struct sip_msg *msg, str *body, str *mime, static int get_updated_body_part_f(struct sip_msg *msg, int *type, pv_spec_t* res) { static str out = {NULL, 0}; - struct body_part *p, *it; - unsigned int out_offs, orig_offs, parts; + struct body_part *p = NULL, *it; + unsigned int out_offs, orig_offs, parts = 0; pv_value_t val; @@ -1395,7 +1395,9 @@ static int sip_validate_hdrs(struct sip_msg *msg) hf->name.len, hf->name.s); goto failed; } - hf->parsed = (void*)(unsigned long)u_aux; + /* do not write back the value, let he MF module do its + * own magic on how to store the parsed value */ + //hf->parsed = (void*)(unsigned long)u_aux; break; case HDR_SUPPORTED_T: @@ -1587,8 +1589,8 @@ static int w_sip_validate(struct sip_msg *msg, void *_flags, pv_spec_t* err_txt) struct hdr_field * ptr; contact_t * contacts; struct sip_uri test_contacts; + struct sip_uri *p_uri; struct cseq_body * cbody; - struct to_body *from, *to; pv_value_t pv_val; char reason[MAX_REASON]; int ret = -SV_GENERIC_FAILURE; @@ -1675,30 +1677,21 @@ static int w_sip_validate(struct sip_msg *msg, void *_flags, pv_spec_t* err_txt) /* test to header uri */ if(flags & SIP_PARSE_TO) { - if(!msg->to->parsed) { - if(parse_to_header(msg) < 0) { - strcpy(reason, "failed to parse 'To' header"); - ret = SV_TO_PARSE_ERROR; - goto failed; - } - } - - to = (struct to_body*)msg->to->parsed; - if(parse_uri(to->uri.s, to->uri.len, &to->parsed_uri) < 0) { + if ( (p_uri=parse_to_uri(msg))==NULL ) { strcpy(reason, "failed to parse 'To' header"); ret = SV_TO_PARSE_ERROR; goto failed; } /* check for valid domain format */ - if(check_hostname(&to->parsed_uri.host) < 0) { + if(check_hostname(&p_uri->host) < 0) { strcpy(reason, "invalid domain for 'To' header"); ret = SV_TO_DOMAIN_ERROR; goto failed; } - if(!is_username_str(&to->parsed_uri.user)) { + if(!is_username_str(&p_uri->user)) { strcpy(reason, "invalid username for 'To' header"); ret = SV_TO_USERNAME_ERROR; goto failed; @@ -1707,30 +1700,21 @@ static int w_sip_validate(struct sip_msg *msg, void *_flags, pv_spec_t* err_txt) /* test from header uri */ if(flags & SIP_PARSE_FROM) { - if(!msg->from->parsed) { - if(parse_from_header(msg) < 0) { - strcpy(reason, "failed to parse 'From' header"); - ret = SV_FROM_PARSE_ERROR; - goto failed; - } - } - - from = (struct to_body*)msg->from->parsed; - if(parse_uri(from->uri.s, from->uri.len, &from->parsed_uri) < 0) { + if ( (p_uri=parse_from_uri(msg))==NULL ) { strcpy(reason, "failed to parse 'From' header"); ret = SV_FROM_PARSE_ERROR; goto failed; } /* check for valid domain format */ - if(check_hostname(&from->parsed_uri.host) < 0) { + if(check_hostname(&p_uri->host) < 0) { strcpy(reason, "invalid domain for 'From' header"); ret = SV_FROM_DOMAIN_ERROR; goto failed; } - if (!is_username_str(&from->parsed_uri.user)) { + if (!is_username_str(&p_uri->user)) { strcpy(reason, "invalid username for 'From' header"); ret = SV_FROM_USERNAME_ERROR; goto failed; diff --git a/modules/siprec/README b/modules/siprec/README index 3af4dedad2d..aac7d7c2161 100644 --- a/modules/siprec/README +++ b/modules/siprec/README @@ -330,7 +330,7 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Razvan Crainea (@razvancrainea) 141 73 4772 1719 + 1. Razvan Crainea (@razvancrainea) 148 79 4859 1773 2. Vlad Patrascu (@rvlad-patrascu) 16 11 166 149 3. Liviu Chircu (@liviuchircu) 9 7 35 53 4. Bogdan-Andrei Iancu (@bogdan-iancu) 4 2 3 2 @@ -357,7 +357,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Jun 2017 - Dec 2023 + 1. Razvan Crainea (@razvancrainea) Jun 2017 - Jul 2024 2. Liviu Chircu (@liviuchircu) Apr 2018 - Aug 2023 3. Vlad Patrascu (@rvlad-patrascu) Feb 2018 - Mar 2023 4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 diff --git a/modules/siprec/doc/contributors.xml b/modules/siprec/doc/contributors.xml index 52d9a356528..99addcf36f7 100644 --- a/modules/siprec/doc/contributors.xml +++ b/modules/siprec/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Razvan Crainea (@razvancrainea) - 141 - 73 - 4772 - 1719 + 148 + 79 + 4859 + 1773 2. @@ -97,7 +97,7 @@ 1. Razvan Crainea (@razvancrainea) - Jun 2017 - Dec 2023 + Jun 2017 - Jul 2024 2. diff --git a/modules/siprec/siprec.c b/modules/siprec/siprec.c index c38ab5e38a1..f8d3f5d7788 100644 --- a/modules/siprec/siprec.c +++ b/modules/siprec/siprec.c @@ -182,6 +182,7 @@ static void mod_destroy(void) static void tm_src_unref_session(void *p) { struct src_sess *ss = (struct src_sess *)p; + srec_dlg.dlg_unref(ss->dlg, 1); /* release the dialog */ srec_hlog(ss, SREC_UNREF, "start recording unref"); SIPREC_UNREF(ss); } @@ -280,6 +281,7 @@ static int siprec_start_rec(struct sip_msg *msg, str *srs) return 1; session_cleanup: + srec_dlg.dlg_unref(dlg, 1); src_free_session(ss); return ret; } diff --git a/modules/siprec/siprec_body.c b/modules/siprec/siprec_body.c index 3221847afb8..a1b23bca630 100644 --- a/modules/siprec/siprec_body.c +++ b/modules/siprec/siprec_body.c @@ -38,11 +38,34 @@ void srs_free_stream(struct srs_sdp_stream *stream) shm_free(stream); } -int srs_add_raw_sdp_stream(int label, int medianum, siprec_uuid *uuid, +int srs_fill_sdp_stream(int label, int medianum, siprec_uuid *uuid, struct src_sess *sess, struct src_part *part) { + struct list_head *it; struct srs_sdp_stream *stream = NULL; + /* first, search for a corresponding stream */ + list_for_each(it, &part->streams) { + stream = list_entry(it, struct srs_sdp_stream, list); + /* if we have a uuid, it is possible that we've already + * created it */ + if (uuid) { + if (siprec_cmp_uuid(uuid, &stream->uuid) == 0) + break; + } else if (stream->medianum == medianum) { + /* if not, we might have the same medianum, so we need + * to update it */ + break; + } + stream = NULL; + } + if (stream) { + if (uuid) + memcpy(stream->uuid, uuid, sizeof *uuid); + stream->label = label; + return 0; + } + stream = shm_malloc(sizeof *stream); if (!stream) { LM_ERR("cannot allocate memory for new stream!\n"); @@ -52,7 +75,10 @@ int srs_add_raw_sdp_stream(int label, int medianum, siprec_uuid *uuid, stream->label = label; stream->medianum = medianum; - memcpy(stream->uuid, uuid, sizeof *uuid); + if (uuid) + memcpy(stream->uuid, uuid, sizeof *uuid); + else + siprec_build_uuid(stream->uuid); list_add_tail(&stream->list, &part->streams); sess->streams_no++; diff --git a/modules/siprec/siprec_body.h b/modules/siprec/siprec_body.h index 0e5326d57d3..66f51899a33 100644 --- a/modules/siprec/siprec_body.h +++ b/modules/siprec/siprec_body.h @@ -51,7 +51,7 @@ struct srs_sdp_stream { void srs_free_stream(struct srs_sdp_stream *stream); -int srs_add_raw_sdp_stream(int label, int medianum, siprec_uuid *uuid, +int srs_fill_sdp_stream(int label, int medianum, siprec_uuid *uuid, struct src_sess *sess, struct src_part *part); int srs_build_body(struct src_sess *sess, str *sdp, str *body); diff --git a/modules/siprec/siprec_logic.c b/modules/siprec/siprec_logic.c index 9c575b7a5bf..273a3003af3 100644 --- a/modules/siprec/siprec_logic.c +++ b/modules/siprec/siprec_logic.c @@ -94,7 +94,7 @@ static int srs_do_failover(struct src_sess *sess) LM_BUG("failover without any destination!\n"); return -1; } - srec_logic_destroy(sess); + srec_logic_destroy(sess, 1); /* pop the first element */ node = list_entry(sess->srs.next, struct srs_node, list); @@ -148,7 +148,7 @@ static void srec_dlg_end(struct dlg_cell *dlg, int type, struct dlg_cb_params *_ LM_ERR("Cannot end recording session for key %.*s\n", req.b2b_key->len, req.b2b_key->s); srec_rtp.copy_delete(ss->rtp, &mod_name, &ss->media); - srec_logic_destroy(ss); + srec_logic_destroy(ss, 0); } static void srec_dlg_sequential(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params) @@ -228,6 +228,30 @@ int srec_reply(struct src_sess *ss, int method, int code, str *body) return srec_b2b.send_reply(&reply_data); } +static int srec_get_body(struct src_sess *sess, str *body) +{ + unsigned int flags = RTP_COPY_MODE_SIPREC|RTP_COPY_LEG_BOTH; + struct rtp_relay_streams streams; + struct rtp_relay_stream *stream; + int s; + + if (sess->flags & SIPREC_PAUSED) + flags |= RTP_COPY_MODE_DISABLE; + + if (srec_rtp.copy_offer(sess->rtp, &mod_name, + &sess->media, flags, -1, body, &streams) < 0) { + LM_ERR("could not start recording!\n"); + return -3; + } + for (s = 0; s < streams.count; s++) { + stream = &streams.streams[s]; + srs_fill_sdp_stream(stream->label, stream->medianum, + NULL, sess, &sess->participants[stream->leg]); + } + return 0; +} + + static int srec_b2b_req(struct sip_msg *msg, struct src_sess *ss) { str body = str_init(""); @@ -244,8 +268,7 @@ static int srec_b2b_req(struct sip_msg *msg, struct src_sess *ss) code = 488; goto reply; } - if (srec_rtp.copy_offer(ss->rtp, &mod_name, &ss->media, - RTP_COPY_MODE_SIPREC|RTP_COPY_LEG_BOTH, -1, &body) < 0) { + if (srec_get_body(ss, &body) < 0) { LM_ERR("could not refresh recording!\n"); goto reply; } @@ -329,26 +352,14 @@ static int srec_b2b_notify(struct sip_msg *msg, str *key, int type, } ss->flags |= SIPREC_ONGOING; - if (ss->flags & SIPREC_PAUSED) { - ss->flags &= ~SIPREC_PAUSED; - //srs_stop_media(ss); - - } else { - if (srs_handle_media(msg, ss) < 0) { - LM_ERR("cannot handle SRS media!\n"); - goto no_recording; - } + if (srs_handle_media(msg, ss) < 0) { + LM_ERR("cannot handle SRS media!\n"); + goto no_recording; } - if (!(ss->flags & SIPREC_DLG_CBS)) { - if (srec_register_callbacks(ss) < 0) { - LM_ERR("cannot register callback for terminating session\n"); - goto no_recording; - } - - /* no need to keep ref on the dialog, since we rely on it from now on */ - srec_dlg.dlg_unref(ss->dlg, 1); - /* also, the b2b ref moves on the dialog - so we avoid a ref-unref */ + if (!(ss->flags & SIPREC_DLG_CBS) && srec_register_callbacks(ss) < 0) { + LM_ERR("cannot register callback for terminating session\n"); + goto no_recording; } return 0; @@ -366,14 +377,12 @@ static int srec_b2b_notify(struct sip_msg *msg, str *key, int type, req.b2b_key->len, req.b2b_key->s); } srec_rtp.copy_delete(ss->rtp, &mod_name, &ss->media); - srec_logic_destroy(ss); + srec_logic_destroy(ss, 0); if (!(ss->flags & SIPREC_DLG_CBS)) { /* if the dialog has already been engaged, then we need to keep the * reference until the end of the dialog, where it will be cleaned up */ srec_dlg.dlg_ctx_put_ptr(ss->dlg, srec_dlg_idx, NULL); - srec_dlg.dlg_unref(ss->dlg, 1); - ss->dlg = NULL; srec_hlog(ss, SREC_UNREF, "no recording"); SIPREC_UNREF(ss); } @@ -486,6 +495,8 @@ static int srs_send_invite(struct src_sess *sess) return -1; } + sess->flags |= SIPREC_STARTED; + /* store the key in the param */ sess->b2b_key.s = shm_malloc(client->len); if (!sess->b2b_key.s) { @@ -501,9 +512,8 @@ static int srs_send_invite(struct src_sess *sess) } /* starts the recording to the srs */ -int src_start_recording(struct sip_msg *msg, struct src_sess *sess) +static int src_start_recording(struct sip_msg *msg, struct src_sess *sess) { - unsigned int flags = RTP_COPY_MODE_SIPREC|RTP_COPY_LEG_BOTH; union sockaddr_union tmp; int ret; str sdp; @@ -517,11 +527,11 @@ int src_start_recording(struct sip_msg *msg, struct src_sess *sess) } } - if (srec_rtp.copy_offer(sess->rtp, &mod_name, - &sess->media, flags, -1, &sdp) < 0) { + if (srec_get_body(sess, &sdp) < 0) { LM_ERR("could not start recording!\n"); return -3; } + if (shm_str_dup(&sess->initial_sdp, &sdp) < 0) { pkg_free(sdp.s); srec_rtp.copy_delete(sess->rtp, &mod_name, &sess->media); @@ -539,8 +549,6 @@ int src_start_recording(struct sip_msg *msg, struct src_sess *sess) return ret; } - sess->flags |= SIPREC_STARTED; - return 1; } @@ -587,16 +595,11 @@ static void srs_send_update_invite(struct src_sess *sess, str *body) static int src_update_recording(struct sip_msg *msg, struct src_sess *sess) { str body, sdp; - unsigned int flags = RTP_COPY_MODE_SIPREC|RTP_COPY_LEG_BOTH; if (msg == FAKED_REPLY) return 0; - if (sess->flags & SIPREC_PAUSED) - flags |= RTP_COPY_MODE_DISABLE; - - if (srec_rtp.copy_offer(sess->rtp, &mod_name, - &sess->media, flags, -1, &sdp) < 0) { + if (srec_get_body(sess, &sdp) < 0) { LM_ERR("could not refresh recording!\n"); goto error; } @@ -635,14 +638,11 @@ void tm_start_recording(struct cell *t, int type, struct tmcb_params *ps) if (!is_invite(t)) return; ss = (struct src_sess *)*ps->param; - if (ps->code >= 300) { - /* unref so we can release the dialog */ - srec_dlg.dlg_unref(ss->dlg, 1); + if (ps->code >= 300) return; - } - /* engage only on successful calls */ SIPREC_LOCK(ss); + /* engage only on successful calls */ /* if session has been started, do not start it again */ if (ss->flags & SIPREC_STARTED) LM_DBG("Session %p (%s) already started!\n", ss, ss->uuid); @@ -651,12 +651,12 @@ void tm_start_recording(struct cell *t, int type, struct tmcb_params *ps) SIPREC_UNLOCK(ss); } -void srec_logic_destroy(struct src_sess *sess) +void srec_logic_destroy(struct src_sess *sess, int keep_sdp) { if (!sess->b2b_key.s) return; - if (sess->initial_sdp.s) { + if (!keep_sdp && sess->initial_sdp.s) { shm_free(sess->initial_sdp.s); sess->initial_sdp.s = NULL; } diff --git a/modules/siprec/siprec_logic.h b/modules/siprec/siprec_logic.h index eb2b0dec732..a97a684ab87 100644 --- a/modules/siprec/siprec_logic.h +++ b/modules/siprec/siprec_logic.h @@ -29,11 +29,10 @@ #include "siprec_sess.h" #include "../b2b_entities/b2be_load.h" -int src_start_recording(struct sip_msg *msg, struct src_sess *sess); void tm_start_recording(struct cell *t, int type, struct tmcb_params *ps); int srec_register_callbacks(struct src_sess *sess); int srec_restore_callback(struct src_sess *sess); -void srec_logic_destroy(struct src_sess *sess); +void srec_logic_destroy(struct src_sess *sess, int keep_sdp); int src_pause_recording(void); int src_resume_recording(void); diff --git a/modules/siprec/siprec_sess.c b/modules/siprec/siprec_sess.c index bc82a028e7c..c5423a2f24e 100644 --- a/modules/siprec/siprec_sess.c +++ b/modules/siprec/siprec_sess.c @@ -168,7 +168,7 @@ void src_free_session(struct src_sess *sess) list_del(&node->list); shm_free(node); } - srec_logic_destroy(sess); + srec_logic_destroy(sess, 0); if (sess->dlg) srec_dlg.dlg_ctx_put_ptr(sess->dlg, srec_dlg_idx, NULL); lock_destroy(&sess->lock); @@ -399,7 +399,7 @@ void srec_loaded_callback(struct dlg_cell *dlg, int type, goto error; } memcpy(&uuid, tmp.s, tmp.len); - if (srs_add_raw_sdp_stream(label, medianum, &uuid, sess, + if (srs_fill_sdp_stream(label, medianum, &uuid, sess, &sess->participants[sess->participants_no - 1]) < 0) { LM_ERR("cannot add new media stream!\n"); goto error; @@ -407,26 +407,29 @@ void srec_loaded_callback(struct dlg_cell *dlg, int type, } } - /* restore b2b callbacks */ - if (srec_restore_callback(sess) < 0) { - LM_ERR("cannot restore b2b callbacks!\n"); - return; - } - /* all good: continue with dialog support! */ SIPREC_REF(sess); srec_hlog(sess, SREC_REF, "registered dlg"); sess->dlg = dlg; srec_dlg.dlg_ctx_put_ptr(dlg, srec_dlg_idx, sess); + /* restore b2b callbacks */ + if (srec_restore_callback(sess) < 0) { + LM_ERR("cannot restore b2b callbacks!\n"); + goto error_unref; + } + if (srec_register_callbacks(sess) < 0) { LM_ERR("cannot register callback for terminating session\n"); - srec_hlog(sess, SREC_UNREF, "error registering dlg callbacks"); - SIPREC_UNREF(sess); - goto error; + goto error_unref; } return; +error_unref: + srec_hlog(sess, SREC_UNREF, "error registering callbacks"); + SIPREC_UNREF(sess); + return; + error: if (sess) src_free_session(sess); diff --git a/modules/siprec/siprec_uuid.h b/modules/siprec/siprec_uuid.h index 3814d04730e..26292d43ab7 100644 --- a/modules/siprec/siprec_uuid.h +++ b/modules/siprec/siprec_uuid.h @@ -38,5 +38,8 @@ static inline void siprec_build_uuid(siprec_uuid uuid) base64encode(uuid, tmp_uuid, sizeof(tmp_uuid)); } +#define siprec_cmp_uuid(a, b) \ + memcmp(a, b, SIPREC_UUID_LEN) + #endif /* _SIPREC_UUID_H_ */ diff --git a/modules/sl/Makefile b/modules/sl/Makefile index 1969e6fe5a3..9a4c0c29c92 100644 --- a/modules/sl/Makefile +++ b/modules/sl/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/sl/README b/modules/sl/README index 3f022541d21..e14e5199492 100644 --- a/modules/sl/README +++ b/modules/sl/README @@ -199,8 +199,8 @@ Chapter 2. Contributors 2. Jiri Kuthan (@jiriatipteldotorg) 42 32 665 232 3. Daniel-Constantin Mierla (@miconda) 22 16 295 172 4. Andrei Pelinescu-Onciul 16 14 50 50 - 5. Jan Janak (@janakj) 12 8 355 21 - 6. Liviu Chircu (@liviuchircu) 11 9 28 60 + 5. Liviu Chircu (@liviuchircu) 13 10 28 62 + 6. Jan Janak (@janakj) 12 8 355 21 7. Henning Westerholt (@henningw) 7 5 12 12 8. Razvan Crainea (@razvancrainea) 7 5 12 11 9. Vlad Patrascu (@rvlad-patrascu) 7 4 30 83 @@ -231,12 +231,12 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2002 - Nov 2019 - 3. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 - 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 6. Liviu Chircu (@liviuchircu) Mar 2014 - Jun 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2002 - Nov 2019 + 4. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Ionut Ionita (@ionutrazvanionita) Nov 2014 - Nov 2014 8. Anca Vamanu Nov 2010 - Nov 2010 9. Henning Westerholt (@henningw) Aug 2007 - Jun 2008 diff --git a/modules/sl/doc/contributors.xml b/modules/sl/doc/contributors.xml index a41dbd7969b..33b6660e813 100644 --- a/modules/sl/doc/contributors.xml +++ b/modules/sl/doc/contributors.xml @@ -52,20 +52,20 @@ 5. + Liviu Chircu (@liviuchircu) + 13 + 10 + 28 + 62 + + + 6. Jan Janak (@janakj) 12 8 355 21 - - 6. - Liviu Chircu (@liviuchircu) - 11 - 9 - 28 - 60 - 7. Henning Westerholt (@henningw) @@ -128,34 +128,34 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 2. + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2002 - Nov 2019 - 3. + 4. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 - 4. + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2019 - 5. + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - 6. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jun 2018 - 7. Ionut Ionita (@ionutrazvanionita) diff --git a/modules/snmpstats/Makefile b/modules/snmpstats/Makefile index 3fc5a938cd8..bbe435507f1 100644 --- a/modules/snmpstats/Makefile +++ b/modules/snmpstats/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs @@ -22,7 +20,7 @@ else endif ifeq ($(CC_NAME), clang) - DEFS := $(filter-out -flto%,$(DEFS)) -Wno-ignored-optimization-argument + DEFS := $(filter-out -flto%,$(DEFS)) -Wno-ignored-optimization-argument -Qunused-arguments endif CFLAGS+= diff --git a/modules/snmpstats/README b/modules/snmpstats/README index 6f6c8fb4f09..be4059c99cd 100644 --- a/modules/snmpstats/README +++ b/modules/snmpstats/README @@ -696,7 +696,7 @@ Chapter 3. Contributors 1. Jeffrey Magder 114 4 13157 64 2. Bogdan-Andrei Iancu (@bogdan-iancu) 50 36 519 526 3. Razvan Crainea (@razvancrainea) 24 21 94 70 - 4. Liviu Chircu (@liviuchircu) 14 11 44 116 + 4. Liviu Chircu (@liviuchircu) 16 13 45 119 5. Ovidiu Sas (@ovidiusas) 13 3 6 505 6. Daniel-Constantin Mierla (@miconda) 12 10 48 41 7. Anca Vamanu 6 2 161 111 @@ -730,10 +730,10 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Oct 2022 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Aug 2015 - Jan 2023 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2006 - Apr 2019 - 4. Liviu Chircu (@liviuchircu) Mar 2014 - Nov 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Oct 2022 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Aug 2015 - Jan 2023 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2006 - Apr 2019 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2017 7. Julián Moreno Patiño Feb 2016 - Feb 2016 diff --git a/modules/snmpstats/doc/contributors.xml b/modules/snmpstats/doc/contributors.xml index cbaaa5fd997..d7a64824560 100644 --- a/modules/snmpstats/doc/contributors.xml +++ b/modules/snmpstats/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 14 - 11 - 44 - 116 + 16 + 13 + 45 + 119 5. @@ -128,24 +128,24 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Oct 2022 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Aug 2015 - Jan 2023 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2006 - Apr 2019 - - 4. - Liviu Chircu (@liviuchircu) - Mar 2014 - Nov 2018 - 5. Peter Lemenkov (@lemenkov) diff --git a/modules/speeddial/Makefile b/modules/speeddial/Makefile index d7a3f8ec395..a600d33affb 100644 --- a/modules/speeddial/Makefile +++ b/modules/speeddial/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # SPEEDDIAL Module # # diff --git a/modules/speeddial/README b/modules/speeddial/README index c15413a0f28..d71d759957b 100644 --- a/modules/speeddial/README +++ b/modules/speeddial/README @@ -217,9 +217,6 @@ if($ru=~"sip:[0-9]{2}@.*") Example 1.10. OpenSIPS config script - sample speeddial usage ... -# -# $Id$ -# # sample config script to use speeddial module # @@ -336,7 +333,7 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 27 23 90 147 2. Daniel-Constantin Mierla (@miconda) 21 16 127 137 - 3. Liviu Chircu (@liviuchircu) 13 11 38 56 + 3. Liviu Chircu (@liviuchircu) 14 12 38 61 4. Elena-Ramona Modroiu 12 2 1063 1 5. Razvan Crainea (@razvancrainea) 8 6 11 8 6. Vlad Patrascu (@rvlad-patrascu) 6 4 31 35 @@ -370,7 +367,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2023 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 3. Walter Doekes (@wdoekes) Apr 2021 - Apr 2021 4. Razvan Crainea (@razvancrainea) Aug 2015 - Jul 2020 diff --git a/modules/speeddial/doc/contributors.xml b/modules/speeddial/doc/contributors.xml index df47e86e182..08dc7a8a879 100644 --- a/modules/speeddial/doc/contributors.xml +++ b/modules/speeddial/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 13 - 11 + 14 + 12 38 - 56 + 61 4. @@ -129,7 +129,7 @@ 1. Liviu Chircu (@liviuchircu) - Mar 2014 - May 2023 + Mar 2014 - May 2024 2. diff --git a/modules/speeddial/doc/speeddial.cfg b/modules/speeddial/doc/speeddial.cfg index 03ed5b2d2aa..3060413b5f5 100644 --- a/modules/speeddial/doc/speeddial.cfg +++ b/modules/speeddial/doc/speeddial.cfg @@ -1,6 +1,3 @@ -# -# $Id$ -# # sample config script to use speeddial module # diff --git a/modules/sql_cacher/README b/modules/sql_cacher/README index be1f6c4e1b4..b4b9683fecd 100644 --- a/modules/sql_cacher/README +++ b/modules/sql_cacher/README @@ -366,8 +366,8 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Vlad Patrascu (@rvlad-patrascu) 93 44 3640 1114 - 2. Liviu Chircu (@liviuchircu) 22 18 166 115 - 3. Razvan Crainea (@razvancrainea) 15 13 25 14 + 2. Liviu Chircu (@liviuchircu) 24 19 192 141 + 3. Razvan Crainea (@razvancrainea) 16 14 33 15 4. Bogdan-Andrei Iancu (@bogdan-iancu) 12 9 123 29 5. Maksym Sobolyev (@sobomax) 6 4 7 8 6. Ionel Cerghit (@ionel-cerghit) 4 1 50 92 @@ -398,13 +398,13 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Bogdan-Andrei Iancu (@bogdan-iancu) May 2017 - Jan 2024 - 2. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 3. Vlad Patrascu (@rvlad-patrascu) Aug 2015 - Jul 2022 - 4. Gang Zhuo Nov 2021 - Nov 2021 - 5. Walter Doekes (@wdoekes) Apr 2021 - Apr 2021 - 6. Razvan Crainea (@razvancrainea) Feb 2016 - Jan 2021 - 7. Liviu Chircu (@liviuchircu) Mar 2016 - Sep 2019 + 1. Razvan Crainea (@razvancrainea) Feb 2016 - Jul 2024 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) May 2017 - Jan 2024 + 3. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 + 4. Vlad Patrascu (@rvlad-patrascu) Aug 2015 - Jul 2022 + 5. Gang Zhuo Nov 2021 - Nov 2021 + 6. Walter Doekes (@wdoekes) Apr 2021 - Apr 2021 + 7. Liviu Chircu (@liviuchircu) Mar 2016 - Apr 2021 8. Dan Pascu (@danpascu) May 2019 - May 2019 9. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 10. Ovidiu Sas (@ovidiusas) Mar 2017 - Mar 2017 diff --git a/modules/sql_cacher/doc/contributors.xml b/modules/sql_cacher/doc/contributors.xml index 4f621c0eba9..e87fb34a3fe 100644 --- a/modules/sql_cacher/doc/contributors.xml +++ b/modules/sql_cacher/doc/contributors.xml @@ -29,18 +29,18 @@ 2. Liviu Chircu (@liviuchircu) - 22 - 18 - 166 - 115 + 24 + 19 + 192 + 141 3. Razvan Crainea (@razvancrainea) - 15 - 13 - 25 + 16 14 + 33 + 15 4. @@ -128,38 +128,38 @@ 1. + Razvan Crainea (@razvancrainea) + Feb 2016 - Jul 2024 + + + 2. Bogdan-Andrei Iancu (@bogdan-iancu) May 2017 - Jan 2024 - 2. + 3. Maksym Sobolyev (@sobomax) Oct 2020 - Feb 2023 - 3. + 4. Vlad Patrascu (@rvlad-patrascu) Aug 2015 - Jul 2022 - 4. + 5. Gang Zhuo Nov 2021 - Nov 2021 - 5. + 6. Walter Doekes (@wdoekes) Apr 2021 - Apr 2021 - - 6. - Razvan Crainea (@razvancrainea) - Feb 2016 - Jan 2021 - 7. Liviu Chircu (@liviuchircu) - Mar 2016 - Sep 2019 + Mar 2016 - Apr 2021 8. diff --git a/modules/sql_cacher/sql_cacher.c b/modules/sql_cacher/sql_cacher.c index 7ff2a1d9dba..ebace87abd4 100644 --- a/modules/sql_cacher/sql_cacher.c +++ b/modules/sql_cacher/sql_cacher.c @@ -737,15 +737,15 @@ static db_handlers_t *db_init_test_conn(cache_entry_t *c_entry) /* cachedb init and test connection */ if (cachedb_bind_mod(&c_entry->cachedb_url, &new_db_hdls->cdbf) < 0) { - LM_ERR("Unable to bind to a cachedb database driver for URL: %.*s\n", - c_entry->cachedb_url.len, c_entry->cachedb_url.s); + LM_ERR("Unable to bind to a cachedb database driver for URL: %s\n", + db_url_escape(&c_entry->cachedb_url)); return NULL; } /* open a test connection */ new_db_hdls->cdbcon = new_db_hdls->cdbf.init(&c_entry->cachedb_url); if (!new_db_hdls->cdbcon) { - LM_ERR("Cannot init connection to cachedb: %.*s\n", - c_entry->cachedb_url.len, c_entry->cachedb_url.s); + LM_ERR("Cannot init connection to cachedb: %s\n", + db_url_escape(&c_entry->cachedb_url)); return NULL; } @@ -758,15 +758,15 @@ static db_handlers_t *db_init_test_conn(cache_entry_t *c_entry) /* setting and getting a test key in cachedb */ if (new_db_hdls->cdbf.set(new_db_hdls->cdbcon, &cdb_test_key, &cdb_test_val, 0) < 0) { - LM_ERR("Failed to set test key in cachedb: %.*s\n", - c_entry->cachedb_url.len, c_entry->cachedb_url.s); + LM_ERR("Failed to set test key in cachedb: %s\n", + db_url_escape(&c_entry->cachedb_url)); new_db_hdls->cdbf.destroy(new_db_hdls->cdbcon); new_db_hdls->cdbcon = 0; return NULL; } if (new_db_hdls->cdbf.get(new_db_hdls->cdbcon, &cdb_test_key, &cachedb_res) < 0) { - LM_ERR("Failed to get test key from cachedb: %.*s\n", - c_entry->cachedb_url.len, c_entry->cachedb_url.s); + LM_ERR("Failed to get test key from cachedb: %s\n", + db_url_escape(&c_entry->cachedb_url)); new_db_hdls->cdbf.destroy(new_db_hdls->cdbcon); new_db_hdls->cdbcon = 0; return NULL; @@ -774,7 +774,14 @@ static db_handlers_t *db_init_test_conn(cache_entry_t *c_entry) rc = str_strcmp(&cachedb_res, &cdb_test_val); pkg_free(cachedb_res.s); if (rc != 0) { - LM_ERR("Inconsistent test key for cachedb: %.*s\n", + LM_ERR("Inconsistent test key for cachedb: %s\n", + db_url_escape(&c_entry->cachedb_url)); + new_db_hdls->cdbf.destroy(new_db_hdls->cdbcon); + new_db_hdls->cdbcon = 0; + return NULL; + } + if (new_db_hdls->cdbf.remove(new_db_hdls->cdbcon, &cdb_test_key) < 0) { + LM_ERR("Failed to remove test key from cachedb: %.*s\n", c_entry->cachedb_url.len, c_entry->cachedb_url.s); new_db_hdls->cdbf.destroy(new_db_hdls->cdbcon); new_db_hdls->cdbcon = 0; @@ -783,14 +790,14 @@ static db_handlers_t *db_init_test_conn(cache_entry_t *c_entry) /* SQL DB init and test connection */ if (db_bind_mod(&c_entry->db_url, &new_db_hdls->db_funcs) < 0) { - LM_ERR("Unable to bind to a SQL database driver for URL: %.*s\n", - c_entry->db_url.len, c_entry->db_url.s); + LM_ERR("Unable to bind to a SQL database driver for URL: %s\n", + db_url_escape(&c_entry->db_url)); return NULL; } /* open a test connection */ if ((new_db_hdls->db_con = new_db_hdls->db_funcs.init(&c_entry->db_url)) == 0) { - LM_ERR("Cannot init connection to SQL DB: %.*s\n", - c_entry->db_url.len, c_entry->db_url.s); + LM_ERR("Cannot init connection to SQL DB: %s\n", + db_url_escape(&c_entry->db_url)); return NULL; } @@ -813,8 +820,8 @@ static db_handlers_t *db_init_test_conn(cache_entry_t *c_entry) if (new_db_hdls->db_funcs.query(new_db_hdls->db_con, &query_key_col, 0, &query_key_val, c_entry->columns, 1, c_entry->nr_columns, 0, &sql_res) != 0) { - LM_ERR("Failure to issuse test query to SQL DB: %.*s\n", - c_entry->db_url.len, c_entry->db_url.s); + LM_ERR("Failure to issuse test query to SQL DB: %s\n", + db_url_escape(&c_entry->db_url)); new_db_hdls->db_funcs.close(new_db_hdls->db_con); new_db_hdls->db_con = 0; return NULL; @@ -912,23 +919,23 @@ static int load_entire_table(cache_entry_t *c_entry, db_handlers_t *db_hdls, if (DB_CAPABILITY(db_hdls->db_funcs, DB_CAP_FETCH)) { if (db_hdls->db_funcs.query(db_hdls->db_con, NULL, 0, NULL, query_cols, 0, c_entry->nr_columns + 1, 0, 0) != 0) { - LM_ERR("Failure to issue query to SQL DB: %.*s\n", - c_entry->db_url.len, c_entry->db_url.s); + LM_ERR("Failure to issue query to SQL DB: %s\n", + db_url_escape(&c_entry->db_url)); pkg_free(query_cols); goto error; } if (db_hdls->db_funcs.fetch_result(db_hdls->db_con,&sql_res,fetch_nr_rows)<0) { - LM_ERR("Error fetching rows from SQL DB: %.*s\n", - c_entry->db_url.len, c_entry->db_url.s); + LM_ERR("Error fetching rows from SQL DB: %s\n", + db_url_escape(&c_entry->db_url)); pkg_free(query_cols); goto error; } } else { if (db_hdls->db_funcs.query(db_hdls->db_con, NULL, 0, NULL, query_cols, 0, c_entry->nr_columns + 1, 0, &sql_res) != 0) { - LM_ERR("Failure to issue query to SQL DB: %.*s\n", - c_entry->db_url.len, c_entry->db_url.s); + LM_ERR("Failure to issue query to SQL DB: %s\n", + db_url_escape(&c_entry->db_url)); pkg_free(query_cols); goto error; } @@ -971,8 +978,8 @@ static int load_entire_table(cache_entry_t *c_entry, db_handlers_t *db_hdls, if (DB_CAPABILITY(db_hdls->db_funcs, DB_CAP_FETCH)) { if (db_hdls->db_funcs.fetch_result(db_hdls->db_con,&sql_res,fetch_nr_rows)<0) { - LM_ERR("Error fetching rows (1) from SQL DB: %.*s\n", - c_entry->db_url.len, c_entry->db_url.s); + LM_ERR("Error fetching rows (1) from SQL DB: %s\n", + db_url_escape(&c_entry->db_url)); lock_stop_write(db_hdls->c_entry->ref_lock); goto error; } @@ -1059,8 +1066,8 @@ static int load_key(cache_entry_t *c_entry, db_handlers_t *db_hdls, str key, if (db_hdls->db_funcs.query(db_hdls->db_con, &key_col, 0, &key_val, c_entry->columns, 1, c_entry->nr_columns, 0, sql_res) != 0) { - LM_ERR("Failure to issue query to SQL DB: %.*s\n", - c_entry->db_url.len, c_entry->db_url.s); + LM_ERR("Failure to issue query to SQL DB: %s\n", + db_url_escape(&c_entry->db_url)); goto sql_error; } @@ -1484,7 +1491,7 @@ static int cdb_val_decode(pv_name_fix_t *pv_name, str *cdb_val, int reload_versi str *str_res, int *int_res) { int int_val, next_str_off, i, rc; - char int_buf[4]; + char int_buf[calc_max_base64_decode_len(INT_B64_ENC_LEN)]; const char zeroes[INT_B64_ENC_LEN] = {0}; if (pv_name->col_offset == -1) { diff --git a/modules/sst/Makefile b/modules/sst/Makefile index 4e778e21526..020172cac5e 100644 --- a/modules/sst/Makefile +++ b/modules/sst/Makefile @@ -1,6 +1,3 @@ -# -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile # # Copyright (C) 2006 SOMA Networks, INC. diff --git a/modules/sst/README b/modules/sst/README index 93376e6691a..6cb2f41f223 100644 --- a/modules/sst/README +++ b/modules/sst/README @@ -302,7 +302,7 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 30 25 125 129 2. Ron Winacott 27 5 2083 265 - 3. Liviu Chircu (@liviuchircu) 18 15 54 65 + 3. Liviu Chircu (@liviuchircu) 19 16 54 68 4. Daniel-Constantin Mierla (@miconda) 15 12 104 104 5. Razvan Crainea (@razvancrainea) 14 10 106 140 6. Andrei Datcu (@andrei-datcu) 8 6 122 28 @@ -338,12 +338,12 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 - 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 3. Ovidiu Sas (@ovidiusas) Mar 2008 - Jun 2022 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2006 - May 2020 - 5. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 - 6. Liviu Chircu (@liviuchircu) Jan 2013 - May 2019 + 1. Liviu Chircu (@liviuchircu) Jan 2013 - May 2024 + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 4. Ovidiu Sas (@ovidiusas) Mar 2008 - Jun 2022 + 5. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2006 - May 2020 + 6. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 8. Ionut Ionita (@ionutrazvanionita) Oct 2016 - Oct 2016 9. Vlad Paiu (@vladpaiu) Jun 2011 - Feb 2015 diff --git a/modules/sst/doc/contributors.xml b/modules/sst/doc/contributors.xml index d272aabf4b9..650a123a153 100644 --- a/modules/sst/doc/contributors.xml +++ b/modules/sst/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Liviu Chircu (@liviuchircu) - 18 - 15 + 19 + 16 54 - 65 + 68 4. @@ -128,34 +128,34 @@ 1. + Liviu Chircu (@liviuchircu) + Jan 2013 - May 2024 + + + 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 - 2. + 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 3. + 4. Ovidiu Sas (@ovidiusas) Mar 2008 - Jun 2022 - 4. + 5. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2006 - May 2020 - 5. + 6. Razvan Crainea (@razvancrainea) Jun 2011 - Sep 2019 - - 6. - Liviu Chircu (@liviuchircu) - Jan 2013 - May 2019 - 7. Peter Lemenkov (@lemenkov) diff --git a/modules/statistics/Makefile b/modules/statistics/Makefile index b87cca20e81..4d748757f0b 100644 --- a/modules/statistics/Makefile +++ b/modules/statistics/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/statistics/README b/modules/statistics/README index a86b76c3cb8..8337edc295d 100644 --- a/modules/statistics/README +++ b/modules/statistics/README @@ -333,7 +333,7 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 33 20 1037 227 - 2. Liviu Chircu (@liviuchircu) 27 19 518 161 + 2. Liviu Chircu (@liviuchircu) 28 20 518 163 3. Razvan Crainea (@razvancrainea) 20 13 691 19 4. Daniel-Constantin Mierla (@miconda) 11 9 22 18 5. Vlad Patrascu (@rvlad-patrascu) 9 4 97 201 @@ -367,9 +367,9 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Razvan Crainea (@razvancrainea) Feb 2012 - Oct 2023 - 2. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - Feb 2023 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Razvan Crainea (@razvancrainea) Feb 2012 - Oct 2023 + 3. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2019 5. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2006 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/statistics/doc/contributors.xml b/modules/statistics/doc/contributors.xml index c443b74cf96..34663c59196 100644 --- a/modules/statistics/doc/contributors.xml +++ b/modules/statistics/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 27 - 19 + 28 + 20 518 - 161 + 163 3. @@ -128,18 +128,18 @@ 1. - Razvan Crainea (@razvancrainea) - Feb 2012 - Oct 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 2. - Maksym Sobolyev (@sobomax) - Jan 2021 - Feb 2023 + Razvan Crainea (@razvancrainea) + Feb 2012 - Oct 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - Feb 2023 + Maksym Sobolyev (@sobomax) + Jan 2021 - Feb 2023 4. diff --git a/modules/status_report/Makefile b/modules/status_report/Makefile index 931e635f2de..dd0a6e42e87 100644 --- a/modules/status_report/Makefile +++ b/modules/status_report/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/status_report/README b/modules/status_report/README index e39dbae79e4..ab9ff8291ba 100644 --- a/modules/status_report/README +++ b/modules/status_report/README @@ -130,7 +130,8 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Bogdan-Andrei Iancu (@bogdan-iancu) 7 3 339 7 - 2. Maksym Sobolyev (@sobomax) 4 2 2 3 + 2. Liviu Chircu (@liviuchircu) 5 3 8 6 + 3. Maksym Sobolyev (@sobomax) 4 2 2 3 (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -152,8 +153,9 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2022 - Feb 2022 + 1. Liviu Chircu (@liviuchircu) May 2024 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2022 - Feb 2022 (1) including any documentation-related commits, excluding merge commits diff --git a/modules/status_report/doc/contributors.xml b/modules/status_report/doc/contributors.xml index 99e58b8da43..88da29f33f8 100644 --- a/modules/status_report/doc/contributors.xml +++ b/modules/status_report/doc/contributors.xml @@ -28,6 +28,14 @@ 2. + Liviu Chircu (@liviuchircu) + 5 + 3 + 8 + 6 + + + 3. Maksym Sobolyev (@sobomax) 4 2 @@ -64,11 +72,16 @@ 1. + Liviu Chircu (@liviuchircu) + May 2024 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2022 - Feb 2022 diff --git a/modules/status_report/status_report.c b/modules/status_report/status_report.c index e7bce3b150f..5fb77b8803f 100644 --- a/modules/status_report/status_report.c +++ b/modules/status_report/status_report.c @@ -38,8 +38,8 @@ static int w_add_report(struct sip_msg *msg, void *srg, static const cmd_export_t cmds[]={ {"sr_set_status", (cmd_function)w_set_status, { {CMD_PARAM_STR, fixup_sr_group, 0}, - {CMD_PARAM_INT, 0, 0}, {0,0,0}, - {CMD_PARAM_STR|CMD_PARAM_OPT, 0, 0}}, + {CMD_PARAM_INT, 0, 0}, + {CMD_PARAM_STR|CMD_PARAM_OPT, 0, 0}, {0,0,0}}, ALL_ROUTES}, {"sr_add_report", (cmd_function)w_add_report, { {CMD_PARAM_STR, fixup_sr_group, 0}, @@ -125,12 +125,16 @@ static int w_add_report(struct sip_msg *msg, void *srg, static int w_set_status(struct sip_msg *msg, void *srg, int *status, str *txt) { + int rc; + if (txt) - return sr_set_status( srg, CHAR_INT_NULL, + rc = sr_set_status( srg, CHAR_INT_NULL, *status, txt->s, txt->len, 1/*public access*/); else - return sr_set_status( srg, CHAR_INT_NULL, + rc = sr_set_status( srg, CHAR_INT_NULL, *status, CHAR_INT_NULL, 1/*public access*/); + + return !rc ? 1 : rc; } diff --git a/modules/stir_shaken/README b/modules/stir_shaken/README index 6b05284927c..4a8375f458a 100644 --- a/modules/stir_shaken/README +++ b/modules/stir_shaken/README @@ -276,7 +276,6 @@ modparam("stir_shaken", "require_date_hdr", 0) The function returns the following values: * 1: Success * -1: Internal error - * -2: Identity header already exists * -3: Failed to derive identity from SIP message because the URI is not a telephone number * -4: Date header value is older than local policy for @@ -424,15 +423,17 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) - Name DevScore Commits Lines ++ Lines -- - 1. Vlad Patrascu (@rvlad-patrascu) 58 26 3129 324 - 2. Liviu Chircu (@liviuchircu) 22 17 246 120 - 3. Maksym Sobolyev (@sobomax) 5 3 21 21 - 4. Razvan Crainea (@razvancrainea) 4 2 8 9 - 5. kworm83 4 2 7 2 - 6. Kevin 3 1 2 2 - 7. John Burke (@john08burke) 2 1 4 0 - 8. Andriy Pylypenko (@bambyster) 2 1 1 0 + Name DevScore Commits Lines ++ Lines -- + 1. Vlad Patrascu (@rvlad-patrascu) 58 26 3129 324 + 2. Liviu Chircu (@liviuchircu) 24 18 252 123 + 3. Maksym Sobolyev (@sobomax) 5 3 21 21 + 4. MonkeyTester 4 2 13 6 + 5. Razvan Crainea (@razvancrainea) 4 2 8 9 + 6. kworm83 4 2 7 2 + 7. Bogdan-Andrei Iancu (@bogdan-iancu) 3 2 0 8 + 8. Kevin 3 1 2 2 + 9. John Burke (@john08burke) 2 1 4 0 + 10. Andriy Pylypenko (@bambyster) 2 1 1 0 (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -453,15 +454,17 @@ Chapter 2. Contributors 2.2. By Commit Activity Table 2.2. Most recently active contributors^(1) to this module - Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Nov 2019 - Sep 2023 - 2. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 3. Kevin Feb 2022 - Feb 2022 - 4. kworm83 Jan 2022 - Jan 2022 - 5. Vlad Patrascu (@rvlad-patrascu) Oct 2019 - Aug 2021 - 6. Razvan Crainea (@razvancrainea) Jan 2021 - Jul 2021 - 7. John Burke (@john08burke) Apr 2021 - Apr 2021 - 8. Andriy Pylypenko (@bambyster) Aug 2020 - Aug 2020 + Name Commit Activity + 1. MonkeyTester Aug 2024 - Aug 2024 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2024 - Jul 2024 + 3. Liviu Chircu (@liviuchircu) Nov 2019 - Apr 2024 + 4. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 + 5. Kevin Feb 2022 - Feb 2022 + 6. kworm83 Jan 2022 - Jan 2022 + 7. Vlad Patrascu (@rvlad-patrascu) Oct 2019 - Aug 2021 + 8. Razvan Crainea (@razvancrainea) Jan 2021 - Jul 2021 + 9. John Burke (@john08burke) Apr 2021 - Apr 2021 + 10. Andriy Pylypenko (@bambyster) Aug 2020 - Aug 2020 (1) including any documentation-related commits, excluding merge commits @@ -470,8 +473,8 @@ Chapter 3. Documentation 3.1. Contributors - Last edited by: Liviu Chircu (@liviuchircu), Vlad Patrascu - (@rvlad-patrascu). + Last edited by: Bogdan-Andrei Iancu (@bogdan-iancu), Liviu + Chircu (@liviuchircu), Vlad Patrascu (@rvlad-patrascu). Documentation Copyrights: diff --git a/modules/stir_shaken/doc/contributors.xml b/modules/stir_shaken/doc/contributors.xml index 4302709df20..8bfb92e215c 100644 --- a/modules/stir_shaken/doc/contributors.xml +++ b/modules/stir_shaken/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 22 - 17 - 246 - 120 + 24 + 18 + 252 + 123 3. @@ -44,6 +44,14 @@ 4. + MonkeyTester + 4 + 2 + 13 + 6 + + + 5. Razvan Crainea (@razvancrainea) 4 2 @@ -51,7 +59,7 @@ 9 - 5. + 6. kworm83 4 2 @@ -59,7 +67,15 @@ 2 - 6. + 7. + Bogdan-Andrei Iancu (@bogdan-iancu) + 3 + 2 + 0 + 8 + + + 8. Kevin 3 1 @@ -67,7 +83,7 @@ 2 - 7. + 9. John Burke (@john08burke) 2 1 @@ -75,7 +91,7 @@ 0 - 8. + 10. Andriy Pylypenko (@bambyster) 2 1 @@ -112,41 +128,51 @@ 1. - Liviu Chircu (@liviuchircu) - Nov 2019 - Sep 2023 + MonkeyTester + Aug 2024 - Aug 2024 2. + Bogdan-Andrei Iancu (@bogdan-iancu) + Jul 2024 - Jul 2024 + + + 3. + Liviu Chircu (@liviuchircu) + Nov 2019 - Apr 2024 + + + 4. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 3. + 5. Kevin Feb 2022 - Feb 2022 - 4. + 6. kworm83 Jan 2022 - Jan 2022 - 5. + 7. Vlad Patrascu (@rvlad-patrascu) Oct 2019 - Aug 2021 - 6. + 8. Razvan Crainea (@razvancrainea) Jan 2021 - Jul 2021 - 7. + 9. John Burke (@john08burke) Apr 2021 - Apr 2021 - 8. + 10. Andriy Pylypenko (@bambyster) Aug 2020 - Aug 2020 @@ -164,7 +190,7 @@ Documentation
Contributors - Last edited by: Liviu Chircu (@liviuchircu), Vlad Patrascu (@rvlad-patrascu). + Last edited by: Bogdan-Andrei Iancu (@bogdan-iancu), Liviu Chircu (@liviuchircu), Vlad Patrascu (@rvlad-patrascu).
diff --git a/modules/stir_shaken/doc/stir_shaken_admin.xml b/modules/stir_shaken/doc/stir_shaken_admin.xml index 2b5bfafdd9a..e3a8b8f53c6 100644 --- a/modules/stir_shaken/doc/stir_shaken_admin.xml +++ b/modules/stir_shaken/doc/stir_shaken_admin.xml @@ -336,9 +336,6 @@ modparam("stir_shaken", "require_date_hdr", 0) -1: Internal error - - -2: Identity header already exists - -3: Failed to derive identity from SIP message because the URI is not a telephone number diff --git a/modules/stir_shaken/stir_shaken.c b/modules/stir_shaken/stir_shaken.c index 9f6a8660a5e..5f6e3410e0c 100644 --- a/modules/stir_shaken/stir_shaken.c +++ b/modules/stir_shaken/stir_shaken.c @@ -1001,11 +1001,6 @@ static int w_stir_auth(struct sip_msg *msg, str *attest, str *origid, return -1; } - if (get_header_by_static_name(msg, "Identity")) { - LM_NOTICE("Identity header already exists\n"); - return -2; - } - if (!orig_tn_p) { if ((rc = get_orig_tn_from_msg(msg, &orig_tn)) < 0) { if (rc == -1) @@ -1064,7 +1059,8 @@ static int w_stir_auth(struct sip_msg *msg, str *attest, str *origid, if (labs(now - date_ts) > auth_date_freshness) { LM_NOTICE("Date header timestamp diff exceeds local policy " - "(diff: %lds, auth-freshness: %ds)\n", now - date_ts, auth_date_freshness); + "(diff: %llds, auth-freshness: %ds)\n", + (long long)(now - date_ts), auth_date_freshness); return -4; } } @@ -1795,7 +1791,7 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf, if ((rc = get_parsed_identity(identity_hdr, &parsed)) < 0) { if (rc == -1) { LM_ERR("Failed to parse identity header\n"); - SET_VERIFY_ERR_VARS(IERROR_CODE, IERROR_REASON); + SET_VERIFY_ERR_VARS(IERROR_CODE, IERROR_REASON_PARSE_IDENTITY); } else { /* rc == -4 */ LM_INFO("Invalid identity header\n"); SET_VERIFY_ERR_VARS(INVALID_IDENTITY_CODE, INVALID_IDENTITY_REASON); @@ -1831,7 +1827,7 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf, if ((now = time(0)) == -1) { LM_ERR("Failed to get current time\n"); - SET_VERIFY_ERR_VARS(IERROR_CODE, IERROR_REASON); + SET_VERIFY_ERR_VARS(IERROR_CODE, IERROR_REASON_GET_CURRENT_TIME); rc = -1; goto error; } @@ -1848,14 +1844,15 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf, if (get_date_ts(date_hf, &date_ts) < 0) { LM_ERR("Failed to get UNIX time from Date header\n"); - SET_VERIFY_ERR_VARS(IERROR_CODE, IERROR_REASON); + SET_VERIFY_ERR_VARS(IERROR_CODE, IERROR_REASON_GET_TIME_FROM_DATE_HEADER); rc = -1; goto error; } if (labs(now - date_ts) > verify_date_freshness) { LM_NOTICE("Date header timestamp diff exceeds local policy " - "(diff: %lds, verify-freshness: %ds)\n", now - date_ts, verify_date_freshness); + "(diff: %llds, verify-freshness: %ds)\n", + (long long)(now - date_ts), verify_date_freshness); SET_VERIFY_ERR_VARS(STALE_DATE_CODE, STALE_DATE_REASON); rc = -6; goto error; @@ -1863,7 +1860,8 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf, } else { if (labs(now - iat_ts) > verify_date_freshness) { LM_NOTICE("'iat' timestamp diff exceeds local policy " - "(diff: %lds, verify-freshness: %ds)\n", now - iat_ts, verify_date_freshness); + "(diff: %llds, verify-freshness: %ds)\n", + (long long)(now - iat_ts), verify_date_freshness); SET_VERIFY_ERR_VARS(STALE_DATE_CODE, STALE_DATE_REASON); rc = -6; goto error; @@ -1896,7 +1894,7 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf, if (load_cert(&cert, &certchain, cert_buf) < 0) { LM_ERR("Failed to load certificate\n"); - SET_VERIFY_ERR_VARS(IERROR_CODE, IERROR_REASON); + SET_VERIFY_ERR_VARS(IERROR_CODE, IERROR_REASON_LOAD_CERTIFICATE); rc = -1; goto error; } @@ -1920,7 +1918,7 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf, if ((rc = validate_certificate(cert, certchain)) < 0) { if (rc == -1) { LM_ERR("Error validating certificate\n"); - SET_VERIFY_ERR_VARS(IERROR_CODE, IERROR_REASON); + SET_VERIFY_ERR_VARS(IERROR_CODE, IERROR_REASON_VALIDATE_CERTIFICATE); goto error; } else { /* rc == -8 */ LM_INFO("Invalid certificate\n"); @@ -1936,7 +1934,7 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf, if ((rc = verify_signature(cert, parsed, iat_ts, orig_tn_p, dest_tn_p)) <= 0) { if (rc < 0) { LM_ERR("Error while verifying signature\n"); - SET_VERIFY_ERR_VARS(IERROR_CODE, IERROR_REASON); + SET_VERIFY_ERR_VARS(IERROR_CODE, IERROR_REASON_VERIFY_SIGNATURE); rc = -1; goto error; } else { diff --git a/modules/stir_shaken/stir_shaken.h b/modules/stir_shaken/stir_shaken.h index d6552446bf8..40d5faf9e8e 100644 --- a/modules/stir_shaken/stir_shaken.h +++ b/modules/stir_shaken/stir_shaken.h @@ -88,6 +88,13 @@ #define INVALID_IDENTITY_REASON "Invalid Identity Header" #define IERROR_CODE 500 #define IERROR_REASON "Internal Server Error" +#define IERROR_REASON_PARSE_HEADERS "Failed to parse headers" +#define IERROR_REASON_PARSE_IDENTITY "Failed to parse identity header" +#define IERROR_REASON_GET_CURRENT_TIME "Failed to get current time" +#define IERROR_REASON_GET_TIME_FROM_DATE_HEADER "Failed to get UNIX time from Date header" +#define IERROR_REASON_LOAD_CERTIFICATE "Failed to load certificate" +#define IERROR_REASON_VALIDATE_CERTIFICATE "Error validating certificate" +#define IERROR_REASON_VERIFY_SIGNATURE "Error while verifying signature" #define TN_AUTH_LIST_OID "1.3.6.1.5.5.7.1.26" #define TN_AUTH_LIST_LN "TNAuthorizationList" diff --git a/modules/textops/Makefile b/modules/textops/Makefile index 3ede80c1a52..25cc1d5fe0e 100644 --- a/modules/textops/Makefile +++ b/modules/textops/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # print example module makefile # # diff --git a/modules/textops/README b/modules/textops/README index 3dce1eb4820..eb638b8e8b6 100644 --- a/modules/textops/README +++ b/modules/textops/README @@ -374,8 +374,8 @@ Chapter 2. Contributors 4. Andrei Dragus 32 15 1540 196 5. Andrei Pelinescu-Onciul 28 21 446 134 6. Jiri Kuthan (@jiriatipteldotorg) 18 14 293 45 - 7. Jan Janak (@janakj) 12 6 496 27 - 8. Liviu Chircu (@liviuchircu) 11 9 32 58 + 7. Liviu Chircu (@liviuchircu) 12 10 32 60 + 8. Jan Janak (@janakj) 12 6 496 27 9. Vlad Patrascu (@rvlad-patrascu) 10 5 129 147 10. Juha Heinanen (@juha-h) 8 5 210 8 @@ -407,9 +407,9 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Jul 2004 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 - 3. Liviu Chircu (@liviuchircu) Oct 2013 - Sep 2019 + 1. Liviu Chircu (@liviuchircu) Oct 2013 - May 2024 + 2. Maksym Sobolyev (@sobomax) Jul 2004 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Feb 2012 - Sep 2019 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2019 5. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2002 - Apr 2019 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 diff --git a/modules/textops/doc/contributors.xml b/modules/textops/doc/contributors.xml index 4b13b33deeb..66de081b8e8 100644 --- a/modules/textops/doc/contributors.xml +++ b/modules/textops/doc/contributors.xml @@ -68,20 +68,20 @@
7. + Liviu Chircu (@liviuchircu) + 12 + 10 + 32 + 60 + + + 8. Jan Janak (@janakj) 12 6 496 27 - - 8. - Liviu Chircu (@liviuchircu) - 11 - 9 - 32 - 58 - 9. Vlad Patrascu (@rvlad-patrascu) @@ -128,18 +128,18 @@ 1. - Maksym Sobolyev (@sobomax) - Jul 2004 - Feb 2023 + Liviu Chircu (@liviuchircu) + Oct 2013 - May 2024 2. - Razvan Crainea (@razvancrainea) - Feb 2012 - Sep 2019 + Maksym Sobolyev (@sobomax) + Jul 2004 - Feb 2023 3. - Liviu Chircu (@liviuchircu) - Oct 2013 - Sep 2019 + Razvan Crainea (@razvancrainea) + Feb 2012 - Sep 2019 4. diff --git a/modules/tls_openssl/README b/modules/tls_openssl/README index 6ab553d7455..67a2b745b30 100644 --- a/modules/tls_openssl/README +++ b/modules/tls_openssl/README @@ -61,8 +61,8 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Vlad Patrascu (@rvlad-patrascu) 24 5 2195 39 - 2. James Stanley 3 1 7 7 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) 3 1 3 3 + 2. Bogdan-Andrei Iancu (@bogdan-iancu) 4 2 9 4 + 3. James Stanley 3 1 7 7 4. Maksym Sobolyev (@sobomax) 3 1 1 1 (1) DevScore = author_commits + author_lines_added / @@ -85,7 +85,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Bogdan-Andrei Iancu (@bogdan-iancu) May 2023 - May 2023 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) May 2023 - Feb 2024 2. James Stanley Apr 2023 - Apr 2023 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 4. Vlad Patrascu (@rvlad-patrascu) May 2021 - Oct 2021 diff --git a/modules/tls_openssl/doc/contributors.xml b/modules/tls_openssl/doc/contributors.xml index 71e479fff03..5ae44a1b19f 100644 --- a/modules/tls_openssl/doc/contributors.xml +++ b/modules/tls_openssl/doc/contributors.xml @@ -28,19 +28,19 @@ 2. - James Stanley - 3 - 1 - 7 - 7 + Bogdan-Andrei Iancu (@bogdan-iancu) + 4 + 2 + 9 + 4 3. - Bogdan-Andrei Iancu (@bogdan-iancu) + James Stanley 3 1 - 3 - 3 + 7 + 7 4. @@ -81,7 +81,7 @@ 1. Bogdan-Andrei Iancu (@bogdan-iancu) - May 2023 - May 2023 + May 2023 - Feb 2024 2. diff --git a/modules/tls_openssl/openssl_conn_ops.c b/modules/tls_openssl/openssl_conn_ops.c index 7f30b01b46a..7d1efa8ddf4 100644 --- a/modules/tls_openssl/openssl_conn_ops.c +++ b/modules/tls_openssl/openssl_conn_ops.c @@ -756,7 +756,12 @@ int openssl_tls_async_connect(struct tcp_connection *con, int fd, #endif { err_len=sizeof(err); - getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &err_len); + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &err_len) != 0) { + LM_WARN("getsockopt error: fd=%d [server=%s:%d]: (%d) %s\n", fd, + ip_addr2a(&con->rcv.src_ip), con->rcv.src_port, + errno, strerror(errno)); + goto failure; + } if ((err==0) && (poll_err==0)) continue; /* retry ssl connect */ if (err!=EINPROGRESS && err!=EALREADY){ diff --git a/modules/tls_wolfssl/README b/modules/tls_wolfssl/README index 0d52728f556..3b80379b513 100644 --- a/modules/tls_wolfssl/README +++ b/modules/tls_wolfssl/README @@ -94,7 +94,7 @@ Chapter 3. Contributors Name DevScore Commits Lines ++ Lines -- 1. Vlad Patrascu (@rvlad-patrascu) 29 22 553 114 2. Razvan Crainea (@razvancrainea) 6 4 114 49 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) 4 2 4 4 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) 5 3 10 5 4. Maksym Sobolyev (@sobomax) 4 2 2 2 5. Liviu Chircu (@liviuchircu) 3 1 2 2 6. Alexey Vasilyev (@vasilevalex) 2 1 11 0 @@ -119,8 +119,8 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Oct 2023 - Oct 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) May 2023 - Oct 2023 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) May 2023 - Feb 2024 + 2. Liviu Chircu (@liviuchircu) Oct 2023 - Oct 2023 3. Razvan Crainea (@razvancrainea) Sep 2023 - Oct 2023 4. Vlad Patrascu (@rvlad-patrascu) May 2021 - Mar 2023 5. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 diff --git a/modules/tls_wolfssl/doc/contributors.xml b/modules/tls_wolfssl/doc/contributors.xml index a22706d72b1..fa6063d26c6 100644 --- a/modules/tls_wolfssl/doc/contributors.xml +++ b/modules/tls_wolfssl/doc/contributors.xml @@ -37,10 +37,10 @@ 3. Bogdan-Andrei Iancu (@bogdan-iancu) - 4 - 2 - 4 - 4 + 5 + 3 + 10 + 5 4. @@ -96,13 +96,13 @@ 1. - Liviu Chircu (@liviuchircu) - Oct 2023 - Oct 2023 + Bogdan-Andrei Iancu (@bogdan-iancu) + May 2023 - Feb 2024 2. - Bogdan-Andrei Iancu (@bogdan-iancu) - May 2023 - Oct 2023 + Liviu Chircu (@liviuchircu) + Oct 2023 - Oct 2023 3. diff --git a/modules/tls_wolfssl/wolfssl_conn_ops.c b/modules/tls_wolfssl/wolfssl_conn_ops.c index 81c41ab2bfc..e0bd2454087 100644 --- a/modules/tls_wolfssl/wolfssl_conn_ops.c +++ b/modules/tls_wolfssl/wolfssl_conn_ops.c @@ -438,7 +438,12 @@ int _wolfssl_tls_async_connect(struct tcp_connection *con, int fd, #endif { err_len=sizeof(err); - getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &err_len); + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &err_len) != 0) { + LM_WARN("getsockopt error: fd=%d [server=%s:%d]: (%d) %s\n", fd, + ip_addr2a(&con->rcv.src_ip), con->rcv.src_port, + errno, strerror(errno)); + goto failure; + } if ((err==0) && (poll_err==0)) continue; /* retry ssl connect */ if (err!=EINPROGRESS && err!=EALREADY){ diff --git a/modules/tm/Makefile b/modules/tm/Makefile index 64502fe848b..69044b49ded 100644 --- a/modules/tm/Makefile +++ b/modules/tm/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/tm/README b/modules/tm/README index 6c796794e22..0ddaa3e66e6 100644 --- a/modules/tm/README +++ b/modules/tm/README @@ -1471,7 +1471,9 @@ _in(ip):$socket_in(port)\r\n"); 1.5.4. $T_fr_inv_timeout $T_fr_inv_timeout (R/W) - the timeout for the final reply to an - INVITE request, after a 1XX reply was received + INVITE request, after a 1XX reply was received. This variable + may also be set in an onreply_route (e.g. on 180 Ringing, after + 100 Trying) and still take effect. With each different request received, $T_fr_inv_timeout will initially be equal to the fr_inv_timeout parameter. @@ -1688,16 +1690,16 @@ Chapter 4. Contributors Table 4.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Bogdan-Andrei Iancu (@bogdan-iancu) 1087 633 21995 16778 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) 1094 639 22075 16794 2. Jiri Kuthan (@jiriatipteldotorg) 534 198 18723 11167 3. Jan Janak (@janakj) 160 76 6462 1840 4. Andrei Pelinescu-Onciul 145 105 2447 1210 - 5. Razvan Crainea (@razvancrainea) 134 103 1980 851 - 6. Liviu Chircu (@liviuchircu) 110 84 1273 890 + 5. Razvan Crainea (@razvancrainea) 140 108 2000 865 + 6. Liviu Chircu (@liviuchircu) 114 88 1303 913 7. Daniel-Constantin Mierla (@miconda) 43 37 322 166 8. Vlad Patrascu (@rvlad-patrascu) 40 18 916 826 9. Anca Vamanu 37 19 778 651 - 10. Vlad Paiu (@vladpaiu) 27 24 172 57 + 10. Vlad Paiu (@vladpaiu) 28 25 173 58 All remaining contributors: Dan Pascu (@danpascu), Henning Westerholt (@henningw), Maksym Sobolyev (@sobomax), Ovidiu Sas @@ -1734,10 +1736,10 @@ Chapter 4. Contributors Table 4.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Jan 2013 - Dec 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Nov 2001 - Dec 2023 - 3. Razvan Crainea (@razvancrainea) Jul 2010 - Sep 2023 - 4. Vlad Paiu (@vladpaiu) Jun 2011 - Jul 2023 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Nov 2001 - Mar 2025 + 2. Razvan Crainea (@razvancrainea) Jul 2010 - Oct 2024 + 3. Vlad Paiu (@vladpaiu) Jun 2011 - Aug 2024 + 4. Liviu Chircu (@liviuchircu) Jan 2013 - Aug 2024 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Apr 2023 6. Maksym Sobolyev (@sobomax) Mar 2004 - Feb 2023 7. MayamaTakeshi Oct 2022 - Oct 2022 @@ -1767,16 +1769,16 @@ Chapter 5. Documentation 5.1. Contributors - Last edited by: Bogdan-Andrei Iancu (@bogdan-iancu), Vlad - Patrascu (@rvlad-patrascu), Razvan Crainea (@razvancrainea), - Liviu Chircu (@liviuchircu), Fabian Gast (@fgast), Alexey - Vasilyev (@vasilevalex), Peter Lemenkov (@lemenkov), Nick - Altmann (@nikbyte), Ovidiu Sas (@ovidiusas), Vlad Paiu - (@vladpaiu), Anca Vamanu, Henning Westerholt (@henningw), Klaus - Darilion, Daniel-Constantin Mierla (@miconda), Konstantin - Bokarius, Edson Gellert Schubert, Dan Pascu (@danpascu), Juha - Heinanen (@juha-h), Elena-Ramona Modroiu, Jan Janak (@janakj), - Jiri Kuthan (@jiriatipteldotorg). + Last edited by: Liviu Chircu (@liviuchircu), Bogdan-Andrei + Iancu (@bogdan-iancu), Vlad Patrascu (@rvlad-patrascu), Razvan + Crainea (@razvancrainea), Fabian Gast (@fgast), Alexey Vasilyev + (@vasilevalex), Peter Lemenkov (@lemenkov), Nick Altmann + (@nikbyte), Ovidiu Sas (@ovidiusas), Vlad Paiu (@vladpaiu), + Anca Vamanu, Henning Westerholt (@henningw), Klaus Darilion, + Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson + Gellert Schubert, Dan Pascu (@danpascu), Juha Heinanen + (@juha-h), Elena-Ramona Modroiu, Jan Janak (@janakj), Jiri + Kuthan (@jiriatipteldotorg). Documentation Copyrights: diff --git a/modules/tm/async.c b/modules/tm/async.c index 7a2931eb783..c67335bde3a 100644 --- a/modules/tm/async.c +++ b/modules/tm/async.c @@ -270,6 +270,7 @@ int t_handle_async(struct sip_msg *msg, struct action* a, } memset(ctx,0,sizeof(async_tm_ctx)); + ctx->async.timeout_s = timeout; async_status = ASYNC_NO_IO; /*assume default status "no IO done" */ return_code = ((const acmd_export_t*)(a->elem[0].u.data_const))->function(msg, diff --git a/modules/tm/doc/contributors.xml b/modules/tm/doc/contributors.xml index 39c5b1bf526..1fbf723a72b 100644 --- a/modules/tm/doc/contributors.xml +++ b/modules/tm/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Bogdan-Andrei Iancu (@bogdan-iancu) - 1087 - 633 - 21995 - 16778 + 1094 + 639 + 22075 + 16794 2. @@ -53,18 +53,18 @@ 5. Razvan Crainea (@razvancrainea) - 134 - 103 - 1980 - 851 + 140 + 108 + 2000 + 865 6. Liviu Chircu (@liviuchircu) - 110 - 84 - 1273 - 890 + 114 + 88 + 1303 + 913 7. @@ -93,10 +93,10 @@ 10. Vlad Paiu (@vladpaiu) - 27 - 24 - 172 - 57 + 28 + 25 + 173 + 58 @@ -128,23 +128,23 @@ 1. - Liviu Chircu (@liviuchircu) - Jan 2013 - Dec 2023 + Bogdan-Andrei Iancu (@bogdan-iancu) + Nov 2001 - Mar 2025 2. - Bogdan-Andrei Iancu (@bogdan-iancu) - Nov 2001 - Dec 2023 + Razvan Crainea (@razvancrainea) + Jul 2010 - Oct 2024 3. - Razvan Crainea (@razvancrainea) - Jul 2010 - Sep 2023 + Vlad Paiu (@vladpaiu) + Jun 2011 - Aug 2024 4. - Vlad Paiu (@vladpaiu) - Jun 2011 - Jul 2023 + Liviu Chircu (@liviuchircu) + Jan 2013 - Aug 2024 5. @@ -190,7 +190,7 @@ Documentation
Contributors - Last edited by: Bogdan-Andrei Iancu (@bogdan-iancu), Vlad Patrascu (@rvlad-patrascu), Razvan Crainea (@razvancrainea), Liviu Chircu (@liviuchircu), Fabian Gast (@fgast), Alexey Vasilyev (@vasilevalex), Peter Lemenkov (@lemenkov), Nick Altmann (@nikbyte), Ovidiu Sas (@ovidiusas), Vlad Paiu (@vladpaiu), Anca Vamanu, Henning Westerholt (@henningw), Klaus Darilion, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Dan Pascu (@danpascu), Juha Heinanen (@juha-h), Elena-Ramona Modroiu, Jan Janak (@janakj), Jiri Kuthan (@jiriatipteldotorg). + Last edited by: Liviu Chircu (@liviuchircu), Bogdan-Andrei Iancu (@bogdan-iancu), Vlad Patrascu (@rvlad-patrascu), Razvan Crainea (@razvancrainea), Fabian Gast (@fgast), Alexey Vasilyev (@vasilevalex), Peter Lemenkov (@lemenkov), Nick Altmann (@nikbyte), Ovidiu Sas (@ovidiusas), Vlad Paiu (@vladpaiu), Anca Vamanu, Henning Westerholt (@henningw), Klaus Darilion, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Dan Pascu (@danpascu), Juha Heinanen (@juha-h), Elena-Ramona Modroiu, Jan Janak (@janakj), Jiri Kuthan (@jiriatipteldotorg).
diff --git a/modules/tm/doc/tm_admin.xml b/modules/tm/doc/tm_admin.xml index 9f77e1697ef..d3216270db5 100644 --- a/modules/tm/doc/tm_admin.xml +++ b/modules/tm/doc/tm_admin.xml @@ -1991,7 +1991,8 @@ route{ $T_fr_inv_timeout (R/W) - the timeout for the final reply to an INVITE request, after a 1XX reply - was received + was received. This variable may also be set in an onreply_route + (e.g. on 180 Ringing, after 100 Trying) and still take effect. With each different request received, diff --git a/modules/tm/mi.c b/modules/tm/mi.c index 0e2a43bb3d5..5eb860552de 100644 --- a/modules/tm/mi.c +++ b/modules/tm/mi.c @@ -691,24 +691,37 @@ mi_response_t *mi_tm_reply(const mi_params_t *params, str *new_hdrs, str *body) tmp = trans_id; p = memchr( tmp.s, ':', tmp.len); - if ( p==NULL) - return init_mi_error(400, MI_SSTR("Invalid trans_id")); - - tmp.len = p-tmp.s; - if( str2int( &tmp, &hash_index)!=0 ) - return init_mi_error(400, MI_SSTR("Invalid index in trans_id")); + if ( p ) { + /* old fashion ID hash:label, decimal */ + tmp.len = p-tmp.s; + if( str2int( &tmp, &hash_index)!=0 ) + return init_mi_error(400,MI_SSTR("Invalid index in old trans_id")); + + tmp.s = p+1; + tmp.len = (trans_id.s+trans_id.len) - tmp.s; + if( str2int( &tmp, &hash_label)!=0 ) + return init_mi_error(400,MI_SSTR("Invalid label in old trans_id")); + } else { + p = memchr( tmp.s, '.', tmp.len); + if ( p==NULL) + return init_mi_error(400, MI_SSTR("Invalid trans_id")); + /* new format ID label.hash, reversed hexa */ + tmp.len = p-tmp.s; + if( reverse_hex2int( tmp.s, tmp.len, &hash_label)!=0 ) + return init_mi_error(400, MI_SSTR("Invalid label in trans_id")); + + tmp.s = p+1; + tmp.len = (trans_id.s+trans_id.len) - tmp.s; + if( reverse_hex2int( tmp.s, tmp.len, &hash_index)!=0 ) + return init_mi_error(400,MI_SSTR("Invalid label in old trans_id")); + } - tmp.s = p+1; - tmp.len = (trans_id.s+trans_id.len) - tmp.s; - if( str2int( &tmp, &hash_label)!=0 ) - return init_mi_error(400, MI_SSTR("Invalid label in trans_id")); + if (get_mi_string_param(params, "to_tag", &totag.s, &totag.len) < 0) + return init_mi_param_error(); if( t_lookup_ident( &trans, hash_index, hash_label)<0 ) return init_mi_error(404, MI_SSTR("Transaction not found")); - if (get_mi_string_param(params, "to_tag", &totag.s, &totag.len) < 0) - return init_mi_param_error(); - n = t_reply_with_body( trans, rpl_code, &reason, body, new_hdrs, &totag); UNREF(trans); diff --git a/modules/tm/sip_msg.c b/modules/tm/sip_msg.c index e1c27f9c570..56f32fe1c39 100644 --- a/modules/tm/sip_msg.c +++ b/modules/tm/sip_msg.c @@ -487,19 +487,44 @@ struct sip_msg* sip_msg_cloner( struct sip_msg *org_msg, int *sip_msg_len, case HDR_PPI_T: case HDR_PAI_T: case HDR_PRIVACY_T: - case HDR_RETRY_AFTER_T: case HDR_CALL_INFO_T: case HDR_WWW_AUTHENTICATE_T: case HDR_PROXY_AUTHENTICATE_T: + case HDR_MIN_EXPIRES_T: case HDR_FEATURE_CAPS_T: + case HDR_REPLACES_T: /* we ignore them for now even if they have something parsed*/ break; + /* not used in sip_msg, used in MSRP */ + case HDR_TO_PATH_T: + case HDR_FROM_PATH_T: + case HDR_MESSAGE_ID_T: + case HDR_BYTE_RANGE_T: + case HDR_FAILURE_REPORT_T: + case HDR_SUCCESS_REPORT_T: + case HDR_STATUS_T: + case HDR_USE_PATH_T: + + /* not having shortcut */ + case HDR_RETRY_AFTER_T: + case HDR_VIA2_T: + + /* not actual hdrs */ + case HDR_OTHER_T: + case HDR_ERROR_T: + case HDR_EOH_T: + break; + + /* we do not have a "default" on purpose, so we get + * a compile err/war where a new HDR is added and we do + * not handle it here. default: if (hdr->parsed) { LM_WARN("header body ignored: %d\n", hdr->type ); } break; + */ }/*switch*/ }/*for all headers*/ @@ -940,6 +965,21 @@ struct sip_msg* sip_msg_cloner( struct sip_msg *org_msg, int *sip_msg_len, new_msg->proxy_authenticate = new_hdr; } break; + case HDR_MIN_EXPIRES_T: + if (HOOK_NOT_SET(min_expires)) { + new_msg->min_expires = new_hdr; + } + break; + case HDR_FEATURE_CAPS_T: + if (HOOK_NOT_SET(feature_caps)) { + new_msg->feature_caps = new_hdr; + } + break; + case HDR_REPLACES_T: + if (HOOK_NOT_SET(replaces)) { + new_msg->replaces = new_hdr; + } + break; default: /* ignore the rest*/ ; diff --git a/modules/tm/t_cancel.c b/modules/tm/t_cancel.c index c95f275965f..61485a257d9 100644 --- a/modules/tm/t_cancel.c +++ b/modules/tm/t_cancel.c @@ -36,6 +36,7 @@ str _extra_cancel_hdrs = {NULL,0}; +extern int _tm_branch_index; /* determine which branches should be canceled; do it @@ -116,9 +117,11 @@ void cancel_branch( struct cell *t, int branch ) crb->activ_type=TYPE_LOCAL_CANCEL; if ( has_tran_tmcbs( t, TMCB_REQUEST_BUILT) ) { + _tm_branch_index = branch; set_extra_tmcb_params( &crb->buffer, &crb->dst); run_trans_callbacks( TMCB_REQUEST_BUILT, t, t->uas.request, 0, 0); + _tm_branch_index = 0; } LM_DBG("sending cancel...\n"); diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c index 132c1e5c272..6006b70f8c1 100644 --- a/modules/tm/t_fwd.c +++ b/modules/tm/t_fwd.c @@ -848,10 +848,12 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg , /* successfully sent out -> run callbacks */ if ( has_tran_tmcbs( t, TMCB_REQUEST_BUILT) ) { + _tm_branch_index = i; set_extra_tmcb_params( &t->uac[i].request.buffer, &t->uac[i].request.dst); run_trans_callbacks( TMCB_REQUEST_BUILT, t, p_msg, 0, 0); + _tm_branch_index = 0; } do { @@ -1074,6 +1076,7 @@ int t_inject_branch( struct cell *t, struct sip_msg *msg, int flags) static struct sip_msg faked_req; branch_bm_t cancel_bm = 0; str reason = str_init(CANCEL_REASON_200); + struct cell *bk_t = NULL; int rc; /* does the transaction state still accept new branches ? */ @@ -1117,6 +1120,11 @@ int t_inject_branch( struct cell *t, struct sip_msg *msg, int flags) } } + /* t_forward_nonack() relies on T for various internal stuff, so be + * we advertise the correct one */ + bk_t = get_t(); + set_t( t ); + /* do we have to cancel the existing branches before injecting new ones? */ if (flags&TM_INJECT_FLAG_CANCEL) { which_cancel( t, &cancel_bm ); @@ -1135,6 +1143,8 @@ int t_inject_branch( struct cell *t, struct sip_msg *msg, int flags) set_cancel_extra_hdrs( NULL, 0); } + set_t( bk_t ); + /* cleanup the faked request */ free_faked_req( &faked_req, t); diff --git a/modules/tm/t_lookup.c b/modules/tm/t_lookup.c index a38760712fa..1588e131b64 100644 --- a/modules/tm/t_lookup.c +++ b/modules/tm/t_lookup.c @@ -1190,7 +1190,11 @@ int t_get_trans_ident(struct sip_msg* p_msg, unsigned int* hash_index, } - +/* Looks for the transaction with the given coordinates (index/label). + * If found, the transaction is ref'ed and retuned via parameter; note that + * the global T holder is not set. + * Returns 1 if transaction found, -1 otherwise. + */ int t_lookup_ident(struct cell ** trans, unsigned int hash_index, unsigned int label) { @@ -1210,7 +1214,6 @@ int t_lookup_ident(struct cell ** trans, unsigned int hash_index, if(p_cell->label == label){ REF_UNSAFE(p_cell); UNLOCK_HASH(hash_index); - set_t(p_cell); *trans=p_cell; LM_DBG("transaction found\n"); return 1; @@ -1218,7 +1221,6 @@ int t_lookup_ident(struct cell ** trans, unsigned int hash_index, } UNLOCK_HASH(hash_index); - set_t(0); *trans=p_cell; LM_DBG("transaction not found\n"); diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c index db2775ae9f8..aa3dbd15cdd 100644 --- a/modules/tm/t_reply.c +++ b/modules/tm/t_reply.c @@ -294,13 +294,16 @@ inline static int update_totag_set(struct cell *t, struct sip_msg *ok) /* * Build and send an ACK to a negative reply + * On successful send: + * - return 0 + * - populate @ack_buf, for callback purposes, which *must* be SHM freed! */ -static int send_ack(struct sip_msg* rpl, struct cell *trans, int branch) +static int send_ack(struct sip_msg* rpl, struct cell *trans, int branch, str *ack_buf) { str method = str_init(ACK); str to; - str ack_buf; struct usr_avp **backup_list; + int rc; if(parse_headers(rpl,is_local(trans)?HDR_EOH_F:(HDR_TO_F|HDR_FROM_F),0)==-1 || !rpl->to || !rpl->from ) { @@ -310,10 +313,10 @@ static int send_ack(struct sip_msg* rpl, struct cell *trans, int branch) to.s=rpl->to->name.s; to.len=rpl->to->len; - ack_buf.s = is_local(trans)? - build_dlg_ack(rpl, trans, branch, &to, (unsigned int*)&ack_buf.len): - build_local( trans, branch, &method, NULL, rpl, (unsigned int*)&ack_buf.len ); - if (ack_buf.s==0) { + ack_buf->s = is_local(trans)? + build_dlg_ack(rpl, trans, branch, &to, (unsigned int*)&ack_buf->len): + build_local( trans, branch, &method, NULL, rpl, (unsigned int*)&ack_buf->len ); + if (ack_buf->s==0) { LM_ERR("failed to build ACK\n"); goto error; } @@ -323,23 +326,17 @@ static int send_ack(struct sip_msg* rpl, struct cell *trans, int branch) set_bavp_list(&trans->uac[branch].user_avps); backup_list = set_avp_list( &trans->user_avps ); - if(SEND_PR_BUFFER(&trans->uac[branch].request, ack_buf.s, ack_buf.len)==0){ - /* successfully sent out */ - if ( has_tran_tmcbs( trans, TMCB_MSG_SENT_OUT) ) { - set_extra_tmcb_params( &ack_buf, &trans->uac[branch].request.dst); - run_trans_callbacks( TMCB_MSG_SENT_OUT, - trans, trans->uas.request, 0, 0); - } - } + + rc = SEND_PR_BUFFER(&trans->uac[branch].request, ack_buf->s, ack_buf->len); + set_avp_list(backup_list); reset_bavp_list(); tcp_no_new_conn = 0; - shm_free(ack_buf.s); - - return 0; + return rc; error: + memset(ack_buf, 0, sizeof *ack_buf); return -1; } @@ -1532,7 +1529,8 @@ int reply_received( struct sip_msg *p_msg ) struct cell *t; struct usr_avp **backup_list; unsigned int has_reply_route; - int old_route_type; + int old_route_type, ack_sent = 0; + str ack_buf; set_t(T_UNDEFINED); @@ -1581,12 +1579,12 @@ int reply_received( struct sip_msg *p_msg ) reset_timer( &uac->request.fr_timer); } - /* acknowledge negative INVITE replies (do it before detailed + /* acknowledge negative INVITE replies ASAP! (do it before detailed * on_reply processing, which may take very long, like if it * is attempted to establish a TCP connection to a fail-over dst */ if (is_invite(t) && ((msg_status >= 300) || (is_local(t) && !no_autoack(t) && msg_status >= 200) )) { - if (send_ack(p_msg, t, branch)!=0) + if (!(ack_sent = (send_ack(p_msg, t, branch, &ack_buf)>=0))) LM_ERR("failed to send ACK (local=%s)\n", is_local(t)?"yes":"no"); } @@ -1600,6 +1598,15 @@ int reply_received( struct sip_msg *p_msg ) run_trans_callbacks( TMCB_RESPONSE_IN, t, t->uas.request, p_msg, p_msg->REPLY_STATUS); + if (ack_sent) { + if ( has_tran_tmcbs( t, TMCB_MSG_SENT_OUT) ) { + set_extra_tmcb_params( &ack_buf, &t->uac[branch].request.dst); + run_trans_callbacks( TMCB_MSG_SENT_OUT, + t, t->uas.request, 0, 0); + } + shm_free(ack_buf.s); + } + /* processing of on_reply block */ has_reply_route = (t->on_reply) || (t->uac[branch].on_reply); if (has_reply_route) { diff --git a/modules/tm/tm.c b/modules/tm/tm.c index a7455d542af..42639373168 100644 --- a/modules/tm/tm.c +++ b/modules/tm/tm.c @@ -1295,11 +1295,6 @@ static int w_t_relay( struct sip_msg *p_msg , void *flags, struct proxy_l *prox tm_has_request_disponsition_no_cancel(p_msg)==0 ) t->flags|=T_MULTI_200OK_FLAG; - /* update the transaction only if in REQUEST route; for other types - of routes we do not want to inherit the local changes */ - if (route_type==REQUEST_ROUTE) - update_cloned_msg_from_msg( t->uas.request, p_msg); - if (route_type==FAILURE_ROUTE) { /* If called from failure route we need reset the branch counter to * ignore the previous set of branches (already terminated) */ @@ -1309,6 +1304,12 @@ static int w_t_relay( struct sip_msg *p_msg , void *flags, struct proxy_l *prox * created, better lock here to avoid any overlapping with * branch injection from other processes */ LOCK_REPLIES(t); + + /* update the transaction only if in REQUEST route; for other types + of routes we do not want to inherit the local changes */ + if (route_type==REQUEST_ROUTE) + update_cloned_msg_from_msg( t->uas.request, p_msg); + ret = t_forward_nonack( t, p_msg, p, 1/*reset*/,1/*locked*/); UNLOCK_REPLIES(t); } diff --git a/modules/topology_hiding/Makefile b/modules/topology_hiding/Makefile index e54e105b545..1863e2f4d89 100644 --- a/modules/topology_hiding/Makefile +++ b/modules/topology_hiding/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # WARNING: do not run this directly, it should be run by the master Makefile include ../../Makefile.defs diff --git a/modules/topology_hiding/README b/modules/topology_hiding/README index 87113e40ddd..2d37f96412d 100644 --- a/modules/topology_hiding/README +++ b/modules/topology_hiding/README @@ -335,14 +335,15 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Vlad Paiu (@vladpaiu) 31 8 2700 25 - 2. Razvan Crainea (@razvancrainea) 27 21 264 154 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) 25 21 146 88 - 4. Liviu Chircu (@liviuchircu) 15 13 80 53 + 1. Razvan Crainea (@razvancrainea) 32 25 361 231 + 2. Vlad Paiu (@vladpaiu) 31 8 2700 25 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) 26 22 148 90 + 4. Liviu Chircu (@liviuchircu) 16 14 80 55 5. Vlad Patrascu (@rvlad-patrascu) 9 6 82 72 6. Maksym Sobolyev (@sobomax) 6 4 7 8 - 7. Alexey Vasilyev (@vasilevalex) 4 2 3 15 - 8. Peter Lemenkov (@lemenkov) 4 2 2 2 + 7. David Trihy 4 2 58 25 + 8. Alexey Vasilyev (@vasilevalex) 4 2 3 15 + 9. Peter Lemenkov (@lemenkov) 4 2 2 2 (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -364,14 +365,15 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2015 - Dec 2023 - 2. Razvan Crainea (@razvancrainea) Aug 2015 - Jun 2023 - 3. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 - 4. Liviu Chircu (@liviuchircu) Mar 2015 - May 2020 - 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Feb 2020 - 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jan 2020 - 7. Alexey Vasilyev (@vasilevalex) Sep 2019 - Sep 2019 - 8. Vlad Paiu (@vladpaiu) Feb 2015 - Mar 2016 + 1. David Trihy Mar 2025 - Mar 2025 + 2. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2024 + 3. Liviu Chircu (@liviuchircu) Mar 2015 - May 2024 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2015 - Feb 2024 + 5. Maksym Sobolyev (@sobomax) Jan 2021 - Feb 2023 + 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Feb 2020 + 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jan 2020 + 8. Alexey Vasilyev (@vasilevalex) Sep 2019 - Sep 2019 + 9. Vlad Paiu (@vladpaiu) Feb 2015 - Mar 2016 (1) including any documentation-related commits, excluding merge commits diff --git a/modules/topology_hiding/doc/contributors.xml b/modules/topology_hiding/doc/contributors.xml index b97e851b2d4..8e8988e35e5 100644 --- a/modules/topology_hiding/doc/contributors.xml +++ b/modules/topology_hiding/doc/contributors.xml @@ -20,35 +20,35 @@ 1. + Razvan Crainea (@razvancrainea) + 32 + 25 + 361 + 231 + + + 2. Vlad Paiu (@vladpaiu) 31 8 2700 25 - - 2. - Razvan Crainea (@razvancrainea) - 27 - 21 - 264 - 154 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) - 25 - 21 - 146 - 88 + 26 + 22 + 148 + 90 4. Liviu Chircu (@liviuchircu) - 15 - 13 + 16 + 14 80 - 53 + 55 5. @@ -68,6 +68,14 @@ 7. + David Trihy + 4 + 2 + 58 + 25 + + + 8. Alexey Vasilyev (@vasilevalex) 4 2 @@ -75,7 +83,7 @@ 15 - 8. + 9. Peter Lemenkov (@lemenkov) 4 2 @@ -112,41 +120,46 @@ 1. - Bogdan-Andrei Iancu (@bogdan-iancu) - Mar 2015 - Dec 2023 + David Trihy + Mar 2025 - Mar 2025 2. Razvan Crainea (@razvancrainea) - Aug 2015 - Jun 2023 + Aug 2015 - Sep 2024 3. - Maksym Sobolyev (@sobomax) - Jan 2021 - Feb 2023 + Liviu Chircu (@liviuchircu) + Mar 2015 - May 2024 4. - Liviu Chircu (@liviuchircu) - Mar 2015 - May 2020 + Bogdan-Andrei Iancu (@bogdan-iancu) + Mar 2015 - Feb 2024 5. + Maksym Sobolyev (@sobomax) + Jan 2021 - Feb 2023 + + + 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - Feb 2020 - 6. + 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jan 2020 - 7. + 8. Alexey Vasilyev (@vasilevalex) Sep 2019 - Sep 2019 - 8. + 9. Vlad Paiu (@vladpaiu) Feb 2015 - Mar 2016 diff --git a/modules/topology_hiding/topo_hiding_logic.c b/modules/topology_hiding/topo_hiding_logic.c index b6558439c7e..cf0cf5ce79a 100644 --- a/modules/topology_hiding/topo_hiding_logic.c +++ b/modules/topology_hiding/topo_hiding_logic.c @@ -1,29 +1,30 @@ /** - * Topology Hiding Module - * - * Copyright (C) 2015 OpenSIPS Foundation - * - * This file is part of opensips, a free SIP server. - * - * opensips is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version - * - * opensips is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * History - * ------- - * 2015-02-17 initial version (Vlad Paiu) +* Topology Hiding Module +* +* Copyright (C) 2015 OpenSIPS Foundation +* +* This file is part of opensips, a free SIP server. +* +* opensips is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version +* +* opensips is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* History +* ------- +* 2015-02-17 initial version (Vlad Paiu) */ +#include "../../ut.h" #include "topo_hiding_logic.h" #include "../../socket_info.h" #include "../../ut.h" @@ -40,8 +41,8 @@ extern str th_contact_encode_param; extern int th_ct_enc_scheme; struct th_ct_params { - str param_name; - struct th_ct_params *next; +str param_name; +struct th_ct_params *next; }; static struct th_ct_params *th_param_list=NULL; static struct th_ct_params *th_hdr_param_list=NULL; @@ -54,7 +55,7 @@ static int topo_delete_record_routes(struct sip_msg *req); static struct lump* delete_existing_contact(struct sip_msg *msg, int del_hdr); static int topo_parse_passed_params(str *params,struct th_ct_params **lst); static void topo_dlg_onroute (struct dlg_cell* dlg, int type, - struct dlg_cb_params * params); + struct dlg_cb_params * params); static void topo_dlg_initial_reply (struct dlg_cell* dlg, int type, struct dlg_cb_params * params); static void th_down_onreply(struct cell* t, int type,struct tmcb_params *param); @@ -64,7 +65,7 @@ static void th_no_dlg_user_onreply(struct cell* t, int type, struct tmcb_params static int topo_no_dlg_encode_contact(struct sip_msg *req,int flags,str *routes); static int topo_no_dlg_seq_handling(struct sip_msg *msg,str *info); static int dlg_th_onreply(struct dlg_cell *dlg, struct sip_msg *rpl, struct sip_msg *req, - int init_req, int dir); + int init_req, int dir, int dst_leg); /* exposed logic below */ @@ -1068,7 +1069,7 @@ static void topo_dlg_initial_reply (struct dlg_cell* dlg, int type, if (t == T_UNDEFINED || t == NULL) return; - if(dlg_th_onreply(dlg, params->msg, t->uas.request, 1, DLG_DIR_UPSTREAM) < 0) + if(dlg_th_onreply(dlg, params->msg, t->uas.request, 1, DLG_DIR_UPSTREAM, params->dst_leg) < 0) LM_ERR("Failed to transform the reply for topology hiding\n"); } @@ -1078,7 +1079,7 @@ static void topo_dlg_onroute (struct dlg_cell* dlg, int type, { int dir = params->direction; struct sip_msg *req = params->msg; - int adv_leg = -1; + int adv_leg = -1, leg; if (!req) { LM_ERR("Called with NULL SIP message \n"); @@ -1117,12 +1118,17 @@ static void topo_dlg_onroute (struct dlg_cell* dlg, int type, return; } - if (dir == DLG_DIR_UPSTREAM) { + leg = (params->dst_leg < 0?DLG_CALLER_LEG:params->dst_leg); + req->force_send_socket = dlg->legs[leg].bind_addr; + switch (dir) { + case DLG_DIR_UPSTREAM: if (dlg_api.is_mod_flag_set(dlg, TOPOH_KEEP_ADV_A)) - adv_leg = DLG_CALLER_LEG; - } else { + adv_leg = leg; + break; + case DLG_DIR_DOWNSTREAM: if (dlg_api.is_mod_flag_set(dlg, TOPOH_KEEP_ADV_B)) - adv_leg = callee_idx(dlg); + adv_leg = leg; + break; } /* replace contact*/ @@ -1140,24 +1146,11 @@ static void topo_dlg_onroute (struct dlg_cell* dlg, int type, dlg_api.dlg_unref(dlg,1); return; } - - if (dir == DLG_DIR_UPSTREAM) { - /* destination leg is the caller - force the send socket - * as the one the caller was inited from */ - req->force_send_socket = dlg->legs[DLG_CALLER_LEG].bind_addr; - LM_DBG("forcing send socket for req going to caller\n"); - } else { - /* destination leg is the callee - force the send socket - * as the one the callee was inited from */ - req->force_send_socket = dlg->legs[callee_idx(dlg)].bind_addr; - LM_DBG("forcing send socket for req going to callee\n"); - } } static int dlg_th_onreply(struct dlg_cell *dlg, struct sip_msg *rpl, - struct sip_msg *req, int init_req, int dir) + struct sip_msg *req, int init_req, int dir, int dst_leg) { - int peer_leg; struct lump* lmp; int size; char* route; @@ -1169,14 +1162,20 @@ static int dlg_th_onreply(struct dlg_cell *dlg, struct sip_msg *rpl, LM_ERR("Failed to parse reply\n"); return -1; } + if (dst_leg < 0) { + if (dir == DLG_DIR_DOWNSTREAM) + dst_leg = callee_idx(dlg); + else + dst_leg = DLG_CALLER_LEG; + } if (!init_req) { if (dir == DLG_DIR_UPSTREAM) { if (dlg_api.is_mod_flag_set(dlg, TOPOH_KEEP_ADV_A)) - adv_leg = DLG_CALLER_LEG; + adv_leg = dst_leg; } else { if (dlg_api.is_mod_flag_set(dlg, TOPOH_KEEP_ADV_B)) - adv_leg = callee_idx(dlg); + adv_leg = dst_leg; } } @@ -1189,11 +1188,7 @@ static int dlg_th_onreply(struct dlg_cell *dlg, struct sip_msg *rpl, } } - if(dir == DLG_DIR_UPSTREAM) - peer_leg = DLG_CALLER_LEG; - else - peer_leg = callee_idx(dlg); - leg = &dlg->legs[peer_leg]; + leg = &dlg->legs[dst_leg]; if (topo_delete_record_routes(rpl) < 0) { LM_ERR("Failed to remove Record Route header \n"); @@ -1245,7 +1240,7 @@ static void th_down_onreply(struct cell* t, int type,struct tmcb_params *param) if (dlg==0) return; - if(dlg_th_onreply(dlg, param->rpl, param->req,0, DLG_DIR_DOWNSTREAM) < 0) + if(dlg_th_onreply(dlg, param->rpl, param->req,0, DLG_DIR_DOWNSTREAM, -1) < 0) LM_ERR("Failed to transform the reply for topology hiding\n"); } @@ -1257,7 +1252,7 @@ static void th_up_onreply(struct cell* t, int type, struct tmcb_params *param) if (dlg==0) return; - if(dlg_th_onreply(dlg, param->rpl, param->req, 0, DLG_DIR_UPSTREAM) < 0) + if(dlg_th_onreply(dlg, param->rpl, param->req, 0, DLG_DIR_UPSTREAM, -1) < 0) LM_ERR("Failed to transform the reply for topology hiding\n"); } @@ -1581,7 +1576,7 @@ static char* build_encoded_contact_suffix(struct sip_msg* msg, str *routes, int int is_req = (msg->first_line.type==SIP_REQUEST)?1:0; int local_len = sizeof(short) /* RR length */ + sizeof(short) /* Contact length */ + - sizeof(short) /* RR length */ + + sizeof(short) /* Flags length */ + sizeof(short) /* bind addr */; /* parse all headers as we can have multiple @@ -1594,7 +1589,6 @@ static char* build_encoded_contact_suffix(struct sip_msg* msg, str *routes, int if (routes) { rr_set = *routes; rr_len = (short)routes->len; - LM_INFO("XXX: adding [%.*s]\n", routes->len, routes->s); } else if(msg->record_route){ if(print_rr_body(msg->record_route, &rr_set, !is_req, 0, NULL) != 0){ LM_ERR("failed to print route records \n"); @@ -1642,7 +1636,7 @@ static char* build_encoded_contact_suffix(struct sip_msg* msg, str *routes, int /* we just iterate over the unknown params */ for (i=0;iparam_name, &ctu.u_name[i])) - suffix_len += topo_ct_param_len(&ctu.u_name[i], &ctu.u_val[i], 0); + total_len += topo_ct_param_len(&ctu.u_name[i], &ctu.u_val[i], 0); } } } @@ -1658,7 +1652,7 @@ static char* build_encoded_contact_suffix(struct sip_msg* msg, str *routes, int for (el=th_hdr_param_list;el;el=el->next) { for (it=((contact_body_t *)msg->contact->parsed)->contacts->params;it;it=it->next) { if (str_match(&el->param_name, &it->name)) - suffix_len += topo_ct_param_len(&it->name, &it->body, 1); + total_len += topo_ct_param_len(&it->name, &it->body, 1); } } } diff --git a/modules/tracer/Makefile b/modules/tracer/Makefile index d03ac39cf4a..3e1f6d3b353 100644 --- a/modules/tracer/Makefile +++ b/modules/tracer/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/tracer/README b/modules/tracer/README index 1bd51523428..b4967295634 100644 --- a/modules/tracer/README +++ b/modules/tracer/README @@ -496,11 +496,11 @@ Chapter 2. Contributors Table 2.1. Top contributors by DevScore^(1), authored commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- - 1. Bogdan-Andrei Iancu (@bogdan-iancu) 113 87 1319 873 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) 116 90 1325 890 2. Ionut Ionita (@ionutrazvanionita) 105 52 2676 1887 - 3. Razvan Crainea (@razvancrainea) 70 49 1642 421 + 3. Razvan Crainea (@razvancrainea) 75 53 1663 430 4. Daniel-Constantin Mierla (@miconda) 49 26 2215 191 - 5. Liviu Chircu (@liviuchircu) 25 22 87 78 + 5. Liviu Chircu (@liviuchircu) 26 23 87 80 6. Vlad Paiu (@vladpaiu) 24 10 402 568 7. Vlad Patrascu (@rvlad-patrascu) 17 8 286 335 8. Henning Westerholt (@henningw) 11 6 146 155 @@ -535,10 +535,10 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Jan 2013 - Jan 2024 - 2. Vlad Paiu (@vladpaiu) Jun 2011 - Dec 2023 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2006 - Jul 2023 - 4. Razvan Crainea (@razvancrainea) Jun 2011 - Jun 2023 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Jul 2006 - Jul 2024 + 2. Razvan Crainea (@razvancrainea) Jun 2011 - Jun 2024 + 3. Liviu Chircu (@liviuchircu) Jan 2013 - May 2024 + 4. Vlad Paiu (@vladpaiu) Jun 2011 - Dec 2023 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2023 6. okhowang Mar 2023 - Mar 2023 7. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 diff --git a/modules/tracer/doc/contributors.xml b/modules/tracer/doc/contributors.xml index 10923228a0e..1f55c2a59dd 100644 --- a/modules/tracer/doc/contributors.xml +++ b/modules/tracer/doc/contributors.xml @@ -21,10 +21,10 @@ 1. Bogdan-Andrei Iancu (@bogdan-iancu) - 113 - 87 - 1319 - 873 + 116 + 90 + 1325 + 890 2. @@ -37,10 +37,10 @@ 3. Razvan Crainea (@razvancrainea) - 70 - 49 - 1642 - 421 + 75 + 53 + 1663 + 430 4. @@ -53,10 +53,10 @@ 5. Liviu Chircu (@liviuchircu) - 25 - 22 + 26 + 23 87 - 78 + 80 6. @@ -128,23 +128,23 @@ 1. - Liviu Chircu (@liviuchircu) - Jan 2013 - Jan 2024 + Bogdan-Andrei Iancu (@bogdan-iancu) + Jul 2006 - Jul 2024 2. - Vlad Paiu (@vladpaiu) - Jun 2011 - Dec 2023 + Razvan Crainea (@razvancrainea) + Jun 2011 - Jun 2024 3. - Bogdan-Andrei Iancu (@bogdan-iancu) - Jul 2006 - Jul 2023 + Liviu Chircu (@liviuchircu) + Jan 2013 - May 2024 4. - Razvan Crainea (@razvancrainea) - Jun 2011 - Jun 2023 + Vlad Paiu (@vladpaiu) + Jun 2011 - Dec 2023 5. diff --git a/modules/tracer/tracer.c b/modules/tracer/tracer.c index 70f5269d8f0..c43409045af 100644 --- a/modules/tracer/tracer.c +++ b/modules/tracer/tracer.c @@ -1037,7 +1037,7 @@ static int mod_init(void) if(load_b2b_logic_api(&b2bl)< 0) { LM_DBG("Failed to load b2b_logic API (module not loaded)\n"); } else { - b2bl.register_set_tracer_cb( b2b_set_tracer_cb, FL_USE_SIPTRACE); + b2bl.register_set_tracer_cb( b2b_set_tracer_cb, FL_USE_SIPTRACE_B2B); } if (load_dlg_api(&dlgb) != 0) @@ -1344,6 +1344,10 @@ static void trace_transaction_dlgcb(struct dlg_cell* dlg, int type, trace_info_p info = (trace_info_p)*params->param; int reverte_dir = 0; + /* should not trace dummy messages */ + if (is_dummy_sip_msg(params->msg) == 0) + return; + if (dlgb.get_direction()==DLG_DIR_UPSTREAM) reverte_dir = 1; @@ -1423,9 +1427,6 @@ static int trace_b2b_transaction(struct sip_msg* msg, void *trans, void* param) trace_info_p info = (trace_info_p)param; struct cell *t = (struct cell*)trans; - /* context for the request message */ - SET_TRACER_CONTEXT( info ); - if (t==T_UNDEFINED) { /* Negative hop-by-hop ACK shouldn't be here */ LM_BUG("undefined transaction received here\n"); @@ -1490,7 +1491,7 @@ static int trace_b2b(struct sip_msg *msg, trace_info_p info) * B2B logic, via the "creating new session" callback, will * install the tracing callback into the B2B logic */ - msg->msg_flags |= FL_USE_SIPTRACE; + msg->msg_flags |= FL_USE_SIPTRACE_B2B; return 0; } @@ -2524,12 +2525,8 @@ static void trace_msg_out(struct sip_msg* msg, str *sbuf, set_sock_columns( db_vals[4], db_vals[5], db_vals[6], fromip_buff, TRACE_GET_DST_IP(msg), TRACE_GET_DST_PORT(msg), msg->rcv.proto); } else { - char *nbuff = proto2str(send_sock->proto,fromip_buff); - db_vals[4].val.str_val.s = fromip_buff; - db_vals[4].val.str_val.len = nbuff - fromip_buff; - db_vals[5].val.str_val = send_sock->adv_sock_str.len?send_sock->adv_name_str:send_sock->address_str; - db_vals[6].val.int_val = send_sock->last_local_real_port? - send_sock->last_local_real_port:send_sock->port_no; + set_sock_columns( db_vals[4], db_vals[5], db_vals[6], fromip_buff, + send_sock->adv_sock_str.len?(struct ip_addr *)&send_sock->adv_address:(struct ip_addr *)&send_sock->address, send_sock->last_local_real_port?send_sock->last_local_real_port:send_sock->port_no, send_sock->proto); } } @@ -2812,12 +2809,8 @@ static void trace_onreply_out(struct cell* t, int type, struct tmcb_params *ps, set_sock_columns( db_vals[4], db_vals[5], db_vals[6], fromip_buff, TRACE_GET_DST_IP(msg), TRACE_GET_DST_PORT(msg), msg->rcv.proto); } else { - char *nbuff = proto2str(dst->send_sock->proto,fromip_buff); - db_vals[4].val.str_val.s = fromip_buff; - db_vals[4].val.str_val.len = nbuff - fromip_buff; - db_vals[5].val.str_val = dst->send_sock->adv_sock_str.len?dst->send_sock->adv_name_str:dst->send_sock->address_str; - db_vals[6].val.int_val = dst->send_sock->last_local_real_port? - dst->send_sock->last_local_real_port:dst->send_sock->port_no; + set_sock_columns( db_vals[4], db_vals[5], db_vals[6], fromip_buff, + dst->send_sock->adv_sock_str.len?(struct ip_addr *)&dst->send_sock->adv_address:(struct ip_addr *)&dst->send_sock->address, dst->send_sock->last_local_real_port?dst->send_sock->last_local_real_port:dst->send_sock->port_no, dst->send_sock->proto); } } diff --git a/modules/uac/Makefile b/modules/uac/Makefile index 5ab53a50d4f..614b856730a 100644 --- a/modules/uac/Makefile +++ b/modules/uac/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # example module makefile # # diff --git a/modules/uac/README b/modules/uac/README index d261c31c31d..33b9fb063ba 100644 --- a/modules/uac/README +++ b/modules/uac/README @@ -309,7 +309,7 @@ Chapter 3. Contributors 1. Bogdan-Andrei Iancu (@bogdan-iancu) 128 75 4208 1076 2. Ovidiu Sas (@ovidiusas) 35 8 403 1351 3. Razvan Crainea (@razvancrainea) 31 23 494 148 - 4. Liviu Chircu (@liviuchircu) 24 16 299 290 + 4. Liviu Chircu (@liviuchircu) 26 18 302 295 5. Daniel-Constantin Mierla (@miconda) 15 11 138 88 6. Vlad Patrascu (@rvlad-patrascu) 10 5 150 175 7. Maksym Sobolyev (@sobomax) 10 3 168 294 @@ -342,12 +342,12 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Ovidiu Sas (@ovidiusas) Mar 2011 - Jun 2023 - 2. Razvan Crainea (@razvancrainea) Aug 2010 - Apr 2023 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2005 - Apr 2023 - 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 - 5. Maksym Sobolyev (@sobomax) Mar 2021 - Feb 2023 - 6. Liviu Chircu (@liviuchircu) Mar 2014 - Feb 2023 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - Oct 2024 + 2. Ovidiu Sas (@ovidiusas) Mar 2011 - Jun 2023 + 3. Razvan Crainea (@razvancrainea) Aug 2010 - Apr 2023 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2005 - Apr 2023 + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 + 6. Maksym Sobolyev (@sobomax) Mar 2021 - Feb 2023 7. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 8. Dusan Klinec (@ph4r05) Dec 2015 - Dec 2015 9. Vlad Paiu (@vladpaiu) Aug 2011 - Sep 2015 diff --git a/modules/uac/auth.c b/modules/uac/auth.c index 8b519353284..bf5250eeda0 100644 --- a/modules/uac/auth.c +++ b/modules/uac/auth.c @@ -252,7 +252,7 @@ static int uac_auth_dlg_leg(struct dlg_cell *dlg, str *tag) return callee_idx(dlg); } -int uac_auth( struct sip_msg *msg, int algmask) +int uac_auth( struct sip_msg *msg, unsigned algmask) { struct authenticate_body *auth = NULL; str msg_body; @@ -307,7 +307,7 @@ int uac_auth( struct sip_msg *msg, int algmask) } if (auth == NULL) { - LM_ERR("Unable to extract authentication info\n"); + LM_ERR("Unable to extract a compatible authentication challenge\n"); goto error; } diff --git a/modules/uac/doc/contributors.xml b/modules/uac/doc/contributors.xml index bef316cb607..dd8c90f0d5f 100644 --- a/modules/uac/doc/contributors.xml +++ b/modules/uac/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 24 - 16 - 299 - 290 + 26 + 18 + 302 + 295 5. @@ -128,34 +128,34 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - Oct 2024 + + + 2. Ovidiu Sas (@ovidiusas) Mar 2011 - Jun 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Aug 2010 - Apr 2023 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Jun 2005 - Apr 2023 - 4. + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Mar 2023 - 5. + 6. Maksym Sobolyev (@sobomax) Mar 2021 - Feb 2023 - - 6. - Liviu Chircu (@liviuchircu) - Mar 2014 - Feb 2023 - 7. Peter Lemenkov (@lemenkov) diff --git a/modules/uac_auth/README b/modules/uac_auth/README index bce53dff5ca..7a67b790337 100644 --- a/modules/uac_auth/README +++ b/modules/uac_auth/README @@ -150,9 +150,9 @@ Chapter 2. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Ovidiu Sas (@ovidiusas) 16 7 869 15 - 2. Maksym Sobolyev (@sobomax) 11 4 123 260 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) 10 7 229 9 - 4. Liviu Chircu (@liviuchircu) 9 7 40 61 + 2. Liviu Chircu (@liviuchircu) 11 8 41 62 + 3. Maksym Sobolyev (@sobomax) 11 4 123 260 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) 10 7 229 9 5. Razvan Crainea (@razvancrainea) 8 6 8 11 6. Vlad Patrascu (@rvlad-patrascu) 6 4 44 30 7. Bence Szigeti 3 1 7 1 @@ -178,9 +178,9 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Bence Szigeti Apr 2023 - Apr 2023 - 2. Maksym Sobolyev (@sobomax) Sep 2020 - Feb 2023 - 3. Liviu Chircu (@liviuchircu) Mar 2014 - Aug 2021 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - Oct 2024 + 2. Bence Szigeti Apr 2023 - Apr 2023 + 3. Maksym Sobolyev (@sobomax) Sep 2020 - Feb 2023 4. Razvan Crainea (@razvancrainea) Sep 2011 - Jan 2021 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jul 2019 6. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2012 - Apr 2019 diff --git a/modules/uac_auth/doc/contributors.xml b/modules/uac_auth/doc/contributors.xml index 3c820843bdf..de30d9c7499 100644 --- a/modules/uac_auth/doc/contributors.xml +++ b/modules/uac_auth/doc/contributors.xml @@ -28,6 +28,14 @@ 2. + Liviu Chircu (@liviuchircu) + 11 + 8 + 41 + 62 + + + 3. Maksym Sobolyev (@sobomax) 11 4 @@ -35,21 +43,13 @@ 260 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) 10 7 229 9 - - 4. - Liviu Chircu (@liviuchircu) - 9 - 7 - 40 - 61 - 5. Razvan Crainea (@razvancrainea) @@ -112,18 +112,18 @@ 1. - Bence Szigeti - Apr 2023 - Apr 2023 + Liviu Chircu (@liviuchircu) + Mar 2014 - Oct 2024 2. - Maksym Sobolyev (@sobomax) - Sep 2020 - Feb 2023 + Bence Szigeti + Apr 2023 - Apr 2023 3. - Liviu Chircu (@liviuchircu) - Mar 2014 - Aug 2021 + Maksym Sobolyev (@sobomax) + Sep 2020 - Feb 2023 4. diff --git a/modules/uac_auth/uac_auth.h b/modules/uac_auth/uac_auth.h index be3afa18297..9cc914b0565 100644 --- a/modules/uac_auth/uac_auth.h +++ b/modules/uac_auth/uac_auth.h @@ -44,7 +44,7 @@ struct authenticate_nc_cnonce { }; -int uac_auth( struct sip_msg *msg, int algmask); +int uac_auth( struct sip_msg *msg, unsigned algmask); int do_uac_auth(str *msg_body, str *method, str *uri, struct uac_credential *crd, struct authenticate_body *auth, struct authenticate_nc_cnonce *auth_nc_cnonce, struct digest_auth_response *response) __attribute__ ((warn_unused_result));; diff --git a/modules/uac_registrant/README b/modules/uac_registrant/README index 72358778241..b518052849b 100644 --- a/modules/uac_registrant/README +++ b/modules/uac_registrant/README @@ -481,8 +481,8 @@ Chapter 2. Contributors Name DevScore Commits Lines ++ Lines -- 1. Ovidiu Sas (@ovidiusas) 141 40 5687 3266 2. Liviu Chircu (@liviuchircu) 17 14 57 68 - 3. Vlad Patrascu (@rvlad-patrascu) 15 7 732 118 - 4. Bogdan-Andrei Iancu (@bogdan-iancu) 14 10 309 20 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) 15 11 320 20 + 4. Vlad Patrascu (@rvlad-patrascu) 15 7 732 118 5. Razvan Crainea (@razvancrainea) 11 9 26 36 6. Nick Altmann (@nikbyte) 4 2 35 4 7. Maksym Sobolyev (@sobomax) 4 2 19 15 @@ -513,7 +513,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2012 - Jun 2023 + 1. Bogdan-Andrei Iancu (@bogdan-iancu) Dec 2012 - Jul 2024 2. James Stanley Mar 2023 - Mar 2023 3. Maksym Sobolyev (@sobomax) Mar 2021 - Feb 2023 4. Razvan Crainea (@razvancrainea) Sep 2011 - Nov 2021 diff --git a/modules/uac_registrant/doc/contributors.xml b/modules/uac_registrant/doc/contributors.xml index 41ead038093..9852828771b 100644 --- a/modules/uac_registrant/doc/contributors.xml +++ b/modules/uac_registrant/doc/contributors.xml @@ -36,20 +36,20 @@ 3. + Bogdan-Andrei Iancu (@bogdan-iancu) + 15 + 11 + 320 + 20 + + + 4. Vlad Patrascu (@rvlad-patrascu) 15 7 732 118 - - 4. - Bogdan-Andrei Iancu (@bogdan-iancu) - 14 - 10 - 309 - 20 - 5. Razvan Crainea (@razvancrainea) @@ -129,7 +129,7 @@ 1. Bogdan-Andrei Iancu (@bogdan-iancu) - Dec 2012 - Jun 2023 + Dec 2012 - Jul 2024 2. diff --git a/modules/uac_registrant/registrant.c b/modules/uac_registrant/registrant.c index b12339c9d94..3da83238de2 100644 --- a/modules/uac_registrant/registrant.c +++ b/modules/uac_registrant/registrant.c @@ -35,6 +35,7 @@ #include "../../parser/parse_authenticate.h" #include "../../parser/contact/parse_contact.h" #include "../../parser/parse_min_expires.h" +#include "../../parser/parse_expires.h" #include "../uac_auth/uac_auth.h" #include "../../lib/digest_auth/digest_auth.h" #include "reg_records.h" @@ -354,6 +355,7 @@ int run_reg_tm_cback(void *e_data, void *data, void *r_data) str msg_body; int statuscode = 0; unsigned int exp = 0; + exp_body_t *header_exp = NULL; unsigned int bindings_counter = 0; reg_record_t *rec = (reg_record_t*)e_data; struct hdr_field *c_ptr, *head_contact; @@ -511,6 +513,15 @@ int run_reg_tm_cback(void *e_data, void *data, void *r_data) contact = contact->next; } } + // if there is no expires in contact, try parse expires from header + if (exp == 0 && msg->expires) { + if (parse_expires(msg->expires) < 0) { + LM_ERR("failed to parse Expires header\n"); + } else { + header_exp = (exp_body_t*)msg->expires->parsed; + exp = header_exp->val; + } + } if (!(rec->flags®_ENABLED)) { if (rec->state==REGISTERING_STATE || diff --git a/modules/usrloc/Makefile b/modules/usrloc/Makefile index 52a5cb15f81..6931a43009a 100644 --- a/modules/usrloc/Makefile +++ b/modules/usrloc/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # Usrloc module Makefile # # diff --git a/modules/usrloc/README b/modules/usrloc/README index e5d91f088e6..e819b60fd02 100644 --- a/modules/usrloc/README +++ b/modules/usrloc/README @@ -893,6 +893,14 @@ modparam("usrloc", "cseq_delay", 5) (addresses-of-record, contacts), organized into specific events (inserts, deletes or updates). + This OpenSIPS cluster exposes the "usrloc-contact-repl" + capability in order to mark nodes as eligible for becoming data + donors during an arbitrary sync request. Consequently, the + cluster must have at least one node marked with the "seed" + value as the clusterer.flags column/property in order to be + fully functional. Consult the clusterer - Capabilities chapter + for more details. + Default value is 0 (replication disabled). More details on the user location distribution mechanisms are @@ -1580,7 +1588,7 @@ Chapter 3. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Jan Janak (@janakj) 410 117 15689 10095 - 2. Liviu Chircu (@liviuchircu) 337 201 9165 3705 + 2. Liviu Chircu (@liviuchircu) 348 210 9259 3783 3. Bogdan-Andrei Iancu (@bogdan-iancu) 245 150 4232 3624 4. Vlad Patrascu (@rvlad-patrascu) 43 25 794 661 5. Daniel-Constantin Mierla (@miconda) 40 29 544 308 @@ -1588,21 +1596,21 @@ Chapter 3. Contributors 7. Jiri Kuthan (@jiriatipteldotorg) 35 25 975 120 8. Razvan Crainea (@razvancrainea) 31 24 427 159 9. Henning Westerholt (@henningw) 21 11 462 356 - 10. Andrei Pelinescu-Onciul 17 13 151 91 - - All remaining contributors: Maksym Sobolyev (@sobomax), Vlad - Paiu (@vladpaiu), Walter Doekes (@wdoekes), Nils Ohlmeier, - Eseanu Marius Cristian (@eseanucristian), Ovidiu Sas - (@ovidiusas), Ionel Cerghit (@ionel-cerghit), Andrei Dragus, - Anca Vamanu, Alessio Garzi (@Ozzyboshi), Zero King (@l2dy), - Dusan Klinec (@ph4r05), Andrei Datcu (@andrei-datcu), Juha - Heinanen (@juha-h), Marcus Hunger, Jamey Hicks, Peter Lemenkov + 10. Maksym Sobolyev (@sobomax) 18 12 339 154 + + All remaining contributors: Andrei Pelinescu-Onciul, Vlad Paiu + (@vladpaiu), Walter Doekes (@wdoekes), Nils Ohlmeier, Eseanu + Marius Cristian (@eseanucristian), Ovidiu Sas (@ovidiusas), + Ionel Cerghit (@ionel-cerghit), Andrei Dragus, Anca Vamanu, + Alessio Garzi (@Ozzyboshi), Zero King (@l2dy), Dusan Klinec + (@ph4r05), Andrei Datcu (@andrei-datcu), Juha Heinanen + (@juha-h), Marcus Hunger, Jamey Hicks, Peter Lemenkov (@lemenkov), Andreas Granig, Shlomi Gutman, @jalung, Jeffrey Magder, Phil D'Amore, Norman Brandinger (@NormB), David Sanders, Konstantin Bokarius, Klaus Darilion, Iouri Kharon, - Aron Podrigal (@ar45), Dan Pascu (@danpascu), Matthew M. - Boedicker, UnixDev, Edson Gellert Schubert, Alexey Vasilyev - (@vasilevalex), Elena-Ramona Modroiu, Stephane Alnet. + Aron Podrigal (@ar45), Dan Pascu (@danpascu), Gang Zhuo, + Matthew M. Boedicker, UnixDev, Edson Gellert Schubert, Alexey + Vasilyev (@vasilevalex), Elena-Ramona Modroiu, Stephane Alnet. (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted @@ -1624,31 +1632,31 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Jan 2013 - Nov 2023 - 2. Vlad Paiu (@vladpaiu) Jun 2011 - Jul 2023 - 3. Vlad Patrascu (@rvlad-patrascu) Jul 2016 - Mar 2023 - 4. Maksym Sobolyev (@sobomax) Apr 2003 - Feb 2023 - 5. Razvan Crainea (@razvancrainea) Jul 2011 - Jan 2023 - 6. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2002 - Feb 2022 - 7. Walter Doekes (@wdoekes) Apr 2019 - May 2021 - 8. Zero King (@l2dy) Mar 2020 - Mar 2020 - 9. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 - 10. Alexey Vasilyev (@vasilevalex) Dec 2019 - Dec 2019 - - All remaining contributors: Aron Podrigal (@ar45), Alessio - Garzi (@Ozzyboshi), Dan Pascu (@danpascu), Shlomi Gutman, - @jalung, Ionut Ionita (@ionutrazvanionita), Ionel Cerghit - (@ionel-cerghit), Ovidiu Sas (@ovidiusas), Dusan Klinec - (@ph4r05), Eseanu Marius Cristian (@eseanucristian), David - Sanders, Andrei Datcu (@andrei-datcu), Stephane Alnet, Andrei - Dragus, Phil D'Amore, UnixDev, Daniel-Constantin Mierla - (@miconda), Henning Westerholt (@henningw), Iouri Kharon, - Konstantin Bokarius, Edson Gellert Schubert, Anca Vamanu, - Matthew M. Boedicker, Marcus Hunger, Elena-Ramona Modroiu, - Jeffrey Magder, Norman Brandinger (@NormB), Andreas Granig, - Juha Heinanen (@juha-h), Klaus Darilion, Jan Janak (@janakj), - Andrei Pelinescu-Onciul, Jiri Kuthan (@jiriatipteldotorg), - Jamey Hicks, Nils Ohlmeier. + 1. Liviu Chircu (@liviuchircu) Jan 2013 - Feb 2025 + 2. Gang Zhuo Nov 2024 - Nov 2024 + 3. Maksym Sobolyev (@sobomax) Apr 2003 - Dec 2023 + 4. Vlad Paiu (@vladpaiu) Jun 2011 - Jul 2023 + 5. Vlad Patrascu (@rvlad-patrascu) Jul 2016 - Mar 2023 + 6. Razvan Crainea (@razvancrainea) Jul 2011 - Jan 2023 + 7. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2002 - Feb 2022 + 8. Walter Doekes (@wdoekes) Apr 2019 - May 2021 + 9. Zero King (@l2dy) Mar 2020 - Mar 2020 + 10. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 + + All remaining contributors: Alexey Vasilyev (@vasilevalex), + Aron Podrigal (@ar45), Alessio Garzi (@Ozzyboshi), Dan Pascu + (@danpascu), Shlomi Gutman, @jalung, Ionut Ionita + (@ionutrazvanionita), Ionel Cerghit (@ionel-cerghit), Ovidiu + Sas (@ovidiusas), Dusan Klinec (@ph4r05), Eseanu Marius + Cristian (@eseanucristian), David Sanders, Andrei Datcu + (@andrei-datcu), Stephane Alnet, Andrei Dragus, Phil D'Amore, + UnixDev, Daniel-Constantin Mierla (@miconda), Henning + Westerholt (@henningw), Iouri Kharon, Konstantin Bokarius, + Edson Gellert Schubert, Anca Vamanu, Matthew M. Boedicker, + Marcus Hunger, Elena-Ramona Modroiu, Jeffrey Magder, Norman + Brandinger (@NormB), Andreas Granig, Juha Heinanen (@juha-h), + Klaus Darilion, Jan Janak (@janakj), Andrei Pelinescu-Onciul, + Jiri Kuthan (@jiriatipteldotorg), Jamey Hicks, Nils Ohlmeier. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/usrloc/dlist.c b/modules/usrloc/dlist.c index d28c50cac3e..e4dd07a4dc1 100644 --- a/modules/usrloc/dlist.c +++ b/modules/usrloc/dlist.c @@ -152,9 +152,9 @@ static int get_domain_db_ucontacts(udomain_t *d, void *buf, int *len, i = snprintf(query_buf, sizeof query_buf, "select %.*s, %.*s, %.*s," #ifdef ORACLE_USRLOC - " %.*s, %.*s, %.*s from %s where %.*s > %lu and mod(contact_id, %u) = %u", + " %.*s, %.*s, %.*s from %s where %.*s > %lld and mod(contact_id, %u) = %u", #else - " %.*s, %.*s, %.*s from %s where %.*s > %lu and contact_id %% %u = %u", + " %.*s, %.*s, %.*s from %s where %.*s > %lld and contact_id %% %u = %u", #endif received_col.len, received_col.s, contact_col.len, contact_col.s, @@ -164,7 +164,7 @@ static int get_domain_db_ucontacts(udomain_t *d, void *buf, int *len, contactid_col.len, contactid_col.s, d->name->s, expires_col.len, expires_col.s, - now, + (long long)now, part_max, part_idx); LM_DBG("query: %.*s\n", (int)(sizeof query_buf), query_buf); @@ -545,7 +545,7 @@ cdb_pack_ping_data(const str *aor, const cdb_pair_t *contact, *len -= needed; if (pack_coords) { - memcpy(cp, &coords, sizeof(ucontact_coords)); + memcpy(cp, coords, sizeof(ucontact_coords)); cp += sizeof(ucontact_coords); } diff --git a/modules/usrloc/dlist.h b/modules/usrloc/dlist.h index 24d039a2ec4..0a9473f3b6a 100644 --- a/modules/usrloc/dlist.h +++ b/modules/usrloc/dlist.h @@ -110,7 +110,7 @@ udomain_t* get_next_udomain(udomain_t *_d); /*contact label may not be higher than 14 bits*/ #define CLABEL_MASK ((1<<14)-1) -#define CLABEL_INC_AND_TEST(_clabel_) ((_clabel_+1)&CLABEL_MASK) +#define CLABEL_NEXT(_clabel_) ((_clabel_+1)&CLABEL_MASK) #define CID_GET_CLABEL(_cid) (_cid&CLABEL_MASK) #define CID_NEXT_RLABEL(_dom, _sl) (_dom->table[_sl].next_label++) @@ -123,7 +123,7 @@ static inline void init_urecord_labels(urecord_t *r, udomain_t *d) static inline uint64_t pack_indexes(unsigned short aorhash, unsigned int rlabel, unsigned short clabel) { - return (clabel & CLABEL_MASK) + + return ((uint64_t)clabel & CLABEL_MASK) + ((uint64_t)rlabel << 14) + ((uint64_t)aorhash << 46); } diff --git a/modules/usrloc/doc/contributors.xml b/modules/usrloc/doc/contributors.xml index e10a882f48f..b5a3b50a36f 100644 --- a/modules/usrloc/doc/contributors.xml +++ b/modules/usrloc/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 337 - 201 - 9165 - 3705 + 348 + 210 + 9259 + 3783 3. @@ -92,16 +92,16 @@ 10. - Andrei Pelinescu-Onciul - 17 - 13 - 151 - 91 + Maksym Sobolyev (@sobomax) + 18 + 12 + 339 + 154 -All remaining contributors: Maksym Sobolyev (@sobomax), Vlad Paiu (@vladpaiu), Walter Doekes (@wdoekes), Nils Ohlmeier, Eseanu Marius Cristian (@eseanucristian), Ovidiu Sas (@ovidiusas), Ionel Cerghit (@ionel-cerghit), Andrei Dragus, Anca Vamanu, Alessio Garzi (@Ozzyboshi), Zero King (@l2dy), Dusan Klinec (@ph4r05), Andrei Datcu (@andrei-datcu), Juha Heinanen (@juha-h), Marcus Hunger, Jamey Hicks, Peter Lemenkov (@lemenkov), Andreas Granig, Shlomi Gutman, @jalung, Jeffrey Magder, Phil D'Amore, Norman Brandinger (@NormB), David Sanders, Konstantin Bokarius, Klaus Darilion, Iouri Kharon, Aron Podrigal (@ar45), Dan Pascu (@danpascu), Matthew M. Boedicker, UnixDev, Edson Gellert Schubert, Alexey Vasilyev (@vasilevalex), Elena-Ramona Modroiu, Stephane Alnet. +All remaining contributors: Andrei Pelinescu-Onciul, Vlad Paiu (@vladpaiu), Walter Doekes (@wdoekes), Nils Ohlmeier, Eseanu Marius Cristian (@eseanucristian), Ovidiu Sas (@ovidiusas), Ionel Cerghit (@ionel-cerghit), Andrei Dragus, Anca Vamanu, Alessio Garzi (@Ozzyboshi), Zero King (@l2dy), Dusan Klinec (@ph4r05), Andrei Datcu (@andrei-datcu), Juha Heinanen (@juha-h), Marcus Hunger, Jamey Hicks, Peter Lemenkov (@lemenkov), Andreas Granig, Shlomi Gutman, @jalung, Jeffrey Magder, Phil D'Amore, Norman Brandinger (@NormB), David Sanders, Konstantin Bokarius, Klaus Darilion, Iouri Kharon, Aron Podrigal (@ar45), Dan Pascu (@danpascu), Gang Zhuo, Matthew M. Boedicker, UnixDev, Edson Gellert Schubert, Alexey Vasilyev (@vasilevalex), Elena-Ramona Modroiu, Stephane Alnet. (1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits) @@ -129,57 +129,57 @@ 1. Liviu Chircu (@liviuchircu) - Jan 2013 - Nov 2023 + Jan 2013 - Feb 2025 2. - Vlad Paiu (@vladpaiu) - Jun 2011 - Jul 2023 + Gang Zhuo + Nov 2024 - Nov 2024 3. - Vlad Patrascu (@rvlad-patrascu) - Jul 2016 - Mar 2023 + Maksym Sobolyev (@sobomax) + Apr 2003 - Dec 2023 4. - Maksym Sobolyev (@sobomax) - Apr 2003 - Feb 2023 + Vlad Paiu (@vladpaiu) + Jun 2011 - Jul 2023 5. + Vlad Patrascu (@rvlad-patrascu) + Jul 2016 - Mar 2023 + + + 6. Razvan Crainea (@razvancrainea) Jul 2011 - Jan 2023 - 6. + 7. Bogdan-Andrei Iancu (@bogdan-iancu) Mar 2002 - Feb 2022 - 7. + 8. Walter Doekes (@wdoekes) Apr 2019 - May 2021 - 8. + 9. Zero King (@l2dy) Mar 2020 - Mar 2020 - 9. + 10. Peter Lemenkov (@lemenkov) Jun 2018 - Feb 2020 - - 10. - Alexey Vasilyev (@vasilevalex) - Dec 2019 - Dec 2019 - -All remaining contributors: Aron Podrigal (@ar45), Alessio Garzi (@Ozzyboshi), Dan Pascu (@danpascu), Shlomi Gutman, @jalung, Ionut Ionita (@ionutrazvanionita), Ionel Cerghit (@ionel-cerghit), Ovidiu Sas (@ovidiusas), Dusan Klinec (@ph4r05), Eseanu Marius Cristian (@eseanucristian), David Sanders, Andrei Datcu (@andrei-datcu), Stephane Alnet, Andrei Dragus, Phil D'Amore, UnixDev, Daniel-Constantin Mierla (@miconda), Henning Westerholt (@henningw), Iouri Kharon, Konstantin Bokarius, Edson Gellert Schubert, Anca Vamanu, Matthew M. Boedicker, Marcus Hunger, Elena-Ramona Modroiu, Jeffrey Magder, Norman Brandinger (@NormB), Andreas Granig, Juha Heinanen (@juha-h), Klaus Darilion, Jan Janak (@janakj), Andrei Pelinescu-Onciul, Jiri Kuthan (@jiriatipteldotorg), Jamey Hicks, Nils Ohlmeier. +All remaining contributors: Alexey Vasilyev (@vasilevalex), Aron Podrigal (@ar45), Alessio Garzi (@Ozzyboshi), Dan Pascu (@danpascu), Shlomi Gutman, @jalung, Ionut Ionita (@ionutrazvanionita), Ionel Cerghit (@ionel-cerghit), Ovidiu Sas (@ovidiusas), Dusan Klinec (@ph4r05), Eseanu Marius Cristian (@eseanucristian), David Sanders, Andrei Datcu (@andrei-datcu), Stephane Alnet, Andrei Dragus, Phil D'Amore, UnixDev, Daniel-Constantin Mierla (@miconda), Henning Westerholt (@henningw), Iouri Kharon, Konstantin Bokarius, Edson Gellert Schubert, Anca Vamanu, Matthew M. Boedicker, Marcus Hunger, Elena-Ramona Modroiu, Jeffrey Magder, Norman Brandinger (@NormB), Andreas Granig, Juha Heinanen (@juha-h), Klaus Darilion, Jan Janak (@janakj), Andrei Pelinescu-Onciul, Jiri Kuthan (@jiriatipteldotorg), Jamey Hicks, Nils Ohlmeier. (1) including any documentation-related commits, excluding merge commits diff --git a/modules/usrloc/doc/usrloc.xml b/modules/usrloc/doc/usrloc.xml index 324be4725bc..d77cbdef0e8 100644 --- a/modules/usrloc/doc/usrloc.xml +++ b/modules/usrloc/doc/usrloc.xml @@ -7,6 +7,8 @@ + + diff --git a/modules/usrloc/doc/usrloc_admin.xml b/modules/usrloc/doc/usrloc_admin.xml index d0ee2e42cbe..1790f5b1bf3 100644 --- a/modules/usrloc/doc/usrloc_admin.xml +++ b/modules/usrloc/doc/usrloc_admin.xml @@ -1171,6 +1171,9 @@ modparam("usrloc", "cseq_delay", 5) (addresses-of-record, contacts), organized into specific events (inserts, deletes or updates). + + &clusterer_sync_cap_para; + Default value is 0 (replication disabled). diff --git a/modules/usrloc/ucontact.h b/modules/usrloc/ucontact.h index c39e0d56656..021f3444baf 100644 --- a/modules/usrloc/ucontact.h +++ b/modules/usrloc/ucontact.h @@ -101,10 +101,10 @@ struct ct_match { */ typedef struct ucontact { uint64_t contact_id; /*!< 64 bit Contact identifier - 0-------0-------------0---------------0 - |0 - 13 | 14 - 45 | 46 - 61 | - |aorhash| record label| contact label | - 0-------0-------------0---------------0 + 0---------------0--------------0---------------0 + | 0 - 13 | 14 - 45 | 46 - 63 | + | contact label | record label | aorhash | + 0---------------0--------------0---------------0 */ str* domain; /*!< Pointer to domain name (NULL terminated) */ str* aor; /*!< Pointer to the AOR string in record structure*/ @@ -127,7 +127,7 @@ typedef struct ucontact { unsigned int methods; /*!< Supported methods */ str attr; /*!< Additional registration info */ struct proxy_l next_hop;/*!< SIP-wise determined next hop */ - unsigned int label; /*!< label to find the contact in contact list>*/ + unsigned short label; /*!< label to find the contact in contact list>*/ int sipping_latency; /*!< useconds; not restart-persistent >*/ str shtag; /*!< helps determine the logical owner node */ str cdb_key; /*!< the key of the contact in cache_db; makes @@ -144,10 +144,10 @@ typedef struct ucontact { typedef struct ucontact_info { uint64_t contact_id; /*!< 64 bit Contact identifier - 0-------0-------------0---------------0 - |0 - 15 | 16 - 47 | 48 - 63 | - |aorhash| record label| contact label | - 0-------0-------------0---------------0 + 0---------------0--------------0---------------0 + | 0 - 13 | 14 - 45 | 46 - 63 | + | contact label | record label | aorhash | + 0---------------0--------------0---------------0 */ str* c; str received; @@ -202,14 +202,15 @@ void free_ucontact_coords(ucontact_coords coords); int is_my_ucontact(ucontact_t *c); /*! \brief - * ancient time used for marking the contacts forced to expired + * Non-zero but still ancient time which forces a contact to expire */ #define UL_EXPIRED_TIME 10 +#define FORCE_EXPIRED_CONTACT(c) ((c)->expires == UL_EXPIRED_TIME) /* - * Valid contact is a contact that either didn't expire yet or is permanent + * A contact is valid when it is neither expired nor permanent */ -#define VALID_CONTACT(c, t) ((c->expires>t) || (c->expires==0)) +#define VALID_CONTACT(c, t) ((c)->expires>(t) || (c)->expires==0) /*! \brief diff --git a/modules/usrloc/udomain.c b/modules/usrloc/udomain.c index a4e3a927519..9d7dfbed4dc 100644 --- a/modules/usrloc/udomain.c +++ b/modules/usrloc/udomain.c @@ -619,7 +619,7 @@ int preload_udomain(db_con_t* _c, udomain_t* _d) _d->table[sl].next_label = rlabel + 1; if (r->next_clabel <= clabel || r->next_clabel == 0) - r->next_clabel = CLABEL_INC_AND_TEST(clabel); + r->next_clabel = CLABEL_NEXT(clabel); r->label = rlabel; } @@ -659,7 +659,7 @@ int preload_udomain(db_con_t* _c, udomain_t* _d) if (cid_regen && old_expires) { /* rebuild the contact id for this contact */ ci->contact_id = pack_indexes(r->aorhash, r->label, r->next_clabel); - r->next_clabel = CLABEL_INC_AND_TEST(r->next_clabel); + r->next_clabel = CLABEL_NEXT(r->next_clabel); ci->expires = old_expires; diff --git a/modules/usrloc/ul_cluster.c b/modules/usrloc/ul_cluster.c index 29c7eb424c4..6129be46c5f 100644 --- a/modules/usrloc/ul_cluster.c +++ b/modules/usrloc/ul_cluster.c @@ -504,7 +504,7 @@ static int receive_ucontact_insert(bin_packet_t *packet) user_agent, path, attr, st, sock, kv_str; udomain_t *domain; urecord_t *record; - ucontact_t *contact, *ct; + ucontact_t *contact; int rc, sl; unsigned short _, clabel; unsigned int rlabel; @@ -596,34 +596,10 @@ static int receive_ucontact_insert(bin_packet_t *packet) record->label = rlabel; sl = record->aorhash & (domain->size - 1); - if (domain->table[sl].next_label <= rlabel) + if (rlabel >= domain->table[sl].next_label) domain->table[sl].next_label = rlabel + 1; } - if (record->label != rlabel) { - int has_good_cts = 0; - - for (ct = record->contacts; ct; ct = ct->next) - if (ct->expires != UL_EXPIRED_TIME) { - has_good_cts = 1; - break; - } - - if (has_good_cts) { - LM_BUG("differring rlabels (%u vs. %u, ci: '%.*s')", - record->label, rlabel, callid.len, callid.s); - } else { - /* no contacts -> it's safe to inherit the active node's rlabel */ - record->label = rlabel; - sl = record->aorhash & (domain->size - 1); - if (domain->table[sl].next_label <= rlabel) - domain->table[sl].next_label = rlabel + 1; - } - } - - if (record->next_clabel <= clabel) - record->next_clabel = CLABEL_INC_AND_TEST(clabel); - rc = get_ucontact(record, &contact_str, &callid, ci.cseq, &cmatch, &contact); @@ -633,7 +609,11 @@ static int receive_ucontact_insert(bin_packet_t *packet) case -1: /* received data is older than what we have */ break; + case 0: + ci.contact_id = pack_indexes((unsigned short)record->aorhash, + record->label, (unsigned short)contact->label); + /* received data is newer than what we have */ if (update_ucontact(record, contact, &ci, NULL, 1) != 0) { LM_ERR("failed to update ucontact (ci: '%.*s')\n", callid.len, callid.s); @@ -641,7 +621,18 @@ static int receive_ucontact_insert(bin_packet_t *packet) goto error; } break; + case 1: + if (clabel >= record->next_clabel) { + record->next_clabel = CLABEL_NEXT(clabel); + } else { + clabel = record->next_clabel; + record->next_clabel = CLABEL_NEXT(record->next_clabel); + } + + ci.contact_id = pack_indexes((unsigned short)record->aorhash, + record->label, (unsigned short)clabel); + if (insert_ucontact(record, &contact_str, &ci, NULL, 1, &contact) != 0) { LM_ERR("failed to insert ucontact (ci: '%.*s')\n", callid.len, callid.s); unlock_udomain(domain, &aor); @@ -773,7 +764,7 @@ static int receive_ucontact_update(bin_packet_t *packet) } if (record->next_clabel <= clabel) - record->next_clabel = CLABEL_INC_AND_TEST(clabel); + record->next_clabel = CLABEL_NEXT(clabel); } else { rc = get_ucontact(record, &contact_str, &callid, ci.cseq + 1, &cmatch, &contact); @@ -789,7 +780,7 @@ static int receive_ucontact_update(bin_packet_t *packet) } if (record->next_clabel <= clabel) - record->next_clabel = CLABEL_INC_AND_TEST(clabel); + record->next_clabel = CLABEL_NEXT(clabel); } else if (rc == 0) { if (update_ucontact(record, contact, &ci, NULL, 1) != 0) { @@ -853,18 +844,27 @@ static int receive_ucontact_delete(bin_packet_t *packet) if (get_urecord(domain, &aor, &record) != 0) { LM_INFO("failed to fetch local urecord - ignoring request " "(ci: '%.*s')\n", callid.len, callid.s); - unlock_udomain(domain, &aor); goto out; } /* simply specify a higher cseq and completely avoid any complications */ rc = get_ucontact(record, &contact_str, &callid, cseq + 1, &cmatch, &contact); - if (rc != 0 && rc != 2) { - LM_ERR("contact '%.*s' not found: (ci: '%.*s')\n", contact_str.len, + switch (rc) { + case -2: + case -1: + /* the DEL packet is too old (same or lower CSeq) */ + LM_ERR("contact '%.*s' found, but DEL too old: (rc: %d, ci: '%.*s')\n", + contact_str.len, contact_str.s, rc, callid.len, callid.s); + goto out; + break; + + case 1: + LM_DBG("contact '%.*s' already deleted: (ci: '%.*s')\n", contact_str.len, contact_str.s, callid.len, callid.s); - unlock_udomain(domain, &aor); - goto error; + goto out; + break; + default:; } if (skip_replicated_db_ops) @@ -877,9 +877,8 @@ static int receive_ucontact_delete(bin_packet_t *packet) goto error; } - unlock_udomain(domain, &aor); - out: + unlock_udomain(domain, &aor); free_pkg_str_list(cmatch.match_params); return 0; diff --git a/modules/usrloc/ul_evi.c b/modules/usrloc/ul_evi.c index 4e4b16d0d89..cec720edd2c 100644 --- a/modules/usrloc/ul_evi.c +++ b/modules/usrloc/ul_evi.c @@ -498,9 +498,12 @@ void ul_raise_contact_event(event_id_t _e, const ucontact_t *_c) } -static inline void _ul_raise_ct_refresh_event( - const ucontact_t *_c, const str *reason, const str *req_callid) +static inline void _ul_raise_ct_refresh_event(const struct ct_refresh_event_data *ev) { + const ucontact_t *_c = ev->ct; + const str *reason = &ev->reason; + const str *req_callid = &ev->req_callid; + if (ei_c_refresh_id == EVI_ERROR) { LM_ERR("event not yet registered ("UL_EV_CT_REFRESH")\n"); return; @@ -537,8 +540,7 @@ static inline void _ul_raise_ct_refresh_event( } /* the socket */ - if (evi_param_set_str(ul_ct_pn_event.socket, - (_c->sock ? &_c->sock->sock_str : _str(""))) < 0) { + if (evi_param_set_str(ul_ct_pn_event.socket, &ev->sock_str) < 0) { LM_ERR("cannot set socket parameter\n"); return; } @@ -593,34 +595,44 @@ static inline void _ul_raise_ct_refresh_event( } +#if UL_ASYNC_CT_REFRESH +struct refresh_event_rpc_data { + struct ct_refresh_event_data ev; + ucontact_t ct; + str domain; + str aor; + char _stor[0]; +}; + static void ul_rpc_raise_ct_refresh(int _, void *_ev) { - struct ct_refresh_event_data *ev = (struct ct_refresh_event_data *)_ev; + struct refresh_event_rpc_data *rev = (struct refresh_event_rpc_data*)_ev; - _ul_raise_ct_refresh_event(ev->ct, &ev->reason, &ev->req_callid); - shm_free(ev); + _ul_raise_ct_refresh_event(&rev->ev); + shm_free(rev); } +#endif void ul_raise_ct_refresh_event(const ucontact_t *c, const str *reason, const str *req_callid) { #if !UL_ASYNC_CT_REFRESH - _ul_raise_ct_refresh_event(c, reason, req_callid); + const struct ct_refresh_event_data ev = { + .ct = c, + .reason = *reason, + .req_callid = *req_callid, + .sock_str = (c->sock != NULL) ? c->sock->sock_str : (str){0}, + }; + _ul_raise_ct_refresh_event(&ev); #else - struct { - struct ct_refresh_event_data ev; - ucontact_t ct; - str domain; - str aor; - struct socket_info sock[0]; - } *buf; + struct refresh_event_rpc_data *buf; char *p; /* since we cannot send a (ucontact_t *), we must dup the data */ buf = shm_malloc(sizeof(*buf) + c->domain->len + c->aor->len + c->c.len + c->received.len + c->path.len + c->user_agent.len + - (c->sock ? (sizeof *c->sock + c->sock->sock_str.len) : 0) + + (c->sock ? c->sock->sock_str.len : 0) + c->callid.len + c->attr.len + c->shtag.len + reason->len + (req_callid ? req_callid->len : 0)); if (buf == NULL) { @@ -628,7 +640,7 @@ void ul_raise_ct_refresh_event(const ucontact_t *c, const str *reason, return; } - p = (c->sock) ? (char *)(&buf->sock[1]) : (char *)(&buf->sock[0]); + p = buf->_stor; buf->ev.reason.s = p; buf->ev.reason.len = reason->len; @@ -675,12 +687,10 @@ void ul_raise_ct_refresh_event(const ucontact_t *c, const str *reason, p += c->user_agent.len; if (!c->sock) { - buf->ct.sock = NULL; + buf->ev.sock_str = (str){0}; } else { - buf->ct.sock = &buf->sock[0]; - - buf->ct.sock->sock_str.s = p; - str_cpy(&buf->ct.sock->sock_str, &c->sock->sock_str); + buf->ev.sock_str.s = p; + str_cpy(&buf->ev.sock_str, &c->sock->sock_str); p += c->sock->sock_str.len; } diff --git a/modules/usrloc/ul_evi.h b/modules/usrloc/ul_evi.h index 698d9ea9032..34de2ce09ff 100644 --- a/modules/usrloc/ul_evi.h +++ b/modules/usrloc/ul_evi.h @@ -52,9 +52,10 @@ #define UL_EV_PARAM_CT_RCLID "req_callid" struct ct_refresh_event_data { - ucontact_t *ct; + const ucontact_t *ct; str reason; str req_callid; + str sock_str; }; /* AoR event IDs */ diff --git a/modules/usrloc/ul_mod.c b/modules/usrloc/ul_mod.c index 639210c3d60..b02dcad9cd8 100644 --- a/modules/usrloc/ul_mod.c +++ b/modules/usrloc/ul_mod.c @@ -427,7 +427,7 @@ int init_cachedb(void) cdbc = cdbf.init(&cdb_url); if (!cdbc) { - LM_ERR("cannot connect to cachedb_url %.*s\n", cdb_url.len, cdb_url.s); + LM_ERR("cannot connect to cachedb_url %s\n", db_url_escape(&cdb_url)); return -1; } @@ -493,29 +493,44 @@ static int mi_child_init(void) */ static void destroy(void) { + int do_sync = 0; + /* we need to sync DB in order to flush the cache */ if (have_sql_con() && ul_dbf.init) { ul_dbh = ul_dbf.init(&db_url); /* Get a new database connection */ if (!ul_dbh) { LM_ERR("failed to connect to database\n"); - } else { - ul_unlock_locks(); - if (sync_lock) - lock_start_read(sync_lock); - if (_synchronize_all_udomains() != 0) { - LM_ERR("flushing cache failed\n"); - } - if (sync_lock) { - lock_stop_read(sync_lock); - lock_destroy_rw(sync_lock); - sync_lock = 0; - } - ul_dbf.close(ul_dbh); + do_sync = -10; + } else { + do_sync++; } } + if (have_cdb_con()) { + if (init_cachedb() < 0) + do_sync = -10; + else + do_sync++; + } + + ul_unlock_locks(); + + if (sync_lock) + lock_start_read(sync_lock); + if (do_sync > 0 && _synchronize_all_udomains() != 0) + LM_ERR("flushing cache failed\n"); + if (sync_lock) { + lock_stop_read(sync_lock); + lock_destroy_rw(sync_lock); + sync_lock = NULL; + } + + if (ul_dbh) + ul_dbf.close(ul_dbh); if (cdbc) cdbf.destroy(cdbc); + + ul_dbh = NULL; cdbc = NULL; free_all_udomains(); @@ -875,14 +890,14 @@ int ul_check_db(void) cdb_url.len = strlen(cdb_url.s); if (cachedb_bind_mod(&cdb_url, &cdbf) < 0) { - LM_ERR("cannot bind functions for cachedb_url %.*s\n", - cdb_url.len, cdb_url.s); + LM_ERR("cannot bind functions for cachedb_url %s\n", + db_url_escape(&cdb_url)); return -1; } if (!CACHEDB_CAPABILITY(&cdbf, CACHEDB_CAP_COL_ORIENTED)) { - LM_ERR("not enough capabilities for cachedb_url %.*s\n", - cdb_url.len, cdb_url.s); + LM_ERR("not enough capabilities for cachedb_url %s\n", + db_url_escape(&cdb_url)); return -1; } } @@ -890,7 +905,7 @@ int ul_check_db(void) /* use database if needed */ if (have_sql_con()) { if (ZSTR(db_url)) { - LM_ERR("selected mode requires a db connection -> db_url \n"); + LM_ERR("selected mode requires a db connection -> db_url\n"); return -1; } diff --git a/modules/usrloc/urecord.c b/modules/usrloc/urecord.c index 56091bd17fa..24c3c4f6c39 100644 --- a/modules/usrloc/urecord.c +++ b/modules/usrloc/urecord.c @@ -249,8 +249,8 @@ static inline int nodb_timer(urecord_t* _r) while(ptr) { if (!VALID_CONTACT(ptr, act_time)) { - /* run callbacks for EXPIRE event */ - if (exists_ulcb_type(UL_CONTACT_EXPIRE)) + /* for forcibly expired contacts, DELETE event is already run */ + if (!FORCE_EXPIRED_CONTACT(ptr) && exists_ulcb_type(UL_CONTACT_EXPIRE)) run_ul_callbacks( UL_CONTACT_EXPIRE, ptr, NULL); LM_DBG("Binding '%.*s','%.*s' has expired\n", @@ -283,10 +283,9 @@ static inline int ALLOW_UNUSED wt_timer(urecord_t* _r) while(ptr) { if (!VALID_CONTACT(ptr, act_time)) { - /* run callbacks for EXPIRE event */ - if (exists_ulcb_type(UL_CONTACT_EXPIRE)) { + /* for forcibly expired contacts, DELETE event is already run */ + if (!FORCE_EXPIRED_CONTACT(ptr) && exists_ulcb_type(UL_CONTACT_EXPIRE)) run_ul_callbacks( UL_CONTACT_EXPIRE, ptr, NULL); - } LM_DBG("Binding '%.*s','%.*s' has expired\n", ptr->aor->len, ZSW(ptr->aor->s), @@ -326,10 +325,9 @@ static inline int wb_timer(urecord_t* _r,query_list_t **ins_list) while(ptr) { if (!VALID_CONTACT(ptr, act_time)) { - /* run callbacks for EXPIRE event */ - if (exists_ulcb_type(UL_CONTACT_EXPIRE)) { + /* for forcibly expired contacts, DELETE event is already run */ + if (!FORCE_EXPIRED_CONTACT(ptr) && exists_ulcb_type(UL_CONTACT_EXPIRE)) run_ul_callbacks( UL_CONTACT_EXPIRE, ptr, NULL); - } LM_DBG("Binding '%.*s','%.*s' has expired\n", ptr->aor->len, ZSW(ptr->aor->s), @@ -859,7 +857,7 @@ int insert_ucontact(urecord_t* _r, str* _contact, ucontact_info_t* _ci, pack_indexes((unsigned short)_r->aorhash, _r->label, ((unsigned short)_r->next_clabel)); - _r->next_clabel = CLABEL_INC_AND_TEST(_r->next_clabel); + _r->next_clabel = CLABEL_NEXT(_r->next_clabel); } if (cluster_mode == CM_FULL_SHARING_CACHEDB && !_ci->cdb_key.s) { @@ -1107,7 +1105,7 @@ uint64_t next_contact_id(urecord_t* _r) pack_indexes((unsigned short)_r->aorhash, _r->label, ((unsigned short)_r->next_clabel)); - _r->next_clabel = CLABEL_INC_AND_TEST(_r->next_clabel); + _r->next_clabel = CLABEL_NEXT(_r->next_clabel); return contact_id; } diff --git a/modules/xcap/Makefile b/modules/xcap/Makefile index 86ecc055085..e0d888caf67 100644 --- a/modules/xcap/Makefile +++ b/modules/xcap/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # XCAP operations module for OpenSIPs # # diff --git a/modules/xcap/README b/modules/xcap/README index 2f021170671..072ab4053cf 100644 --- a/modules/xcap/README +++ b/modules/xcap/README @@ -215,7 +215,7 @@ Chapter 3. Contributors commits^(2) and lines added/removed^(3) Name DevScore Commits Lines ++ Lines -- 1. Saúl Ibarra Corretgé (@saghul) 15 3 1260 53 - 2. Liviu Chircu (@liviuchircu) 10 7 55 102 + 2. Liviu Chircu (@liviuchircu) 11 8 55 106 3. Razvan Crainea (@razvancrainea) 7 5 25 21 4. Bogdan-Andrei Iancu (@bogdan-iancu) 5 3 6 10 5. Ovidiu Sas (@ovidiusas) 3 1 13 3 @@ -243,11 +243,11 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Mar 2020 - 3. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2019 - 4. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 5. Liviu Chircu (@liviuchircu) Jul 2014 - Jun 2018 + 1. Liviu Chircu (@liviuchircu) Jul 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Mar 2020 + 4. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2019 + 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 6. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2017 7. Ovidiu Sas (@ovidiusas) Jan 2013 - Jan 2013 8. Saúl Ibarra Corretgé (@saghul) Nov 2012 - Jan 2013 diff --git a/modules/xcap/doc/contributors.xml b/modules/xcap/doc/contributors.xml index 67b16647110..0b31787312d 100644 --- a/modules/xcap/doc/contributors.xml +++ b/modules/xcap/doc/contributors.xml @@ -29,10 +29,10 @@ 2. Liviu Chircu (@liviuchircu) - 10 - 7 + 11 + 8 55 - 102 + 106 3. @@ -112,29 +112,29 @@ 1. + Liviu Chircu (@liviuchircu) + Jul 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Mar 2020 - 3. + 4. Razvan Crainea (@razvancrainea) Aug 2015 - Sep 2019 - 4. + 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - 5. - Liviu Chircu (@liviuchircu) - Jul 2014 - Jun 2018 - 6. Vlad Patrascu (@rvlad-patrascu) diff --git a/modules/xcap_client/Makefile b/modules/xcap_client/Makefile index 902b084b0ea..6c6c1222c62 100644 --- a/modules/xcap_client/Makefile +++ b/modules/xcap_client/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # XCAP client for OpenSIPs # # diff --git a/modules/xcap_client/README b/modules/xcap_client/README index 6aa88765ff4..c0be1448d90 100644 --- a/modules/xcap_client/README +++ b/modules/xcap_client/README @@ -273,8 +273,8 @@ Chapter 3. Contributors Name DevScore Commits Lines ++ Lines -- 1. Anca Vamanu 36 14 2155 193 2. Bogdan-Andrei Iancu (@bogdan-iancu) 18 15 56 63 - 3. Razvan Crainea (@razvancrainea) 12 10 18 18 - 4. Liviu Chircu (@liviuchircu) 11 9 30 48 + 3. Liviu Chircu (@liviuchircu) 12 10 30 50 + 4. Razvan Crainea (@razvancrainea) 12 10 18 18 5. Daniel-Constantin Mierla (@miconda) 9 7 22 19 6. Henning Westerholt (@henningw) 8 6 60 49 7. Saúl Ibarra Corretgé (@saghul) 6 3 55 89 @@ -306,12 +306,12 @@ Chapter 3. Contributors Table 3.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. Razvan Crainea (@razvancrainea) Sep 2011 - Sep 2019 - 3. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2008 - Apr 2019 - 4. Vlad Patrascu (@rvlad-patrascu) May 2017 - Dec 2018 - 5. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - 6. Liviu Chircu (@liviuchircu) Mar 2014 - Jun 2018 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 + 3. Razvan Crainea (@razvancrainea) Sep 2011 - Sep 2019 + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2008 - Apr 2019 + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Dec 2018 + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 7. Vlad Paiu (@vladpaiu) Mar 2014 - Mar 2014 8. Ovidiu Sas (@ovidiusas) Jan 2013 - Jan 2013 9. Saúl Ibarra Corretgé (@saghul) Nov 2012 - Jan 2013 diff --git a/modules/xcap_client/doc/contributors.xml b/modules/xcap_client/doc/contributors.xml index 67991ec7c70..e3644ad7d17 100644 --- a/modules/xcap_client/doc/contributors.xml +++ b/modules/xcap_client/doc/contributors.xml @@ -36,19 +36,19 @@ 3. - Razvan Crainea (@razvancrainea) + Liviu Chircu (@liviuchircu) 12 10 - 18 - 18 + 30 + 50 4. - Liviu Chircu (@liviuchircu) - 11 - 9 - 30 - 48 + Razvan Crainea (@razvancrainea) + 12 + 10 + 18 + 18 5. @@ -128,34 +128,34 @@ 1. + Liviu Chircu (@liviuchircu) + Mar 2014 - May 2024 + + + 2. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 - 2. + 3. Razvan Crainea (@razvancrainea) Sep 2011 - Sep 2019 - 3. + 4. Bogdan-Andrei Iancu (@bogdan-iancu) Feb 2008 - Apr 2019 - 4. + 5. Vlad Patrascu (@rvlad-patrascu) May 2017 - Dec 2018 - 5. + 6. Peter Lemenkov (@lemenkov) Jun 2018 - Jun 2018 - - 6. - Liviu Chircu (@liviuchircu) - Mar 2014 - Jun 2018 - 7. Vlad Paiu (@vladpaiu) diff --git a/modules/xmpp/Makefile b/modules/xmpp/Makefile index 14481149f98..26b4adadd8f 100644 --- a/modules/xmpp/Makefile +++ b/modules/xmpp/Makefile @@ -1,5 +1,3 @@ -# $Id$ -# # xmpp module makefile # # diff --git a/modules/xmpp/README b/modules/xmpp/README index 8f2dec09068..83e21d7f69c 100644 --- a/modules/xmpp/README +++ b/modules/xmpp/README @@ -346,7 +346,7 @@ Chapter 2. Contributors 1. Daniel-Constantin Mierla (@miconda) 67 16 5988 76 2. Bogdan-Andrei Iancu (@bogdan-iancu) 28 23 120 245 3. Anca Vamanu 20 9 438 398 - 4. Liviu Chircu (@liviuchircu) 13 10 56 96 + 4. Liviu Chircu (@liviuchircu) 14 11 56 98 5. Razvan Crainea (@razvancrainea) 9 7 31 23 6. Vlad Patrascu (@rvlad-patrascu) 6 4 9 5 7. Henning Westerholt (@henningw) 5 3 13 13 @@ -378,7 +378,7 @@ Chapter 2. Contributors Table 2.2. Most recently active contributors^(1) to this module Name Commit Activity - 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2023 + 1. Liviu Chircu (@liviuchircu) Mar 2014 - May 2024 2. Vlad Patrascu (@rvlad-patrascu) May 2017 - May 2023 3. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 4. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2006 - Apr 2020 diff --git a/modules/xmpp/doc/contributors.xml b/modules/xmpp/doc/contributors.xml index 63cc2aba6c1..0d1f24cf97b 100644 --- a/modules/xmpp/doc/contributors.xml +++ b/modules/xmpp/doc/contributors.xml @@ -45,10 +45,10 @@ 4. Liviu Chircu (@liviuchircu) - 13 - 10 + 14 + 11 56 - 96 + 98 5. @@ -129,7 +129,7 @@ 1. Liviu Chircu (@liviuchircu) - Mar 2014 - May 2023 + Mar 2014 - May 2024 2. diff --git a/net/net_tcp.c b/net/net_tcp.c index 236603ddac4..4933fcdf78e 100644 --- a/net/net_tcp.c +++ b/net/net_tcp.c @@ -65,7 +65,18 @@ struct struct_hist_list *con_hist; enum tcp_worker_state { STATE_INACTIVE=0, STATE_ACTIVE, STATE_DRAINING}; -/* definition of a TCP worker */ +/* definition of a TCP worker - the array of these TCP workers is + * mainly intended to be used by the TCP main, to keep track of the + * workers, about their load and so. Nevertheless, since the addition + * of the process auto-scaling, other processes may need access to this + * data, thus it's relocation in SHM (versus initial PKG). For example, + * the attendant process is the one forking new TCP workers (scaling up), + * so it must be able to set the ENABLE state for the TCP worker (and being + * (seen by the TCP main proc). Similar, when a TCP worker shuts down, it has + * to mark itself as DISABLED and the TCP main must see that. + * Again, 99% this array is intended for TCP Main ops, it is not lock + * protected, so be very careful with any ops from other procs. + */ struct tcp_worker { pid_t pid; int unix_sock; /*!< Main-Worker comm, worker end */ @@ -725,8 +736,15 @@ static void tcp_disconnect_event_raise(struct tcp_connection* c) evi_free_params(list); } +/* convenience macro to aid in shm_free() debugging */ +#define _tcpconn_rm(c, ne) \ + do {\ + __tcpconn_rm(c, ne);\ + shm_free(c);\ + } while (0) + /*! \brief unsafe tcpconn_rm version (nolocks) */ -static void _tcpconn_rm(struct tcp_connection* c, int no_event) +static void __tcpconn_rm(struct tcp_connection* c, int no_event) { int r; @@ -759,10 +777,11 @@ static void _tcpconn_rm(struct tcp_connection* c, int no_event) c->hist = NULL; #endif - shm_free(c); + /* shm_free(c); -- freed by _tcpconn_rm() */ } + #if 0 static void tcpconn_rm(struct tcp_connection* c) { @@ -1204,8 +1223,8 @@ inline static int handle_tcpconn_ev(struct tcp_connection* tcpconn, int fd_i, tcpconn->flags|=F_CONN_REMOVED; tcp_trigger_report(tcpconn, TCP_REPORT_CLOSE, "Async connect failed"); - tcpconn_destroy(tcpconn); sh_log(tcpconn->hist, TCP_UNREF, "tcpconn connect, (%d)", tcpconn->refcnt); + tcpconn_destroy(tcpconn); return 0; } @@ -1762,7 +1781,7 @@ int tcp_init(void) return 0; #ifdef DBG_TCPCON - con_hist = shl_init("TCP con", 10000, 1); + con_hist = shl_init("TCP con", 10000, 0); if (!con_hist) { LM_ERR("oom con hist\n"); goto error; @@ -1783,10 +1802,10 @@ int tcp_init(void) s_profile->max_procs : tcp_workers_no ; /* init tcp workers array */ - tcp_workers = (struct tcp_worker*)pkg_malloc + tcp_workers = (struct tcp_worker*)shm_malloc ( tcp_workers_max_no*sizeof(struct tcp_worker) ); if (tcp_workers==0) { - LM_CRIT("could not alloc tcp_workers array in pkg memory\n"); + LM_CRIT("could not alloc tcp_workers array in shm memory\n"); goto error; } memset( tcp_workers, 0, tcp_workers_max_no*sizeof(struct tcp_worker)); diff --git a/net/net_tcp_proc.c b/net/net_tcp_proc.c index 773c137aab8..86d15bf5eee 100644 --- a/net/net_tcp_proc.c +++ b/net/net_tcp_proc.c @@ -110,6 +110,8 @@ int tcp_done_reading(struct tcp_connection* con) tcpconn_check_del(con); tcpconn_listrm(tcp_conn_lst, con, c_next, c_prev); if (con->fd!=-1) { close(con->fd); con->fd = -1; } + sh_log(con->hist, TCP_SEND2MAIN, + "parallel read OK - releasing, ref: %d", con->refcnt); tcpconn_release(con, CONN_RELEASE, 0, 1 /*as TCP proc*/); _tcp_done_reading_marker = 1; @@ -285,6 +287,9 @@ inline static int handle_io(struct fd_map* fm, int idx,int event_type) goto con_error; } + sh_log(con->hist, TCP_ADD_READER, "add reader fd %d, ref: %d", + s, con->refcnt); + /* mark that the connection is currently in our process future writes to this con won't have to acquire FD */ con->proc_id = process_no; diff --git a/net/tcp_common.c b/net/tcp_common.c index a8e4d7c98b7..9305c9161a6 100644 --- a/net/tcp_common.c +++ b/net/tcp_common.c @@ -113,7 +113,12 @@ int tcp_connect_blocking_timeout(int fd, const struct sockaddr *servaddr, #endif { err_len=sizeof(err); - getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &err_len); + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &err_len) != 0) { + get_su_info( servaddr, ip, port); + LM_WARN("getsockopt error: fd=%d [server=%s:%d]: (%d) %s\n", fd, + ip, port, errno, strerror(errno)); + goto error; + } if ((err==0) && (poll_err==0)) goto end; if (err!=EINPROGRESS && err!=EALREADY){ get_su_info( servaddr, ip, port); @@ -330,7 +335,12 @@ int tcp_async_connect(struct socket_info* send_sock, #endif { err_len=sizeof(err); - getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &err_len); + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &err_len) != 0) { + get_su_info(&server->s, ip, port); + LM_WARN("getsockopt error: fd=%d [server=%s:%d]: (%d) %s\n", fd, + ip, port, errno, strerror(errno)); + goto error; + } if ((err==0) && (poll_err==0)) goto local_connect; if (err!=EINPROGRESS && err!=EALREADY){ get_su_info(&server->s, ip, port); diff --git a/opensips.8 b/opensips.8 index 7bf0774ce08..e6c20f5206e 100644 --- a/opensips.8 +++ b/opensips.8 @@ -1,4 +1,3 @@ -.\" $Id$ .\" Process with .\" groff -man -Tascii opensips.8 .\" diff --git a/opensips.cfg.5 b/opensips.cfg.5 index 3e50a641761..db1e83c3eb0 100644 --- a/opensips.cfg.5 +++ b/opensips.cfg.5 @@ -1,4 +1,3 @@ -.\" $Id$ .TH opensips.cfg 5 08.06.2006 opensips "Open SIP Server" .\" Process with .\" groff -man -Tascii opensips.cfg.5 diff --git a/packaging/debian/changelog b/packaging/debian/changelog index d9c0320ec75..1057882dcf7 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,3 +1,59 @@ +opensips (3.4.11-1) stable; urgency=low + + * Minor Public Release. + + -- Liviu Chircu Wed, 19 Feb 2025 17:11:10 +0200 + + +opensips (3.4.10-1) stable; urgency=low + + * Minor Public Release. + + -- Liviu Chircu Wed, 18 Dec 2024 16:35:11 +0200 + + +opensips (3.4.9-1) stable; urgency=low + + * Minor Public Release. + + -- Liviu Chircu Wed, 23 Oct 2024 17:54:10 +0300 + + +opensips (3.4.8-1) stable; urgency=low + + * Minor Public Release. + + -- Liviu Chircu Wed, 21 Aug 2024 12:32:33 +0300 + + +opensips (3.4.7-1) stable; urgency=low + + * Minor Public Release. + + -- Liviu Chircu Wed, 24 Jul 2024 15:20:36 +0300 + + +opensips (3.4.6-1) stable; urgency=low + + * Minor Public Release. + + -- Liviu Chircu Wed, 19 Jun 2024 15:33:49 +0300 + + +opensips (3.4.5-1) stable; urgency=low + + * Minor Public Release. + + -- Liviu Chircu Thu, 18 Apr 2024 14:14:52 +0300 + + +opensips (3.4.4-1) stable; urgency=low + + * Minor Public Release. + + -- Liviu Chircu Wed, 21 Feb 2024 15:05:27 +0200 + + opensips (3.4.3-1) stable; urgency=low * Minor Public Release. diff --git a/packaging/debian/opensips-mongodb-module.preinst b/packaging/debian/opensips-mongodb-module.preinst index 2ecf52ef17c..f8fa8877872 100644 --- a/packaging/debian/opensips-mongodb-module.preinst +++ b/packaging/debian/opensips-mongodb-module.preinst @@ -1,17 +1,11 @@ #!/bin/sh #DEBHELPER# -set -e -LIBMONGOC_NAME=libmongoc-1.0-0 +dpkg -s libmongoc-1.0-0 > /dev/null && exit 0 +dpkg -s libmongoc-1.0-0t64 > /dev/null && exit 0 -# check if libmongoc is installed -dpkg -s $LIBMONGOC_NAME > /dev/null -if [ "$?" -ne "0" ] -then - echo "This packages was not built for your release!" - echo "opensips-mongodb-module wasn't installed and you cannot use it in your script!" - exit 1 -fi - -exit 0 +# no known library installed +echo "This packages was not built for your release!" +echo "opensips-mongodb-module wasn't installed and you cannot use it in your script!" +exit 1 diff --git a/packaging/debian/opensips.postinst b/packaging/debian/opensips.postinst index f6d97e6016b..f2921981aec 100644 --- a/packaging/debian/opensips.postinst +++ b/packaging/debian/opensips.postinst @@ -1,6 +1,4 @@ #! /bin/sh -# -# $Id$ PKG=opensips DEFAULTS=/etc/default/opensips diff --git a/packaging/debian/rules b/packaging/debian/rules index be8890a5a73..2dcccc245df 100755 --- a/packaging/debian/rules +++ b/packaging/debian/rules @@ -345,8 +345,10 @@ override_dh_auto_build: CC="$(CC)" CFLAGS="$(CFLAGS)" $(VARS) FASTER=$(FASTER) $(MAKE) $(NJOBS) \ modules modules="$(BUILD_MODULE_PATHS)" cfg_prefix=$(INSTALL_PREFIX) \ cfg_target=$(INSTALL_PREFIX)/etc/opensips/ +ifneq ($(filter BERKELEY,$(BUILD_MODPKG_LIST)),) # generate the utils db_berkeley CC="$(CC)" CFLAGS="$(CFLAGS)" $(VARS) FASTER=$(FASTER) $(MAKE) $(NJOBS) utils include_modules="db_berkeley" +endif touch build-stamp @@ -399,10 +401,12 @@ override_dh_auto_install: ;\ done - # move binaries of opensips-berkeley-module to opensips-berkeley-bin +ifneq ($(filter BERKELEY,$(BUILD_MODPKG_LIST)),) + # move binaries of opensips-berkeley-module to opensips-iberkeley-bin mkdir -p $(CURDIR)/debian/opensips-berkeley-bin/$(BIN_PREFIX)/ mv $(CURDIR)/debian/opensips-berkeley-module/$(BIN_PREFIX)/sbin \ $(CURDIR)/debian/opensips-berkeley-bin/$(BIN_PREFIX)/ +endif override_dh_strip: dh_strip --dbg-package=opensips-dbg diff --git a/packaging/freebsd/Makefile b/packaging/freebsd/Makefile index 8859be97bcf..3ff75138eeb 100644 --- a/packaging/freebsd/Makefile +++ b/packaging/freebsd/Makefile @@ -6,7 +6,7 @@ # PORTNAME= opensips -PORTVERSION= 3.4.3 +PORTVERSION= 3.4.11 CATEGORIES= net MASTER_SITES= https://opensips.org/pub/opensips/${PORTVERSION}/ DISTNAME= ${PORTNAME}-${PORTVERSION}-tls_src diff --git a/packaging/netbsd/Makefile b/packaging/netbsd/Makefile index 59cf35f3c3f..7ffab3c4f74 100644 --- a/packaging/netbsd/Makefile +++ b/packaging/netbsd/Makefile @@ -2,15 +2,13 @@ # # $NetBSD$ # -# $Id$ -# COMMENT= "OpenSIPS" PORTNAME= opensips -PORTVERSION= 3.4.3 +PORTVERSION= 3.4.11 CATEGORIES= net -MASTER_SITES= https://opensips.org/pub/opensips/3.4.3/ +MASTER_SITES= https://opensips.org/pub/opensips/3.4.11/ MAINTAINER= bogdan@opensips.org diff --git a/packaging/netbsd/PLIST b/packaging/netbsd/PLIST index 52fbe05bcee..2197cb283a5 100644 --- a/packaging/netbsd/PLIST +++ b/packaging/netbsd/PLIST @@ -60,7 +60,6 @@ lib/opensips/modules/xlog.so lib/opensips/modules/xmpp.so share/doc/opensips/README share/doc/opensips/INSTALL -share/doc/opensips/README-MODULES share/doc/opensips/AUTHORS share/doc/opensips/NEWS share/doc/opensips/README.acc diff --git a/packaging/openbsd/Makefile b/packaging/openbsd/Makefile index 170defc74ac..b7b266eb492 100644 --- a/packaging/openbsd/Makefile +++ b/packaging/openbsd/Makefile @@ -2,15 +2,13 @@ # # $OpenBSD$ # -# $Id$ -# COMMENT= "OpenSIPS" PORTNAME= opensips -PORTVERSION= 3.4.3 +PORTVERSION= 3.4.11 CATEGORIES= net -MASTER_SITES= https://opensips.org/pub/opensips/3.4.3/ +MASTER_SITES= https://opensips.org/pub/opensips/3.4.11/ MAINTAINER= bogdan@opensips.org diff --git a/packaging/openbsd/pkg/PLIST b/packaging/openbsd/pkg/PLIST index 57d7417c5de..f38b6ce88b3 100644 --- a/packaging/openbsd/pkg/PLIST +++ b/packaging/openbsd/pkg/PLIST @@ -60,7 +60,6 @@ lib/opensips/modules/xlog.so lib/opensips/modules/xmpp.so share/doc/opensips/README share/doc/opensips/INSTALL -share/doc/opensips/README-MODULES share/doc/opensips/AUTHORS share/doc/opensips/NEWS share/doc/opensips/README.acc diff --git a/packaging/redhat_fedora/opensips.spec b/packaging/redhat_fedora/opensips.spec index 49cf604ee49..2a9e3b1616b 100644 --- a/packaging/redhat_fedora/opensips.spec +++ b/packaging/redhat_fedora/opensips.spec @@ -21,11 +21,7 @@ %global _with_cachedb_mongodb 1 %endif -%if 0%{?rhel} > 7 || 0%{?fedora} > 23 -%global _without_aaa_radius 1 -%endif - -%if 0%{?rhel} > 7 +%if 0%{?rhel} > 7 || 0%{?fedora} > 36 %global _with_python3 1 %endif @@ -41,11 +37,11 @@ %global _with_wolfssl 1 %endif -%global EXCLUDE_MODULES %{!?_with_auth_jwt:auth_jwt} %{!?_with_cachedb_cassandra:cachedb_cassandra} %{!?_with_cachedb_couchbase:cachedb_couchbase} %{!?_with_cachedb_mongodb:cachedb_mongodb} %{!?_with_cachedb_redis:cachedb_redis} %{!?_with_db_oracle:db_oracle} %{!?_with_osp:osp} %{!?_with_sngtc:sngtc} %{!?_with_aaa_diameter:aaa_diameter} %{?_without_aaa_radius:aaa_radius} %{?_without_db_perlvdb:db_perlvdb} %{?_without_snmpstats:snmpstats} %{!?_with_wolfssl:tls_wolfssl} +%global EXCLUDE_MODULES %{!?_with_auth_jwt:auth_jwt} %{!?_with_cachedb_cassandra:cachedb_cassandra} %{!?_with_cachedb_couchbase:cachedb_couchbase} %{!?_with_cachedb_mongodb:cachedb_mongodb} %{!?_with_cachedb_redis:cachedb_redis} %{!?_with_db_oracle:db_oracle} %{!?_with_osp:osp} %{!?_with_sngtc:sngtc} %{!?_with_aaa_diameter:aaa_diameter} %{?_without_db_perlvdb:db_perlvdb} %{?_without_snmpstats:snmpstats} %{!?_with_wolfssl:tls_wolfssl} Summary: Very fast and configurable SIP server Name: opensips -Version: 3.4.3 +Version: 3.4.11 Release: 1%{?dist} License: GPLv2+ Group: System Environment/Daemons @@ -88,6 +84,9 @@ BuildRequires: python3-devel %else BuildRequires: python-devel %endif +%if 0%{?fedora} > 38 +BuildRequires: python3-setuptools +%endif %if 0%{?fedora} > 16 || 0%{?rhel} > 6 BuildRequires: systemd-units %endif @@ -634,9 +633,7 @@ module to publish RabbitMQ messages to a RabbitMQ server. Summary: Radius modules for OpenSIPS Group: System Environment/Daemons Requires: %{name} = %{version}-%{release} -%if 0%{!?_without_aaa_radius:1} -BuildRequires: radiusclient-ng-devel -%endif +BuildRequires: radcli-devel %description radius-modules OpenSIPS is a very fast and flexible SIP (RFC3261) @@ -1015,9 +1012,7 @@ fi %attr(755,root,root) %{_initrddir}/opensips %endif -%if 0%{!?_without_aaa_radius:1} %config(noreplace) %{_sysconfdir}/opensips/dictionary.opensips -%endif %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %attr(640,%{name},%{name}) %config(noreplace) %{_sysconfdir}/opensips/opensips.cfg %attr(640,%{name},%{name}) %config(noreplace) %{_sysconfdir}/opensips/scenario_callcenter.xml @@ -1049,7 +1044,6 @@ fi %doc docdir/AUTHORS %doc docdir/NEWS %doc docdir/README -%doc docdir/README-MODULES %doc COPYING %{_libdir}/opensips/modules/acc.so @@ -1487,10 +1481,8 @@ fi %files radius-modules %{_libdir}/opensips/modules/peering.so %doc docdir/README.peering -%if 0%{!?_without_aaa_radius:1} %{_libdir}/opensips/modules/aaa_radius.so %doc docdir/README.aaa_radius -%endif %if 0%{?_with_cachedb_redis:1} %files redis-module @@ -1587,6 +1579,36 @@ fi %changelog +* Wed Feb 19 2025 Liviu Chircu - 3.4.11-1 +- OpenSIPS minor stable release: 3.4.11-1 + +* Wed Dec 18 2024 Liviu Chircu - 3.4.10-1 +- OpenSIPS minor stable release: 3.4.10-1 + +* Wed Oct 23 2024 Liviu Chircu - 3.4.9-1 +- OpenSIPS minor stable release: 3.4.9-1 + +* Wed Aug 21 2024 Liviu Chircu - 3.4.8-1 +- OpenSIPS minor stable release: 3.4.8-1 + +* Tue Aug 20 2024 Razvan Crainea - 3.4.7-1 +- Add python-setuptools dependency + +* Mon Aug 19 2024 Razvan Crainea - 3.4.7-1 +- Replace deprecated dependency for radius modules + +* Wed Jul 24 2024 Liviu Chircu - 3.4.7-1 +- OpenSIPS minor stable release: 3.4.7-1 + +* Wed Jun 19 2024 Liviu Chircu - 3.4.6-1 +- OpenSIPS minor stable release: 3.4.6-1 + +* Thu Apr 18 2024 Liviu Chircu - 3.4.5-1 +- OpenSIPS minor stable release: 3.4.5-1 + +* Wed Feb 21 2024 Liviu Chircu - 3.4.4-1 +- OpenSIPS minor stable release: 3.4.4-1 + * Wed Dec 20 2023 Liviu Chircu - 3.4.3-1 - OpenSIPS minor stable release: 3.4.3-1 diff --git a/packaging/solaris/base-Prototype b/packaging/solaris/base-Prototype index 462f084e478..9f3fc692283 100644 --- a/packaging/solaris/base-Prototype +++ b/packaging/solaris/base-Prototype @@ -128,7 +128,6 @@ d none /opt/opensips/man8 0755 root root f none /opt/opensips/man8/opensips.8 0644 root root f none /opt/opensips/NEWS 0644 root root f none /opt/opensips/README 0644 root root -f none /opt/opensips/README-MODULES 0644 root root f none /opt/opensips/README.acc 0644 root root f none /opt/opensips/README.alias_db 0644 root root f none /opt/opensips/README.auth 0644 root root diff --git a/packaging/solaris/base-pkginfo b/packaging/solaris/base-pkginfo index dabdba1581b..87630d49987 100644 --- a/packaging/solaris/base-pkginfo +++ b/packaging/solaris/base-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-base-dbg" NAME="Programmable SIP Server Base Install - Debugging Symbols" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="bogdan@opensips.org" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/solaris/berkeley-pkginfo b/packaging/solaris/berkeley-pkginfo index c94c4420cf0..65fddaa920d 100644 --- a/packaging/solaris/berkeley-pkginfo +++ b/packaging/solaris/berkeley-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-berkeley-dbg" NAME="Programmable SIP Server Berkeley Database Support - Debugging Symbols" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="saguti@gmail.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/solaris/carrierroute-pkginfo b/packaging/solaris/carrierroute-pkginfo index b1bcb10b3a0..c0ffae6cf6e 100644 --- a/packaging/solaris/carrierroute-pkginfo +++ b/packaging/solaris/carrierroute-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-carrierroute" NAME="Programmable SIP Server carrierroute Support" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="saguti@gmail.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/solaris/identity-pkginfo b/packaging/solaris/identity-pkginfo index dd5e7c72519..808c3f5d6ae 100644 --- a/packaging/solaris/identity-pkginfo +++ b/packaging/solaris/identity-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-identity" NAME="Programmable SIP Server Identity Module" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="saguti@gmail.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/solaris/ldap-pkginfo b/packaging/solaris/ldap-pkginfo index f32124a7472..42d0a693019 100644 --- a/packaging/solaris/ldap-pkginfo +++ b/packaging/solaris/ldap-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-ldap" NAME="Programmable SIP Server LDAP Support" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="saguti@gmail.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/solaris/mmgeoip-pkginfo b/packaging/solaris/mmgeoip-pkginfo index 2c05cd87869..92da3aa81c9 100644 --- a/packaging/solaris/mmgeoip-pkginfo +++ b/packaging/solaris/mmgeoip-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-geoip" NAME="Programmable SIP Server Address Location Support" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="saguti@gmail.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/solaris/mysql-pkginfo b/packaging/solaris/mysql-pkginfo index 0b7bd02b3c7..5d8e8fa244d 100644 --- a/packaging/solaris/mysql-pkginfo +++ b/packaging/solaris/mysql-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-mysql" NAME="Programmable SIP Server MySQL Support" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="saguti@gmail.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/solaris/perl-pkginfo b/packaging/solaris/perl-pkginfo index 5ba97341cd6..144988fa198 100644 --- a/packaging/solaris/perl-pkginfo +++ b/packaging/solaris/perl-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-perl" NAME="Programmable SIP Server PERL Support" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="saguti@gmail.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/solaris/pgsql-pkginfo b/packaging/solaris/pgsql-pkginfo index cd081572e61..9a16a530ac6 100644 --- a/packaging/solaris/pgsql-pkginfo +++ b/packaging/solaris/pgsql-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-pgsql" NAME="Programmable SIP Server PostgreSQL Support" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="saguti@gmail.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/solaris/pkginfo b/packaging/solaris/pkginfo index d7788d3f587..2fcd5470bd3 100644 --- a/packaging/solaris/pkginfo +++ b/packaging/solaris/pkginfo @@ -1,6 +1,6 @@ PKG=OpenSIPS ARCH=sparc -VERSION="3.4.3" +VERSION="3.4.11" CATEGORY=application EMAIL=bogdan@opensips.org NAME= OpenSIPS is a very fast and flexible SIP (RFC3261) server diff --git a/packaging/solaris/prototype b/packaging/solaris/prototype index b9173aca701..b5062ba2fe3 100644 --- a/packaging/solaris/prototype +++ b/packaging/solaris/prototype @@ -1,4 +1,3 @@ -# $Id$ i pkginfo=pkginfo d none etc 0755 bin bin d none etc/opensips 0755 bin bin @@ -57,7 +56,6 @@ d none doc 0755 bin bin d none doc/opensips 0755 bin bin f none doc/opensips/README 0644 bin bin f none doc/opensips/INSTALL 0644 bin bin -f none doc/opensips/README-MODULES 0644 bin bin f none doc/opensips/AUTHORS 0644 bin bin f none doc/opensips/NEWS 0644 bin bin f none doc/opensips/README.acc 0644 bin bin diff --git a/packaging/solaris/regex-pkginfo b/packaging/solaris/regex-pkginfo index 9836b3160a8..f2be90b8d40 100644 --- a/packaging/solaris/regex-pkginfo +++ b/packaging/solaris/regex-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-regex" NAME="Programmable SIP Server Regex Module" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="saguti@gmail.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/solaris/snmp-pkginfo b/packaging/solaris/snmp-pkginfo index 86a1763a37b..b94cd2c7e75 100644 --- a/packaging/solaris/snmp-pkginfo +++ b/packaging/solaris/snmp-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-snmp" NAME="Programmable SIP Server SNMP Support" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="saguti@gmail.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/solaris/tls-Prototype b/packaging/solaris/tls-Prototype index 913f383a14f..1bb79336a0f 100644 --- a/packaging/solaris/tls-Prototype +++ b/packaging/solaris/tls-Prototype @@ -146,7 +146,6 @@ f none /opt/opensips/man5/opensips.cfg.5 0644 root root d none /opt/opensips/man8 0755 root root f none /opt/opensips/man8/opensips.8 0644 root root f none /opt/opensips/NEWS 0644 root root -f none /opt/opensips/README-MODULES 0644 root root f none /opt/opensips/README.acc 0644 root root f none /opt/opensips/README.alias_db 0644 root root f none /opt/opensips/README.auth 0644 root root diff --git a/packaging/solaris/tls-pkginfo b/packaging/solaris/tls-pkginfo index 8e2f675d1ff..2cf61bd83ed 100644 --- a/packaging/solaris/tls-pkginfo +++ b/packaging/solaris/tls-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-base-TLS" NAME="Programmable SIP Server Base Install with TLS" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="saguti@gmail.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/solaris/xmlrpc-pkginfo b/packaging/solaris/xmlrpc-pkginfo index f7d08272129..c7a8530fe38 100644 --- a/packaging/solaris/xmlrpc-pkginfo +++ b/packaging/solaris/xmlrpc-pkginfo @@ -1,11 +1,11 @@ PKG="OpenSIPS-xmlrpc" NAME="Programmable SIP Server MI XMLRPC Support" -VERSION="3.4.3" +VERSION="3.4.11" ARCH="sparc" CLASSES="none" CATEGORY="utility" VENDOR="OpenSIPS Solutions" -PSTAMP="20thDec23" +PSTAMP="19thFeb25" EMAIL="saguti@gmail.com" ISTATES="S s 1 2 3" RSTATES="S s 1 2 3" diff --git a/packaging/suse/opensips.spec.SuSE b/packaging/suse/opensips.spec.SuSE index 40807976a36..c9bc2ed11dc 100644 --- a/packaging/suse/opensips.spec.SuSE +++ b/packaging/suse/opensips.spec.SuSE @@ -224,7 +224,6 @@ sbin/insserv etc/init.d/ %doc %{_docdir}/opensips/INSTALL %doc %{_docdir}/opensips/READE %doc %{_docdir}/opensips/NEWS -%doc %{_docdir}/opensips/README-MODULES %doc %{_docdir}/opensips/README.acc %doc %{_docdir}/opensips/README.alias_db %doc %{_docdir}/opensips/README.auth diff --git a/parser/msg_parser.c b/parser/msg_parser.c index 833160b29b4..a9543d659f2 100644 --- a/parser/msg_parser.c +++ b/parser/msg_parser.c @@ -44,6 +44,7 @@ #include "../ut.h" #include "../error.h" #include "../dprint.h" +#include "../data_lump.h" #include "../data_lump_rpl.h" #include "../mem/mem.h" #include "../error.h" @@ -604,46 +605,48 @@ int clone_headers(struct sip_msg *from_msg, struct sip_msg *to_msg) } /* reset all header fields before populating new ones */ + to_msg->h_via1 = NULL; to_msg->callid = NULL; to_msg->to = NULL; to_msg->cseq = NULL; to_msg->from = NULL; - to_msg->maxforwards = NULL; - to_msg->content_type = NULL; - to_msg->content_length = NULL; - to_msg->expires = NULL; - to_msg->organization = NULL; - to_msg->priority = NULL; - to_msg->subject = NULL; - to_msg->user_agent = NULL; - to_msg->content_disposition = NULL; - to_msg->rpid = NULL; - to_msg->refer_to = NULL; - to_msg->session_expires = NULL; - to_msg->min_se = NULL; - to_msg->min_expires = NULL; - to_msg->privacy = NULL; to_msg->contact = NULL; + to_msg->maxforwards = NULL; to_msg->route = NULL; to_msg->record_route = NULL; to_msg->path = NULL; + to_msg->content_type = NULL; + to_msg->content_length = NULL; to_msg->authorization = NULL; + to_msg->expires = NULL; to_msg->proxy_auth = NULL; - to_msg->proxy_require = NULL; to_msg->supported = NULL; + to_msg->proxy_require = NULL; to_msg->unsupported = NULL; to_msg->allow = NULL; to_msg->event = NULL; to_msg->accept = NULL; to_msg->accept_language = NULL; + to_msg->organization = NULL; + to_msg->priority = NULL; + to_msg->subject = NULL; + to_msg->user_agent = NULL; + to_msg->content_disposition = NULL; to_msg->accept_disposition = NULL; to_msg->diversion = NULL; + to_msg->rpid = NULL; + to_msg->refer_to = NULL; + to_msg->session_expires = NULL; + to_msg->min_se = NULL; + to_msg->ppi = NULL; + to_msg->pai = NULL; + to_msg->privacy = NULL; to_msg->call_info = NULL; to_msg->www_authenticate = NULL; to_msg->proxy_authenticate = NULL; - to_msg->ppi = NULL; - to_msg->pai = NULL; - to_msg->h_via1 = NULL; + to_msg->min_expires = NULL; + to_msg->feature_caps = NULL; + to_msg->replaces = NULL; for (i = 0, hdr = from_msg->headers; hdr; i++, hdr = hdr->next) { memcpy(&hdrs[i], hdr, sizeof(struct hdr_field)); @@ -651,48 +654,50 @@ int clone_headers(struct sip_msg *from_msg, struct sip_msg *to_msg) hdrs[i].next = &hdrs[i + 1]; hdrs[i].sibling = NULL; switch(hdr->type) { - link_hdr_case(callid, HDR_CALLID_T); - link_hdr_case(to, HDR_TO_T); - link_hdr_case(cseq, HDR_CSEQ_T); - link_hdr_case(from, HDR_FROM_T); - link_hdr_case(maxforwards, HDR_MAXFORWARDS_T); - link_hdr_case(content_type, HDR_CONTENTTYPE_T); - link_hdr_case(content_length, HDR_CONTENTLENGTH_T); - link_hdr_case(expires, HDR_EXPIRES_T); - link_hdr_case(organization, HDR_ORGANIZATION_T); - link_hdr_case(priority, HDR_PRIORITY_T); - link_hdr_case(subject, HDR_SUBJECT_T); - link_hdr_case(user_agent, HDR_USERAGENT_T); - link_hdr_case(content_disposition, HDR_CONTENTDISPOSITION_T); - link_hdr_case(rpid, HDR_RPID_T); - link_hdr_case(refer_to, HDR_REFER_TO_T); - link_hdr_case(session_expires, HDR_SESSION_EXPIRES_T); - link_hdr_case(min_se, HDR_MIN_SE_T); - link_hdr_case(min_expires, HDR_MIN_EXPIRES_T); - link_hdr_case(privacy, HDR_PRIVACY_T); + link_sibling_hdr_case(h_via1, HDR_VIA_T); + link_hdr_case (callid, HDR_CALLID_T); + link_hdr_case (to, HDR_TO_T); + link_hdr_case (cseq, HDR_CSEQ_T); + link_hdr_case (from, HDR_FROM_T); link_sibling_hdr_case(contact, HDR_CONTACT_T); + link_hdr_case (maxforwards, HDR_MAXFORWARDS_T); link_sibling_hdr_case(route, HDR_ROUTE_T); link_sibling_hdr_case(record_route, HDR_RECORDROUTE_T); link_sibling_hdr_case(path, HDR_PATH_T); + link_hdr_case (content_type, HDR_CONTENTTYPE_T); + link_hdr_case (content_length, HDR_CONTENTLENGTH_T); link_sibling_hdr_case(authorization, HDR_AUTHORIZATION_T); + link_hdr_case (expires, HDR_EXPIRES_T); link_sibling_hdr_case(proxy_auth, HDR_PROXYAUTH_T); - link_sibling_hdr_case(proxy_require, HDR_PROXYREQUIRE_T); link_sibling_hdr_case(supported, HDR_SUPPORTED_T); + link_sibling_hdr_case(proxy_require, HDR_PROXYREQUIRE_T); link_sibling_hdr_case(unsupported, HDR_UNSUPPORTED_T); link_sibling_hdr_case(allow, HDR_ALLOW_T); link_sibling_hdr_case(event, HDR_EVENT_T); link_sibling_hdr_case(accept, HDR_ACCEPT_T); link_sibling_hdr_case(accept_language, HDR_ACCEPTLANGUAGE_T); + link_hdr_case (organization, HDR_ORGANIZATION_T); + link_hdr_case (priority, HDR_PRIORITY_T); + link_hdr_case (subject, HDR_SUBJECT_T); + link_hdr_case (user_agent, HDR_USERAGENT_T); + link_hdr_case (content_disposition, HDR_CONTENTDISPOSITION_T); link_sibling_hdr_case(accept_disposition, HDR_ACCEPTDISPOSITION_T); link_sibling_hdr_case(diversion, HDR_DIVERSION_T); + link_hdr_case (rpid, HDR_RPID_T); + link_hdr_case (refer_to, HDR_REFER_TO_T); + link_hdr_case (session_expires, HDR_SESSION_EXPIRES_T); + link_hdr_case (min_se, HDR_MIN_SE_T); + link_sibling_hdr_case(ppi, HDR_PPI_T); + link_sibling_hdr_case(pai, HDR_PAI_T); + link_hdr_case (privacy, HDR_PRIVACY_T); link_sibling_hdr_case(call_info, HDR_CALL_INFO_T); link_sibling_hdr_case(www_authenticate, HDR_WWW_AUTHENTICATE_T); link_sibling_hdr_case(proxy_authenticate, HDR_PROXY_AUTHENTICATE_T); - link_sibling_hdr_case(ppi, HDR_PPI_T); - link_sibling_hdr_case(pai, HDR_PAI_T); - link_sibling_hdr_case(h_via1, HDR_VIA_T); + link_hdr_case (min_expires, HDR_MIN_EXPIRES_T); + link_sibling_hdr_case(feature_caps, HDR_FEATURE_CAPS_T); + link_hdr_case (replaces, HDR_REPLACES_T); - /* not used in sip_msg */ + /* not used in sip_msg, used in MSRP */ case HDR_TO_PATH_T: case HDR_FROM_PATH_T: case HDR_MESSAGE_ID_T: @@ -702,12 +707,22 @@ int clone_headers(struct sip_msg *from_msg, struct sip_msg *to_msg) case HDR_STATUS_T: case HDR_USE_PATH_T: + /* not having shortcut */ + case HDR_RETRY_AFTER_T: + case HDR_VIA2_T: + + /* not actual hdrs */ case HDR_OTHER_T: case HDR_ERROR_T: + case HDR_EOH_T: break; + /* we do not have a "default" on purpose, so we get + * a compile err/war where a new HDR is added and we do + * not handle it here. default: LM_ERR("unknown header type %d\n", hdr->type); break; + */ } } hdrs[i - 1].next = 0; @@ -719,7 +734,8 @@ int clone_headers(struct sip_msg *from_msg, struct sip_msg *to_msg) /* returns 0 if ok, -1 for errors */ -int parse_msg(char* buf, unsigned int len, struct sip_msg* msg) +int parse_msg_opt(char* buf, unsigned int len, struct sip_msg* msg, + int free_on_err) { char *tmp; @@ -773,7 +789,7 @@ int parse_msg(char* buf, unsigned int len, struct sip_msg* msg) } msg->unparsed=tmp; /*find first Via: */ - if (parse_headers(msg, flags, 0)==-1) goto error; + if (parse_headers(msg, flags, 0)==-1) goto parse_error; #ifdef EXTRA_DEBUG /* dump parsed data */ @@ -825,6 +841,14 @@ int parse_msg(char* buf, unsigned int len, struct sip_msg* msg) return 0; +parse_error: + if (free_on_err) { + /* Free the SIP message if it has already been created to + * prevent memory leaks */ + free_sip_msg(msg); + memset(msg, 0, sizeof(*msg)); + } + error: /* more debugging, msg->orig is/should be null terminated*/ LM_ERR("message=<%.*s>\n", (int)len, redact_pii(buf)); @@ -1429,3 +1453,15 @@ int extract_ftc_hdrs( char *buf, int len, str *from, str *to, str *cseq,str *cal } +int delete_headers(struct sip_msg *msg, struct hdr_field *hdr) +{ + for (; hdr; hdr = hdr->sibling) { + if (!del_lump(msg, hdr->name.s - msg->buf, hdr->len, hdr->type)) { + LM_ERR("failed to delete contact '%.*s'\n", hdr->name.len, + hdr->name.s); + return -1; + } + } + + return 0; +} diff --git a/parser/msg_parser.h b/parser/msg_parser.h index 0b3497424d1..0e29965b0c2 100644 --- a/parser/msg_parser.h +++ b/parser/msg_parser.h @@ -128,6 +128,9 @@ enum request_method { * one, not received */ #define FL_HAS_ROUTE_LUMP (1<<22) /* the message had Route headers added * as lumps */ +#define FL_USE_SIPTRACE_B2B (1<<23) /* used by tracer to check if the b2b + * tracing was enabled */ +#define FL_ACK_WITH_BODY (1<<24) /* ACK message has SDP body */ /* define the # of unknown URI parameters to parse */ #define URI_MAX_U_PARAMS 10 @@ -206,6 +209,9 @@ struct sip_uri { str pn_prid_val; str pn_param_val; str pn_purr_val; + /* XXX - in the future when adding params as special links + * in the list above, make sure to also update compare_uris() function + * to explicitly compare these here */ /* unknown params */ str u_name[URI_MAX_U_PARAMS]; /* Unknown param names */ @@ -357,12 +363,19 @@ struct sip_msg { extern int via_cnt; -int parse_msg(char* buf, unsigned int len, struct sip_msg* msg); +#define parse_msg( _buf, _len, _msg) \ + parse_msg_opt( _buf, _len, _msg, 1) + +int parse_msg_opt(char* buf, unsigned int len, struct sip_msg* msg, + int free_on_err); int parse_headers(struct sip_msg* msg, hdr_flags_t flags, int next); char* get_hdr_field(char* buf, char* end, struct hdr_field* hdr); +/* add DEL lumps for all headers matching the given @hdr */ +int delete_headers(struct sip_msg *msg, struct hdr_field *hdr); + void free_sip_msg(struct sip_msg* msg); int clone_headers(struct sip_msg *from_msg, struct sip_msg *to_msg); diff --git a/parser/parse_authenticate.c b/parser/parse_authenticate.c index 8d4df86b45c..6eedde960c2 100644 --- a/parser/parse_authenticate.c +++ b/parser/parse_authenticate.c @@ -332,9 +332,10 @@ int parse_authenticate_header(struct hdr_field *authenticate, { void **parsed; struct authenticate_body *auth_body, *ret_auth; - int rc; + int rc, prev_parsed; parsed = &(authenticate->parsed); + prev_parsed = (*parsed != NULL); ret_auth = NULL; while(*parsed == NULL) @@ -366,6 +367,14 @@ int parse_authenticate_header(struct hdr_field *authenticate, else break; } + if (prev_parsed) { + while (!ret_auth && authenticate) { + if (authenticate->parsed && + (md == NULL || md->matchf(authenticate->parsed, md))) + ret_auth = authenticate->parsed; + authenticate = authenticate->sibling; + } + } *picked_auth = ret_auth; return ret_auth ? 0 : -1; diff --git a/parser/parse_to.c b/parser/parse_to.c index 5691bfe3184..23476d7313f 100644 --- a/parser/parse_to.c +++ b/parser/parse_to.c @@ -904,3 +904,20 @@ int parse_to_header( struct sip_msg *msg) error: return -1; } + + +/* + * Parses the URI from a generic to_body structure + * Helper function (not specific to TO hdr) + */ +int parse_to_body_uri(struct to_body *to_b) +{ + if (to_b==NULL) + return -1; + + if (parse_uri(to_b->uri.s, to_b->uri.len, &to_b->parsed_uri) < 0) { + memset( &to_b->parsed_uri, 0, sizeof(struct sip_uri)); + return -1; + } + return 0; +} diff --git a/parser/parse_to.h b/parser/parse_to.h index 180d0976e25..db739fe24ea 100644 --- a/parser/parse_to.h +++ b/parser/parse_to.h @@ -43,7 +43,9 @@ struct to_body{ str uri; /* URI */ str display; /* Display Name */ str tag_value; /* Value of tag */ - struct sip_uri parsed_uri; /* Parsed URI */ + struct sip_uri parsed_uri; /* Parsed URI + * IMPORTANT - be sure you set it to 0 + * upon parse URI failure !!!!!! */ struct to_param *param_lst; /* Linked list of parameters */ struct to_param *last_param; /* Last parameter in the list */ struct to_body *next; /* Next body if multi-instance header */ @@ -69,4 +71,6 @@ void free_to_params(struct to_body *tb); char* parse_multi_to(char* buffer, char *end, struct to_body *to_b); +int parse_to_body_uri(struct to_body *to_b); + #endif diff --git a/parser/parse_uri.c b/parser/parse_uri.c index 89c9334d278..70a389d774e 100644 --- a/parser/parse_uri.c +++ b/parser/parse_uri.c @@ -1800,6 +1800,11 @@ int compare_uris(str *raw_uri_a,struct sip_uri* parsed_uri_a, compare_uri_val(method_val,strncasecmp); compare_uri_val(lr_val,strncasecmp); compare_uri_val(r2_val,strncasecmp); + compare_uri_val(gr_val,strncasecmp); + compare_uri_val(pn_provider_val,strncasecmp); + compare_uri_val(pn_prid_val,strncasecmp); + compare_uri_val(pn_param_val,strncasecmp); + compare_uri_val(pn_purr_val,strncasecmp); if (first.u_params_no == 0 || second.u_params_no == 0) /* one URI doesn't have other params, diff --git a/pt.c b/pt.c index c8e34e2f685..23d02380153 100644 --- a/pt.c +++ b/pt.c @@ -486,6 +486,8 @@ void dynamic_process_final_exit(void) /* if a TCP proc by chance, reset the tcp-related data */ tcp_reset_worker_slot(); + pt_become_idle(); + /* mark myself as DYNAMIC (just in case) to have an err-less termination */ pt[process_no].flags |= OSS_PROC_SELFEXIT; LM_INFO("doing self termination\n"); diff --git a/receive.c b/receive.c index bc802052d7e..3c94fd90633 100644 --- a/receive.c +++ b/receive.c @@ -152,7 +152,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info* rcv_info, msg->msg_flags=msg_flags; msg->ruri_q = Q_UNSPECIFIED; - if (parse_msg(in_buff.s,len, msg)!=0){ + if (parse_msg_opt(in_buff.s,len, msg, 0)!=0){ tmp=ip_addr2a(&(rcv_info->src_ip)); LM_ERR("Unable to parse msg received from [%s:%d]\n", tmp, rcv_info->src_port); diff --git a/route.c b/route.c index 61fbfffb546..b6f66cf1551 100644 --- a/route.c +++ b/route.c @@ -200,27 +200,30 @@ static struct script_route_ref * __ref_script_route_by_name(char *name, int l, struct script_route_ref *ref; unsigned int i; - /* first check if a reference to the route already exists */ - for( ref=sroute_refs ; ref ; ref=ref->next ) { - if (ref->type==type && ref->name.len==l - && strncmp(ref->name.s,name,l)==0) { - /* we found an already exists reference */ - ref->u.refcnt++; - LM_DBG("returning existing %p [%.*s] with idx %d, " - "ver/cnt %d\n", ref, - ref->name.len, ref->name.s, ref->idx, ref->u.refcnt); - /* note that the returned reference may point to - * no route, there is no guarantee to be a working one */ - return ref; + if (!in_shm) { + /* first check if a reference to the route already exists */ + for( ref=sroute_refs ; ref ; ref=ref->next ) { + if (ref->type==type && ref->name.len==l + && strncmp(ref->name.s,name,l)==0) { + /* we found an already exists reference */ + ref->u.refcnt++; + LM_DBG("returning existing %p [%.*s] with idx %d, " + "ver/cnt %d\n", ref, + ref->name.len, ref->name.s, ref->idx, ref->u.refcnt); + /* note that the returned reference may point to + * no route, there is no guarantee to be a working one */ + return ref; + } } + + /* no reference found, create a new one */ + ref = pkg_malloc( sizeof *ref + l + 1 ); + } else { + ref = shm_malloc( sizeof *ref + l + 1 ); } - /* no reference found, create a new one */ - ref = in_shm - ? shm_malloc( sizeof(struct script_route_ref) + l + 1 ) - : pkg_malloc( sizeof(struct script_route_ref) + l + 1 ); if (ref==NULL) { - LM_ERR("failed to pkg allocate new sroute reference\n"); + LM_ERR("failed to allocate new sroute reference\n"); return NULL; } ref->name.s = (char*)(ref+1); @@ -359,6 +362,7 @@ struct script_route_ref *dup_ref_script_route_in_shm( sizeof(struct script_route_ref) + ref->name.len + 1); if (s_ref==NULL) { LM_ERR("failed to dup script route in shm\n"); + return NULL; } else { memcpy( s_ref, ref, sizeof(struct script_route_ref) + ref->name.len + 1 ); diff --git a/scripts/build/apt_requirements.txt b/scripts/build/apt_requirements.txt index feccd6b9089..424781810e3 100644 --- a/scripts/build/apt_requirements.txt +++ b/scripts/build/apt_requirements.txt @@ -5,9 +5,7 @@ libsqlite3-dev libsctp-dev libradcli-dev libhiredis-dev -libodbc1 odbcinst -odbcinst1debian2 unixodbc unixodbc-dev libconfuse-dev diff --git a/scripts/build/apt_requirements_postupdate.sh b/scripts/build/apt_requirements_postupdate.sh new file mode 100644 index 00000000000..5829dbc7ff2 --- /dev/null +++ b/scripts/build/apt_requirements_postupdate.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# handle package naming transitions across Ubuntu 20.04 +# and GitHub-specific Ubuntu 22.04 multi-arch (e.g. i386, using 20.04 packages) + +find_debs() { + echo -n $(apt-cache --names-only search "$1" | awk '{print $1}' | grep -oE "^($2)$" | xargs) +} + +libodbc_debs=$(find_debs odbc "libodbc2|libodbcinst2|libodbc1|odbcinst1debian2") +[ -z "$libodbc_debs" ] && libodbc_debs="libodbc2 libodbcinst2" + +python_debs=$(find_debs python "python3-setuptools|python-setuptools") +[ -z "$python_debs" ] && python_debs="python3-setuptools" + +# Output: a space-separated list of packages +echo -n "$libodbc_debs $python_debs" diff --git a/scripts/build/do_build.sh b/scripts/build/do_build.sh index e7b4bed5480..15e7105a4df 100755 --- a/scripts/build/do_build.sh +++ b/scripts/build/do_build.sh @@ -7,7 +7,7 @@ set -e . $(dirname $0)/build.conf.sub EXCLUDE_MODULES="db_oracle osp sngtc cachedb_cassandra cachedb_couchbase \ - cachedb_mongodb auth_jwt event_kafka aaa_diameter libphonenumber" + cachedb_mongodb auth_jwt event_kafka aaa_diameter snmpstats libphonenumber" if [ ! -z "${EXCLUDE_MODULES_ADD}" ] then EXCLUDE_MODULES="${EXCLUDE_MODULES} ${EXCLUDE_MODULES_ADD}" diff --git a/scripts/build/install_depends.sh b/scripts/build/install_depends.sh index a27244e2e1e..7aa33ef268a 100755 --- a/scripts/build/install_depends.sh +++ b/scripts/build/install_depends.sh @@ -4,7 +4,7 @@ set -e . $(dirname $0)/dockerize.sub -PKGS="`cat "$(dirname $0)/apt_requirements.txt"`" +PKGS=$(cat "$(dirname $0)/apt_requirements.txt") . $(dirname $0)/build.conf.sub @@ -27,6 +27,8 @@ fi ${SUDO} apt-get update -y ${SUDO} apt-get -y remove libmemcached11 libpq5 ${SUDO} apt-get -y autoremove + +PKGS="$PKGS $(. "$(dirname $0)/apt_requirements_postupdate.sh")" ${SUDO} apt-get -y --allow-downgrades install ${PKGS} if [ ! -z "${POST_INSTALL_CMD}" ] diff --git a/scripts/mysql/dialog-create.sql b/scripts/mysql/dialog-create.sql index 406ebb693f8..9d48a852963 100644 --- a/scripts/mysql/dialog-create.sql +++ b/scripts/mysql/dialog-create.sql @@ -6,8 +6,8 @@ CREATE TABLE dialog ( from_tag CHAR(64) NOT NULL, to_uri CHAR(255) NOT NULL, to_tag CHAR(64) NOT NULL, - mangled_from_uri CHAR(64) DEFAULT NULL, - mangled_to_uri CHAR(64) DEFAULT NULL, + mangled_from_uri CHAR(255) DEFAULT NULL, + mangled_to_uri CHAR(255) DEFAULT NULL, caller_cseq CHAR(11) NOT NULL, callee_cseq CHAR(11) NOT NULL, caller_ping_cseq INT(11) UNSIGNED NOT NULL, diff --git a/scripts/oracle/dialog-create.sql b/scripts/oracle/dialog-create.sql index 00a0f683120..52e3c26d93c 100644 --- a/scripts/oracle/dialog-create.sql +++ b/scripts/oracle/dialog-create.sql @@ -6,8 +6,8 @@ CREATE TABLE dialog ( from_tag VARCHAR2(64), to_uri VARCHAR2(255), to_tag VARCHAR2(64), - mangled_from_uri VARCHAR2(64) DEFAULT NULL, - mangled_to_uri VARCHAR2(64) DEFAULT NULL, + mangled_from_uri VARCHAR2(255) DEFAULT NULL, + mangled_to_uri VARCHAR2(255) DEFAULT NULL, caller_cseq VARCHAR2(11), callee_cseq VARCHAR2(11), caller_ping_cseq NUMBER(10), diff --git a/scripts/postgres/dialog-create.sql b/scripts/postgres/dialog-create.sql index d2c0b4357ec..f57b37aa2cc 100644 --- a/scripts/postgres/dialog-create.sql +++ b/scripts/postgres/dialog-create.sql @@ -6,8 +6,8 @@ CREATE TABLE dialog ( from_tag VARCHAR(64) NOT NULL, to_uri VARCHAR(255) NOT NULL, to_tag VARCHAR(64) NOT NULL, - mangled_from_uri VARCHAR(64) DEFAULT NULL, - mangled_to_uri VARCHAR(64) DEFAULT NULL, + mangled_from_uri VARCHAR(255) DEFAULT NULL, + mangled_to_uri VARCHAR(255) DEFAULT NULL, caller_cseq VARCHAR(11) NOT NULL, callee_cseq VARCHAR(11) NOT NULL, caller_ping_cseq INTEGER NOT NULL, diff --git a/scripts/sqlite/dialog-create.sql b/scripts/sqlite/dialog-create.sql index 5c7a2e9f70d..33368847906 100644 --- a/scripts/sqlite/dialog-create.sql +++ b/scripts/sqlite/dialog-create.sql @@ -6,8 +6,8 @@ CREATE TABLE dialog ( from_tag CHAR(64) NOT NULL, to_uri CHAR(255) NOT NULL, to_tag CHAR(64) NOT NULL, - mangled_from_uri CHAR(64) DEFAULT NULL, - mangled_to_uri CHAR(64) DEFAULT NULL, + mangled_from_uri CHAR(255) DEFAULT NULL, + mangled_to_uri CHAR(255) DEFAULT NULL, caller_cseq CHAR(11) NOT NULL, callee_cseq CHAR(11) NOT NULL, caller_ping_cseq INTEGER NOT NULL, diff --git a/socket_info.c b/socket_info.c index 9d042d88afc..6605e210e0a 100644 --- a/socket_info.c +++ b/socket_info.c @@ -245,7 +245,6 @@ struct socket_info* grep_sock_info_ext(str* host, unsigned short port, struct socket_info** list; unsigned short c_proto; struct ip_addr* ip6; - struct ip_addr* ip4; h_len=host->len; hname=host->s; diff --git a/sr_module.c b/sr_module.c index efded7d60b5..f65743e7575 100644 --- a/sr_module.c +++ b/sr_module.c @@ -643,6 +643,7 @@ static int init_mod_child( struct sr_module* m, int rank, char *type, int init_child(int rank) { char* type; + int rc; type = 0; @@ -660,7 +661,11 @@ int init_child(int rank) type = "UNKNOWN"; } - return init_mod_child(modules, rank, type, 0); + rc = init_mod_child(modules, rank, type, 0); + ready_time = time(NULL); + ready_delay = ready_time - startup_time; + + return rc; } diff --git a/status_report.c b/status_report.c index 704ffef6594..0c110893324 100644 --- a/status_report.c +++ b/status_report.c @@ -697,6 +697,11 @@ static int _check_status(sr_group *srg, str *identifier, mi_item_t *id_item) int sr_set_core_status(int status, char *txt_s, int txt_len) { + if (status == STATE_RUNNING) { + ready_time = time(NULL); + ready_delay = ready_time - startup_time; + } + return sr_set_status( srg_core, CHAR_INT_NULL /*main*/, status, txt_s, txt_len, 0); } diff --git a/status_report.h b/status_report.h index 30cc3dbaa58..9b2e40f9fd5 100644 --- a/status_report.h +++ b/status_report.h @@ -33,7 +33,7 @@ enum sr_status { SR_STATUS_NO_DATA =- 2, SR_STATUS_LOADING_DATA = -1, SR_STATUS_NOT_READY = -1, - SR_STATUS_RESEARVED = 0, + SR_STATUS_RESERVED = 0, SR_STATUS_READY = 1, SR_STATUS_RELOADING_DATA= 2, }; diff --git a/test/test_ut.c b/test/test_ut.c index edd92eff18a..19e051fcf80 100644 --- a/test/test_ut.c +++ b/test/test_ut.c @@ -45,4 +45,37 @@ void test_ut(void) ok(_is_e164(_str("+123456789012345"), 0, 15) == 1, "test-e164-17"); ok(_is_e164(_str("+1234567890123456"), 0, 15) == -1, "test-e164-18"); ok(_is_e164(_str("123456789x12345"), 0, 15) == -1, "test-e164-19"); + + /* str_strcasestr() tests */ + { + struct { + str a; + str b; + int ok_offset; + } tests[] = { + {str_init(""), str_init(""), -1}, + {str_init(""), str_init("x"), -1}, + {str_init("x"), str_init(""), -1}, + {str_init("x"), str_init("x"), 0}, + {str_init("xy"), str_init("x"), 0}, + {str_init("yx"), str_init("x"), 1}, + {str_init("yxy"), str_init("x"), 1}, + {str_init("foo"), str_init("bar"), -1}, + {str_init("foobar"), str_init("BAR"), 3}, + {str_init("fooBaRx"), str_init("bAr"), 3}, + {str_init("fbaRx"), str_init("bar"), 1}, + {str_init("barx"), str_init("Bar"), 0}, + {str_init("Bar"), str_init("baR"), 0}, + {str_init("foo"), str_init("foobar"), -1}, + }; + int i; + + for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) { + char *p = str_strcasestr(&tests[i].a, &tests[i].b); + if (tests[i].ok_offset < 0) + ok(!p, "test-str_strcasestr-%d", i); + else + ok(p == (tests[i].a.s + tests[i].ok_offset), "test-str_strcasestr-%d", i); + } + } } diff --git a/ut.c b/ut.c index 9179f6658e7..0134b50a784 100644 --- a/ut.c +++ b/ut.c @@ -30,6 +30,7 @@ #include #include "ut.h" +unsigned int int2str_buf_index = 0; char int2str_buf[INT2STR_BUF_NO][INT2STR_MAX_LEN]; int tcp_timeout_con_get = 0; @@ -742,7 +743,7 @@ char *db_url_escape(const str *url) char *at, *slash, *scn; str upw; - if (!url) + if (!url || !url->s) return NULL; if (pkg_str_extend(&buf, url->len + 6 + 1) < 0) { diff --git a/ut.h b/ut.h index 57a718cf18d..bd241647189 100644 --- a/ut.h +++ b/ut.h @@ -272,13 +272,15 @@ static inline char* int2bstr(uint64_t l, char *s, int* len) /* INTeger-TO-STRing : convers a 64-bit integer to a string * returns a pointer to a static buffer containing l in asciiz & sets len */ #define INT2STR_BUF_NO 7 +extern unsigned int int2str_buf_index; extern char int2str_buf[INT2STR_BUF_NO][INT2STR_MAX_LEN]; +static inline unsigned int getstrbufindex(void) { + return ((int2str_buf_index++) % INT2STR_BUF_NO); +} + static inline char* int2str(uint64_t l, int* len) { - static unsigned int it = 0; - - if ((++it)==INT2STR_BUF_NO) it = 0; - return int2bstr( l, int2str_buf[it], len); + return int2bstr( l, int2str_buf[getstrbufindex()], len); } @@ -304,9 +306,9 @@ static inline char* sint2str(long l, int* len) static inline char* double2str(double d, int* len) { - static int buf; + unsigned int buf; - buf = (buf + 1) % INT2STR_BUF_NO; + buf = getstrbufindex(); *len = snprintf(int2str_buf[buf], INT2STR_MAX_LEN - 1, "%0.*lf", FLOATING_POINT_PRECISION, d); int2str_buf[buf][*len] = '\0'; @@ -1175,6 +1177,48 @@ static inline char* str_strstr(const str *stra, const str *strb) return NULL; } +/* + * search @strb in @stra ignoring case of both, return pointer to 1st occurrence + */ +static inline char* str_strcasestr(const str *stra, const str *strb) +{ + int i; + int len; + + if (stra==NULL || strb==NULL || stra->s==NULL || strb->s==NULL + || stra->len<=0 || strb->len<=0) { +#ifdef EXTRA_DEBUG + LM_DBG("bad parameters\n"); +#endif + return NULL; + } + + if (strb->len > stra->len) + return NULL; + + len=0; + while (stra->len-len >= strb->len){ + if (tolower(stra->s[len]) != tolower(strb->s[0])) { + len++; + continue; + } + + for (i=1; ilen; i++) + if (tolower(stra->s[len+i])!=tolower(strb->s[i])) { + len++; + break; + } + + if (i != strb->len) + continue; + + return stra->s+len; + } + + + return NULL; +} + /* * case-insensitive compare n chars of two str's */ diff --git a/utils/db_berkeley/Makefile b/utils/db_berkeley/Makefile index 1ee03c23d31..d27a618a372 100644 --- a/utils/db_berkeley/Makefile +++ b/utils/db_berkeley/Makefile @@ -1,4 +1,3 @@ -# $Id$ # # db_berkeley Makefile # diff --git a/utils/db_oracle/Makefile b/utils/db_oracle/Makefile index 1f1af8ed655..aeaccd7106b 100644 --- a/utils/db_oracle/Makefile +++ b/utils/db_oracle/Makefile @@ -1,4 +1,3 @@ -# $Id$ # # db_orasel Makefile # diff --git a/utils/vim/opensips.vim b/utils/vim/opensips.vim index 3596db1fa92..bfd5aba95be 100644 --- a/utils/vim/opensips.vim +++ b/utils/vim/opensips.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: OpenSIPS 2.4 script +" Language: OpenSIPS 3.4 script " Maintainer: Liviu Chircu -" Last Change: 2017 Jul 30 +" Last Change: 2024 Jun 11 " Quit when a (custom) syntax file was already loaded "if exists("b:current_syntax") @@ -21,8 +21,10 @@ syn keyword osAction loadmodule modparam async launch syn keyword specialOperand yes no true false enable disable on off NULL null syn keyword specialOperand UDP TCP TLS SCTP WS WSS HEP_TCP HEP_UDP INET inet INET6 inet6 -syn keyword osGlobalParam xlog_level log_level memdump memlog stderror_enabled syslog_enabled syslog_facility syslog_name -syn keyword osGlobalParam debug_mode udp_workers auto_aliases listen mpath tcp_workers +syn keyword osGlobalParam xlog_level log_level memdump memlog stderror_enabled syslog_enabled +syn keyword osGlobalParam xlog_print_level log_stdout syslog_facility syslog_name +syn keyword osGlobalParam restart_persistency_cache_file restart_persistency_size +syn keyword osGlobalParam debug_mode udp_workers auto_aliases socket mpath tcp_workers syn keyword osGlobalParam disable_tcp disable_tls check_via dns rev_dns syn keyword osGlobalParam tcp_send_timeout tcp_connect_timeout tcp_no_new_conn_bflag syn keyword osGlobalParam disable_dns_failover disable_dns_blacklist dst_blacklist @@ -49,6 +51,11 @@ syn keyword osGlobalParam open_files_limit mcast_loopback mcast_ttl tos syn keyword osGlobalParam max_while_loops disable_stateless_fwd db_default_url syn keyword osGlobalParam disable_503_translation import_file server_header syn keyword osGlobalParam tcp_max_msg_time abort_on_assert anycast +syn keyword osGlobalParam log_prefix tcp_parallel_read_on_workers +syn keyword osGlobalParam stderror_log_format syslog_log_format +syn keyword osGlobalParam log_json_buf_size log_msg_buf_size +syn keyword osGlobalParam log_event_enabled log_event_level_filter +syn keyword osGlobalParam shm_memlog_size " String constants syn match osSpecial contained display "\\\(x\x\+\|\o\{1,3}\|.\|$\)"