diff --git a/CMakeLists.txt b/CMakeLists.txt index 67fdbf351..dc4a5287f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.10) # Set the project name project( kamailio - VERSION 6.0.0 + VERSION 6.0.2 DESCRIPTION "Kamailio SIP Server" HOMEPAGE_URL "https://www.kamailio.org") diff --git a/ChangeLog b/ChangeLog index 74cf0f16e..a8913de9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,1255 @@ +===================== 2025-06-25 Version 6.0.2 Released ===================== + +===================== Changes Since Version 6.0.1 =========================== + +commit ab318d268404799950cb992aa4498756f88bbed3 +Author: Daniel-Constantin Mierla +Date: Wed Jun 25 08:56:30 2025 +0200 + + Makefile.defs: version set to 6.0.2 + +commit 16e04c66058386012cb975fa8e73db4c82152063 +Author: Daniel-Constantin Mierla +Date: Wed Jun 25 08:55:15 2025 +0200 + + CMakeLists.txt: version set to 6.0.2 + +commit 6c9e5413656a7f375f42fdf5fc9888398d1d2524 +Author: Daniel-Constantin Mierla +Date: Wed Jun 25 08:51:38 2025 +0200 + + pkg/kamailio/deb: set version to 6.0.2 + +commit cadf2e2248177b4e38a9f7611ddab4be455b17e1 +Author: Daniel-Constantin Mierla +Date: Wed Jun 25 08:48:31 2025 +0200 + + pkg/kamailio: version set 6.0.2 for rpms and alpine + +commit c522cff31e01abc822ae488a830f08b292f69829 +Author: Ovidiu Sas +Date: Mon Jun 23 13:48:00 2025 -0400 + + tls: fix setting cipher suites for tls verions prior to 1.3 + + (cherry picked from commit 84a29ac892d1097a8d08a4853fd2749ee039405c) + +commit 0e820635bbbf9d887e1d481f2dc0243603eb9624 +Author: Nicolas Chapleau +Date: Mon Jun 23 10:42:09 2025 +0000 + + tls: use SSL_CTX_set_ciphersuites() when using openSSL 1.1.1 + + (cherry picked from commit 6faf0470d0fab1594249e43d91000f324c5e25a7) + +commit 3c19d508ea84d8541b9eca0fc06c0c62309b34cc +Author: Daniel-Constantin Mierla +Date: Tue Jun 24 15:11:18 2025 +0200 + + secsipid: set global url pointer to null after free + + - GH #4284 + + (cherry picked from commit 15a976808f5e785a6d234734b0a7de0d735d4a5a) + +commit 6de03f80bd266ab8b2ddf018b68f3501bd0094b0 +Author: Daniel-Constantin Mierla +Date: Mon Jun 23 13:29:37 2025 +0200 + + websocket: set the field for event route execution on timer removing + + - GH #3950 + + (cherry picked from commit e77ba1cdf80b384bc55cc457d280b5fc0aef80db) + +commit cf14f3244567658bee3f226834baea424dceff32 +Author: Daniel-Constantin Mierla +Date: Mon Jun 23 13:19:44 2025 +0200 + + websocket: updated a couple of debug messages with id and hash id + + (cherry picked from commit 868240b75b9bc6a2263a31a46038d11064269000) + +commit 1c2ed9b6c1a4c82bb9fe8a98271bae3db3acee5b +Author: Sergey Safarov +Date: Sat Jun 21 21:36:44 2025 +0300 + + github: added multiarch support for rpm generation [skip ci] + + (cherry picked from commit 76b6e3b9733d0382348da1a80c3cdeecec44415e) + +commit 1f3058011f8f45f8d7ad2eb68294a9b9c6e82bcd +Author: Sergey Safarov +Date: Sat Mar 29 20:50:13 2025 +0200 + + github: generate rpm packages + + (cherry picked from commit afa2d017e3b5a1f5a776935767e485c1158be461) + +commit 3bb3b4ef8f38e944bbae94ccc51c25b3330d2faa +Author: Sergey Safarov +Date: Fri May 23 09:09:48 2025 +0300 + + pkg/kamailio: use radcli on RHEL based dist [skip ci] + + (cherry picked from commit c2fc809059e0c70aa4324f5727666989ee8aff05) + +commit b80dd57418fa1dad8a333f11f64f5a9df3e65332 +Author: Sergey Safarov +Date: Wed Jan 29 13:00:57 2025 +0200 + + pkg/kamailio: removed RHEL 6 and 7 if macros from RPM spec file + + (cherry picked from commit 701d07df14d0d66125ff0ff3adec3ce424929472) + +commit 6d0c691c379a8798822c5672d3fd515eb01f5394 +Author: Sergey Safarov +Date: Sun Jan 26 13:31:15 2025 +0200 + + pkg/kamailio: sipcapture remove + + (cherry picked from commit a7c4d4003dced50b3f6cbc7c9c6235e6bf894334) + +commit 4e221917fc18463e8a7a1a5f6db13e8da6785ed0 +Author: Victor Seva +Date: Fri Mar 28 09:59:10 2025 +0100 + + pkg/kamailio/alpine: add missing dependency for jwt module [skip ci] + + related #4132 + + (cherry picked from commit 95d0c1fc38da00dc6bbda19dba1ac4b20535abf5) + +commit 6edde7080fd5f7fb6a547f6de5c5b7c104cb493a +Author: Sergey Safarov +Date: Mon Jun 9 18:25:59 2025 +0300 + + pkg/kamailio: for dispatcher work required working DNS resolution daemon + + (cherry picked from commit aa7b2460ff0d8085ddc8ae9232a9fea0fe0db5f8) + +commit d4159f45972bad6151649d190f4e6c35c3259e5f +Author: Sergey Safarov +Date: Tue May 27 19:20:05 2025 +0300 + + pkg/kamailio: updated alpine build rules + + (cherry picked from commit 9ddd70a45168c618a3ef2356689890daee8c8415) + +commit 26bd61047c446eb509691765ad3fa60292a0b25d +Author: Sergey Safarov +Date: Tue May 27 22:23:02 2025 +0300 + + github: refactored alpine docker image generation + + - GH #4241 + + (cherry picked from commit de4e36779ec0d01e4ba749318677e29472de5b55) + Signed-off-by: Sergey Safarov + +commit 7022d9493d4db047d5fa2d67e589c05f43aec5e9 +Author: Sergey Safarov +Date: Sat Jun 21 16:40:40 2025 +0300 + + pkg/docker: submodule update + +commit a9e553746d7853e5229a54a5b54a8448374171dd +Author: Kamailio Dev +Date: Fri Jun 20 10:01:20 2025 +0200 + + modules: readme files regenerated - modules ... [skip ci] + +commit 265a2b6b7173944d38acf3e93a85ef2d50c3e68f +Author: Daniel-Constantin Mierla +Date: Fri Jun 20 09:48:11 2025 +0200 + + Revert "secfilter: add missing RPC del_wl command" + + This reverts commit 6e4100e11f49c02a9e319aa2ab269e5476fa3b9e. + +commit 7990d4bf35f7b79a74315ed775401d6311b6bf97 +Author: Daniel-Constantin Mierla +Date: Fri Jun 20 09:47:53 2025 +0200 + + Revert "secfilter: add RPC del_* commands [skip ci]" + + This reverts commit a1a65348974d7847af6637dedf31d926cd09cffd. + +commit 8926a88d9011f0ec08b8e97f085848929572d9e5 +Author: Daniel-Constantin Mierla +Date: Fri Jun 20 09:47:37 2025 +0200 + + Revert "secfilter: fix table of contents index points [skip ci]" + + This reverts commit 8ffc7f1e971e94e18facc000bf99084f69b1f400. + +commit b3555bb2e5d4ea0ffa80c5f98dd0988eb69c14e7 +Author: Daniel-Constantin Mierla +Date: Sun Jun 15 19:23:11 2025 +0200 + + core: reformat structure with core pv exports + + (cherry picked from commit 076d9549a28295392c9a8ca0ce079f2a59ed4f1e) + +commit 24e9e573eaa0e85abd4285103528d1e5272cd13c +Author: Daniel-Constantin Mierla +Date: Fri Jun 13 09:49:25 2025 +0200 + + core: tcp - log message on message processing timeout made debug + + (cherry picked from commit 2af2c80fde4e82614846af9d817ab2bffa2d954d) + +commit c31ea2270f5b3ef43bb324f63b86c1f1764fd83c +Author: Daniel-Constantin Mierla +Date: Fri Jun 13 09:26:17 2025 +0200 + + jwt: added to the notes about libjwt versions + + - module is not compatible with the new libjwt3 + + (cherry picked from commit 36c466bce5a57df72806a0915361612c32cc838e) + +commit 7a4362f646cfa029c31e7a447beac1559e40ffa0 +Author: Daniel-Constantin Mierla +Date: Thu Jun 12 17:42:14 2025 +0200 + + core: parser - count diversion header body len based on last param + + - take in consideratio quoted param values + + (cherry picked from commit f789f6a5fa4d651ad3bcb657cb2a1dc765de6460) + +commit ab88793011826693e259699ea9fe1a00bfcde443 +Author: Daniel-Constantin Mierla +Date: Thu Jun 12 16:10:01 2025 +0200 + + htable: return true for sht_setxi() + + - GH #4283 + + (cherry picked from commit 9ded810b2dfe527db8d8be409fe1f34b002f3325) + +commit 9ba402d3508034ef3111942b8f594cf91197497a +Author: Daniel-Constantin Mierla +Date: Thu Jun 12 08:15:34 2025 +0200 + + dispatcher: rework MIXSOCKPRPORT (16) matching mode + + - GH #4236 + + (cherry picked from commit 28cd81c9ad7a64ee8953ba9438756b88740b7820) + +commit b0089e25607d8724a1f5f3f0effa95ec21c5a909 +Author: Daniel-Constantin Mierla +Date: Wed Jun 11 19:56:57 2025 +0200 + + dispatcher: rename varaiable about strictest match with common prefix + + - init values + + (cherry picked from commit dfb5ef6f9d670a9ee2de223eac0a665f9e5cab71) + +commit b920a95701c4109089045d9bd9e2395976fc8af6 +Author: Daniel-Constantin Mierla +Date: Tue Jun 10 11:56:46 2025 +0200 + + core: srapi - prototype function names set back for msg env push/pop + + (cherry picked from commit ec5ab51a7ba1c2a94515b8f28c546c9d7cf58b90) + +commit 91182d61d5df9fefcb71893eaa71757217cb19c1 +Author: Daniel-Constantin Mierla +Date: Tue Jun 10 08:21:44 2025 +0200 + + core: sdp - check if space is found for extracting session version + + (cherry picked from commit cdcb570e46101703f4963863c705345c7a3420ac) + +commit 644669d61667b8bc4e484c80c12a8cd1cdc1bfbd +Author: Daniel-Constantin Mierla +Date: Mon Jun 9 08:45:31 2025 +0200 + + core: destroy the x/avp lists on msg env data pop + + (cherry picked from commit 418a1017a58e87a9fe9085f75183bcbfba3f9022) + +commit ebef3ae7185862339f6751bf4798802524c895b0 +Author: Daniel-Constantin Mierla +Date: Sun Jun 8 12:09:53 2025 +0200 + + sipdump: use the msg env data stack + + (cherry picked from commit 10c6f973b0f2334c6b2790d61efa1fc3ac282a01) + +commit 506f4fa7a8bb6768bd4f2ddf2bd419da3ac30e29 +Author: Daniel-Constantin Mierla +Date: Sun Jun 8 10:53:21 2025 +0200 + + siptrace: use the msg env data stack + + (cherry picked from commit f3a6f2ed539a4a0f287ba0bfee89bd44d2f1a781) + +commit fd054f531e400653a1f13f3379257b7e89de8bf9 +Author: Daniel-Constantin Mierla +Date: Sun Jun 8 10:52:24 2025 +0200 + + core: keep a stack of msg env data + + - GH #4258 + + (cherry picked from commit c10c1d7f0214105c01a300b4a69c58219e4c970a) + +commit 0e9f67faef8408befffa3bf39580efc7c8233870 +Author: Sergey Safarov +Date: Fri May 9 16:30:44 2025 +0300 + + core: tcp_send_timeout applied for outbound connections + + (cherry picked from commit 9105398413b4f9fab410482d9ebf5d82b6c3fb0a) + +commit fa614b1cb8c638292e399fe4350b212619b10a1e +Author: Benjamin Tietz +Date: Tue May 27 15:56:40 2025 +0200 + + tls: add WSS to RPC funtions + - tls_list() add PROTO_WSS to TLS_LIST RPC call to include WSS connections in tls.list + + - tls_kill() add PROTO_WSS to handle WSS connections + + Co-authored-by: Andreas Tarp + (cherry picked from commit 9581e5b332bff8e61ed65c6ddd340a472cb1d93c) + +commit 39685ace68f52a0b5e96dc9b6e42479915efe151 +Author: Daniel-Constantin Mierla +Date: Fri Jun 6 10:15:02 2025 +0200 + + dialog: use defined tockens for is_set field of local cseq structure for keepalives + + (cherry picked from commit 2492b92e49cfcd5f6828007b6a289b3f881dba69) + +commit 082a07138b7b920cfda8ce52b4b611dbbf680afc +Author: Daniel-Constantin Mierla +Date: Fri Jun 6 10:08:12 2025 +0200 + + tm: add defines for dlg cseq is_self field + + - DLG_SEQ_VALINIT (should be initialized), DLG_SEQ_VALSET (is set, but + can be updated for requests within dialog), DLG_SEQ_VALNEW (is set, + and ready to be used as new cseq number in generated request) + + (cherry picked from commit 73c8316bf89703156f241886554919339ac270d0) + +commit e5d101f2385b20b98cb7f2e27a8c8ac1aadc6505 +Author: Daniel-Constantin Mierla +Date: Tue Jun 3 22:27:14 2025 +0200 + + core: print default path to runtime dir on internals output + + (cherry picked from commit 730d6872054cb6218684d5e48af341c7c2749233) + +commit 980975e95219da00acdbde91343ff8cdfec1522b +Author: Daniel-Constantin Mierla +Date: Mon Jun 2 07:50:17 2025 +0200 + + userblocklist: docs - small typo + + (cherry picked from commit 81357b548b6e0cdf464361c2b1742d797f0d7e95) + +commit 14664939b8e7c054ac73af228a57b948227d06ba +Author: Daniel-Constantin Mierla +Date: Mon Jun 2 23:33:01 2025 +0200 + + siptrace: reset x/avp lists after event route + + (cherry picked from commit 0195e86084ffbe5333310fc4206f4a6d01662a85) + +commit ff735b36117c13608d45c80749372e0a14fe75d0 +Author: Daniel-Constantin Mierla +Date: Fri May 30 12:23:19 2025 +0200 + + siptrace: reset x/avp lists after event route + + - GH #4258 + + (cherry picked from commit 5ee87b7905d931931dece44ec591d8e6bcf567e2) + +commit ffe19fc22151f63c310f71650a50c35e9c1a32b4 +Author: Daniel-Constantin Mierla +Date: Fri May 30 12:07:46 2025 +0200 + + core: implement pop of lists from msg env + + (cherry picked from commit 465fda0f790e44e5484b2ef41363fb23fece3f41) + +commit 0f9266684005a3c4f4748d72b8e8d54d4912361e +Author: Daniel-Constantin Mierla +Date: Thu May 29 20:53:04 2025 +0200 + + jansson: docs - added missing semicolon in the example + + (cherry picked from commit 7fed8f52391aaef43d5cb672f4821d50d4855830) + +commit d39f318b36cd468826887289651f87df02155b62 +Author: Daniel-Constantin Mierla +Date: Wed May 28 21:28:05 2025 +0200 + + core: helper functions to get/set msg env lists + + (cherry picked from commit 54a330bb707fb6b4943ba26356891696681a02e7) + +commit ac74e0fae054e264fe8d64063fef477b85262e0f +Author: Daniel-Constantin Mierla +Date: Tue May 27 21:40:26 2025 +0200 + + ims_ipsec_pcscf: jump to error for clean up + + (cherry picked from commit f0291728b7fb623faf1d4de0f3152e782a6782ae) + +commit 36004e22f8a61becf75cb6b8e424190f05e73b7a +Author: Daniel-Constantin Mierla +Date: Mon May 26 18:59:14 2025 +0200 + + pv_headers: set value after checking if src is set + + (cherry picked from commit 25daa0445ebc611cda3e47fd34aefc74494550d7) + +commit b00a05bf7b0483d16b722b41e2407201cd04619b +Author: Daniel-Constantin Mierla +Date: Sat May 24 17:24:47 2025 +0200 + + dialog: check for message struct before accessing the fields + + - for build_dlg_t_early() + + (cherry picked from commit 5c38b53b902949fa48c3bc60288514cd7c555d5b) + +commit 761770e87b8f27bd8aa5dd46c23fa6dde3470749 +Author: Daniel-Constantin Mierla +Date: Fri May 23 13:16:53 2025 +0200 + + pua_dialoginfo.c: fix condition for refresh_pubruri_avps_flag + + (cherry picked from commit 46548193144c0b8ab0bf2e3ecdfd7feb79bc3b2f) + +commit 7fa5f5d94d81b7517b71963c4de475fa6753aa1e +Author: Daniel-Constantin Mierla +Date: Thu May 22 16:58:57 2025 +0200 + + carrierroute: check pointer and length for str value + + (cherry picked from commit 423f46e6a68e241ef03f59f863ecf6dee92c07db) + +commit 6974217dfd37a0097b4e27e2cb699296fa0a16c8 +Author: Daniel-Constantin Mierla +Date: Thu May 15 22:49:07 2025 +0200 + + tls: removed unnecessary code + + (cherry picked from commit 73dc08affb9d0a7a3f9ab83c24e01bada8958b2d) + +commit 656256019c08727c352d62f35303c5f3e4dec358 +Author: Daniel-Constantin Mierla +Date: Wed May 14 07:39:32 2025 +0200 + + pv_headers: compare the pvh_set_xavi() result with NULL + + (cherry picked from commit 87cfa9f3c5ae337dceb78654beb6fe4b00587993) + +commit 3884d9d3661ca17d5eeb8f731bdff6696c982bd6 +Author: Henning Westerholt +Date: Sat May 10 11:07:56 2025 +0000 + + dialog: add missing documentation for optional limit parameter for list_match + + (cherry picked from commit c66d9f7298aa1d76d1905b3388e3e55023baa5ae) + +commit 877ed19b937aafc4fcdcb39f3dd07feedd0e9832 +Author: FelipeCuadra +Date: Fri Apr 4 10:22:27 2025 +0200 + + stirshaken: removed repeated x509 certification path check + + - removed a second check of the x509 certificate path from the module, since it is already done earlier in the library and updated documentation + + (cherry picked from commit f007736ba18f5cc2114ffdd1e6df2b9b03808fe7) + +commit c941b9aa680618b5a72e8adf1e5e77f61de2b2a4 +Author: Xenofon Karamanos +Date: Tue Apr 29 12:17:44 2025 +0000 + + cdp: docs: Add missing list_peers function + + - Fix some typos + - Remove unused section 7.2 + + (cherry picked from commit 11275ccb94cdddfec49191eaf80b2bc2f083c284) + +commit ff2a85e9021bb1991156ad0ad912d7ad93fef9f7 +Author: Xenofon Karamanos +Date: Tue Apr 29 12:18:23 2025 +0000 + + cdp: Cast time_t and use 'L' (long long) identifier in rpc function. + + (cherry picked from commit 4e94572059d46b6bdd6726abfd52cb59793f5b03) + +commit c8952f7e75b022d6319fd57acbc905c548d100fd +Author: Xenofon Karamanos +Date: Tue Apr 29 14:58:00 2025 +0000 + + core: docs - Update type identifiers that can be used in the RPC API + + - format as well + + (cherry picked from commit 9a8ab3199488f02bd01e39bb6e13ef192321b37c) + +commit 9828b565e8646ab5ecebc128efb08a05a370351d +Author: S-P Chan +Date: Tue May 6 06:21:51 2025 +0800 + + core: sdp - update start pointer only after len adjustment + + - len is adjusted first by the amount of chars consumed so far + - start pointer is adjusted to start new search + + (cherry picked from commit c9fbf6f46898dbb2a8413a1c9d824a56241f2288) + +commit e85f97cee22fcc234c1918687ff38b6b16626735 +Author: Daniel-Constantin Mierla +Date: Fri May 2 08:58:32 2025 +0200 + + drouting: rework expression to prevent value overflow + + (cherry picked from commit eee4431447789b2fc614144064dd61b97570e8bf) + +commit ce23c88d710d38c785a328949695b8caac9a92ed +Author: Daniel-Constantin Mierla +Date: Thu May 1 20:53:56 2025 +0200 + + pv_headers: proper pointer comparison for returned value + + (cherry picked from commit c2f36a2c4f83b0ea077722ae6cc2fcecfb3616c1) + +commit 8ffc7f1e971e94e18facc000bf99084f69b1f400 +Author: pepelux +Date: Wed Apr 30 22:49:54 2025 +0200 + + secfilter: fix table of contents index points [skip ci] + + (cherry picked from commit 4ade5f53c1f7f6eb7357b0561b67928e39a91b9f) + +commit a1a65348974d7847af6637dedf31d926cd09cffd +Author: Victor Seva +Date: Wed Apr 30 15:51:10 2025 +0200 + + secfilter: add RPC del_* commands [skip ci] + + Related #4089 + + (cherry picked from commit e87326297a30f2adeaa4936da4e1e30fa5a81dc8) + +commit 6e4100e11f49c02a9e319aa2ab269e5476fa3b9e +Author: Victor Seva +Date: Wed Apr 30 15:41:39 2025 +0200 + + secfilter: add missing RPC del_wl command + + Related #4089 + + (cherry picked from commit dca075fec723fa9d1d64997d6d5c0a992780c83c) + +commit 4c96282bdf3445d4fc8f4bbeac7ebdc4a4b6e526 +Author: Daniel-Constantin Mierla +Date: Tue Apr 29 11:48:22 2025 +0200 + + core: utils/tmrec - reworked bymonth matching for negative indexes + + - GH #4214 + + (cherry picked from commit 2081b3aac394223b68b849fbac2a9e5ac4392334) + +commit 2f05a38a11a80fe2f2617e8c219cc60dfb399273 +Author: Daniel-Constantin Mierla +Date: Tue Apr 29 09:21:37 2025 +0200 + + core: utils/tmrec - decrement month for bymonth matching + + - struct tm uses 0-11, comparing with 1-12 in the date format + - GH #4214 + + (cherry picked from commit 8f1a8c50ff230a1fffdd6b376f172cabe9fe60e3) + +commit cafa2e0d74ae6ca1a27ee6aa604ddfa0f9c7afa6 +Author: Daniel-Constantin Mierla +Date: Mon Apr 28 11:15:58 2025 +0200 + + smsops: use global buffer for getting pv sms body + + (cherry picked from commit 4a20f89185d82515e1ac55f8cf12eec332723fc0) + +commit 7e2ed561c12c172d9f3d6ce1c7f13d44752eac40 +Author: Daniel-Constantin Mierla +Date: Sun Apr 27 21:05:37 2025 +0200 + + lib/ims: free before return on not finding the token + + (cherry picked from commit e0adeaa22ec64444773d75b0ef04fce19b44ef2b) + +commit 5a9526f03b23bcc86f3983c5135e1c6d523ede8c +Author: Daniel-Constantin Mierla +Date: Sat Apr 26 16:24:20 2025 +0200 + + lost: clean allocated memory also for length 0 + + (cherry picked from commit c8217350f44a9ab897e3acdffbce1eb2a57fe1a2) + +commit 0bddbd8c1525d73ad990d5cf97f332f91b626057 +Author: Paul Donald +Date: Fri Apr 25 10:52:45 2025 +0200 + + lib/srdb1: spell fixes + + - mainly setup(n) <-> set(v) up distinction + + (cherry picked from commit eefee7f917795bd4e6ffd049fbdfc0ebd166ab96) + +commit 0b87a5492792741f6f9d2d3d95713c67bf0b751e +Author: Paul Donald +Date: Fri Apr 25 10:51:53 2025 +0200 + + pkg/kamailio/deb: spell fixes + + - mainly setup(n) <-> set(v) up distinction + + (cherry picked from commit cb55765834b24da779d381531d1bc70c56deee3f) + +commit c01d4339ae199a5cbfb7c579d013f148dc6e3c48 +Author: Daniel-Constantin Mierla +Date: Fri Apr 25 10:50:04 2025 +0200 + + core: spell fixes + + - mainly setup(n) <-> set(v) up distinction + + (cherry picked from commit 7dbb45a1a8d4a98f439054ace33f041f1758bd96) + +commit 99ac7b807fb6aad46087897b89da7d2c413e7daa +Author: Paul Donald +Date: Fri Apr 25 10:48:41 2025 +0200 + + doc: spell fixes + + - mainly setup(n) <-> set(v) up distinction + + (cherry picked from commit c876f3f753cd48184bc1f11d6354a66cd7e6ccd3) + +commit d53bb2348099619669d080511d8c2b9c22efed33 +Author: Paul Donald +Date: Fri Apr 25 10:48:01 2025 +0200 + + kamctl: spell fixes + + (cherry picked from commit 92917b5d3e69798ddb64c8cc40d3c4aa77f9659c) + +commit 9f09bb8b029f6f64dba64ed7b81d1e9d4fa71f41 +Author: Paul Donald +Date: Fri Apr 25 10:47:21 2025 +0200 + + kamdbclt: version set to 6.0.0 + + - spell fix + + (cherry picked from commit 607d713acfaadbb3b60ec1ba25c6eec101810c95) + +commit a4c3c463d5658f91012a9ecb55eb8343395d0622 +Author: Paul Donald +Date: Fri Apr 25 10:46:44 2025 +0200 + + kamctl: version set to 6.0.0 + + (cherry picked from commit d54641a86656b782e3c8901c1c3ba6556248a4f5) + +commit a18ea51273139bbc14efafe899aecfceafa0c9d4 +Author: Daniel-Constantin Mierla +Date: Fri Apr 25 08:57:08 2025 +0200 + + misc/examples/ims/pcscf: location renamed to pcscf_location + + - GH #4177 + - table has different name to avoid conflict with usrloc + - pre-commit whitespaces fixes + + (cherry picked from commit dc269b336c863940514e538bc71a0ef3eb5961ff) + +commit 17f763a892e62387d945dd3c94a9189d5a480963 +Author: Daniel-Constantin Mierla +Date: Thu Apr 24 20:51:21 2025 +0200 + + sca: free in case of parse headers error + + (cherry picked from commit 6d658fe6c1af84368d093942356cf2b116ff17e5) + +commit 705aa5bdb4e1412b8ee5c7a54031dd096c671925 +Author: Daniel-Constantin Mierla +Date: Wed Apr 23 21:04:08 2025 +0200 + + jsonrpcs: reworked closing tcp socket + + (cherry picked from commit d965b9242b313cb19f75baac12786d202a9987eb) + +commit 6da6f0e25a902ad89ea293b7fddd8cc11c3c16e6 +Author: Daniel-Constantin Mierla +Date: Tue Apr 22 22:15:45 2025 +0200 + + ims_isc: free allocated route in case of error + + (cherry picked from commit 76a72a0092272d0f0ca7cf3df22ad6d05a79e782) + +commit 544866d63dcca50e47233ab878112f1d34b3d49d +Author: Daniel-Constantin Mierla +Date: Mon Apr 21 08:24:18 2025 +0200 + + cdp: free in case of errors inside load_certificates() + + (cherry picked from commit 47aa53ebd55eba4b36c38329f8619d9f7d20c076) + +commit 0b39a7359b8d7470168279e4ad1dd21d0c366087 +Author: Daniel-Constantin Mierla +Date: Sun Apr 20 09:15:59 2025 +0200 + + prefix_route: more debug messages + + - GH #4218 + + (cherry picked from commit 5aee159c2881aff29a2973073e1dd6c5c61bfdb9) + +commit 58a7e25ffcbca6b681c3d581e8322ceebc2efc26 +Author: Daniel-Constantin Mierla +Date: Sat Apr 19 09:25:19 2025 +0200 + + cfgutils: kemi export try/un/lock_key2() functions + + - different kemi functions cannot be exported with same name, even if + they have different number of parameters + - GH #4216 + + (cherry picked from commit 204839ec9aeb0f31425732dd0a2e8e256481dae5) + +commit 7c3475af29df1e5a7f2fe25a84d7450264e51e98 +Author: Daniel-Constantin Mierla +Date: Fri Apr 18 09:21:17 2025 +0200 + + core: use ULL constant to induce value size + + (cherry picked from commit cb915a518106c49c2d71308396feee9ba5149e39) + +commit 2ee3ce3efac5dd600cb74a427a63a3faf1791048 +Author: Daniel-Constantin Mierla +Date: Thu Apr 17 09:39:15 2025 +0200 + + textops: simplify return code when removing via param + + (cherry picked from commit e9c519ad4d49b8c74069577edb84ce02a5e63ee0) + +commit 039c877b8846043db9cef6a8024e68d25369cbc7 +Author: Daniel-Constantin Mierla +Date: Wed Apr 16 08:31:10 2025 +0200 + + microhttpd: warning on failing to add content-type + + (cherry picked from commit 2b331d95ae62eb0000a289e1bdb668ee7bc572cb) + +commit 304ac169061d785e098b03bf3c49809d75b4300e +Author: Daniel-Constantin Mierla +Date: Mon Apr 14 21:19:08 2025 +0200 + + nat_traversal: check result for searching port in contact uri + + (cherry picked from commit 91e9cba3d4e22851275167510b6d8a71bd9e11a1) + +commit b4030094f1dedcc7977ab49be66fbea031e47f0d +Author: Daniel-Constantin Mierla +Date: Sun Apr 13 22:22:21 2025 +0200 + + lost: simplify freeing local variables on error + + - the helper function has conditions inside + + (cherry picked from commit 9f24f1109d6d491750c6feb19a9a6d0bcb674f90) + +commit d8ffd03c81833ec33c532c79ef57b92c4975855c +Author: Daniel-Constantin Mierla +Date: Sat Apr 12 17:24:11 2025 +0200 + + lost: simplified lost_free_string() + + - removed unnecessary memset() for lost_copy_string() + + (cherry picked from commit 28efc7610d08ee0177b8b252316ba53686bf83bf) + +commit 9b6fa2f9ee13b64edf90ab0e823397555d260ae3 +Author: Daniel-Constantin Mierla +Date: Sat Apr 12 17:18:23 2025 +0200 + + lost: keep pointer to original geo value + + - triming can lose the start pointer and free is going to fail + - init more local variables + + (cherry picked from commit f390a654ee9d2c2059669e0209926096c978ff11) + +commit a8d291951b225415538d07208b8fb08ef48fc195 +Author: Daniel-Constantin Mierla +Date: Sat Apr 12 16:43:30 2025 +0200 + + lost: condition only on str pointer to free it + + - cover empty strings + + (cherry picked from commit 6b1008610861be62bd1b5f419f2cdd9bd2b23ffc) + +commit 8bde7892f40349beb10953da23f0737fc92b618c +Author: Daniel-Constantin Mierla +Date: Sat Apr 12 10:10:20 2025 +0200 + + microhttpd: return on malloc failure + + (cherry picked from commit cdf0eda22f91f0d237e0ae0a9fc3ad292934fae1) + +commit 4262016921e015153bfb61d47d33e993b9f24b64 +Author: ngash +Date: Thu Apr 10 19:19:44 2025 +0100 + + uac: fix memory corruption from shared tp being freed by another transaction + + - Shared memory corruption resulting in multiple process core dumps. Triggered by an outbound REGISTER receiving 401 for all requests which resulted in the shared tp being released in uac_resend_tm_callback whilst the current transaction was put on timer and also used after release and then re-released. In order to avoid sharing the tp I changed the code in uac_send_tm_callback to clone the existing tp. Also added a sanity check for null as tp could be released prior to a dereference of tp->event + + (cherry picked from commit d529b511b1ce722ceccf29dc006e92d45f1f340e) + +commit 5fd7f980d6cbcc21b669d445887e768338b13aa6 +Author: Xenofon Karamanos +Date: Mon Apr 7 15:26:17 2025 +0000 + + tm: Update docs of fr_timer to match the implementation + + - Use description found in https://sip-router.org/wiki/ref_manual/timers + + (cherry picked from commit 1195252256858dc4419c179e5b72541018f5feab) + +commit 9f8f0ebdd69de961a8e67245067a81df64ed715c +Author: Daniel-Constantin Mierla +Date: Mon Apr 7 13:18:02 2025 +0200 + + snmpstats: mibs/KAMAILIO-MIB relocated DEFVAL after DESCRIPTION + + - follow better the definition specs + - some tools complain otherwise + + (cherry picked from commit eff0a5d9b39b371c2fdea0378a1f52002cba1e7f) + +commit c99eba2aa980b2c9a2769a6ddc6e16831d3e8ecd +Author: Mathias Schneuwly +Date: Tue Mar 11 15:10:21 2025 +0000 + + core: Include parameter skip_record in dns_cache_print_entry + + Extend the return value of dns_cache_print_entry with + the parameter `rr_skip_record` for NAPTR records. The parameter + `rr_skip_record` indicates, whether the NAPTR record is skipped + due to issues reaching the destinations. Once a NAPTR record is + marked as skipped, it will no longer be used. + + Reported by schneuwlym #4174 + + (cherry picked from commit 1f4e6795502626865d10c83b3880e2985eb94787) + +commit c0e60449ae0d35fd9e753d0da92c98c03e2a4494 +Author: Xenofon Karamanos +Date: Wed Jun 18 07:41:34 2025 +0000 + + dlgs: Fix spelling mistake + + (cherry picked from commit 994d4dfa9cd284f63092543400a5ed82b746a758) + +commit 0637ca7e0b7795c33ab9f230c0eee65d6ea80e8d +Author: Xenofon Karamanos +Date: Mon Jun 16 14:32:39 2025 +0000 + + tmx: Update to use new tm FLAG for CANCEL + + (cherry picked from commit caad49279e6db7e85e3f2b84276f9defb0aa4eef) + +commit c3160efc9b4af01d8e2997fdc6cb168838f76ba9 +Author: Xenofon Karamanos +Date: Mon Jun 16 14:32:27 2025 +0000 + + rtp_media_server: Update to use new tm FLAG for CANCEL + + (cherry picked from commit fc5f804ad92593f74110a9392d63384e04fed218) + +commit 5d82b77ad9852d8d584edef97ec11e16879a1fd6 +Author: Xenofon Karamanos +Date: Mon Jun 16 14:32:10 2025 +0000 + + dialog: Update to use new tm FLAG for CANCEL + + (cherry picked from commit 9740f5ea7ee0b9827cf3e113bc1c458f72b8cbf7) + +commit 835a3b60607db381b3941b308f00c0469fcaf021 +Author: Xenofon Karamanos +Date: Mon Jun 16 14:20:02 2025 +0000 + + tm: Generate local_request for CANCEL only if locally initiated + + - Introduce new flag F_CANCEL_LOCAL + + (cherry picked from commit 49ffcebdf6cbf8ce2e4e2e55d9197b906f74ff95) + +commit 7bbf2cc6f2ee947c33d1b6a2495ba210f43b663c +Author: Torrey Searle +Date: Tue Jun 10 14:41:26 2025 +0200 + + tm: fix compile warning in uac.c + + fix compile warning introduced by #4250 + +commit c020f76b231d554545e14ed1f4e543b942ea769b +Author: tsearle +Date: Tue Jun 10 13:05:06 2025 +0200 + + tm: invoke tm:local-request on generated ACK messages (#4250) + +commit 53f721cf7169e163ceab5113ca3296683b88921e +Author: Xenofon Karamanos +Date: Wed May 21 12:25:04 2025 +0000 + + rtpengine: Add check for skipping pings on manually disabled nodes. + + - Add debug log when trying to ping a node. + + (cherry picked from commit 3202dc9d8e26620fe642e474e5cf8632ab6bc3a7) + +commit a37a57c2b4db73b4963d3af5e733ea8fe5c5833d +Author: Daniel-Constantin Mierla +Date: Thu Jun 5 13:07:59 2025 +0200 + + dialog: bump cseq for generated byes also for caller side + + - do it always, they are the last requests within dialog + + (cherry picked from commit 43e64af9bade5fedf34e847f662b97ce94c041bc) + +commit b293f20620c3396130f6409ddf30b69499bb482f +Author: Daniel-Constantin Mierla +Date: Thu Jun 5 11:32:04 2025 +0200 + + dialog: set cseq is_set for keepalive + + (cherry picked from commit b5d4c20172bdcaf0e63b15b4e23d205125398a42) + +commit 21c944e4a8c04d6f1a4c66897021e01a5ea6f22b +Author: Daniel-Constantin Mierla +Date: Mon May 5 16:48:21 2025 +0200 + + core: sdp - removed invalid condition + + - introduced in commit 3198b66 + - GH #4229 + + (cherry picked from commit 444fef809c21b250402cfdbd48de65926ac6286a) + +commit 14de4b1101f62c3463e5f05836e8618a3b0db96b +Author: Victor Seva +Date: Thu May 22 09:04:51 2025 +0200 + + sca: reserve subscription.rr.s separately since it could be updated + + (cherry picked from commit fd04bcc152dd6ef88fbb819b0b77aee7ca817878) + +commit e3b1220b375b48f16ae361cfe592e8c1bd8e7649 +Author: Torrey Searle +Date: Wed May 7 10:44:57 2025 +0200 + + rtpengine: improve compatibility of rtpengine per call leg stats parsing + + not all versions of rtpengine sends a key SSRC per stream. For those that do not + the same information can be found in ingress SSRCs. Add logic to check for the + SSRC value there if the SSRC key is not present. + + (cherry picked from commit 992ee3df02148a940c255b8be7eb9d8e63465834) + +commit be2fae4075fc23582356e416e1bdbb475d837eda +Author: Kamailio Dev +Date: Tue Apr 22 02:01:20 2025 +0200 + + modules: readme files regenerated - modules ... [skip ci] + +commit 265e0f78bd0ecf34c0356ad4ffe8a9d9cf4a9594 +Author: S-P Chan +Date: Thu Apr 17 09:15:49 2025 +0800 + + app_python3s: update docs for threads_mode parameter + + (cherry picked from commit fcedbd7099a15e09d1dd21c933f3ebfe3c55f5c5) + +commit 5406da9cf265f6dc80beeb9bea642bf8dd87be32 +Author: S-P Chan +Date: Thu Apr 17 09:15:37 2025 +0800 + + app_python3: update docs for threads_mode parameter + + (cherry picked from commit 168d289ebd6daadf58199f4461ef7cd30dc7442a) + +commit 9e8e6efc812795498d6d540c9f4afcae30965e35 +Author: S-P Chan +Date: Wed Apr 16 12:56:44 2025 +0800 + + app_python3s: fix threads_mode = 1 + + - fixes gh #4153 + - commit 62b4ee4: incorrect use of thread-local storage + to save python thread state + + (cherry picked from commit 779cb229ba9a693ac241f4b359c596c0ed46bb7b) + +commit 24b095d86ae3288dac2e703dc865f9b43a7c40c6 +Author: S-P Chan +Date: Wed Apr 16 12:51:12 2025 +0800 + + app_python3: fix threads_mode = 1 + + - fixes gh #4153 + - commit 0ffe157: incorrect use of thread-local storage + to save python thread state + + (cherry picked from commit 9c746b26bf7ecb4922f445318de7756d21e0d041) + +commit 0f5d7744976cabdd1ddac0371fadaf22ee19c636 +Author: Kamailio Dev +Date: Fri Apr 11 15:01:17 2025 +0200 + + modules: readme files regenerated - modules ... [skip ci] + +commit a68d952de5d6a5d91202176877730d53f9c2c580 +Author: Lyubomir Yatanski +Date: Thu Mar 6 14:56:20 2025 +0200 + + ims_registrar_scscf: fix reg_fetch_contacts call + + The implementation of reg_fetch_contacts was hard-coded to empty result. + The fix: + - adds iteration over contacts and + - adds impi to the ulc variable + - improve documentation + in the documentation $ulc variable is referred with misleading name + cleanup the $imssulc mentions to avoid confusion + + (cherry picked from commit 9caf655c51d5a846fa944bb866e3abadeb8b799c) + +commit 91cc4a6af20911e96ccc8d88edd1c43c636b3ee2 +Author: Daniel-Constantin Mierla +Date: Wed Apr 9 08:28:22 2025 +0200 + + tm: debug message instead of error log + + (cherry picked from commit d5cbcfad6e4227b198c90a57ed9a9d7883e7d911) + +commit bc5e32c9ba1a4da6cd9dd85098f3576d2c0dc4bc +Author: Daniel-Constantin Mierla +Date: Tue Apr 8 17:33:14 2025 +0200 + + tm: mode details in log message + + (cherry picked from commit 9788fe9d2241fb85e6d78578689d6694161bc5a1) + +commit d3d62bde97a86faa7dd1189bf10b697f28d84a63 +Author: Daniel-Constantin Mierla +Date: Tue Apr 1 19:38:01 2025 +0200 + + parser/sdp: check if value is exceeded when looking for o= version field + + (cherry picked from commit c532a67db654efb21f81e058b7e3a86229766a40) + +commit 0b48c889623a19ed223c252ada049cabebee45f2 +Author: Daniel-Constantin Mierla +Date: Fri Mar 28 08:15:13 2025 +0100 + + core: allow route(...) usage inside onsend_route block + + - GH #4130 + + (cherry picked from commit 6343713bcc91a499c772fc6f548597693f220c35) + +commit 70a26690c00c18086dad440abe64268e7270802b +Author: Daniel-Constantin Mierla +Date: Tue Mar 25 18:37:44 2025 +0100 + + uid_domain: rename internal is_local() to avoid duplicates + + (cherry picked from commit 7cc9a1979a2594f4b19d6750cffb2795b3274ede) + +commit 202e8bd38692ec8ed97c218fd0517d9655dcb7df +Author: Boris Korzun +Date: Wed Mar 5 23:37:12 2025 +0300 + + sipt: KEMI support + + - GH #3264 + + (cherry picked from commit 522fa2fabe1d4ec8fe53a25b2af95cbf8031cbad) + +commit a0c724ff720d71fd9e6c5d5988c3cd59e76bc8ab +Author: Federico Cabiddu +Date: Wed Apr 9 07:45:35 2025 +0200 + + dlgs: fix dlgs_rpc_briefing + + (cherry picked from commit b856d90b1e63308f23c4510edecc1159d41bfa4e) + +commit 5d740aa865561a9b7d36fd43647fbc4c4b76cfc1 +Author: Kamailio Dev +Date: Tue Apr 8 14:31:21 2025 +0200 + + modules: readme files regenerated - modules ... [skip ci] + +commit 6c55de3be8ff537dc2d3ba0169b26917c5765094 +Author: Henning Westerholt +Date: Tue Apr 8 12:29:29 2025 +0000 + + cdp: document library dependencies + + (cherry picked from commit 72579affd6751c096a7f6457b5f0b245be8f3389) + +commit ecb00946bf684b4c8405d71fe9306d35aba21359 +Author: Alessio Garzi +Date: Mon Mar 24 12:52:29 2025 +0100 + + fix typo on sanity checks module + + (cherry picked from commit 3b48fff143b49f16b328475a7b26017209e98666) + +commit 00544a66aad09faf345d54bef7f464f2749ef548 +Author: João Capucho +Date: Thu Mar 6 02:50:12 2025 +0000 + + pua_reginfo: handle_notify - fix AoR key parsing + + - The AoR key generated by handle_notify no longer includes the domain + of the AoR when usrloc use_domain isn't enabled + + (cherry picked from commit b7e16294ae1bbfe8cc469facf59fc9e3960ff2a4) + +commit f24315c2bc4ec7b9507516a96603e91ae2ce0fd1 +Author: Daniel-Constantin Mierla +Date: Mon Mar 17 09:15:39 2025 +0100 + + microhttpd: handle all incoming body data + + - GH #4176 + + (cherry picked from commit 96392eda8fac1cb075e7f407c0155085acc92c5f) + +commit f761cad5b462820af060d6e07410f0dd84c1a52f +Author: Daniel-Constantin Mierla +Date: Sun Mar 16 08:50:52 2025 +0100 + + microhttpd: create response with MHD_RESPMEM_MUST_COPY flag + + (cherry picked from commit 1569a7b71af26f5b3cb7cb25de7d2425c75f5587) + +commit 813d3ed6a532cc0baa98d27ef9eea579e5ca1688 +Author: Daniel-Constantin Mierla +Date: Sat Mar 15 20:27:22 2025 +0100 + + microhttpd: debug message for http response queue + + (cherry picked from commit 7a793a257b12f946e54bca3d3d92b6c07602fb20) + +commit b3cb2b38c5d81c48b0b6315cb7feb99d236d15e3 +Author: Daniel-Constantin Mierla +Date: Wed Mar 12 11:20:11 2025 +0100 + + tls: get wss connections as well for selects and vars + + - GH #4167 + + (cherry picked from commit 3a3856c68cf0cc04385921f8bbec72420cf8f656) + +commit 0cbf7eede6dbd3198664160b77d1b4d0337833b8 +Author: Daniel-Constantin Mierla +Date: Wed Mar 12 11:07:15 2025 +0100 + + dialog: enforce second bye towards callee for dlg_bye() + + - GH #4169 + + (cherry picked from commit 7de1693573fc08e54db1955095d66c495b2051b9) + +commit e4781f256cc0fbfc8ad4b4345934da7c8899b47e +Author: Lyubomir Yatanski +Date: Tue Mar 4 10:48:47 2025 +0200 + + cdp: fix cmake build + + - fix runtime Error relocating cdp.so: TLS_client_method: symbol not found + when building with cmake + + (cherry picked from commit ba13699faba8938ff547a34af9f05631d0b8a9cd) + +commit 5807e268169d251780b09c526c3cf33404314485 +Author: Kamailio Dev +Date: Wed Mar 12 23:16:16 2025 +0100 + + modules: readme files regenerated - modules ... [skip ci] + +commit f86649b48483a69327fe4a2ffc66886eab28f07d +Author: Victor Seva +Date: Wed Mar 12 23:09:16 2025 +0100 + + presence_dfks: add missing definition + + (cherry picked from commit fb00af35fa36120491c85d47d3e71b5c6c22a2db) + +commit 394437f499c487c364d9e82a49367202b2aeb435 +Author: Victor Seva +Date: Wed Mar 12 22:34:50 2025 +0100 + + presence_dfks: fix list format on docs [skip ci] + + (cherry picked from commit 0dd0d00e935d1cc74eb5c2bcec8119ed572e324d) + +commit 2b3dd3b477afef88421377b703aefe217b9e915b +Author: Victor Seva +Date: Tue Mar 11 13:22:38 2025 +0100 + + core: fix NAPTR dns cache print + + fix #4173 + + (cherry picked from commit df1eff2a52d0670900ee5bf15f2e7a2cd4d74da0) + +commit b686ca7466df403512191384cc8322333a9ebcdc +Author: Victor Seva +Date: Tue Feb 11 01:35:56 2025 +0100 + + utils/kamcmd: cmake fix on custom command + +commit 5b2758c2d390c2a735de1026c7cfaf6e8aae4480 +Author: drTr0jan +Date: Mon Feb 24 22:19:35 2025 +0300 + + sctp: cmake - search for libsctp on linux only + + (cherry picked from commit 41b2cba74a9fff204b2cc671670073d008b3c6b1) + +commit 3c5e7b5031951870457f5e3b96b1449b1c1d9613 +Author: drTr0jan +Date: Mon Feb 24 22:20:50 2025 +0300 + + dialplan: cmake - add pcre2 + + (cherry picked from commit 1f3b45056caf298062c6fbe683660ac6c158331a) + + ===================== 2025-03-10 Version 6.0.1 Released ===================== ===================== Changes Since Version 6.0.0 =========================== diff --git a/doc/README.md b/doc/README.md index 562cef0e0..f335aa257 100644 --- a/doc/README.md +++ b/doc/README.md @@ -2,7 +2,7 @@ Kamailio - Doc Folder ===================== The doc/ folder contains various resource used for generating documentation, -as well as several tutotirals and info files from old times. +as well as several tutorials and info files from old times. Most of documentation for Kamailio can be found on the website: diff --git a/doc/tutorials/rpc/kamailio_rpc.xml b/doc/tutorials/rpc/kamailio_rpc.xml index debd9907b..523aab117 100644 --- a/doc/tutorials/rpc/kamailio_rpc.xml +++ b/doc/tutorials/rpc/kamailio_rpc.xml @@ -16,7 +16,7 @@ $Date$ --> - + The Kamailio RPC Control Interface @@ -62,7 +62,7 @@ (over HTTP TCP or TLS). - For more information about the existing transport modules, please + For more information about the existing transport modules, please refer to their documentation. @@ -148,7 +148,7 @@ typedef void (*rpc_function_t)(rpc_t* rpc, void* ctx); Each module containing RPC functions has to export all the RPC functions to the &kamailio; core in order to make them visible to the RPC transport modules. - The export process involves a rpc_export_t + The export process involves a rpc_export_t structure (either by itself or in an array): @@ -219,11 +219,11 @@ rpc_export_t ul_rpc[] = { contains a new attribute called rpc_methods: struct module_exports { - char* name; /* null terminated module name */ + char* name; /* null terminated module name */ cmd_export_t* cmds; /* null terminated array of the exported commands */ rpc_export_t* rpc_methods; /* null terminated array of exported rpc methods */ param_export_t* params; /* null terminated array of the exported module parameters */ - + init_function init_f; /* Initialization function */ response_function response_f; /* function used for responses */ destroy_function destroy_f; /* function called upon shutdown */ @@ -236,19 +236,19 @@ struct module_exports { bumper containing zeroes in all the attributes of the structure. The following program listing shows the exported RPC functions of the modules_s/usrloc module, using the rpc_export_t array - ul_rpc defined above, in the + ul_rpc defined above, in the rpc_register_array() example: usrloc Module Exports Declaration struct module_exports exports = { "usrloc", - cmds, /* Exported functions */ + cmds, /* Exported functions */ ul_rpc, /* RPC methods */ - params, /* Export parameters */ - mod_init, /* Module initialization function */ - 0, /* Response function */ - destroy, /* Destroy function */ - 0, /* OnCancel function */ + params, /* Export parameters */ + mod_init, /* Module initialization function */ + 0, /* Response function */ + destroy, /* Destroy function */ + 0, /* OnCancel function */ child_init /* Child initialization function */ }; @@ -256,8 +256,9 @@ struct module_exports exports = { This mode works only with modules using the SER flavour module interface. It does not work for &kamailio; modules and it - will probably not work for future sip-router modules. It is - safer and recommended to use instead the + will probably not work for future sip-router modules. + It is now completely obselete. + The correct way is to use instead the rpc_register_array() function. @@ -353,34 +354,74 @@ add("sd", string_param, int_param); (2 ints and a string) are optional. - +
Data Type Overview - + - Name - Formating String Char - C-Style Variable + Name + Formating String Char + C-Style Variable + + + Integer + d + int - Integer - d - int + Unsigned Integer + u + int - Float - f - double + Boolean + b + int - String - s - char* + Long + l + long - String - S - str* + Unsigned Long + j + unsigned long + + + Long Long + L + long long + + + Unsigned Long Long + J + unsigned long long + + + Float + f + double + + + String + s + char* + + + String + S + str* + + + time + t + int + + + Struct + { + struct rpc_struct_l Optional modifier @@ -392,9 +433,15 @@ add("sd", string_param, int_param); . requires auto-conversion for the next parameter - + -
+ + + + + The time parameter is of type int. Recent OS use 64-bit time_t (typedef long), so if you are using a 64-bit OS, you should use l or LL instead of t when trying to add/read a time_t value to avoid overflowing. + +
@@ -448,7 +495,7 @@ add("sd", string_param, int_param); The '.' modifiers turns on type autoconversion for the next - parameter. This means that if the type of the next parameter + parameter. This means that if the type of the next parameter differs from the type specified in the formatting string, the parameter will be automatically converted to the formatting string type (if possible) and if the automatic conversion succeeds, no @@ -457,13 +504,13 @@ add("sd", string_param, int_param); The function returns the number of parameters read on success (a number greater or equal 0) and - (minus) the number of - parameters read on error (for example for an error after + parameters read on error (for example for an error after reading 2 parameters it will return -2). When a failure occurs (incorrect parameter type or no more parameters in the parameter set) the function will return a negative number (- number of parameters read so far) and it will also automatically change the reply that will be - sent to the caller to indicate that a failure has occurred on + sent to the caller to indicate that a failure has occurred on the server (unless the "*" is used and the error is lack of more parameters). @@ -504,7 +551,7 @@ rpc->scan(ctx, "f", &double_val); rpc->scan(ctx, "{", &handle); - The corresponding variable (named + The corresponding variable (named handle in the example above) will contain the index of the structure parameter within the parameter set, but the index cannot be used to retrieve the contents @@ -526,7 +573,7 @@ rpc->struct_scan(handle, "sd", "str_attr", &str_val, "int_attr", &int_va the structure.
- +
Retrieving Parameters Example Retrieving Parameters @@ -569,7 +616,7 @@ static void core_prints(rpc_t* rpc, void* c) } /* variable number of parameters and auto conversion: - echo back all the parameters, works with any type (everything is + echo back all the parameters, works with any type (everything is internally converted to string, notice the '.' modifier) */ static void core_echo(rpc_t* rpc, void* c) { @@ -703,7 +750,7 @@ static void core_kill(rpc_t* rpc, void *ctx) ]]> - +
add @@ -867,8 +914,8 @@ static void rpc_register(rpc_t* rpc, void *ctx) module). - serweb (php application that can use - the XML-RPC interface to call ser + siremis (php application that can use + the XML-RPC interface to call &kamailioname; functions). diff --git a/doc/tutorials/ser_radius/ser_radius.xml b/doc/tutorials/ser_radius/ser_radius.xml index 6b0d5f14b..c9af6f1ba 100644 --- a/doc/tutorials/ser_radius/ser_radius.xml +++ b/doc/tutorials/ser_radius/ser_radius.xml @@ -46,11 +46,11 @@ too. Any volunteers willing to describe setup of other RADIUS servers are encouraged to contact the author. - +
Prerequisites - To setup RADIUS support in SIP-router you will need the following: + To set up RADIUS support in SIP-router you will need the following: @@ -208,7 +208,7 @@ $INCLUDE /usr/local/etc/radiuclient/dictionary.ser
- +
FreeRADIUS Server @@ -234,7 +234,7 @@ root@localhost"/usr/local/src/freeradius-0.9.1# make install accounting, and group membership checking will be described in separate sections. - +
Common configuration
@@ -274,7 +274,7 @@ client proxy.foo.bar {
- +
File <filename>dictionary</filename> @@ -297,7 +297,7 @@ $INCLUDE /usr/local/etc/radiusclient/dictionary.ser understand each other.
- +
File <filename>radiusd.conf</filename> @@ -318,7 +318,7 @@ $INCLUDE /usr/local/etc/radiusclient/dictionary.ser
- +
File <filename>users</filename> @@ -330,7 +330,7 @@ $INCLUDE /usr/local/etc/radiusclient/dictionary.ser test Auth-Type := Digest, User-Password == "test" Reply-Message = "Hello, test with digest" - + The username and password is for testing only, you can safely remove the entry once your RADIUS server works and @@ -338,7 +338,7 @@ test Auth-Type := Digest, User-Password == "test"
- +
Test The Server @@ -361,9 +361,9 @@ root@/usr/local/src# radiusd -X into the file: -User-Name = "test", Digest-Response = "631d6d73147add2f9e437f59bbc3aeb7", -Digest-Realm = "testrealm", Digest-Nonce = "1234abcd" , -Digest-Method = "INVITE", Digest-URI = "sip:5555551212@example.com", +User-Name = "test", Digest-Response = "631d6d73147add2f9e437f59bbc3aeb7", +Digest-Realm = "testrealm", Digest-Nonce = "1234abcd" , +Digest-Method = "INVITE", Digest-URI = "sip:5555551212@example.com", Digest-Algorithm = "MD5", Digest-User-Name = "test" @@ -394,7 +394,7 @@ Received response ID 224, code 2, length = 45 Reply-Message = "Hello, test with digest"
- +
Authentication Configuration @@ -417,8 +417,8 @@ joe@sip-router.org Auth-Type := Digest, User-Password == "heslo" don't need it.
- -
+ +
Accounting Configuration By default the FreeRADIUS server will log all accounting requests @@ -472,7 +472,7 @@ Tue Jun 24 00:20:56 2003
- +
Group Checking Configuration @@ -486,7 +486,7 @@ joe@sip-router.org Sip-Group == "pstn", Auth-Type := Accept
- +
SIP-router Configuration @@ -559,7 +559,7 @@ root@localhost:/usr/local/src/sip_router# make install
- +
Frequently Asked Questions @@ -618,6 +618,5 @@ libradiusclient.so.0: cannot open shared object file: No such file or directory
- - + diff --git a/misc/examples/ims/pcscf/kamailio.cfg b/misc/examples/ims/pcscf/kamailio.cfg index e96083455..57ad5e951 100644 --- a/misc/examples/ims/pcscf/kamailio.cfg +++ b/misc/examples/ims/pcscf/kamailio.cfg @@ -48,11 +48,11 @@ max_while_loops=5000 listen=tcp:127.0.0.1:5060 #!endif -# Locks all ser pages into memory making it unswappable (in general one +# Locks all ser pages into memory making it unswappable (in general one # doesn't want his sip proxy swapped out ) mlock_pages=yes -# Tries to pre-fault all the shared memory, before starting. When "on", start -# time will increase, but combined with mlock_pages will guarantee ser will get +# Tries to pre-fault all the shared memory, before starting. When "on", start +# time will increase, but combined with mlock_pages will guarantee ser will get # all its memory from the beginning (no more kswapd slow downs) shm_force_alloc=yes @@ -108,9 +108,9 @@ tcp_connection_lifetime=36000 # alias port will be created for the connection the message came from (the # alias port will be set to the via one). # -# Note: For NAT traversal of TCP clients it is better to not use -# tcp_accept_aliases but just use nathelper module and -# fix_nated_[contact|register] functions. +# Note: For NAT traversal of TCP clients it is better to not use +# tcp_accept_aliases but just use nathelper module and +# fix_nated_[contact|register] functions. tcp_accept_aliases=no # Enable SIP outbound TCP keep-alive using PING-PONG (CRLFCRLF - CRLF). tcp_crlf_ping=yes @@ -136,7 +136,7 @@ auto_aliases=no udp_mtu = 1300 udp_mtu_try_proto = TCP -/* uncomment and configure the following line if you want Kamailio to +/* uncomment and configure the following line if you want Kamailio to bind on a specific interface/port/proto (default bind on all available) */ system.shutdownmode = 0 desc "System shutdown mode" @@ -172,7 +172,7 @@ loadmodule "path" loadmodule "statistics" loadmodule "ims_dialog" -loadmodule "ims_usrloc_pcscf" +loadmodule "ims_usrloc_pcscf" # Following module is required even in case of IPSec being disabled. loadmodule "ims_ipsec_pcscf" loadmodule "ims_registrar_pcscf" @@ -545,7 +545,7 @@ route { if (is_method("INVITE")) { if (is_present_hf("C-Params")) { remove_hf("Contact"); - remove_hf("C-Params"); + remove_hf("C-Params"); append_hf("Contact: $ct;$hdr(C-Params)\r\n"); } if ($route_uri =~ "sip:mo@.*") { @@ -580,7 +580,7 @@ route { # Handle NAT route(NATMANAGE); # Handle Mobile Terminated requests - route(MT); + route(MT); } } if (is_method("REGISTER")) { @@ -596,7 +596,7 @@ route { if (!strempty($(ct{tobody.params}))) { append_hf("C-Params: $(ct{tobody.params})\r\n"); } - + append_hf("SBC: mt\r\n"); # Do some Round-Robin on the SBC's t_on_failure("SBC_failure"); @@ -626,7 +626,7 @@ route { route(NATMANAGE); # prepend mo as user for record route $avp(RR_CUSTOM_USER_AVP)="mt"; - route(MT); + route(MT); #!endif } else { force_rport(); @@ -639,14 +639,14 @@ route { route(REGISTER); exit; } - + # prepend mo as user for record route $avp(RR_CUSTOM_USER_AVP)="mo"; # Set Flag for MO: setflag(FLT_MOBILE_ORIG); # Increase timer for inbound requests, we may have to do failover: t_set_fr(120000, 30000); - route(MO); + route(MO); if (is_method("INVITE")) { # SRTP in RTP übersetzen if ($pr == "tls") { @@ -721,7 +721,7 @@ route[REQINIT] { # Trace this message #!ifdef CAPTURE_NODE - sip_trace(); + sip_trace(); setflag(FLT_CAPTURE); #!endif @@ -776,7 +776,7 @@ route[REQINIT] { if (is_method("INVITE|REGISTER")) { send_reply("100", "Trying"); - } + } } route[RELAY] { @@ -860,7 +860,7 @@ failure_route[SBC_failure] { # - receive a 5xx or 6xx reply from the proxy. if (t_branch_timeout() || t_check_status("[5-6]..")) { if (ds_next_dst()) { - # Do Failover in case problems: + # Do Failover in case problems: t_on_failure("SBC_failure"); t_relay(); } else { @@ -877,7 +877,7 @@ failure_route[SBC_failure] { route[NOTIFY] { xlog("L_DBG", "IMS: INSIDE NOTIFY\n"); - if (reginfo_handle_notify("location")) { + if (reginfo_handle_notify("pcscf_location")) { send_reply("200", "OK - P-CSCF processed notification"); break; } else { @@ -901,9 +901,9 @@ route[NATPING] { $uac_req(furi) = PCSCF_URL; $uac_req(sock) = $sht(natpingfrom=>$shtitkey(nat_iterator)); $uac_req(turi) = $shtitval(nat_iterator); - $uac_req(ouri) = $shtitkey(nat_iterator); + $uac_req(ouri) = $shtitkey(nat_iterator); $uac_req(evroute) = 1; - uac_req_send(); + uac_req_send(); } sht_iterator_end("nat_iterator"); sht_unlock("natping=>natpinglock"); @@ -931,9 +931,9 @@ event_route[uac:reply] { xlog(" Unregistering $uac_req(ruri);$var(alias)\n"); setdebug("9"); #!ifdef WITH_IPSEC - ipsec_destroy_by_contact("location", "$uac_req(ruri);$var(alias)", "$(uac_req(ouri){uri.host})", "$(uac_req(ouri){uri.port})"); + ipsec_destroy_by_contact("pcscf_location", "$uac_req(ruri);$var(alias)", "$(uac_req(ouri){uri.host})", "$(uac_req(ouri){uri.port})"); #!endif - pcscf_unregister("location", "$uac_req(ruri);$var(alias)", "$(uac_req(ouri){uri.host})", "$(uac_req(ouri){uri.port})"); + pcscf_unregister("pcscf_location", "$uac_req(ruri);$var(alias)", "$(uac_req(ouri){uri.host})", "$(uac_req(ouri){uri.port})"); resetdebug(); sht_lock("natping=>natpinglock"); $sht(natping=>$uac_req(ouri)) = $null; @@ -962,7 +962,7 @@ route[preload_pcscf] { if ($shv(preload_pcscf) == 1) return; $shv(preload_pcscf) = 1; - sql_query("pcscf", "select aor, received, received_port, received_proto from location;", "resultset"); + sql_query("pcscf", "select aor, received, received_port, received_proto from pcscf_location;", "resultset"); xlog("Preloading NAT-PING. Rows: $dbr(resultset=>rows)\n"); if($dbr(resultset=>rows)>0) { $var(i) = 0; diff --git a/pkg/kamailio/Makefile b/pkg/kamailio/Makefile index ce2e3ae73..6f1a18ec3 100644 --- a/pkg/kamailio/Makefile +++ b/pkg/kamailio/Makefile @@ -32,8 +32,8 @@ apk: sed -e "s/^_gitcommit=.*/_gitcommit=${GIT_TAG}/" \ -e "s/^pkgver=.*/pkgver=${APK_VERSION}/" \ -i alpine/APKBUILD - cd alpine && abuild snapshot - @echo \"abuild\" cannot be started from Makefile please start manually \"cd alpine \&\& abuild -r\" + abuild -C alpine snapshot + @echo \"abuild\" cannot be started from Makefile please start manually \"abuild -C alpine -r\" # build source rpm package .PHONY: src.rpm diff --git a/pkg/kamailio/alpine/APKBUILD b/pkg/kamailio/alpine/APKBUILD index fe941ec28..4754aa04f 100644 --- a/pkg/kamailio/alpine/APKBUILD +++ b/pkg/kamailio/alpine/APKBUILD @@ -4,7 +4,7 @@ # Maintainer: Nathan Angelacos pkgname=kamailio -pkgver=6.0.1 +pkgver=6.0.2 pkgrel=0 # If building from a git snapshot, specify the gitcommit @@ -32,7 +32,7 @@ makedepends="bison db-dev flex freeradius-client-dev expat-dev net-snmp-dev libuuid libev-dev jansson-dev json-c-dev libevent-dev linux-headers libmemcached-dev rabbitmq-c-dev hiredis-dev ruby-dev libmaxminddb-dev libunistring-dev mongo-c-driver-dev - libwebsockets-dev mosquitto-dev librdkafka-dev nghttp2-dev" + libwebsockets-dev mosquitto-dev librdkafka-dev nghttp2-dev libjwt-dev" install="$pkgname.pre-install $pkgname.pre-upgrade" diff --git a/pkg/kamailio/deb/bionic/changelog b/pkg/kamailio/deb/bionic/changelog index e7d32e8b8..1211723a0 100644 --- a/pkg/kamailio/deb/bionic/changelog +++ b/pkg/kamailio/deb/bionic/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/bionic/kamailio.README.Debian b/pkg/kamailio/deb/bionic/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/bionic/kamailio.README.Debian +++ b/pkg/kamailio/deb/bionic/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/bookworm/changelog b/pkg/kamailio/deb/bookworm/changelog index e7d32e8b8..1211723a0 100644 --- a/pkg/kamailio/deb/bookworm/changelog +++ b/pkg/kamailio/deb/bookworm/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/bookworm/kamailio.README.Debian b/pkg/kamailio/deb/bookworm/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/bookworm/kamailio.README.Debian +++ b/pkg/kamailio/deb/bookworm/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/bullseye/changelog b/pkg/kamailio/deb/bullseye/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/bullseye/changelog +++ b/pkg/kamailio/deb/bullseye/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/bullseye/kamailio.README.Debian b/pkg/kamailio/deb/bullseye/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/bullseye/kamailio.README.Debian +++ b/pkg/kamailio/deb/bullseye/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/buster/changelog b/pkg/kamailio/deb/buster/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/buster/changelog +++ b/pkg/kamailio/deb/buster/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/buster/kamailio.README.Debian b/pkg/kamailio/deb/buster/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/buster/kamailio.README.Debian +++ b/pkg/kamailio/deb/buster/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/debian/changelog b/pkg/kamailio/deb/debian/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/debian/changelog +++ b/pkg/kamailio/deb/debian/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/debian/kamailio.README.Debian b/pkg/kamailio/deb/debian/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/debian/kamailio.README.Debian +++ b/pkg/kamailio/deb/debian/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/focal/changelog b/pkg/kamailio/deb/focal/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/focal/changelog +++ b/pkg/kamailio/deb/focal/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/focal/kamailio.README.Debian b/pkg/kamailio/deb/focal/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/focal/kamailio.README.Debian +++ b/pkg/kamailio/deb/focal/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/jammy/changelog b/pkg/kamailio/deb/jammy/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/jammy/changelog +++ b/pkg/kamailio/deb/jammy/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/jammy/kamailio.README.Debian b/pkg/kamailio/deb/jammy/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/jammy/kamailio.README.Debian +++ b/pkg/kamailio/deb/jammy/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/jessie/changelog b/pkg/kamailio/deb/jessie/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/jessie/changelog +++ b/pkg/kamailio/deb/jessie/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/jessie/kamailio.README.Debian b/pkg/kamailio/deb/jessie/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/jessie/kamailio.README.Debian +++ b/pkg/kamailio/deb/jessie/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/noble/changelog b/pkg/kamailio/deb/noble/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/noble/changelog +++ b/pkg/kamailio/deb/noble/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/noble/kamailio.README.Debian b/pkg/kamailio/deb/noble/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/noble/kamailio.README.Debian +++ b/pkg/kamailio/deb/noble/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/precise/changelog b/pkg/kamailio/deb/precise/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/precise/changelog +++ b/pkg/kamailio/deb/precise/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/precise/kamailio.README.Debian b/pkg/kamailio/deb/precise/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/precise/kamailio.README.Debian +++ b/pkg/kamailio/deb/precise/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/sid/changelog b/pkg/kamailio/deb/sid/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/sid/changelog +++ b/pkg/kamailio/deb/sid/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/sid/kamailio.README.Debian b/pkg/kamailio/deb/sid/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/sid/kamailio.README.Debian +++ b/pkg/kamailio/deb/sid/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/stretch/changelog b/pkg/kamailio/deb/stretch/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/stretch/changelog +++ b/pkg/kamailio/deb/stretch/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/stretch/kamailio.README.Debian b/pkg/kamailio/deb/stretch/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/stretch/kamailio.README.Debian +++ b/pkg/kamailio/deb/stretch/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/trusty/changelog b/pkg/kamailio/deb/trusty/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/trusty/changelog +++ b/pkg/kamailio/deb/trusty/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/trusty/kamailio.README.Debian b/pkg/kamailio/deb/trusty/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/trusty/kamailio.README.Debian +++ b/pkg/kamailio/deb/trusty/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/wheezy/changelog b/pkg/kamailio/deb/wheezy/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/wheezy/changelog +++ b/pkg/kamailio/deb/wheezy/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/wheezy/kamailio.README.Debian b/pkg/kamailio/deb/wheezy/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/wheezy/kamailio.README.Debian +++ b/pkg/kamailio/deb/wheezy/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/deb/xenial/changelog b/pkg/kamailio/deb/xenial/changelog index 3ca8bab29..b85d7bf7e 100644 --- a/pkg/kamailio/deb/xenial/changelog +++ b/pkg/kamailio/deb/xenial/changelog @@ -1,3 +1,9 @@ +kamailio (6.0.2) unstable; urgency=medium + + * version set 6.0.2 + + -- Victor Seva Wed, 25 Jun 2025 08:51:11 +0200 + kamailio (6.0.1) unstable; urgency=medium * version set 6.0.1 diff --git a/pkg/kamailio/deb/xenial/kamailio.README.Debian b/pkg/kamailio/deb/xenial/kamailio.README.Debian index d25769a96..bf6c0219d 100644 --- a/pkg/kamailio/deb/xenial/kamailio.README.Debian +++ b/pkg/kamailio/deb/xenial/kamailio.README.Debian @@ -17,7 +17,7 @@ as a conffile. * Kamailio setup ---------------- -To setup Kamailio, you need to: +To set Kamailio up, you need to: - configure Kamailio properly to suit your needs - edit /etc/default/kamailio, adjust the MEMORY parameter and set RUN_KAMAILIO to "yes" diff --git a/pkg/kamailio/obs/kamailio.service b/pkg/kamailio/obs/kamailio.service index 0c4fbc49c..0a527056f 100644 --- a/pkg/kamailio/obs/kamailio.service +++ b/pkg/kamailio/obs/kamailio.service @@ -1,8 +1,8 @@ [Unit] Description=Kamailio - the Open Source SIP Server Documentation=man:kamailio(8) -Wants=network-online.target -After=network-online.target +Wants=network-online.target nss-lookup.target +After=network-online.target nss-lookup.target [Service] Type=simple diff --git a/pkg/kamailio/obs/kamailio.spec b/pkg/kamailio/obs/kamailio.spec index ef9ce183d..e8f28a267 100644 --- a/pkg/kamailio/obs/kamailio.spec +++ b/pkg/kamailio/obs/kamailio.spec @@ -1,5 +1,5 @@ %define name kamailio -%define ver 6.0.1 +%define ver 6.0.2 %define rel dev1.0%{dist} %if 0%{?fedora} @@ -31,42 +31,6 @@ %bcond_without wolfssl %endif -%if 0%{?rhel} == 7 -%if 0%{?centos_ver} -%define dist_name centos -%define dist_version %{?centos} -%define dist .el7.centos -%endif -%if 0%{?centos_ver} == 0 -%define dist_name rhel -%define dist_version %{?rhel} -%endif -%bcond_without cnxcc -%bcond_with dnssec -%bcond_without evapi -%bcond_without http_async_client -%bcond_without ims -%bcond_without jansson -%bcond_without json -%bcond_without lua -%bcond_without lwsc -%bcond_without kazoo -%bcond_without memcached -%bcond_without mongodb -%bcond_with nats -%bcond_without perl -%bcond_without phonenum -%bcond_without python2 -%bcond_without python3 -%bcond_without rabbitmq -%bcond_without redis -%bcond_without ruby -%bcond_without sctp -%bcond_without websocket -%bcond_without xmlrpc -%bcond_without wolfssl -%endif - %if 0%{?rhel} == 8 %if 0%{?centos_ver} %define dist_name centos @@ -188,11 +152,6 @@ %bcond_without wolfssl %endif -# build with openssl 1.1.1 on RHEL 7 based dists -%if 0%{?rhel} == 7 -%bcond_with openssl11 -%endif - # redefine buggy openSUSE Leap _sharedstatedir macro. More info at https://bugzilla.redhat.com/show_bug.cgi?id=183370 %if 0%{?suse_version} == 1315 %define _sharedstatedir /var/lib @@ -252,10 +211,8 @@ Conflicts: kamailio-xhttp-pi < %ver, kamailio-xmlops < %ver Conflicts: kamailio-xmlrpc < %ver, kamailio-xmpp < %ver Conflicts: kamailio-uuid < %ver BuildRequires: bison, flex, which, make, gcc, gcc-c++, pkgconfig, readline-devel -%if 0%{?rhel} != 6 Requires: systemd BuildRequires: systemd-devel -%endif %if 0%{?suse_version} == 1315 || 0%{?suse_version} == 1330 Requires: filesystem @@ -281,13 +238,8 @@ like Asterisk™, FreeSWITCH™ or SEMS. Summary: Account transaction information in a JSON dictionary Group: %{PKGGROUP} Requires: kamailio = %ver -%if 0%{?rhel} == 6 -Requires: libevent2 -BuildRequires: libevent2-devel -%else Requires: libevent BuildRequires: libevent-devel -%endif %if 0%{?suse_version} Requires: libjansson BuildRequires: libjansson-devel @@ -303,14 +255,8 @@ Account transaction information in a JSON dictionary. %package auth-ephemeral Summary: Functions for authentication using ephemeral credentials -Group: %{PKGGROUP} -%if 0%{?rhel} == 7 && %{with openssl11} -Requires: openssl11, kamailio = %ver -BuildRequires: openssl11-devel -%else Requires: openssl, kamailio = %ver BuildRequires: openssl-devel -%endif %description auth-ephemeral Functions for authentication using ephemeral credentials. @@ -333,14 +279,9 @@ Requires: kamailio = %ver Requires: libdb-4_8 BuildRequires: libdb-4_8-devel %else -%if 0%{?rhel} == 6 -Requires: db4 -BuildRequires: db4-devel -%else Requires: libdb BuildRequires: libdb-devel %endif -%endif %description bdb Berkeley database connectivity for Kamailio. @@ -390,20 +331,7 @@ CPL (Call Processing Language) interpreter for Kamailio. Summary: Module to support cryptographic extensions Group: %{PKGGROUP} Requires: kamailio = %ver -%if 0%{?rhel} == 6 -Requires: openssl -BuildRequires: openssl-devel -%endif -%if 0%{?rhel} == 7 -%if %{with openssl11} -Requires: openssl11-libs -BuildRequires: openssl11-devel -%else -Requires: openssl-libs -BuildRequires: openssl-devel -%endif -%endif -%if 0%{?fedora} +%if 0%{?rhel} || 0%{?fedora} Requires: openssl-libs BuildRequires: openssl-devel %endif @@ -487,13 +415,8 @@ Compressed body (SIP and HTTP) handling for kamailio. Summary: Async HTTP client module for Kamailio Group: %{PKGGROUP} Requires: kamailio = %ver -%if 0%{?rhel} == 6 -Requires: libevent2 -BuildRequires: libevent2-devel -%else Requires: libevent BuildRequires: libevent-devel -%endif %if 0%{?suse_version} Requires: libcurl4 BuildRequires: libcurl-devel @@ -539,13 +462,8 @@ IMS modules and extensions module for Kamailio. Summary: JSON string handling and RPC modules for Kamailio using JANSSON library Group: %{PKGGROUP} Requires: kamailio = %ver -%if 0%{?rhel} == 6 -Requires: libevent2 -BuildRequires: libevent2-devel -%else Requires: libevent BuildRequires: libevent-devel -%endif %if 0%{?suse_version} Requires: libjson-c2 BuildRequires: libjansson-devel @@ -564,13 +482,8 @@ JSON string handling and RPC modules for Kamailio using JANSSON library. Summary: JSON string handling and RPC modules for Kamailio Group: %{PKGGROUP} Requires: kamailio = %ver -%if 0%{?rhel} == 6 -Requires: libevent2 -BuildRequires: libevent2-devel -%else Requires: libevent BuildRequires: libevent-devel -%endif %if 0%{?suse_version} Requires: libjson-c2 BuildRequires: libjson-c-devel @@ -601,13 +514,8 @@ Summary: Kazoo middle layer connector support for Kamailio Group: %{PKGGROUP} Requires: libuuid, librabbitmq, json-c, kamailio = %ver BuildRequires: libuuid-devel, librabbitmq-devel, json-c-devel -%if 0%{?rhel} == 6 -Requires: libevent2 -BuildRequires: libevent2-devel -%else Requires: libevent BuildRequires: libevent-devel -%endif %description kazoo Kazoo module for Kamailio. @@ -706,12 +614,8 @@ BuildRequires: zlib-devel Requires: libmysqlclient18 BuildRequires: libmysqlclient-devel %else -%if 0%{?rhel} == 6 -BuildRequires: mysql-devel -%else BuildRequires: mariadb-devel %endif -%endif %description mysql MySQL database connectivity for Kamailio. @@ -732,13 +636,8 @@ The module provides an NATS consumer for Kamailio. NATS is a real time distribut %package outbound Summary: Outbound (RFC 5626) support for Kamailio Group: %{PKGGROUP} -%if 0%{?rhel} == 7 && %{with openssl11} -Requires: openssl11, kamailio = %ver -BuildRequires: openssl11-devel -%else Requires: openssl, kamailio = %ver BuildRequires: openssl-devel -%endif %description outbound RFC 5626, "Managing Client-Initiated Connections in the Session Initiation @@ -846,9 +745,9 @@ RabbitMQ module for Kamailio. Summary: RADIUS modules for Kamailio Group: %{PKGGROUP} Requires: kamailio = %ver -%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8 -Requires: freeradius-client -BuildRequires: freeradius-client-devel +%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} +Requires: radcli +BuildRequires: radcli-devel %else Requires: radiusclient-ng BuildRequires: radiusclient-ng-devel @@ -922,18 +821,6 @@ Requires: kamailio = %ver Additional layer of security over our communications. -%package sipcapture-daemon-config -Summary: Reference config for sipcapture daemon -Group: %{PKGGROUP} -Requires: kamailio = %ver -%if 0%{?suse_version} -Requires: filesystem -%endif - -%description sipcapture-daemon-config -reference config for sipcapture daemon. - - %package sipdump Summary: This module writes SIP traffic and some associated details into local files Group: %{PKGGROUP} @@ -1035,13 +922,8 @@ SQLite database connectivity for Kamailio. %package tls Summary: TLS transport for Kamailio Group: %{PKGGROUP} -%if 0%{?rhel} == 7 && %{with openssl11} -Requires: openssl11, kamailio = %ver -BuildRequires: openssl11-devel -%else Requires: openssl, kamailio = %ver BuildRequires: openssl-devel -%endif %description tls TLS transport for Kamailio. @@ -1107,13 +989,8 @@ Non-SIP utitility functions for Kamailio. %package websocket Summary: WebSocket transport for Kamailio Group: %{PKGGROUP} -%if 0%{?rhel} == 7 && %{with openssl11} -Requires: libunistring, openssl11, kamailio = %ver -BuildRequires: libunistring-devel, openssl11-devel -%else Requires: libunistring, openssl, kamailio = %ver BuildRequires: libunistring-devel, openssl-devel -%endif %description websocket WebSocket transport for Kamailio. @@ -1185,21 +1062,17 @@ UUID module for Kamailio. %prep %setup -n %{name}-%{ver} -# python3 does not exist in RHEL 6 and similar dist. -%if 0%{?rhel} == 6 -sed -i -e 's/python3/python2/' utils/kamctl/dbtextdb/dbtextdb.py -%endif # on latest dist need to add --atexit=no for Kamailio options. More details GH #2616 -%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8 sed -i -e 's|/usr/sbin/kamailio|/usr/sbin/kamailio --atexit=no|' pkg/kamailio/obs/kamailio.service sed -i -e 's|/usr/sbin/kamailio|/usr/sbin/kamailio --atexit=no|' pkg/kamailio/obs/kamailio@.service -%endif + +rm -f misc/examples/pkg/sipcapture.cfg %build %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8 -export FREERADIUS=1 +export RADCLI=1 %endif make cfg prefix=/usr \ basedir=%{buildroot} \ @@ -1210,11 +1083,8 @@ make cfg prefix=/usr \ make make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \ jabber ndb_cassandra osp" \ -%if %{with openssl11} - SSL_BUILDER="pkg-config libssl11" \ -%endif %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8 - FREERADIUS=1 \ + RADCLI=1 \ %endif %if 0%{?rhel} >= 8 PYTHON3=python3.12 \ @@ -1321,11 +1191,8 @@ rm -rf %{buildroot} make install make install-modules-all skip_modules="app_mono db_cassandra db_oracle \ iptrtpproxy jabber osp" \ -%if %{with openssl11} - SSL_BUILDER="pkg-config libssl11" \ -%endif %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8 - FREERADIUS=1 \ + RADCLI=1 \ %endif %if 0%{?rhel} >= 8 PYTHON3=python3.12 \ @@ -1426,34 +1293,19 @@ make install-cfg-pkg install -d %{buildroot}%{_sharedstatedir}/kamailio -%if "%{?_unitdir}" == "" -# On RedHat 6 like -install -d %{buildroot}%{_var}/run/kamailio -install -d %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m755 pkg/kamailio/obs/kamailio.init \ - %{buildroot}%{_sysconfdir}/rc.d/init.d/kamailio -%else -# systemd install -d %{buildroot}%{_unitdir} install -Dpm 0644 pkg/kamailio/obs/kamailio.service %{buildroot}%{_unitdir}/kamailio.service install -Dpm 0644 pkg/kamailio/obs/kamailio@.service %{buildroot}%{_unitdir}/kamailio@.service -install -Dpm 0644 pkg/kamailio/obs/sipcapture.service %{buildroot}%{_unitdir}/sipcapture.service install -Dpm 0644 pkg/kamailio/obs/kamailio.tmpfiles %{buildroot}%{_tmpfilesdir}/kamailio.conf -install -Dpm 0644 pkg/kamailio/obs/sipcapture.tmpfiles %{buildroot}%{_tmpfilesdir}/sipcapture.conf -%endif %if 0%{?suse_version} install -d %{buildroot}%{_fillupdir} install -m644 pkg/kamailio/obs/kamailio.sysconfig \ %{buildroot}%{_fillupdir}/sysconfig.kamailio -install -m644 pkg/kamailio/obs/sipcapture.sysconfig \ - %{buildroot}%{_fillupdir}/sysconfig.sipcapture %else install -d %{buildroot}%{_sysconfdir}/sysconfig install -m644 pkg/kamailio/obs/kamailio.sysconfig \ %{buildroot}%{_sysconfdir}/sysconfig/kamailio -install -m644 pkg/kamailio/obs/sipcapture.sysconfig \ - %{buildroot}%{_sysconfdir}/sysconfig/sipcapture %endif %if 0%{?suse_version} @@ -1489,13 +1341,6 @@ rm -rf %{buildroot} %endif -%if "%{?_unitdir}" != "" -%post sipcapture-daemon-config -%tmpfiles_create sipcapture.conf -/usr/bin/systemctl -q enable sipcapture.service -%endif - - %preun if [ $1 = 0 ]; then %if "%{?_unitdir}" == "" @@ -1829,10 +1674,6 @@ fi %dir %{_libdir}/kamailio/kamctl/dbtextdb/__pycache__ %{_libdir}/kamailio/kamctl/dbtextdb/__pycache__/*.pyc %endif -%if 0%{?rhel} == 6 || 0%{?rhel} == 7 -%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyc -%{_libdir}/kamailio/kamctl/dbtextdb/dbtextdb.pyo -%endif %{_mandir}/man5/* %{_mandir}/man8/* @@ -2259,20 +2100,6 @@ fi %{_libdir}/kamailio/modules/rtjson.so -%files sipcapture-daemon-config -%defattr(-,root,root) -%config(noreplace) %{_sysconfdir}/kamailio/kamailio-sipcapture.cfg -%if 0%{?suse_version} -%{_fillupdir}/sysconfig.sipcapture -%else -%config(noreplace) %{_sysconfdir}/sysconfig/sipcapture -%endif -%if "%{?_unitdir}" != "" -%{_unitdir}/sipcapture.service -%{_tmpfilesdir}/sipcapture.conf -%endif - - %if %{with ruby} %files ruby %defattr(-,root,root) diff --git a/pkg/kamailio/obs/sipcapture.service b/pkg/kamailio/obs/sipcapture.service deleted file mode 100644 index 639521630..000000000 --- a/pkg/kamailio/obs/sipcapture.service +++ /dev/null @@ -1,26 +0,0 @@ -[Unit] -Description=Kamailio SIP router server daemon for sipcapture -Wants=network-online.target -After=network-online.target -After=syslog.target -After=auditd.service -After=mysqld.service - -[Service] -Type=simple -User=kamailio -Group=kamailio -WorkingDirectory=/run/sipcapture -Environment='CFGFILE=/etc/kamailio/kamailio-sipcapture.cfg' -Environment='SHM_MEMORY=32' -Environment='PKG_MEMORY=4' -EnvironmentFile=-/etc/sysconfig/sipcapture -# PIDFile requires a full absolute path -PIDFile=/run/sipcapture/sipcapture.pid -# ExecStart requires a full absolute path -ExecStart=/usr/sbin/kamailio -DD -P /run/sipcapture/sipcapture.pid -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY -Restart=on-failure - - -[Install] -WantedBy=multi-user.target diff --git a/pkg/kamailio/obs/sipcapture.sysconfig b/pkg/kamailio/obs/sipcapture.sysconfig deleted file mode 100644 index 0e65a6a56..000000000 --- a/pkg/kamailio/obs/sipcapture.sysconfig +++ /dev/null @@ -1,12 +0,0 @@ -# -# sipcapture startup options -# - -# Amount of shared memory to allocate for the running Kamailio server (in Mb) -#SHM_MEMORY=64 - -# Amount of per-process (package) memory to allocate for Kamailio (in Mb) -#PKG_MEMORY=4 - -# sipcapture config file -#CFGFILE=/etc/kamailio/kamailio-sipcapture.cfg diff --git a/pkg/kamailio/obs/sipcapture.tmpfiles b/pkg/kamailio/obs/sipcapture.tmpfiles deleted file mode 100644 index 12a5da752..000000000 --- a/pkg/kamailio/obs/sipcapture.tmpfiles +++ /dev/null @@ -1 +0,0 @@ -D /run/sipcapture 0700 kamailio kamailio - diff --git a/src/Makefile.defs b/src/Makefile.defs index 7d9112763..855f83cc1 100644 --- a/src/Makefile.defs +++ b/src/Makefile.defs @@ -106,7 +106,7 @@ INSTALL_FLAVOUR=$(FLAVOUR) # version number VERSION = 6 PATCHLEVEL = 0 -SUBLEVEL = 1 +SUBLEVEL = 2 EXTRAVERSION = # memory manager switcher diff --git a/src/core/atomic/atomic_sparc.h b/src/core/atomic/atomic_sparc.h index 6a1db75a1..98d64caa7 100644 --- a/src/core/atomic/atomic_sparc.h +++ b/src/core/atomic/atomic_sparc.h @@ -42,7 +42,7 @@ #define membar_depends() \ do { \ } while(0) /* really empty, not even a cc bar. */ -/* lock barrriers: empty, not needed for NOSMP; the lock/unlock should already +/* lock barriers: empty, not needed for NOSMP; the lock/unlock should already * contain gcc barriers*/ #define membar_enter_lock() \ do { \ diff --git a/src/core/atomic/atomic_sparc64.h b/src/core/atomic/atomic_sparc64.h index ca777770e..c71e3f80d 100644 --- a/src/core/atomic/atomic_sparc64.h +++ b/src/core/atomic/atomic_sparc64.h @@ -58,7 +58,7 @@ /* memory barriers for lock & unlock where lock & unlock are inline asm * functions that use atomic ops (and both of them use at least a store to * the lock). membar_enter_lock() is at most a StoreStore|StoreLoad barrier - * and membar_leave_lock() is at most a LoadStore|StoreStore barries + * and membar_leave_lock() is at most a LoadStore|StoreStore barriers * (if the atomic ops on the specific architecture imply these barriers * => these macros will be empty) * Warning: these barriers don't force LoadLoad ordering between code diff --git a/src/core/atomic/atomic_x86.h b/src/core/atomic/atomic_x86.h index 03a6c2bb9..3230a091e 100644 --- a/src/core/atomic/atomic_x86.h +++ b/src/core/atomic/atomic_x86.h @@ -374,7 +374,7 @@ inline static long mb_atomic_get_long(volatile long *var) #endif /* NOSMP */ -/* on x86 atomic intructions act also as barriers */ +/* on x86 atomic instructions act also as barriers */ #define mb_atomic_inc_int(v) atomic_inc_int(v) #define mb_atomic_dec_int(v) atomic_dec_int(v) #define mb_atomic_or_int(v, m) atomic_or_int(v, m) diff --git a/src/core/autover.h b/src/core/autover.h index cbd799467..c98e604f3 100644 --- a/src/core/autover.h +++ b/src/core/autover.h @@ -2,6 +2,6 @@ * DO NOT EDIT IT */ -#define REPO_VER "fce50d" -#define REPO_HASH "fce50d" +#define REPO_VER "d4dc5d" +#define REPO_HASH "d4dc5d" #define REPO_STATE "" diff --git a/src/core/cfg.y b/src/core/cfg.y index d2a6d28a1..a5bb2004d 100644 --- a/src/core/cfg.y +++ b/src/core/cfg.y @@ -2886,6 +2886,7 @@ fcmd: case MODULE5_T: case MODULE6_T: case MODULEX_T: + case ROUTE_T: case SET_FWD_NO_CONNECT_T: case SET_RPL_NO_CONNECT_T: case SET_FWD_CLOSE_T: diff --git a/src/core/cfg/cfg.h b/src/core/cfg/cfg.h index 9a2d4cbab..424a61dbd 100644 --- a/src/core/cfg/cfg.h +++ b/src/core/cfg/cfg.h @@ -56,7 +56,7 @@ typedef int (*cfg_on_change)(void *, str *, str *, void **); typedef void (*cfg_on_set_child)(str *, str *); -/*! \brief structrure to be used by the module interface */ +/*! \brief structure to be used by the module interface */ typedef struct _cfg_def { char *name; diff --git a/src/core/cfg/cfg_script.c b/src/core/cfg/cfg_script.c index 61bb496e2..91cfaf181 100644 --- a/src/core/cfg/cfg_script.c +++ b/src/core/cfg/cfg_script.c @@ -333,7 +333,7 @@ error: return -1; } -/* destory a dynamically allocated group definition */ +/* destroy a dynamically allocated group definition */ void cfg_script_destroy(cfg_group_t *group) { int i; diff --git a/src/core/cfg/cfg_script.h b/src/core/cfg/cfg_script.h index b88e7f824..846cf7db2 100644 --- a/src/core/cfg/cfg_script.h +++ b/src/core/cfg/cfg_script.h @@ -63,7 +63,7 @@ int cfg_set_script_var( /* fix-up the dynamically declared group */ int cfg_script_fixup(cfg_group_t *group, unsigned char *block); -/* destory a dynamically allocated group definition */ +/* destroy a dynamically allocated group definition */ void cfg_script_destroy(cfg_group_t *group); #endif /* _CFG_SCRIPT_H */ diff --git a/src/core/cfg/cfg_select.c b/src/core/cfg/cfg_select.c index b0b51f954..6e6e9fd2a 100644 --- a/src/core/cfg/cfg_select.c +++ b/src/core/cfg/cfg_select.c @@ -136,7 +136,7 @@ int cfg_fixup_selects() *(sel->group_p) = (void *)group; } } - /* the select list is not needed anymore */ + /* the select list is not needed any more */ cfg_free_selects(); return 0; } diff --git a/src/core/cfg/cfg_struct.c b/src/core/cfg/cfg_struct.c index 63e8e4e07..2644005d3 100644 --- a/src/core/cfg/cfg_struct.c +++ b/src/core/cfg/cfg_struct.c @@ -296,7 +296,7 @@ static void cfg_destory_groups(unsigned char *block) mapping = group->mapping; def = mapping ? mapping->def : NULL; - /* destory the shmized strings in the block */ + /* destroy the shmized strings in the block */ if(block && def) for(i = 0; i < group->num; i++) if(((CFG_VAR_TYPE(&mapping[i]) == CFG_VAR_STRING) @@ -378,7 +378,7 @@ int sr_cfg_init(void) *cfg_child_cb_last = NULL; /* A new cfg_child_cb struct must be created with a NULL callback function. - * This stucture will be the entry point for the child processes, and + * This structure will be the entry point for the child processes, and * will be freed later, when none of the processes refers to it */ *cfg_child_cb_first = *cfg_child_cb_last = cfg_child_cb_new(NULL, NULL, NULL, 0); @@ -536,7 +536,7 @@ void cfg_child_destroy(void) cfg_child_cb = cfg_child_cb->next; atomic_inc(&cfg_child_cb->refcnt); if(atomic_dec_and_test(&prev_cb->refcnt)) { - /* No more pocess refers to this callback. + /* No more process refers to this callback. * Did this process block the deletion, * or is there any other process that has not * reached prev_cb yet? */ diff --git a/src/core/cfg/cfg_struct.h b/src/core/cfg/cfg_struct.h index 94d9a7f0b..2a497f32e 100644 --- a/src/core/cfg/cfg_struct.h +++ b/src/core/cfg/cfg_struct.h @@ -71,7 +71,7 @@ typedef struct _cfg_mapping /* additional information about the cfg variable */ int pos; /*!< position of the variable within the group starting from 0 */ - int offset; /*!< offest within the memory block */ + int offset; /*!< offset within the memory block */ unsigned int flag; /*!< flag indicating the state of the variable */ } cfg_mapping_t; @@ -87,7 +87,7 @@ enum #pragma pack(push, 1) typedef struct _cfg_group { - cfg_mapping_t *mapping; /*!< describes the mapping betweeen + cfg_mapping_t *mapping; /*!< describes the mapping between the cfg variable definition and the memory block */ char *vars; /*!< pointer to the memory block where the values are stored -- used only before the config is @@ -126,7 +126,7 @@ typedef struct _cfg_group_inst { unsigned int id; /*!< identifier of the group instance */ unsigned int set[CFG_MAX_VAR_NUM / (sizeof(int) * 8)]; - /*!< Bitmap indicating whether or not a value is explicitely set + /*!< Bitmap indicating whether or not a value is explicitly set within this instance. If the value is not set, then the default value is used, and copied into this instance. */ unsigned char vars[1]; /*!< block for the values */ @@ -159,7 +159,7 @@ typedef struct _cfg_block /*! \brief Linked list of per-child process callbacks. * Each child process has a local pointer, and executes the callbacks * when the pointer is not pointing to the end of the list. - * Items from the begginning of the list are deleted when the starter + * Items from the beginning of the list are deleted when the starter * pointer is moved, and no more child process uses them. */ typedef struct _cfg_child_cb @@ -211,19 +211,19 @@ extern int cfg_ginst_count; #define CFG_GROUP_DATA(block, group) \ ((unsigned char *)((block)->vars + (group)->var_offset)) -/* Test whether a variable is explicitely set in the group instance, +/* Test whether a variable is explicitly set in the group instance, * or it uses the default value */ #define CFG_VAR_TEST(group_inst, var) \ bit_test((var)->pos % (sizeof(int) * 8), \ (group_inst)->set + (var)->pos / (sizeof(int) * 8)) -/* Test whether a variable is explicitely set in the group instance, +/* Test whether a variable is explicitly set in the group instance, * or it uses the default value, and set the flag. */ #define CFG_VAR_TEST_AND_SET(group_inst, var) \ bit_test_and_set((var)->pos % (sizeof(int) * 8), \ (group_inst)->set + (var)->pos / (sizeof(int) * 8)) -/* Test whether a variable is explicitely set in the group instance, +/* Test whether a variable is explicitly set in the group instance, * or it uses the default value, and reset the flag. */ #define CFG_VAR_TEST_AND_RESET(group_inst, var) \ bit_test_and_reset((var)->pos % (sizeof(int) * 8), \ @@ -382,7 +382,7 @@ static inline void cfg_update_local(int no_cbs) cfg_child_cb = cfg_child_cb->next; atomic_inc(&cfg_child_cb->refcnt); if(atomic_dec_and_test(&prev_cb->refcnt)) { - /* No more pocess refers to this callback. + /* No more process refers to this callback. Did this process block the deletion, or is there any other process that has not reached prev_cb yet? */ diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c index 1507e8901..0a2553f58 100644 --- a/src/core/dns_cache.c +++ b/src/core/dns_cache.c @@ -3898,6 +3898,15 @@ int dns_cache_print_entry(rpc_t *rpc, void *ctx, struct dns_hash_entry *e) rpc->fault(ctx, 500, "Internal error adding naptr order"); return -1; } + if(rpc->struct_add(sh, "s", "rr_skip_record", + ((struct naptr_rdata *)(rr->rdata))->skip_record + ? "yes" + : "no") + < 0) { + rpc->fault(ctx, 500, + "Internal error adding naptr rr_skip_record"); + return -1; + } s.s = ((struct naptr_rdata *)(rr->rdata))->flags; s.len = ((struct naptr_rdata *)(rr->rdata))->flags_len; if(rpc->struct_add(sh, "S", "rr_flags", &s) < 0) { @@ -3921,7 +3930,7 @@ int dns_cache_print_entry(rpc_t *rpc, void *ctx, struct dns_hash_entry *e) } s.s = ((struct naptr_rdata *)(rr->rdata))->repl; s.len = ((struct naptr_rdata *)(rr->rdata))->repl_len; - if(rpc->struct_add(sh, "S", "rr_regexp", &s) < 0) { + if(rpc->struct_add(sh, "S", "rr_replacement", &s) < 0) { rpc->fault(ctx, 500, "Internal error adding naptre rr_replacement"); return -1; diff --git a/src/core/parser/hf.c b/src/core/parser/hf.c index 9a91a2378..adb14ec1b 100644 --- a/src/core/parser/hf.c +++ b/src/core/parser/hf.c @@ -234,7 +234,7 @@ void dump_hdr_field(struct hdr_field const *const hf) /** * free hdr parsed structure using inner free function * - hdr parsed struct must have as first file a free function, - * so it can be caseted to hf_parsed_t + * so it can be cast to hf_parsed_t */ void hdr_free_parsed(void **h_parsed) { diff --git a/src/core/parser/hf.h b/src/core/parser/hf.h index 5111f6e05..3cae89061 100644 --- a/src/core/parser/hf.h +++ b/src/core/parser/hf.h @@ -266,7 +266,7 @@ void dump_hdr_field(struct hdr_field const *const hf); /** * free hdr parsed structure using inner free function * - hdr parsed struct must have as first file a free function, - * so it can be caseted to hf_parsed_t + * so it can be cast to hf_parsed_t */ void hdr_free_parsed(void **h_parsed); diff --git a/src/core/parser/parse_diversion.c b/src/core/parser/parse_diversion.c index 1b5d70a5f..098ae19af 100644 --- a/src/core/parser/parse_diversion.c +++ b/src/core/parser/parse_diversion.c @@ -52,10 +52,10 @@ int parse_diversion_body(char *buf, int len, diversion_body_t **body) { static to_body_t uri_b[NUM_DIVERSION_BODIES]; /* Temporary storage */ int num_uri = 0; - int body_len = 0; char *tmp; int i; to_param_t *params; + to_param_t *lparam; memset(uri_b, 0, NUM_DIVERSION_BODIES * sizeof(to_body_t)); @@ -66,17 +66,27 @@ int parse_diversion_body(char *buf, int len, diversion_body_t **body) } /* id.body should contain all info including uri and params */ - body_len = uri_b[num_uri].body.len; - /* Loop over all params */ params = uri_b[num_uri].param_lst; + lparam = NULL; while(params) { - body_len += - params->name.len + params->value.len + 2; // 2 for '=' and ';' + lparam = params; params = params->next; } - uri_b[num_uri].body.len = body_len; + if(lparam) { + if(lparam->value.len > 0) { + uri_b[num_uri].body.len = + lparam->value.s + lparam->value.len - uri_b[num_uri].body.s; + if(*(lparam->value.s - 1) == '"' + || *(lparam->value.s - 1) == '\'') { + uri_b[num_uri].body.len++; + } + } else { + uri_b[num_uri].body.len = + lparam->name.s + lparam->name.len - uri_b[num_uri].body.s; + } + } num_uri++; while(*tmp == ',' && (num_uri < NUM_DIVERSION_BODIES)) { @@ -132,17 +142,25 @@ int parse_diversion_body(char *buf, int len, diversion_body_t **body) } /* id.body should contain all info including uri and params */ - body_len = uri_b[num_uri].body.len; - /* Loop over all params */ params = uri_b[num_uri].param_lst; while(params) { - body_len += params->name.len + params->value.len - + 2; /* 2 for '=' and ';' */ + lparam = params; params = params->next; } - - uri_b[num_uri].body.len = body_len; + if(lparam) { + if(lparam->value.len > 0) { + uri_b[num_uri].body.len = lparam->value.s + lparam->value.len + - uri_b[num_uri].body.s; + if(*(lparam->value.s - 1) == '"' + || *(lparam->value.s - 1) == '\'') { + uri_b[num_uri].body.len++; + } + } else { + uri_b[num_uri].body.len = lparam->name.s + lparam->name.len + - uri_b[num_uri].body.s; + } + } num_uri++; } diff --git a/src/core/parser/sdp/sdp_helpr_funcs.c b/src/core/parser/sdp/sdp_helpr_funcs.c index 893ef0e58..60613ff82 100644 --- a/src/core/parser/sdp/sdp_helpr_funcs.c +++ b/src/core/parser/sdp/sdp_helpr_funcs.c @@ -330,12 +330,9 @@ int extract_candidate(str *body, sdp_stream_cell_t *stream) fl = space - start; - start = space + 1; len = len - (space - start + 1); - if(start + len > body->s + body->len) { - LM_ERR("no component in `a=candidate'\n"); - return -1; - } + start = space + 1; + space = memchr(start, 32, len); if(space == NULL) { LM_ERR("no component in `a=candidate'\n"); @@ -735,7 +732,12 @@ int extract_sess_version(str *oline, str *sess_version) } i++; - } while(len < oline->len && i < 3); + } while((cp < oline->s + oline->len) && i < 3); + + if(cp == NULL || cp0 == NULL || cp >= oline->s + oline->len) { + LM_ERR("broken o= line - version field not found\n"); + return -1; + } len = cp - cp0 - 1; LM_DBG("end %d: >%.*s<\n", len, len, cp0); diff --git a/src/core/pv_core.c b/src/core/pv_core.c index c889f7572..87bf4cc91 100644 --- a/src/core/pv_core.c +++ b/src/core/pv_core.c @@ -168,24 +168,27 @@ static int pv_get_defn(sip_msg_t *msg, pv_param_t *param, pv_value_t *res) } } +/* clang-format off */ /** * */ static pv_export_t core_pvs[] = { - /* return code, various synonims */ - {STR_STATIC_INIT("?"), PVT_OTHER, pv_get_retcode, 0, 0, 0, 0, 0}, - {STR_STATIC_INIT("rc"), PVT_OTHER, pv_get_retcode, 0, 0, 0, 0, 0}, - {STR_STATIC_INIT("retcode"), PVT_OTHER, pv_get_retcode, 0, 0, 0, 0, 0}, - {STR_STATIC_INIT("env"), PVT_OTHER, pv_get_env, 0, pv_parse_env_name, 0, - 0, 0}, - {STR_STATIC_INIT("envn"), PVT_OTHER, pv_get_envn, 0, pv_parse_envn_name, - 0, 0, 0}, - {STR_STATIC_INIT("def"), PVT_OTHER, pv_get_def, 0, pv_parse_def_name, 0, - 0, 0}, - {STR_STATIC_INIT("defn"), PVT_OTHER, pv_get_defn, 0, pv_parse_defn_name, - 0, 0, 0}, - - {{0, 0}, 0, 0, 0, 0, 0, 0, 0}}; + /* return code, various synonims */ + {STR_STATIC_INIT("?"), PVT_OTHER, pv_get_retcode, 0, 0, 0, 0, 0}, + {STR_STATIC_INIT("rc"), PVT_OTHER, pv_get_retcode, 0, 0, 0, 0, 0}, + {STR_STATIC_INIT("retcode"), PVT_OTHER, pv_get_retcode, 0, 0, 0, 0, 0}, + {STR_STATIC_INIT("env"), PVT_OTHER, pv_get_env, 0, pv_parse_env_name, 0, + 0, 0}, + {STR_STATIC_INIT("envn"), PVT_OTHER, pv_get_envn, 0, pv_parse_envn_name, + 0, 0, 0}, + {STR_STATIC_INIT("def"), PVT_OTHER, pv_get_def, 0, pv_parse_def_name, 0, + 0, 0}, + {STR_STATIC_INIT("defn"), PVT_OTHER, pv_get_defn, 0, pv_parse_defn_name, + 0, 0, 0}, + + {{0, 0}, 0, 0, 0, 0, 0, 0, 0} +}; +/* clang-format on */ /** * register built-in core pvars. diff --git a/src/core/sr_module.h b/src/core/sr_module.h index 80538c604..fbb8e265d 100644 --- a/src/core/sr_module.h +++ b/src/core/sr_module.h @@ -154,7 +154,7 @@ void ksr_module_set_flag(unsigned int flag); -127 /**< special rank, the context is the main kamailio process, but this is guaranteed to be executed before any process is forked, so it can be used - to setup shared variables that depend on some + to set up shared variables that depend on some after mod_init available information (e.g. total number of processes). @warning child_init(PROC_MAIN) is again called @@ -310,7 +310,7 @@ typedef struct module_exports } module_exports_t; -/** kamailio module exports version coverted for core operations */ +/** kamailio module exports version converted for core operations */ typedef struct ksr_module_exports { /**< null terminated module name */ @@ -347,7 +347,7 @@ typedef struct sr_module extern sr_module_t *modules; /**< global module list*/ extern response_function *mod_response_cbks; /**< response callback array */ -extern int mod_response_cbk_no; /**< size of reponse callbacks array */ +extern int mod_response_cbk_no; /**< size of response callbacks array */ int register_builtin_modules(void); int ksr_load_module(char *path, char *opts); diff --git a/src/core/srapi.c b/src/core/srapi.c index 99fbf49d8..3be80b4d0 100644 --- a/src/core/srapi.c +++ b/src/core/srapi.c @@ -19,7 +19,9 @@ #include #include + #include "dprint.h" +#include "route.h" #include "srapi.h" @@ -69,3 +71,98 @@ sr_cfgenv_t *sr_cfgenv_get(void) { return &_sr_cfgenv; } + +/** + * + */ +#define KSR_MSG_ENV_STACK_SIZE 8 +static ksr_msg_env_data_t _ksr_msg_env_stack[KSR_MSG_ENV_STACK_SIZE]; +static int _ksr_msg_env_stack_idx = 0; + +/** + * + */ +int ksr_msg_env_data_destroy(ksr_msg_env_data_t *denv) +{ + if(denv == NULL) { + return -1; + } + destroy_avp_list(&denv->avps_uri_from); + destroy_avp_list(&denv->avps_uri_to); + destroy_avp_list(&denv->avps_user_from); + destroy_avp_list(&denv->avps_user_to); + destroy_avp_list(&denv->avps_domain_from); + destroy_avp_list(&denv->avps_domain_to); + xavp_destroy_list(&denv->xavps); + xavp_destroy_list(&denv->xavus); + xavp_destroy_list(&denv->xavis); + + return 0; +} + +/** + * + */ +int ksr_msg_env_push(ksr_msg_env_links_t *oenv) +{ + ksr_msg_env_data_t *senv = NULL; + + if(_ksr_msg_env_stack_idx >= KSR_MSG_ENV_STACK_SIZE) { + LM_ERR("msg env stack size exceeded\n"); + return -1; + } + senv = &_ksr_msg_env_stack[_ksr_msg_env_stack_idx]; + memset(&_ksr_msg_env_stack[_ksr_msg_env_stack_idx], 0, + sizeof(ksr_msg_env_data_t)); + + oenv->route_type = get_route_type(); + + oenv->avps_uri_from = + set_avp_list(AVP_TRACK_FROM | AVP_CLASS_URI, &senv->avps_uri_from); + oenv->avps_uri_to = + set_avp_list(AVP_TRACK_TO | AVP_CLASS_URI, &senv->avps_uri_to); + oenv->avps_user_from = set_avp_list( + AVP_TRACK_FROM | AVP_CLASS_USER, &senv->avps_user_from); + oenv->avps_user_to = + set_avp_list(AVP_TRACK_TO | AVP_CLASS_USER, &senv->avps_user_to); + oenv->avps_domain_from = set_avp_list( + AVP_TRACK_FROM | AVP_CLASS_DOMAIN, &senv->avps_domain_from); + oenv->avps_domain_to = set_avp_list( + AVP_TRACK_TO | AVP_CLASS_DOMAIN, &senv->avps_domain_to); + oenv->xavps = xavp_set_list(&senv->xavps); + oenv->xavus = xavu_set_list(&senv->xavus); + oenv->xavis = xavi_set_list(&senv->xavis); + + _ksr_msg_env_stack_idx++; + + return 0; +} + +/** + * + */ +int ksr_msg_env_pop(ksr_msg_env_links_t *menv) +{ + if(_ksr_msg_env_stack_idx <= 0) { + LM_ERR("invalid msg env stack index\n"); + return -1; + } + + ksr_msg_env_data_destroy(&_ksr_msg_env_stack[_ksr_msg_env_stack_idx - 1]); + + set_route_type(menv->route_type); + + set_avp_list(AVP_TRACK_FROM | AVP_CLASS_URI, menv->avps_uri_from); + set_avp_list(AVP_TRACK_TO | AVP_CLASS_URI, menv->avps_uri_to); + set_avp_list(AVP_TRACK_FROM | AVP_CLASS_USER, menv->avps_user_from); + set_avp_list(AVP_TRACK_TO | AVP_CLASS_USER, menv->avps_user_to); + set_avp_list(AVP_TRACK_FROM | AVP_CLASS_DOMAIN, menv->avps_domain_from); + set_avp_list(AVP_TRACK_TO | AVP_CLASS_DOMAIN, menv->avps_domain_to); + xavp_set_list(menv->xavps); + xavu_set_list(menv->xavus); + xavi_set_list(menv->xavis); + + _ksr_msg_env_stack_idx--; + + return 0; +} diff --git a/src/core/srapi.h b/src/core/srapi.h index 1f5f8e7d3..0081624b7 100644 --- a/src/core/srapi.h +++ b/src/core/srapi.h @@ -20,6 +20,8 @@ #define __SRAPI_H__ #include "str.h" +#include "usr_avp.h" +#include "xavp.h" #include "parser/msg_parser.h" typedef void (*sr_generate_callid_f)(str *); @@ -39,4 +41,36 @@ typedef struct sr_cfgenv void sr_cfgenv_init(void); sr_cfgenv_t *sr_cfgenv_get(void); +typedef struct ksr_msg_env_data +{ + int route_type; + avp_list_t avps_user_from; + avp_list_t avps_user_to; + avp_list_t avps_domain_from; + avp_list_t avps_domain_to; + avp_list_t avps_uri_from; + avp_list_t avps_uri_to; + sr_xavp_t *xavps; + sr_xavp_t *xavus; + sr_xavp_t *xavis; +} ksr_msg_env_data_t; + +typedef struct ksr_msg_env_links +{ + int route_type; + avp_list_t *avps_user_from; + avp_list_t *avps_user_to; + avp_list_t *avps_domain_from; + avp_list_t *avps_domain_to; + avp_list_t *avps_uri_from; + avp_list_t *avps_uri_to; + sr_xavp_t **xavps; + sr_xavp_t **xavus; + sr_xavp_t **xavis; +} ksr_msg_env_links_t; + +int ksr_msg_env_push(ksr_msg_env_links_t *menv); +int ksr_msg_env_pop(ksr_msg_env_links_t *menv); +int ksr_msg_env_data_destroy(ksr_msg_env_data_t *denv); + #endif diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c index 391255cab..b24349a8b 100644 --- a/src/core/tcp_main.c +++ b/src/core/tcp_main.c @@ -352,6 +352,17 @@ static int init_sock_opt(int s, int af) } } #endif +#ifdef HAVE_TCP_USER_TIMEOUT + if((optval = TICKS_TO_S(cfg_get(tcp, tcp_cfg, send_timeout)))) { + optval *= 1000; + if(setsockopt(s, IPPROTO_TCP, TCP_USER_TIMEOUT, &optval, sizeof(optval)) + < 0) { + LM_WARN("failed to set TCP_USER_TIMEOUT: %s\n", strerror(errno)); + } else { + LM_DBG("Set TCP_USER_TIMEOUT=%d ms\n", optval); + } + } +#endif #ifdef HAVE_TCP_QUICKACK if(cfg_get(tcp, tcp_cfg, delayed_ack)) { optval = 0; /* reset quick ack => delayed ack */ @@ -5564,9 +5575,9 @@ void tcp_timer_check_connections(unsigned int ticks, void *param) if(n > 0) { for(i = 0; i < n; i++) { if((con = tcpconn_get(tcpidlist[i], 0, 0, 0, 0))) { - LM_CRIT("message processing timeout on connection id: %d " - "(state: %d) - " - "closing\n", + LM_DBG("message processing timeout on connection id: %d " + "(state: %d) - " + "closing\n", tcpidlist[i], con->state); mcmd[0] = (long)con; mcmd[1] = CONN_EOF; diff --git a/src/core/udp_server.c b/src/core/udp_server.c index fec05ee77..b4e87ada3 100644 --- a/src/core/udp_server.c +++ b/src/core/udp_server.c @@ -348,7 +348,7 @@ int probe_max_send_buffer(int udp_sock) #ifdef USE_MCAST /* - * Setup multicast receiver + * Set up multicast receiver */ static int setup_mcast_rcvr( int sock, union sockaddr_union *addr, char *interface) diff --git a/src/core/utils/tmrec.c b/src/core/utils/tmrec.c index 09749bcee..eec02d224 100644 --- a/src/core/utils/tmrec.c +++ b/src/core/utils/tmrec.c @@ -1030,7 +1030,7 @@ int check_freq_interval(tmrec_t *_trp, ac_tm_t *_atp) ? REC_MATCH : REC_NOMATCH; case FREQ_MONTHLY: - _t0 = (_atp->t.tm_year - _trp->ts.tm_year) * 12 + _atp->t.tm_mon + _t0 = 12ULL * (_atp->t.tm_year - _trp->ts.tm_year) + _atp->t.tm_mon - _trp->ts.tm_mon; return (_t0 % _trp->interval == 0) ? REC_MATCH : REC_NOMATCH; case FREQ_YEARLY: @@ -1104,6 +1104,7 @@ int check_min_unit(tmrec_t *_trp, ac_tm_t *_atp, tr_res_t *_tsw) int check_byxxx(tmrec_t *_trp, ac_tm_t *_atp) { int i; + int v; ac_maxval_t *_amp = NULL; if(!_trp || !_atp) return REC_ERR; @@ -1117,9 +1118,12 @@ int check_byxxx(tmrec_t *_trp, ac_tm_t *_atp) if(_trp->bymonth) { for(i = 0; i < _trp->bymonth->nr; i++) { - if(_atp->t.tm_mon - == (_trp->bymonth->xxx[i] * _trp->bymonth->req[i] + 12) - % 12) + if(_trp->bymonth->req[i] < 0) { + v = 12 - _trp->bymonth->xxx[i]; + } else { + v = _trp->bymonth->xxx[i] - 1; + } + if(_atp->t.tm_mon == v) break; } if(i >= _trp->bymonth->nr) diff --git a/src/lib/ims/ims_getters.c b/src/lib/ims/ims_getters.c index 8d97a7a54..aabf221d9 100644 --- a/src/lib/ims/ims_getters.c +++ b/src/lib/ims/ims_getters.c @@ -1310,6 +1310,7 @@ int cscf_get_p_charging_vector( p = strtok(header_body.s, " ;:\r\t\n\"="); loop: if(p == NULL || p > (header_body.s + header_body.len)) { + ims_str_free(header_body, pkg); return 1; } diff --git a/src/lib/srdb1/db_query.h b/src/lib/srdb1/db_query.h index 4c195b352..bb9a98f4e 100644 --- a/src/lib/srdb1/db_query.h +++ b/src/lib/srdb1/db_query.h @@ -48,7 +48,7 @@ * \brief Helper function for db queries * * This method evaluates the actual arguments for the database query and - * setups the string that is used for the query in the db module. + * sets up the string that is used for the query in the db module. * Then it submits the query and stores the result if necessary. It uses for * its work the implementation in the concrete database module. * @@ -59,7 +59,7 @@ * \param _c column names that should be returned * \param _n number of key/value pairs that are compared, if zero then no comparison is done * \param _nc number of columns that should be returned - * \param _o order by the specificied column, optional + * \param _o order by the specified column, optional * \param _r the result that is returned, set to NULL if you want to use fetch_result later * \param (*val2str) function pointer to the db specific val conversion function * \param (*submit_query) function pointer to the db specific query submit function @@ -77,7 +77,7 @@ int db_do_query(const db1_con_t *_h, const db_key_t *_k, const db_op_t *_op, * \brief Helper function for db queries with update lock * * This method evaluates the actual arguments for the database query and - * setups the string that is used for the query in the db module. + * sets up the string that is used for the query in the db module. * Then it submits the query and stores the result if necessary. It uses for * its work the implementation in the concrete database module. * @@ -88,7 +88,7 @@ int db_do_query(const db1_con_t *_h, const db_key_t *_k, const db_op_t *_op, * \param _c column names that should be returned * \param _n number of key/value pairs that are compared, if zero then no comparison is done * \param _nc number of columns that should be returned - * \param _o order by the specificied column, optional + * \param _o order by the specified column, optional * \param _r the result that is returned, set to NULL if you want to use fetch_result later * \param (*val2str) function pointer to the db specific val conversion function * \param (*submit_query) function pointer to the db specific query submit function @@ -106,7 +106,7 @@ int db_do_query_lock(const db1_con_t *_h, const db_key_t *_k, * \brief Helper function for raw db queries * * This method evaluates the actual arguments for the database raw query - * and setups the string that is used for the query in the db module. + * and sets up the string that is used for the query in the db module. * Then it submits the query and stores the result if necessary. * It uses for its work the implementation in the concrete database module. * @@ -126,7 +126,7 @@ int db_do_raw_query(const db1_con_t *_h, const str *_s, db1_res_t **_r, * \brief Helper function for db insert operations * * This method evaluates the actual arguments for the database operation - * and setups the string that is used for the insert operation in the db + * and sets up the string that is used for the insert operation in the db * module. Then it submits the query for the operation. It uses for its work * the implementation in the concrete database module. * @@ -148,7 +148,7 @@ int db_do_insert(const db1_con_t *_h, const db_key_t *_k, const db_val_t *_v, * \brief Helper function for db delete operations * * This method evaluates the actual arguments for the database operation - * and setups the string that is used for the delete operation in the db + * and sets up the string that is used for the delete operation in the db * module. Then it submits the query for the operation. It uses for its work * the implementation in the concrete database module. * @@ -171,7 +171,7 @@ int db_do_delete(const db1_con_t *_h, const db_key_t *_k, const db_op_t *_o, * \brief Helper function for db update operations * * This method evaluates the actual arguments for the database operation - * and setups the string that is used for the update operation in the db + * and sets up the string that is used for the update operation in the db * module. Then it submits the query for the operation. It uses for its work * the implementation in the concrete database module. * @@ -198,7 +198,7 @@ int db_do_update(const db1_con_t *_h, const db_key_t *_k, const db_op_t *_o, * \brief Helper function for db delete operations * * This helper method evaluates the actual arguments for the database operation - * and setups the string that is used for the replace operation in the db + * and sets up the string that is used for the replace operation in the db * module. Then it submits the query for the operation. It uses for its work the * implementation in the concrete database module. * @@ -220,7 +220,7 @@ int db_do_replace(const db1_con_t *_h, const db_key_t *_k, const db_val_t *_v, * \brief Helper function for db insert delayed operations * * This method evaluates the actual arguments for the database operation - * and setups the string that is used for the insert delayed operation in the db + * and sets up the string that is used for the insert delayed operation in the db * module. Then it submits the query for the operation. It uses for its work * the implementation in the concrete database module. * diff --git a/src/main.c b/src/main.c index a29857757..b05f4e4b3 100644 --- a/src/main.c +++ b/src/main.c @@ -288,6 +288,7 @@ void print_internals(void) printf(" Version: %s\n", full_version); printf(" Default config: %s\n", CFG_FILE); printf(" Default paths to modules: %s\n", MODS_DIR); + printf(" Default path to runtime dir: %s\n", RUN_DIR); printf(" Compile flags: %s\n", ver_flags); printf(" MAX_RECV_BUFFER_SIZE=%d\n", MAX_RECV_BUFFER_SIZE); printf(" MAX_SEND_BUFFER_SIZE=%d\n", MAX_SEND_BUFFER_SIZE); diff --git a/src/modules/app_python3/README b/src/modules/app_python3/README index 5a012417d..98d7c3725 100644 --- a/src/modules/app_python3/README +++ b/src/modules/app_python3/README @@ -177,6 +177,10 @@ modparam("app_python3", "child_init_method", "my_child_init") If set to 0, use PyGILState_Ensure()/PyGILState_Release() (the mode implemented initially). + If set to 1, Python threading Thread objects created in the KEMI script + will be scheduled. Otherwise, additional Python threads will not be + scheduled (no release of GIL). + Default value is “0”. Example 1.4. Set threads_mode parameter diff --git a/src/modules/app_python3/app_python3_mod.c b/src/modules/app_python3/app_python3_mod.c index 7436d528f..a25a0e354 100644 --- a/src/modules/app_python3/app_python3_mod.c +++ b/src/modules/app_python3/app_python3_mod.c @@ -59,7 +59,7 @@ int _apy_process_rank = 0; int _ksr_apy3_threads_mode = 0; PyThreadState *myThreadState = NULL; -__thread PyThreadState *_save = NULL; +PyThreadState *_save = NULL; /* clang-format off */ /** module parameters */ diff --git a/src/modules/app_python3/doc/app_python3_admin.xml b/src/modules/app_python3/doc/app_python3_admin.xml index 87b97f082..20eeae6ff 100644 --- a/src/modules/app_python3/doc/app_python3_admin.xml +++ b/src/modules/app_python3/doc/app_python3_admin.xml @@ -168,6 +168,10 @@ modparam("app_python3", "child_init_method", "my_child_init") v6.0.x). If set to 0, use PyGILState_Ensure()/PyGILState_Release() (the mode implemented initially). + + If set to 1, Python threading Thread objects created in the KEMI script will be scheduled. Otherwise, + additional Python threads will not be scheduled (no release of GIL). + Default value is 0. diff --git a/src/modules/app_python3/python_exec.c b/src/modules/app_python3/python_exec.c index 3c62265ab..d4c0f519d 100644 --- a/src/modules/app_python3/python_exec.c +++ b/src/modules/app_python3/python_exec.c @@ -49,7 +49,7 @@ sr_apy_env_t *sr_apy_env_get() return &_sr_apy_env; } -extern __thread PyThreadState *_save; +extern PyThreadState *_save; extern int _ksr_apy3_threads_mode; #define LOCK_RELEASE \ diff --git a/src/modules/app_python3s/README b/src/modules/app_python3s/README index af38af3e8..cf79c7fed 100644 --- a/src/modules/app_python3s/README +++ b/src/modules/app_python3s/README @@ -174,6 +174,10 @@ def ksr_script_child_init(): If set to 0, use PyGILState_Ensure()/PyGILState_Release() (the mode implemented initially). + If set to 1, Python threading Thread objects created in the KEMI script + will be scheduled. Otherwise, additional Python threads will not be + scheduled (no release of GIL). + Default value is “0”. Example 1.4. Set threads_mode parameter diff --git a/src/modules/app_python3s/app_python3s_mod.c b/src/modules/app_python3s/app_python3s_mod.c index a99154366..876bd3c2a 100644 --- a/src/modules/app_python3s/app_python3s_mod.c +++ b/src/modules/app_python3s/app_python3s_mod.c @@ -60,7 +60,7 @@ int _apy3s_process_rank = 0; int _ksr_apy3s_threads_mode = 0; PyThreadState *myThreadState = NULL; -__thread PyThreadState *_save = NULL; +PyThreadState *_save = NULL; static int apy3s_script_init_exec(PyObject *pModule, str *fname, int *vparam); diff --git a/src/modules/app_python3s/apy3s_kemi.c b/src/modules/app_python3s/apy3s_kemi.c index c25ccfdc9..48ee1c46b 100644 --- a/src/modules/app_python3s/apy3s_kemi.c +++ b/src/modules/app_python3s/apy3s_kemi.c @@ -52,7 +52,7 @@ extern str _sr_python_load_file; extern int _apy3s_process_rank; extern int _ksr_apy3s_threads_mode; -extern __thread PyThreadState *_save; +extern PyThreadState *_save; int apy_reload_script(void); @@ -69,8 +69,6 @@ sr_apy_env_t *sr_apy_env_get() /** * */ -extern __thread PyThreadState *_save; - int apy3s_exec_func(sip_msg_t *_msg, char *fname, char *fparam, int emode) { PyObject *pFunc, *pArgs, *pValue; diff --git a/src/modules/app_python3s/doc/app_python3s_admin.xml b/src/modules/app_python3s/doc/app_python3s_admin.xml index 8381dda27..bb9e86c8c 100644 --- a/src/modules/app_python3s/doc/app_python3s_admin.xml +++ b/src/modules/app_python3s/doc/app_python3s_admin.xml @@ -160,6 +160,10 @@ def ksr_script_child_init(): v6.0.x). If set to 0, use PyGILState_Ensure()/PyGILState_Release() (the mode implemented initially). + + If set to 1, Python threading Thread objects created in the KEMI script will be scheduled. Otherwise, + additional Python threads will not be scheduled (no release of GIL). + Default value is 0. diff --git a/src/modules/carrierroute/cr_rpc_helper.c b/src/modules/carrierroute/cr_rpc_helper.c index fa1537151..5077875bc 100644 --- a/src/modules/carrierroute/cr_rpc_helper.c +++ b/src/modules/carrierroute/cr_rpc_helper.c @@ -107,7 +107,7 @@ static int update_route_data_recursor( if(rr->host.s) { shm_free(rr->host.s); } - if(opts->new_host.len) { + if(opts->new_host.s && opts->new_host.len) { if((rr->host.s = shm_malloc(opts->new_host.len + 1)) == NULL) { SHM_MEM_ERROR; @@ -132,12 +132,10 @@ static int update_route_data_recursor( FIFO_ERR(E_RESET); return -1; } - if(opts->new_host.len > 0) { + if(opts->new_host.s && opts->new_host.len > 0) { LM_INFO("deactivating host %.*s\n", rr->host.len, rr->host.s); - if(opts->new_host.s - && (strcmp(opts->new_host.s, rr->host.s) - == 0)) { + if(strcmp(opts->new_host.s, rr->host.s) == 0) { LM_ERR("Backup host the same as initial host " "%.*s", rr->host.len, rr->host.s); diff --git a/src/modules/cdp/CMakeLists.txt b/src/modules/cdp/CMakeLists.txt index 41758eb30..7d48b3af4 100644 --- a/src/modules/cdp/CMakeLists.txt +++ b/src/modules/cdp/CMakeLists.txt @@ -3,5 +3,6 @@ file(GLOB MODULE_SOURCES "*.c") add_library(${module_name} SHARED ${MODULE_SOURCES}) find_package(LibXml2 REQUIRED) +find_package(OpenSSL REQUIRED) -target_link_libraries(${module_name} PRIVATE LibXml2::LibXml2) +target_link_libraries(${module_name} PRIVATE LibXml2::LibXml2 OpenSSL::SSL) diff --git a/src/modules/cdp/README b/src/modules/cdp/README index 79e4f8512..80f6970a8 100644 --- a/src/modules/cdp/README +++ b/src/modules/cdp/README @@ -52,13 +52,14 @@ Carsten Bock 6. RPC Commands - 6.1. cdp.disable_peer - 6.2. cdp.enable_peer + 6.1. States + 6.2. cdp.disable_peer + 6.3. cdp.enable_peer + 6.4. cdp.list_peers 7. Configuration Examples 7.1. DiameterPeer.xml example - 7.2. 2. Developer Guide @@ -147,8 +148,8 @@ Carsten Bock 1.9. Set certificate parameter 1.10. Set ca_list parameter 1.11. cdp_check_peer usage - 1.12. cdp_check_peer usage - 1.13. cdp_check_peer usage + 1.12. cdp_has_app usage + 1.13. cdp_has_app usage 1.14. DiameterPeer.xml example Chapter 1. Admin Guide @@ -182,13 +183,14 @@ Chapter 1. Admin Guide 6. RPC Commands - 6.1. cdp.disable_peer - 6.2. cdp.enable_peer + 6.1. States + 6.2. cdp.disable_peer + 6.3. cdp.enable_peer + 6.4. cdp.list_peers 7. Configuration Examples 7.1. DiameterPeer.xml example - 7.2. 1. Overview @@ -238,7 +240,8 @@ Chapter 1. Admin Guide The following libraries or applications must be installed before running Kamailio with this module loaded: - * None. + * libxml, + * openssl. 4. Parameters @@ -421,7 +424,7 @@ if(!cdp_check_peer("hss.mnc001.mcc001.3gppnetwork.org")) { * vendorid - The Vendor ID of the App application - The Application ID - Example 1.12. cdp_check_peer usage + Example 1.12. cdp_has_app usage ... if(!cdp_has_app("10415", "4")) { send_reply("503", "Charging Server not ready"); @@ -429,7 +432,7 @@ if(!cdp_has_app("10415", "4")) { } ... - Example 1.13. cdp_check_peer usage + Example 1.13. cdp_has_app usage ... if(!cdp_has_app("16777216")) { send_reply("503", "Cx/Dx Interface not ready"); @@ -439,23 +442,43 @@ if(!cdp_has_app("16777216")) { 6. RPC Commands - 6.1. cdp.disable_peer - 6.2. cdp.enable_peer + 6.1. States + 6.2. cdp.disable_peer + 6.3. cdp.enable_peer + 6.4. cdp.list_peers + +6.1. States + + * Closed (0) - Not connected + * Wait_Conn_Ack (1) - Connecting - waiting for Ack + * Wait_I_CEA (2) - Connecting - waiting for Capabilities Exchange + Answer + * Wait_Conn_Ack_Elect (3) - Connecting - Acknowledged and going for + Election + * Wait_Returns (4) - Connecting - done + * R_Open (5) - Connected as receiver + * I_Open (6) - Connected as initiator + * Closing (7) - Closing the connection - exported RPC commands. + Exported RPC commands. -6.1. cdp.disable_peer +6.2. cdp.disable_peer instantly disable a particular diameter peer. -6.2. cdp.enable_peer +6.3. cdp.enable_peer enable/re-enable a diameter peer +6.4. cdp.list_peers + + list all configured diameter peers + + State details can be found in the list above (Section 6.1, “States”) + 7. Configuration Examples 7.1. DiameterPeer.xml example - 7.2. 7.1. DiameterPeer.xml example diff --git a/src/modules/cdp/cdp_rpc.c b/src/modules/cdp/cdp_rpc.c index 576b1ba8f..8df60230c 100644 --- a/src/modules/cdp/cdp_rpc.c +++ b/src/modules/cdp/cdp_rpc.c @@ -101,10 +101,10 @@ static void cdp_rpc_list_peers(rpc_t *rpc, void *ctx) lock_release(i->lock); return; } - if(rpc->struct_add(peerdetail_container, "ssd", "State", + if(rpc->struct_add(peerdetail_container, "ssL", "State", dp_states[(int)i->state], "Disabled", i->disabled ? "True" : "False", "Last used", - i->last_selected) + TIME_T_CAST(i->last_selected)) < 0) { rpc->fault(ctx, 500, "Internal error creating peer detail container struct"); diff --git a/src/modules/cdp/cdp_tls.c b/src/modules/cdp/cdp_tls.c index a3cfdfa92..f2c7c7b8b 100644 --- a/src/modules/cdp/cdp_tls.c +++ b/src/modules/cdp/cdp_tls.c @@ -149,16 +149,20 @@ int load_certificates(SSL_CTX *ctx, str *cert, str *key) } if(pkg_str_dup(&key_fixed, key) < 0) { LM_ERR("Failed to copy key parameter\n"); + pkg_free(cert_fixed.s); return -1; } if(!SSL_CTX_use_certificate_chain_file(ctx, cert_fixed.s)) { LM_ERR("Unable to load certificate file\n"); TLS_LM_ERR("load_cert:", ctx); + pkg_free(key_fixed.s); + pkg_free(cert_fixed.s); return -1; } if(SSL_CTX_use_PrivateKey_file(ctx, key_fixed.s, SSL_FILETYPE_PEM) <= 0) { LM_ERR("Unable to load private key file\n"); TLS_LM_ERR("load_private_key:", ctx); + pkg_free(key_fixed.s); return -1; } if(!SSL_CTX_check_private_key(ctx)) { diff --git a/src/modules/cdp/doc/cdp_admin.xml b/src/modules/cdp/doc/cdp_admin.xml index 2be939868..afc93be50 100644 --- a/src/modules/cdp/doc/cdp_admin.xml +++ b/src/modules/cdp/doc/cdp_admin.xml @@ -82,7 +82,10 @@ The following libraries or applications must be installed before running &kamailio; with this module loaded: - None. + libxml, + + + openssl. @@ -362,7 +365,7 @@ if(!cdp_check_peer("hss.mnc001.mcc001.3gppnetwork.org")) { - <function>cdp_check_peer</function> usage + <function>cdp_has_app</function> usage ... if(!cdp_has_app("10415", "4")) { @@ -373,7 +376,7 @@ if(!cdp_has_app("10415", "4")) { - <function>cdp_check_peer</function> usage + <function>cdp_has_app</function> usage ... if(!cdp_has_app("16777216")) { @@ -389,7 +392,20 @@ if(!cdp_has_app("16777216")) {
RPC Commands - exported RPC commands. +
+ States + + Closed (0) - Not connected + Wait_Conn_Ack (1) - Connecting - waiting for Ack + Wait_I_CEA (2) - Connecting - waiting for Capabilities Exchange Answer + Wait_Conn_Ack_Elect (3) - Connecting - Acknowledged and going for Election + Wait_Returns (4) - Connecting - done + R_Open (5) - Connected as receiver + I_Open (6) - Connected as initiator + Closing (7) - Closing the connection + +
+ Exported RPC commands.
cdp.disable_peer @@ -402,6 +418,14 @@ if(!cdp_has_app("16777216")) { enable/re-enable a diameter peer
+ +
+ cdp.list_peers + list all configured diameter peers + + State details can be found in the list above () + +
@@ -535,7 +559,5 @@ if(!cdp_has_app("16777216")) {
- -
diff --git a/src/modules/cfgutils/cfgutils.c b/src/modules/cfgutils/cfgutils.c index fd0a5e5b2..2d3809e67 100644 --- a/src/modules/cfgutils/cfgutils.c +++ b/src/modules/cfgutils/cfgutils.c @@ -1050,7 +1050,7 @@ static sr_kemi_t sr_kemi_cfgutils_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, - { str_init("cfgutils"), str_init("lock"), + { str_init("cfgutils"), str_init("lock_key2"), SR_KEMIP_INT, cfg_lock_key2, { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } @@ -1060,7 +1060,7 @@ static sr_kemi_t sr_kemi_cfgutils_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, - { str_init("cfgutils"), str_init("unlock"), + { str_init("cfgutils"), str_init("unlock_key2"), SR_KEMIP_INT, cfg_unlock_key2, { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } @@ -1070,7 +1070,7 @@ static sr_kemi_t sr_kemi_cfgutils_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, - { str_init("cfgutils"), str_init("trylock"), + { str_init("cfgutils"), str_init("trylock_key2"), SR_KEMIP_INT, cfg_trylock_key2, { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } diff --git a/src/modules/dialog/README b/src/modules/dialog/README index 6bfa6e44d..be626d40c 100644 --- a/src/modules/dialog/README +++ b/src/modules/dialog/README @@ -2211,6 +2211,7 @@ kamcmd dlg.list_ctx greater comparison; 'lt' - match using integer lesser comparison. Integer comparison can be used only with 'start_ts' key. * mval - matching value. + * limit (optional) - limit of matched dialogs. RPC Command Format: ... diff --git a/src/modules/dialog/dlg_req_within.c b/src/modules/dialog/dlg_req_within.c index 62b6aea1a..1e7c71c17 100644 --- a/src/modules/dialog/dlg_req_within.c +++ b/src/modules/dialog/dlg_req_within.c @@ -376,7 +376,8 @@ error: * DLG_CALLER_LEG (0): caller * DLG_CALLEE_LEG (1): callee */ -static inline int send_bye(struct dlg_cell *cell, int dir, str *hdrs) +static inline int send_bye( + struct dlg_cell *cell, int dir, str *hdrs, int enforce) { uac_req_t uac_r; dlg_t *dialog_info; @@ -386,16 +387,15 @@ static inline int send_bye(struct dlg_cell *cell, int dir, str *hdrs) str lhdrs; /* dialog is already in deleted state, nothing to do */ - if(cell->state == DLG_STATE_DELETED) { + if(cell->state == DLG_STATE_DELETED && enforce == 0) { LM_WARN("dlg [%u:%u] with callid %.*s already in deleted state, BYE " "not sent.\n", cell->h_entry, cell->h_id, cell->callid.len, cell->callid.s); - return 0; + return 1; } /* Send Cancel or final response for non-confirmed dialogs */ - if(cell->state != DLG_STATE_CONFIRMED_NA - && cell->state != DLG_STATE_CONFIRMED) { + if(cell->state < DLG_STATE_CONFIRMED_NA) { if(cell->t) { if(dir == DLG_CALLER_LEG) { if(d_tmb.t_reply(cell->t->uas.request, bye_early_code, @@ -407,7 +407,7 @@ static inline int send_bye(struct dlg_cell *cell, int dir, str *hdrs) LM_DBG("\"%d %.*s\" sent to caller\n", bye_early_code, bye_early_reason.len, bye_early_reason.s); } else { - d_tmb.cancel_all_uacs(cell->t, 0); + d_tmb.cancel_all_uacs(cell->t, F_CANCEL_LOCAL); LM_DBG("CANCEL sent to callee(s)\n"); } return 0; @@ -425,10 +425,9 @@ static inline int send_bye(struct dlg_cell *cell, int dir, str *hdrs) goto err; } - /* safety bump of cseq if prack was involved in call setup */ - if(cell->iflags & DLG_IFLAG_PRACK) { - dialog_info->loc_seq.value += 80; - } + /* safety bump of cseq for callee side if prack was involved in call setup + * or keepalives were sent to caller side */ + dialog_info->loc_seq.value += 100; LM_DBG("sending BYE to %s\n", (dir == DLG_CALLER_LEG) ? "caller" : "callee"); @@ -494,7 +493,12 @@ dlg_t *build_dlg_t_early( goto error; } - if(msg == NULL || msg->first_line.type != SIP_REPLY) { + if(msg == NULL) { + LM_ERR("no sip message\n"); + goto error; + } + + if(msg->first_line.type != SIP_REPLY) { if(!cell->t) { LM_ERR("no transaction associated\n"); goto error; @@ -784,10 +788,13 @@ int dlg_send_ka(dlg_cell_t *dlg, int dir) /* tm increases cseq value, decrease it no to make it invalid * - dialog is ended on timeout (408) or C/L does not exist (481) */ - if(di->loc_seq.value > 1) + if(di->loc_seq.value > 1) { di->loc_seq.value -= 2; - else + di->loc_seq.is_set = DLG_SEQ_VALSET; + } else { di->loc_seq.value = 0; + di->loc_seq.is_set = DLG_SEQ_VALNEW; + } LM_DBG("sending OPTIONS to %s\n", (dir == DLG_CALLER_LEG) ? "caller" : "callee"); @@ -843,7 +850,7 @@ int dlg_bye(struct dlg_cell *dlg, str *hdrs, int side) LM_ERR("failed to build dlg headers\n"); return -1; } - ret = send_bye(dlg, side, &all_hdrs); + ret = send_bye(dlg, side, &all_hdrs, 0); pkg_free(all_hdrs.s); dlg_run_event_route(dlg, NULL, dlg->state, DLG_STATE_DELETED); @@ -864,8 +871,10 @@ int dlg_bye_all(struct dlg_cell *dlg, str *hdrs) return -1; } - ret = send_bye(dlg, DLG_CALLER_LEG, &all_hdrs); - ret |= send_bye(dlg, DLG_CALLEE_LEG, &all_hdrs); + ret = send_bye(dlg, DLG_CALLER_LEG, &all_hdrs, 0); + if(ret == 0) { + ret |= send_bye(dlg, DLG_CALLEE_LEG, &all_hdrs, 1); + } pkg_free(all_hdrs.s); diff --git a/src/modules/dialog/doc/dialog_admin.xml b/src/modules/dialog/doc/dialog_admin.xml index 4a522cd55..2653f159e 100644 --- a/src/modules/dialog/doc/dialog_admin.xml +++ b/src/modules/dialog/doc/dialog_admin.xml @@ -2848,6 +2848,9 @@ dlg_set_state("early"); mval - matching value. + + limit (optional) - limit of matched dialogs. + RPC Command Format: diff --git a/src/modules/dialplan/CMakeLists.txt b/src/modules/dialplan/CMakeLists.txt index 9c8de9639..9d716f3eb 100644 --- a/src/modules/dialplan/CMakeLists.txt +++ b/src/modules/dialplan/CMakeLists.txt @@ -1,3 +1,14 @@ file(GLOB MODULE_SOURCES "*.c") add_library(${module_name} SHARED ${MODULE_SOURCES}) + +find_package(pcre2 QUIET) +if(NOT pcre2_FOUND) + message(STATUS "PCRE2 library not found... looking with pkg-config") + find_package(PkgConfig REQUIRED) + # TODO: verify we want 8-bit libpcre2 + pkg_check_modules(pcre2 REQUIRED IMPORTED_TARGET libpcre2-8) + add_library(PCRE2::8BIT ALIAS PkgConfig::pcre2) +endif() + +target_link_libraries(${module_name} PRIVATE PCRE2::8BIT) diff --git a/src/modules/dispatcher/dispatch.c b/src/modules/dispatcher/dispatch.c index eef2c72d6..1adcb1be5 100644 --- a/src/modules/dispatcher/dispatch.c +++ b/src/modules/dispatcher/dispatch.c @@ -135,8 +135,8 @@ static int *ds_crt_idx = NULL; static int *ds_next_idx = NULL; static ds_set_t *ds_strictest_node = NULL; -static int ds_strictest_idx; -static int ds_strictness; +static int ds_strictest_idx = 0; +static int ds_strictest_match = 0; #define _ds_list (ds_lists[*ds_crt_idx]) #define _ds_list_nr (*ds_list_nr) @@ -3796,33 +3796,34 @@ int ds_is_addr_from_set(sip_msg_t *_m, struct ip_addr *pipaddr, if(mode & DS_MATCH_MIXSOCKPRPORT) { node_strictness = DS_MATCHED_ADDR; if(node->dlist[j].port) { - if(tport != node->dlist[j].port) - continue; - else + if(tport == node->dlist[j].port) { node_strictness |= DS_MATCHED_PORT; + } } if(node->dlist[j].proto) { - if(tproto != node->dlist[j].proto) - continue; - else + if(tproto == node->dlist[j].proto) { node_strictness |= DS_MATCHED_PROTO; + } } if(node->dlist[j].sock) { - if(node->dlist[j].sock != _m->rcv.bind_address) - continue; - else + if(node->dlist[j].sock == _m->rcv.bind_address) { node_strictness |= DS_MATCHED_SOCK; + } } if(node_strictness == (DS_MATCHED_ADDR | DS_MATCHED_PORT | DS_MATCHED_PROTO - | DS_MATCHED_SOCK)) + | DS_MATCHED_SOCK)) { + ds_strictest_match = node_strictness; + ds_strictest_node = node; + ds_strictest_idx = j; return ds_set_vars(_m, node, j, export_set_pv); + } - if(ds_strictness < node_strictness) { - ds_strictness = node_strictness; + if(ds_strictest_match < node_strictness) { + ds_strictest_match = node_strictness; ds_strictest_node = node; ds_strictest_idx = j; } @@ -3917,7 +3918,7 @@ int ds_is_addr_from_list(sip_msg_t *_m, int group, str *uri, int mode) if(mode & DS_MATCH_MIXSOCKPRPORT) { - ds_strictness = 0; + ds_strictest_match = 0; ds_strictest_node = NULL; } diff --git a/src/modules/dlgs/dlgs_records.c b/src/modules/dlgs/dlgs_records.c index f1ba134c4..38ecb3d5e 100644 --- a/src/modules/dlgs/dlgs_records.c +++ b/src/modules/dlgs/dlgs_records.c @@ -692,7 +692,7 @@ void dlgs_update_stats(dlgs_stats_t *stats, int state, int val) stats->c_confirmed += val; return; case DLGS_STATE_TERMINATED: - stats->c_terminted += val; + stats->c_terminated += val; return; case DLGS_STATE_NOTANSWERED: stats->c_notanswered += val; @@ -1046,7 +1046,7 @@ static void dlgs_rpc_stats(rpc_t *rpc, void *ctx) sta.c_progress += _dlgs_htb->slots[i].astats.c_progress; sta.c_answered += _dlgs_htb->slots[i].astats.c_answered; sta.c_confirmed += _dlgs_htb->slots[i].astats.c_confirmed; - sta.c_terminted += _dlgs_htb->slots[i].astats.c_terminted; + sta.c_terminated += _dlgs_htb->slots[i].astats.c_terminated; sta.c_notanswered += _dlgs_htb->slots[i].astats.c_notanswered; } sti = &sta; @@ -1058,7 +1058,7 @@ static void dlgs_rpc_stats(rpc_t *rpc, void *ctx) } if(rpc->struct_add(ti, "uuuuuu", "init", sti->c_init, "progress", sti->c_progress, "answered", sti->c_answered, "confirmed", - sti->c_confirmed, "terminted", sti->c_terminted, + sti->c_confirmed, "terminated", sti->c_terminated, "notanswered", sti->c_notanswered) < 0) { rpc->fault(ctx, 500, "Internal error creating values"); @@ -1149,7 +1149,7 @@ static void dlgs_rpc_briefing(rpc_t *rpc, void *ctx) rpc->fault(ctx, 500, "Internal error creating rpc"); return; } - if(rpc->struct_add(th, "dSSSuu", "count", ++n, "src", &it->src, + if(rpc->struct_add(th, "dSSSu", "count", ++n, "src", &it->src, "dst", &it->dst, "callid", &it->callid, "state", it->state) < 0) { diff --git a/src/modules/dlgs/dlgs_records.h b/src/modules/dlgs/dlgs_records.h index e6a02824a..0dfeba797 100644 --- a/src/modules/dlgs/dlgs_records.h +++ b/src/modules/dlgs/dlgs_records.h @@ -43,7 +43,7 @@ typedef struct _dlgs_stats { unsigned int c_progress; unsigned int c_answered; unsigned int c_confirmed; - unsigned int c_terminted; + unsigned int c_terminated; unsigned int c_notanswered; } dlgs_stats_t; diff --git a/src/modules/drouting/dr_time.c b/src/modules/drouting/dr_time.c index b08f6eb35..b65477af8 100644 --- a/src/modules/drouting/dr_time.c +++ b/src/modules/drouting/dr_time.c @@ -964,7 +964,7 @@ int dr_check_freq_interval(dr_tmrec_p _trp, dr_ac_tm_p _atp) ? REC_MATCH : REC_NOMATCH; case FREQ_MONTHLY: - _t0 = (_atp->t.tm_year - _trp->ts.tm_year) * 12 + _atp->t.tm_mon + _t0 = 12ULL * (_atp->t.tm_year - _trp->ts.tm_year) + _atp->t.tm_mon - _trp->ts.tm_mon; return (_t0 % _trp->interval == 0) ? REC_MATCH : REC_NOMATCH; case FREQ_YEARLY: diff --git a/src/modules/htable/htable.c b/src/modules/htable/htable.c index d458e8314..63c0b4ced 100644 --- a/src/modules/htable/htable.c +++ b/src/modules/htable/htable.c @@ -1406,7 +1406,7 @@ static int ki_ht_setxi( return -1; } - return 0; + return 1; } /** diff --git a/src/modules/ims_ipsec_pcscf/cmd.c b/src/modules/ims_ipsec_pcscf/cmd.c index e15de4e2d..4672a4590 100644 --- a/src/modules/ims_ipsec_pcscf/cmd.c +++ b/src/modules/ims_ipsec_pcscf/cmd.c @@ -272,7 +272,7 @@ static int fill_contact( if((srcip = pkg_malloc(50)) == NULL) { LM_ERR("Error allocating memory for source IP address\n"); - return -1; + goto error; } memcpy(srcip, alias_s.s, ci->received_host.len); diff --git a/src/modules/ims_isc/mark.c b/src/modules/ims_isc/mark.c index cbd0c17e3..9e417e29d 100644 --- a/src/modules/ims_isc/mark.c +++ b/src/modules/ims_isc/mark.c @@ -348,7 +348,7 @@ int isc_mark_write_route(struct sip_msg *msg, str *as, str *iscmark) { struct hdr_field *first; struct lump *anchor; - str route; + str route = STR_NULL; parse_headers(msg, HDR_EOH_F, 0); first = msg->headers; @@ -367,6 +367,7 @@ int isc_mark_write_route(struct sip_msg *msg, str *as, str *iscmark) anchor = anchor_lump(msg, first->name.s - msg->buf, 0, HDR_ROUTE_T); if(anchor == NULL) { LM_ERR("isc_mark_write_route: anchor_lump failed\n"); + pkg_free(route.s); return 0; } diff --git a/src/modules/ims_registrar_scscf/README b/src/modules/ims_registrar_scscf/README index 100ea1e65..5ef62cbb0 100644 --- a/src/modules/ims_registrar_scscf/README +++ b/src/modules/ims_registrar_scscf/README @@ -682,7 +682,7 @@ switch ($retcode) { 4.8. reg_fetch_contacts(domain, uri, profile) The function fetches the contacts for 'uri' from table 'domain' to - pseudo-variable $imssulc(profile) [imssulc = ims scscf ulc]. + pseudo-variable $ulc(profile) [ulc = ims scscf ulc]. Meaning of the parameters is as follows: * domain - Name of table that should be used for the lookup of @@ -690,8 +690,8 @@ switch ($retcode) { * uri - The SIP URI address of the user which to fetch the contact addresses for. It can contain pseudo-variables that are evaluated at runtime. - * profile - Name of $imssulc pseudo-variable profile that will store - the fetched contacts. It is a static string. + * profile - Name of $ulc pseudo-variable profile that will store the + fetched contacts. It is a static string. This function can be used in REQUEST_ROUTE, FAILURE_ROUTE @@ -709,7 +709,7 @@ reg_fetch_contacts("location", "sip:user@kamailio.org", "caller"); data in that profile. Meaning of the parameters is as follows: - * profile - Name of $imssulc pseudo-variable profile that stores the + * profile - Name of $ulc pseudo-variable profile that stores the contacts. It is a static string. This function can be used in REQUEST_ROUTE, FAILURE_ROUTE diff --git a/src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml b/src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml index afea49ee3..5df8c2f55 100644 --- a/src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml +++ b/src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml @@ -744,7 +744,7 @@ switch ($retcode) { profile) The function fetches the contacts for 'uri' from table 'domain' to - pseudo-variable $imssulc(profile) [imssulc = ims scscf ulc]. + pseudo-variable $ulc(profile) [ulc = ims scscf ulc].
Meaning of the parameters is as follows: @@ -761,7 +761,7 @@ switch ($retcode) { - profile - Name of $imssulc + profile - Name of $ulc pseudo-variable profile that will store the fetched contacts. It is a static string. @@ -793,7 +793,7 @@ reg_fetch_contacts("location", "sip:user@kamailio.org", "caller"); - profile - Name of $imssulc + profile - Name of $ulc pseudo-variable profile that stores the contacts. It is a static string. diff --git a/src/modules/ims_registrar_scscf/regpv.c b/src/modules/ims_registrar_scscf/regpv.c index 9ef1da8f2..236406951 100644 --- a/src/modules/ims_registrar_scscf/regpv.c +++ b/src/modules/ims_registrar_scscf/regpv.c @@ -45,6 +45,7 @@ typedef struct _regpv_profile str pname; str domain; str aor; + str impi; int flags; unsigned int aorhash; int nrc; @@ -121,6 +122,11 @@ static void regpv_free_profile(regpv_profile_t *rpp) rpp->aor.s = 0; rpp->aor.len = 0; } + if(rpp->impi.s != NULL) { + pkg_free(rpp->impi.s); + rpp->impi.s = 0; + rpp->impi.len = 0; + } rpp->flags = 0; rpp->aorhash = 0; @@ -245,6 +251,9 @@ int pv_get_ulc(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) case 17: /* count */ return pv_get_sintval(msg, param, res, rpp->nrc); break; + case 18: /* impi */ + return pv_get_strval(msg, param, res, &rpp->impi); + break; } return pv_get_null(msg, param, res); @@ -323,6 +332,8 @@ int pv_parse_ulc_name(pv_spec_p sp, str *in) rp->attr = 4; else if(strncmp(pa.s, "cseq", 4) == 0) rp->attr = 9; + else if(strncmp(pa.s, "impi", 4) == 0) + rp->attr = 18; else goto error; break; @@ -437,10 +448,18 @@ int pv_fetch_contacts( if(res != 0) { LM_DBG("'%.*s' Not found in usrloc\n", aor.len, ZSW(aor.s)); ul.unlock_udomain((udomain_t *)table, &aor); - return -1; + goto error; + } + + rpp->impi.s = (char *)pkg_malloc(r->private_identity.len * sizeof(char)); + if(rpp->impi.s == NULL) { + LM_ERR("no mem for impi\n"); + goto error; } + memcpy(rpp->impi.s, r->private_identity.s, r->private_identity.len); + rpp->impi.len = r->private_identity.len; - ptr = 0; //r->contacts;TODO + ptr = r->linked_contacts.head ? r->linked_contacts.head->contact : NULL; ptr0 = NULL; n = 0; while(ptr) { @@ -455,8 +474,8 @@ int pv_fetch_contacts( goto error; } memcpy(c0, ptr, ilen); - //c0->domain = {0,0};//NULL;TODO - //c0->aor = {0,0};//NULL; + c0->domain = (str){NULL, 0}; + c0->aor = (str){NULL, 0}; c0->next = NULL; c0->prev = NULL; diff --git a/src/modules/jansson/README b/src/modules/jansson/README index 550c9d62a..47a091b8c 100644 --- a/src/modules/jansson/README +++ b/src/modules/jansson/README @@ -134,7 +134,7 @@ if(!jansson_get("inner.deep.list[3]", "$var(myjson)", "$var(n)")) { } xlog("L_INFO", "foo is $var(n)"); ... -jansson_get("test", "{\"test\":\"abc\",\"idx\":20}", "$var(n)") +jansson_get("test", "{\"test\":\"abc\",\"idx\":20}", "$var(n)"); ... 3.2. jansson_pv_get(key/path, srcvar, dst) diff --git a/src/modules/jansson/doc/jansson_admin.xml b/src/modules/jansson/doc/jansson_admin.xml index daa5e9ea5..71ffa92bf 100644 --- a/src/modules/jansson/doc/jansson_admin.xml +++ b/src/modules/jansson/doc/jansson_admin.xml @@ -94,7 +94,7 @@ if(!jansson_get("inner.deep.list[3]", "$var(myjson)", "$var(n)")) { } xlog("L_INFO", "foo is $var(n)"); ... -jansson_get("test", "{\"test\":\"abc\",\"idx\":20}", "$var(n)") +jansson_get("test", "{\"test\":\"abc\",\"idx\":20}", "$var(n)"); ... @@ -313,4 +313,3 @@ xlog("foo.foz is $var(foofoz)"); - diff --git a/src/modules/jsonrpcs/jsonrpcs_sock.c b/src/modules/jsonrpcs/jsonrpcs_sock.c index 366569ea3..ebd040e65 100644 --- a/src/modules/jsonrpcs/jsonrpcs_sock.c +++ b/src/modules/jsonrpcs/jsonrpcs_sock.c @@ -830,6 +830,9 @@ int jsonrpc_tcp_process(void) LM_DBG("waiting for client connections\n"); while(1) { cfg_update(); + if(csock >= 0) { + close(csock); + } csock = accept( _jsonrpc_tcp_address.tsock, (struct sockaddr *)&caddr, &clen); @@ -845,12 +848,10 @@ int jsonrpc_tcp_process(void) n = read(csock, jsonrpc_tcp_buf, JSONRPC_DGRAM_BUF_SIZE - 1); if(n < 0) { LM_ERR("failed reading from tcp socket\n"); - close(csock); continue; } if(n == 0) { LM_DBG("no data received\n"); - close(csock); continue; } LM_DBG("data received - size: %d\n", n); @@ -892,7 +893,6 @@ int jsonrpc_tcp_process(void) if(n < 0) { LM_ERR("failed to send the response\n"); } - close(csock); continue; } @@ -900,7 +900,6 @@ int jsonrpc_tcp_process(void) if(n < 0) { LM_ERR("failed to send the response\n"); } - close(csock); } return 0; diff --git a/src/modules/jwt/README b/src/modules/jwt/README index 7101d714c..03ef468df 100644 --- a/src/modules/jwt/README +++ b/src/modules/jwt/README @@ -75,7 +75,8 @@ Chapter 1. Admin Guide Kamailio configuration file. It relies on libjwt (at least v1.12.0) library - (https://github.com/benmcollins/libjwt). + (https://github.com/benmcollins/libjwt), but it is not working with the + new libjwt3. 2. Dependencies @@ -91,7 +92,7 @@ Chapter 1. Admin Guide The following libraries or applications must be installed before running Kamailio with this module loaded: - * libjwt - minimum version 1.12.0. + * libjwt - minimum version 1.12.0, but less than libjwt 3.0. 3. Parameters diff --git a/src/modules/jwt/doc/jwt_admin.xml b/src/modules/jwt/doc/jwt_admin.xml index 5389bb61f..4aecc4d0a 100644 --- a/src/modules/jwt/doc/jwt_admin.xml +++ b/src/modules/jwt/doc/jwt_admin.xml @@ -20,7 +20,8 @@ in &kamailio; configuration file. - It relies on libjwt (at least v1.12.0) library (https://github.com/benmcollins/libjwt). + It relies on libjwt (at least v1.12.0) library (https://github.com/benmcollins/libjwt), + but it is not working with the new libjwt3. @@ -47,7 +48,8 @@ - libjwt - minimum version 1.12.0. + libjwt - minimum version 1.12.0, but less + than libjwt 3.0. diff --git a/src/modules/lost/functions.c b/src/modules/lost/functions.c index 96886db9a..278f5ea69 100644 --- a/src/modules/lost/functions.c +++ b/src/modules/lost/functions.c @@ -173,9 +173,9 @@ err: int lost_held_function(struct sip_msg *_m, char *_con, char *_pidf, char *_url, char *_err, char *_id) { - pv_spec_t *pspidf; - pv_spec_t *psurl; - pv_spec_t *pserr; + pv_spec_t *pspidf = NULL; + pv_spec_t *psurl = NULL; + pv_spec_t *pserr = NULL; pv_value_t pvpidf; pv_value_t pvurl; @@ -187,9 +187,10 @@ int lost_held_function(struct sip_msg *_m, char *_con, char *_pidf, char *_url, xmlNodePtr root = NULL; xmlNodePtr cur_node = NULL; - str geo = STR_NULL; /* return value geolocation uri */ - str res = STR_NULL; /* return value pidf */ - str err = STR_NULL; /* return value error */ + str geo = STR_NULL; /* return value geolocation uri */ + str egeo = STR_NULL; /* entire value geolocation uri */ + str res = STR_NULL; /* return value pidf */ + str err = STR_NULL; /* return value error */ str url = STR_NULL; str did = STR_NULL; @@ -261,6 +262,7 @@ int lost_held_function(struct sip_msg *_m, char *_con, char *_pidf, char *_url, LM_DBG("parsing From header\n"); + lost_free_string(&idhdr); /* id from From header */ idhdr.s = lost_get_from_header(_m, &idhdr.len); if(idhdr.len == 0) { @@ -282,7 +284,6 @@ int lost_held_function(struct sip_msg *_m, char *_con, char *_pidf, char *_url, lost_free_held(&held); /* clean up */ if(que.len == 0) { LM_ERR("held request document error\n"); - que.s = NULL; goto err; } @@ -410,14 +411,16 @@ int lost_held_function(struct sip_msg *_m, char *_con, char *_pidf, char *_url, LM_DBG("*** node '%s' found\n", cur_node->name); + lost_free_string(&egeo); /* get the locationUri element */ - geo.s = lost_get_content( - root, (char *)HELD_TYPE_URI, &geo.len); - if(geo.len == 0) { + egeo.s = lost_get_content( + root, (char *)HELD_TYPE_URI, &egeo.len); + if(egeo.len == 0) { LM_WARN("%s element not found\n", HELD_TYPE_URI); - geo.s = NULL; + lost_free_string(&egeo); } else { - geo.s = lost_trim_content(geo.s, &geo.len); + geo.len = egeo.len; + geo.s = lost_trim_content(egeo.s, &geo.len); } } if(xmlStrcmp(cur_node->name, (const xmlChar *)"presence") @@ -509,7 +512,7 @@ int lost_held_function(struct sip_msg *_m, char *_con, char *_pidf, char *_url, pvurl.flags = PV_VAL_STR; psurl = (pv_spec_t *)_url; psurl->setf(_m, &psurl->pvp, (int)EQ_T, &pvurl); - lost_free_string(&geo); /* clean up */ + lost_free_string(&egeo); /* clean up */ /* return error code in case of response error */ if(err.len > 0) { @@ -536,15 +539,9 @@ err: xmlFreeDoc(doc); } /* clean up string */ - if(res.s != NULL && res.len > 0) { - lost_free_string(&res); - } - if(geo.s != NULL && geo.len > 0) { - lost_free_string(&geo); - } - if(err.s != NULL && err.len > 0) { - lost_free_string(&err); - } + lost_free_string(&res); + lost_free_string(&egeo); + lost_free_string(&err); return LOST_CLIENT_ERROR; } @@ -787,12 +784,8 @@ err: xmlFreeDoc(doc); } /* clean up string */ - if(res.s != NULL && res.len > 0) { - lost_free_string(&res); - } - if(err.s != NULL && err.len > 0) { - lost_free_string(&err); - } + lost_free_string(&res); + lost_free_string(&err); return LOST_CLIENT_ERROR; } @@ -1348,27 +1341,13 @@ err: lost_free_geoheader_list(&geolist); lost_free_loc(&loc); /* clean up string */ - if(oldurl.s != NULL && oldurl.len > 0) { - lost_free_string(&oldurl); - } - if(ret.s != NULL && ret.len > 0) { - lost_free_string(&ret); - } - if(req.s != NULL && req.len > 0) { - lost_free_string(&req); - } - if(rereq.s != NULL && rereq.len > 0) { - lost_free_string(&rereq); - } - if(name.s != NULL && name.len > 0) { - lost_free_string(&name); - } - if(uri.s != NULL && uri.len > 0) { - lost_free_string(&uri); - } - if(err.s != NULL && err.len > 0) { - lost_free_string(&err); - } + lost_free_string(&oldurl); + lost_free_string(&ret); + lost_free_string(&req); + lost_free_string(&rereq); + lost_free_string(&name); + lost_free_string(&uri); + lost_free_string(&err); return LOST_CLIENT_ERROR; } diff --git a/src/modules/lost/response.c b/src/modules/lost/response.c index 7ff63ca98..ac1728b62 100644 --- a/src/modules/lost/response.c +++ b/src/modules/lost/response.c @@ -731,10 +731,10 @@ p_lost_list_t lost_get_response_list( new->next = list; list = new; - lost_free_string(&tmp); /* clean up */ } else { lost_delete_response_list(&new); /* clean up */ } + lost_free_string(&tmp); /* clean up */ } } } else { @@ -839,10 +839,9 @@ p_lost_info_t lost_get_response_info( } else { tmp.s = lost_get_content(node, name, &tmp.len); } - if(tmp.len > 0 && tmp.s != NULL) { + if(tmp.s != NULL) { res->text = lost_copy_string(tmp, &len); - if(len > 0) { - + if(res->text != NULL) { LM_DBG("###\t\t[%s]\n", res->text); } lost_free_string(&tmp); /* clean up */ diff --git a/src/modules/lost/utilities.c b/src/modules/lost/utilities.c index 802fb597e..2e88a3474 100644 --- a/src/modules/lost/utilities.c +++ b/src/modules/lost/utilities.c @@ -287,7 +287,6 @@ char *lost_copy_string(str src, int *lgth) if(res == NULL) { PKG_MEM_ERROR; } else { - memset(res, 0, src.len); memcpy(res, src.s, src.len); res[src.len] = '\0'; *lgth = (int)strlen(res); @@ -303,21 +302,12 @@ char *lost_copy_string(str src, int *lgth) */ void lost_free_string(str *string) { - str ptr = STR_NULL; - + string->len = 0; if(string->s == NULL) return; - - ptr = *string; - - if(ptr.s != NULL && ptr.len > 0) { - pkg_free(ptr.s); - - LM_DBG("### string object removed\n"); - } - + pkg_free(string->s); + LM_DBG("### string object removed\n"); string->s = NULL; - string->len = 0; return; } diff --git a/src/modules/microhttpd/microhttpd_mod.c b/src/modules/microhttpd/microhttpd_mod.c index 0ef4b3628..ff486ac7d 100644 --- a/src/modules/microhttpd/microhttpd_mod.c +++ b/src/modules/microhttpd/microhttpd_mod.c @@ -177,6 +177,13 @@ static void mod_destroy(void) { } +typedef struct ksr_mhd_cstream +{ + int ctype; + int rcvmode; + str data; +} ksr_mhd_cstream_t; + typedef struct ksr_mhttpd_ctx { struct MHD_Connection *connection; @@ -360,18 +367,24 @@ static int ksr_mhttpd_send_reply( } response = MHD_create_response_from_buffer( - sbody->len, sbody->s, MHD_RESPMEM_PERSISTENT); + sbody->len, sbody->s, MHD_RESPMEM_MUST_COPY); if(response == NULL) { LM_ERR("failed to create the response\n"); return -1; } if(sctype->len > 0) { - MHD_add_response_header(response, "Content-Type", sctype->s); + if(MHD_add_response_header(response, "Content-Type", sctype->s) + == MHD_NO) { + LM_WARN("failed to add Content-Type header\n"); + } } ret = MHD_queue_response( _ksr_mhttpd_ctx.connection, (unsigned int)rcode, response); MHD_destroy_response(response); + LM_DBG("queue response return: %d (%s)\n", ret, + (ret == MHD_YES) ? "YES" : "XYZ"); + return (ret == MHD_YES) ? 1 : -1; } @@ -447,23 +460,68 @@ static int fixup_free_mhttpd_send_reply(void **param, int param_no) return 0; } + static enum MHD_Result ksr_microhttpd_request(void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **ptr) { - static int _first_callback; sr_kemi_eng_t *keng = NULL; str evname = str_init("microhttpd:request"); sip_msg_t *fmsg = NULL; run_act_ctx_t ctx; int rtb; + ksr_mhd_cstream_t *cstream = NULL; + + cstream = (ksr_mhd_cstream_t *)*ptr; + if(cstream == NULL) { + cstream = (ksr_mhd_cstream_t *)malloc(sizeof(ksr_mhd_cstream_t)); + if(cstream == NULL) { + LM_ERR("no more system memroy\n"); + return MHD_NO; + } + memset(cstream, 0, sizeof(ksr_mhd_cstream_t)); + *ptr = cstream; + } - if(&_first_callback != *ptr) { + if(cstream->rcvmode == 0) { + cstream->rcvmode = 1; /* the first time only the headers are valid, - do not respond in the first round... */ - *ptr = &_first_callback; + * do not respond in the first round */ return MHD_YES; + } else { + if(*upload_data_size != 0) { + char *buf = NULL; + int bsize = 0; + if(cstream->data.s != NULL) { + bsize = *upload_data_size + cstream->data.len + 1; + } else { + bsize = *upload_data_size + 1; + } + buf = (char *)malloc(sizeof(char) * bsize); + if(buf == NULL) { + if(cstream->data.s != NULL) { + free(cstream->data.s); + free(cstream); + } + *ptr = NULL; + return MHD_NO; + } + if(cstream->data.s != NULL) { + snprintf(buf, bsize, "%s%s", cstream->data.s, upload_data); + free(cstream->data.s); + } else { + snprintf(buf, bsize, "%s", upload_data); + } + cstream->data.s = buf; + cstream->data.len = bsize - 1; + *upload_data_size = 0; + return MHD_YES; + } else { + LM_DBG("incoming data: [%.*s]\n", + cstream->data.len <= 64 ? cstream->data.len : 64, + cstream->data.s); + } } *ptr = NULL; /* clear context pointer */ @@ -474,13 +532,19 @@ static enum MHD_Result ksr_microhttpd_request(void *cls, _ksr_mhttpd_ctx.url.len = strlen(_ksr_mhttpd_ctx.url.s); _ksr_mhttpd_ctx.httpversion.s = (char *)version; _ksr_mhttpd_ctx.httpversion.len = strlen(_ksr_mhttpd_ctx.httpversion.s); - if(*upload_data_size > 0) { - _ksr_mhttpd_ctx.data.s = (char *)upload_data; - _ksr_mhttpd_ctx.data.len = (int)(*upload_data_size); + if(_ksr_mhttpd_ctx.data.s != NULL) { + free(_ksr_mhttpd_ctx.data.s); + } + if(cstream->data.len > 0) { + if(_ksr_mhttpd_ctx.data.s != NULL) { + free(_ksr_mhttpd_ctx.data.s); + } + _ksr_mhttpd_ctx.data = cstream->data; } else { _ksr_mhttpd_ctx.data.s = NULL; _ksr_mhttpd_ctx.data.len = 0; } + free(cstream); _ksr_mhttpd_ctx.cinfo = MHD_get_connection_info( connection, MHD_CONNECTION_INFO_CLIENT_ADDRESS); _ksr_mhttpd_ctx.srcip.s = NULL; diff --git a/src/modules/nat_traversal/nat_traversal.c b/src/modules/nat_traversal/nat_traversal.c index 0f952f01d..f4288ac9a 100644 --- a/src/modules/nat_traversal/nat_traversal.c +++ b/src/modules/nat_traversal/nat_traversal.c @@ -1611,6 +1611,10 @@ static void send_keepalive(NAT_Contact *contact) //nat_ip.s = strchr(contact->uri, ':') + 1; nat_ip.s = &contact->uri[4]; // skip over "sip:" ptr = strchr(nat_ip.s, ':'); + if(ptr == NULL) { + LM_ERR("searching port failed\n"); + return; + } nat_ip.len = ptr - nat_ip.s; nat_port = strtol(ptr + 1, NULL, 10); lport = 0; diff --git a/src/modules/prefix_route/prefix_route.c b/src/modules/prefix_route/prefix_route.c index 686962089..92059cd54 100644 --- a/src/modules/prefix_route/prefix_route.c +++ b/src/modules/prefix_route/prefix_route.c @@ -262,16 +262,20 @@ static int ki_prefix_route(sip_msg_t *msg, str *ruser) int err; int route; + LM_DBG("trying to run route block for [%.*s]\n", ruser->len, ruser->s); route = tree_route_get(ruser); - if(route <= 0) + if(route <= 0) { + LM_DBG("route block for [%.*s] not found\n", ruser->len, ruser->s); return -1; + } /* If match send to route[x] */ init_run_actions_ctx(&ra_ctx); err = run_actions(&ra_ctx, main_rt.rlist[route], msg); if(err < 0) { - LM_ERR("run_actions failed (%d)\n", err); + LM_ERR("run actions failed (%d) for [%.*s]\n", err, ruser->len, + ruser->s); return -1; } diff --git a/src/modules/presence_dfks/README b/src/modules/presence_dfks/README index d965a6e4c..4369c944d 100644 --- a/src/modules/presence_dfks/README +++ b/src/modules/presence_dfks/README @@ -67,7 +67,9 @@ Chapter 1. Admin Guide 2.1. Kamailio Modules The following modules must be loaded before this module: - * sl. presence. pua. + * sl + * presence + * pua 2.2. External Libraries or Applications diff --git a/src/modules/presence_dfks/doc/presence_dfks_admin.xml b/src/modules/presence_dfks/doc/presence_dfks_admin.xml index 6b08fcb27..bcea808b3 100644 --- a/src/modules/presence_dfks/doc/presence_dfks_admin.xml +++ b/src/modules/presence_dfks/doc/presence_dfks_admin.xml @@ -32,13 +32,9 @@ The following modules must be loaded before this module: - - - sl. - presence. - pua. - - + sl + presence + pua diff --git a/src/modules/presence_dfks/presence_dfks.c b/src/modules/presence_dfks/presence_dfks.c index da7210941..1e67ee638 100644 --- a/src/modules/presence_dfks/presence_dfks.c +++ b/src/modules/presence_dfks/presence_dfks.c @@ -46,6 +46,7 @@ MODULE_VERSION static int mod_init(void); /** API structures */ +add_event_t pres_add_event; sl_api_t slb; presence_api_t pres; pua_api_t pua; diff --git a/src/modules/pua_dialoginfo/pua_dialoginfo.c b/src/modules/pua_dialoginfo/pua_dialoginfo.c index 26883cc27..09d25a67e 100644 --- a/src/modules/pua_dialoginfo/pua_dialoginfo.c +++ b/src/modules/pua_dialoginfo/pua_dialoginfo.c @@ -381,12 +381,9 @@ static void __dialog_sendpublish( uri = callee_entity_when_publish_disabled; } - if(use_pubruri_avps - && (refresh_pubruri_avps_flag > -1 - || (request - && (request->flags - & (1U << (unsigned int) - refresh_pubruri_avps_flag))))) { + if(use_pubruri_avps && (refresh_pubruri_avps_flag > -1) && (request != NULL) + && (request->flags + & (1U << (unsigned int)refresh_pubruri_avps_flag))) { lock_get(&dlginfo->lock); refresh_pubruri_avps(dlginfo, &uri); } @@ -584,12 +581,9 @@ static void __dialog_sendpublish( } } - if(use_pubruri_avps - && (refresh_pubruri_avps_flag > -1 - || (request - && (request->flags - & (1U << (unsigned int) - refresh_pubruri_avps_flag))))) { + if(use_pubruri_avps && (refresh_pubruri_avps_flag > -1) && (request != NULL) + && (request->flags + & (1U << (unsigned int)refresh_pubruri_avps_flag))) { lock_release(&dlginfo->lock); } } diff --git a/src/modules/pua_reginfo/notify.c b/src/modules/pua_reginfo/notify.c index a390a00f2..23b44caae 100644 --- a/src/modules/pua_reginfo/notify.c +++ b/src/modules/pua_reginfo/notify.c @@ -305,10 +305,10 @@ int process_body(str notify_body, udomain_t *domain) if(reginfo_use_domain) { aor_key.s = uri; + aor_key.len = strlen(uri); } else { - aor_key.s = parsed_aor.user.s; + aor_key = parsed_aor.user; } - aor_key.len = strlen(aor_key.s); /* Now let's lock that domain for this AOR: */ ul.lock_udomain(domain, &aor_key); /* and retrieve the user-record for this user: */ diff --git a/src/modules/pv_headers/pvh_func.c b/src/modules/pv_headers/pvh_func.c index 1fe3d58f0..5cbeb1431 100644 --- a/src/modules/pv_headers/pvh_func.c +++ b/src/modules/pv_headers/pvh_func.c @@ -113,20 +113,20 @@ int pvh_collect_headers(struct sip_msg *msg) val_part.len = strlen(hvals[idx]); if(pvh_set_xavi(msg, &_pvh_params.xavi_name, &name, &val_part, SR_XTYPE_STR, 0, 1) - < 0) + == NULL) return -1; } continue; } if(pvh_set_xavi( msg, &_pvh_params.xavi_name, &name, &val, SR_XTYPE_STR, 0, 1) - < 0) + == NULL) return -1; } if(pvh_set_xavi(msg, &_pvh_params.xavi_helper_xname, &xavi_helper_name, &_pvh_params.xavi_name, SR_XTYPE_STR, 0, 0) - < 0) + == NULL) return -1; pvh_hdrs_set_collected(msg); diff --git a/src/modules/pv_headers/pvh_str.c b/src/modules/pv_headers/pvh_str.c index 28908a370..1916f93e0 100644 --- a/src/modules/pv_headers/pvh_str.c +++ b/src/modules/pv_headers/pvh_str.c @@ -50,11 +50,12 @@ int pvh_str_free(str *s) int pvh_str_copy(str *dst, str *src, unsigned int max_size) { - unsigned int src_len = src->len + 1 >= max_size ? max_size - 1 : src->len; + unsigned int src_len = 0; if(src == NULL || dst == NULL || src->len <= 0) return -1; + src_len = src->len + 1 >= max_size ? max_size - 1 : src->len; memset(dst->s, 0, dst->len); memcpy(dst->s, src->s, src_len); dst->s[src_len] = '\0'; diff --git a/src/modules/pv_headers/pvh_xavp.c b/src/modules/pv_headers/pvh_xavp.c index e200afcf9..f416fdb0c 100644 --- a/src/modules/pv_headers/pvh_xavp.c +++ b/src/modules/pv_headers/pvh_xavp.c @@ -520,7 +520,7 @@ int pvh_clone_branch_xavi(struct sip_msg *msg, str *xname) if(sub->val.type == SR_XTYPE_DATA) continue; if(pvh_xavi_append_value(&sub->name, &sub->val, &br_xavi->val.v.xavp) - < 0) { + == NULL) { LM_ERR("cannot clone xavi %.*s\n", sub->name.len, sub->name.s); return -1; } diff --git a/src/modules/rtp_media_server/rtp_media_server.c b/src/modules/rtp_media_server/rtp_media_server.c index 720c4afd9..21abb7fb8 100644 --- a/src/modules/rtp_media_server/rtp_media_server.c +++ b/src/modules/rtp_media_server/rtp_media_server.c @@ -1024,7 +1024,7 @@ static int rms_sip_cancel(struct sip_msg *msg, str *callid_s, str *cseq_s) cancel_data.reason.cause = rcode; cancel_data.cancel_bitmap = 0; tmb.prepare_to_cancel(trans, &cancel_data.cancel_bitmap, 0); - tmb.cancel_uacs(trans, &cancel_data, 0); + tmb.cancel_uacs(trans, &cancel_data, F_CANCEL_LOCAL); tmb.t_sett(bkt, bkb); if(!tmb.t_reply(msg, 202, "cancelling")) { diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c index 49c942627..36f93dd35 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -1744,6 +1744,7 @@ static int rtpp_test_ping(struct rtpp_node *node) char *cp; int ret; + LM_DBG("Sending ping to node %.*s\n", node->rn_url.len, node->rn_url.s); if(bencode_buffer_init(&bencbuf)) { return -1; } @@ -3777,7 +3778,7 @@ static void rtpengine_ping_check_timer(unsigned int ticks, void *param) for(crt_rtpp = rtpp_list->rn_first; crt_rtpp != NULL; crt_rtpp = crt_rtpp->rn_next) { - if(!crt_rtpp->rn_displayed) { + if(!crt_rtpp->rn_displayed || crt_rtpp->rn_disabled) { continue; } @@ -4490,7 +4491,8 @@ static void parse_call_stats_1(struct minmax_mos_label_stats *mmls, long long ssrc; char *endp; bencode_item_t *ssrc_list, *ssrc_key, *ssrc_dict, *tags, *tag_key, - *tag_dict, *medias, *media, *streams, *stream; + *tag_dict, *medias, *media, *streams, *stream, *ingress_ssrcs, + *ingress_ssrc; struct minmax_stats_vals min_vals = {.mos = 100}, max_vals = {.mos = -1}, average_vals = {.avg_samples = 0}, vals_decoded; @@ -4545,9 +4547,21 @@ static void parse_call_stats_1(struct minmax_mos_label_stats *mmls, (char *)stream->child->iov[1].iov_base); LM_DBG("rtpengine: XXX stream child val type %i\n", stream->child->sibling->type); - if((ssrc = bencode_dictionary_get_integer(stream, "SSRC", -1)) - == -1) - continue; + ssrc = bencode_dictionary_get_integer(stream, "SSRC", -1); + if(ssrc == -1) { + ingress_ssrcs = bencode_dictionary_get_expect( + stream, "ingress SSRCs", BENCODE_LIST); + if(!ingress_ssrcs || !ingress_ssrcs->child) + continue; + LM_DBG("rtpengine: XXX got ingress SSRCs\n"); + ingress_ssrc = ingress_ssrcs->child; + if((ssrc = bencode_dictionary_get_integer( + ingress_ssrc, "SSRC", -1)) + == -1) { + continue; + } + } + /* got a valid SSRC to watch for */ ssrcs[num_ssrcs] = ssrc; LM_DBG("rtpengine: found SSRC '%lli' for label '%.*s'\n", ssrc, diff --git a/src/modules/sanity/sanity.c b/src/modules/sanity/sanity.c index 582a1aaad..8059866c4 100644 --- a/src/modules/sanity/sanity.c +++ b/src/modules/sanity/sanity.c @@ -813,7 +813,7 @@ int check_parse_uris(sip_msg_t *msg, int checks) if(!msg->to || !msg->to->body.s) { msg->msg_flags |= FL_MSG_NOREPLY; } else { - if(sanity_reply(msg, 400, "Ivalid To Header") < 0) { + if(sanity_reply(msg, 400, "Invalid To Header") < 0) { LM_WARN("failed to send 400 via sl reply (missing To)\n"); } } diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c index 3d5471178..0bf57b6f0 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c @@ -609,6 +609,7 @@ int sca_call_info_seize_held_call(sip_msg_t *msg, sca_call_info *call_info, // all headers must be parsed before using lump functions if(parse_headers(msg, HDR_EOH_F, 0) < 0) { LM_ERR("Failed to parse_headers\n"); + pkg_free(replaces_hdr.s); goto done; } diff --git a/src/modules/sca/sca_subscribe.c b/src/modules/sca/sca_subscribe.c index ca42fd138..5e34ceac6 100644 --- a/src/modules/sca/sca_subscribe.c +++ b/src/modules/sca/sca_subscribe.c @@ -626,9 +626,6 @@ sca_subscription *sca_subscription_create(str *aor, int event, str *subscriber, len += sizeof(sca_subscription); len += sizeof(char) * (aor->len + subscriber->len); - if(!SCA_STR_EMPTY(rr)) { - len += sizeof(char) * rr->len; - } sub = (sca_subscription *)shm_malloc(len); if(sub == NULL) { @@ -660,18 +657,20 @@ sca_subscription *sca_subscription_create(str *aor, int event, str *subscriber, SCA_STR_COPY(&sub->target_aor, aor); len += aor->len; + // we shm_malloc this parts separately in case we need to update in-memory + // info for this subscriber. This is likely to happen if the + // subscriber goes off-line for some reason. if(!SCA_STR_EMPTY(rr)) { - sub->rr.s = (char *)sub + len; + sub->rr.s = (char *)shm_malloc(rr->len); + if(sub->rr.s == NULL) { + SHM_MEM_ERROR; + goto error; + } SCA_STR_COPY(&sub->rr, rr); - len += rr->len; } // dialog.id holds call-id + from-tag + to-tag; dialog.call_id, // dialog.from_tag, and dialog.to_tag point to offsets within // dialog.id. - // - // we shm_malloc this separately in case we need to update in-memory - // dialog saved for this subscriber. This is likely to happen if the - // subscriber goes off-line for some reason. len = sizeof(char) * (call_id->len + from_tag->len + to_tag->len); sub->dialog.id.s = (char *)shm_malloc(len); if(sub->dialog.id.s == NULL) { @@ -702,6 +701,9 @@ sca_subscription *sca_subscription_create(str *aor, int event, str *subscriber, error: if(sub != NULL) { + if(sub->rr.s != NULL) { + shm_free(sub->rr.s); + } if(sub->dialog.id.s != NULL) { shm_free(sub->dialog.id.s); } @@ -734,6 +736,10 @@ void sca_subscription_free(void *value) LM_DBG("Freeing %s subscription from %.*s\n", sca_event_name_from_type(sub->event), STR_FMT(&sub->subscriber)); + if(!SCA_STR_EMPTY(&sub->rr)) { + shm_free(sub->rr.s); + } + if(!SCA_STR_EMPTY(&sub->dialog.id)) { shm_free(sub->dialog.id.s); } diff --git a/src/modules/sctp/CMakeLists.txt b/src/modules/sctp/CMakeLists.txt index 22e51fd7c..0913855cb 100644 --- a/src/modules/sctp/CMakeLists.txt +++ b/src/modules/sctp/CMakeLists.txt @@ -14,11 +14,11 @@ endif() target_include_directories(${module_name} PRIVATE ${SCTP_INCLUDE_DIR}) -find_library( - SCTP_LIBRARY - NAMES sctp - PATHS /usr/lib /usr/local/lib) +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + find_library( + SCTP_LIBRARY + NAMES sctp + PATHS /usr/lib /usr/local/lib) -if(UNIX) target_link_libraries(${module_name} PRIVATE ${SCTP_LIBRARY}) endif() diff --git a/src/modules/secsipid/secsipid_mod.c b/src/modules/secsipid/secsipid_mod.c index ebe2e2e50..eecf18c77 100644 --- a/src/modules/secsipid/secsipid_mod.c +++ b/src/modules/secsipid/secsipid_mod.c @@ -916,6 +916,7 @@ static sr_kemi_xval_t *ki_secsipid_get_url(sip_msg_t *msg, str *surl) if(_secsipid_get_url_val.s != NULL) { free(_secsipid_get_url_val.s); + _secsipid_get_url_val.s = NULL; _secsipid_get_url_val.len = 0; } @@ -959,6 +960,7 @@ static int w_secsipid_get_url(sip_msg_t *msg, char *purl, char *povar) } if(_secsipid_get_url_val.s != NULL) { free(_secsipid_get_url_val.s); + _secsipid_get_url_val.s = NULL; _secsipid_get_url_val.len = 0; } diff --git a/src/modules/sipdump/sipdump_mod.c b/src/modules/sipdump/sipdump_mod.c index cdac1a32c..6dd3af751 100644 --- a/src/modules/sipdump/sipdump_mod.c +++ b/src/modules/sipdump/sipdump_mod.c @@ -40,6 +40,8 @@ #include "../../core/mod_fix.h" #include "../../core/fmsg.h" #include "../../core/events.h" +#include "../../core/srapi.h" +#include "../../core/receive.h" #include "../../core/kemi.h" #include "sipdump_write.h" @@ -286,14 +288,14 @@ static sipdump_data_t *sipdump_event_data = NULL; */ int sipdump_event_route(sipdump_data_t *sdi) { - int backup_rt; run_act_ctx_t ctx; run_act_ctx_t *bctx; sr_kemi_eng_t *keng = NULL; str evname = str_init("sipdump:msg"); sip_msg_t *fmsg = NULL; + ksr_msg_env_links_t menv = {0}; - backup_rt = get_route_type(); + ksr_msg_env_push(&menv); set_route_type(EVENT_ROUTE); init_run_actions_ctx(&ctx); fmsg = faked_msg_next(); @@ -312,7 +314,8 @@ int sipdump_event_route(sipdump_data_t *sdi) } } sipdump_event_data = NULL; - set_route_type(backup_rt); + ksr_msg_env_reset(); + ksr_msg_env_pop(&menv); if(ctx.run_flags & DROP_R_F) { return DROP_R_F; } diff --git a/src/modules/sipt/sipt.c b/src/modules/sipt/sipt.c index 128852f17..c34a1b11a 100644 --- a/src/modules/sipt/sipt.c +++ b/src/modules/sipt/sipt.c @@ -20,21 +20,22 @@ * */ +#include +#include +#include #include "../../core/sr_module.h" #include "../../core/parser/parse_param.h" #include "../../core/data_lump.h" +#include "../../core/kemi.h" #include "../../core/mem/mem.h" #include "../../core/mod_fix.h" #include "../../core/parser/parse_content.h" #include "../../core/parser/parse_body.h" #include "../../core/parser/parser_f.h" #include "../../core/trim.h" -#include "ss7.h" -#include -#include -#include +#include "ss7.h" MODULE_VERSION @@ -92,7 +93,7 @@ static int sipt_get_generic_number_nai( static int sipt_get_generic_number( struct sip_msg *msg, pv_param_t *param, pv_value_t *res); -static int sipt_has_isup_body(struct sip_msg *msg, char *type, char *str2); +static int sipt_has_isup_body(struct sip_msg *msg); /* New API */ int sipt_parse_pv_name(pv_spec_p sp, str *in); @@ -612,13 +613,21 @@ static int sipt_get_called_party( return 0; } -static int sipt_has_isup_body(struct sip_msg *msg, char *foo, char *bar) +static int sipt_has_isup_body(struct sip_msg *msg) { str body; body.s = get_body_part(msg, TYPE_APPLICATION, SUBTYPE_ISUP, &body.len); return (body.s == NULL) ? -1 : 1; } +/** + * + */ +static int ki_has_isup_body(sip_msg_t *msg) +{ + return (sipt_has_isup_body(msg) == 1) ? SR_KEMI_TRUE : SR_KEMI_FALSE; +} + int sipt_parse_pv_name(pv_spec_p sp, str *in) { sipt_pv_t *spv = NULL; @@ -870,6 +879,19 @@ static int sipt_set_bci_1(struct sip_msg *msg, char *_charge_indicator, return 1; } +/** + * + */ +static int ki_set_bci_1(sip_msg_t *msg, str *_charge_indicator, + str *_called_status, str *_called_category, str *_e2e_indicator) +{ + return (sipt_set_bci_1(msg, _charge_indicator->s, _called_status->s, + _called_category->s, _e2e_indicator->s) + == 1) + ? SR_KEMI_TRUE + : SR_KEMI_FALSE; +} + static int sipt_destination( struct sip_msg *msg, char *_destination, char *_hops, char *_nai) { @@ -878,6 +900,17 @@ static int sipt_destination( msg, _destination, _hops, _nai, (char *)&terminator); } +/** + * + */ +static int ki_destination( + sip_msg_t *msg, str *_destination, str *_hops, str *_nai) +{ + return (sipt_destination(msg, _destination->s, _hops->s, _nai->s) == 1) + ? SR_KEMI_TRUE + : SR_KEMI_FALSE; +} + static int sipt_destination2(struct sip_msg *msg, char *_destination, char *_hops, char *_nai, char *_terminator) { @@ -943,6 +976,16 @@ static int sipt_destination2(struct sip_msg *msg, char *_destination, return 1; } +static int ki_destination_terminator(sip_msg_t *msg, str *_destination, + str *_hops, str *_nai, str *_terminator) +{ + return (sipt_destination2( + msg, _destination->s, _hops->s, _nai->s, _terminator->s) + == 1) + ? SR_KEMI_TRUE + : SR_KEMI_FALSE; +} + static int sipt_set_calling(struct sip_msg *msg, char *_origin, char *_nai, char *_pres, char *_screen) { @@ -1000,6 +1043,18 @@ static int sipt_set_calling(struct sip_msg *msg, char *_origin, char *_nai, return 1; } +/** + * + */ +static int ki_set_calling( + sip_msg_t *msg, str *_origin, str *_nai, str *_pres, str *_screen) +{ + return (sipt_set_calling(msg, _origin->s, _nai->s, _pres->s, _screen->s) + == 1) + ? SR_KEMI_TRUE + : SR_KEMI_FALSE; +} + static int sipt_forwarding(struct sip_msg *msg, char *_fwdnumber, char *_nai) { str *nai = (str *)_nai; @@ -1053,6 +1108,14 @@ static int sipt_forwarding(struct sip_msg *msg, char *_fwdnumber, char *_nai) return 1; } +/** + * + */ +static int ki_forwarding(sip_msg_t *msg, str *_fwdnumber, str *_nai) +{ + return (sipt_forwarding(msg, _fwdnumber->s, _nai->s) == 1) ? SR_KEMI_TRUE + : SR_KEMI_FALSE; +} static int mod_init(void) { @@ -1063,3 +1126,46 @@ static int mod_init(void) static void mod_destroy(void) { } + +/** + * + */ +/* clang-format off */ +static sr_kemi_t sr_kemi_sipt_exports[] = { + { str_init("sipt"), str_init("destination"), + SR_KEMIP_BOOL, ki_destination, + { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }}, + { str_init("sipt"), str_init("destination_terminator"), + SR_KEMIP_BOOL, ki_destination_terminator, + { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR, + SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE }}, + { str_init("sipt"), str_init("forwarding"), + SR_KEMIP_BOOL, ki_forwarding, + { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }}, + { str_init("sipt"), str_init("has_isup_body"), + SR_KEMIP_BOOL, ki_has_isup_body, + { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }}, + { str_init("sipt"), str_init("set_bci_1"), + SR_KEMIP_BOOL, ki_set_bci_1, + { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR, + SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE }}, + { str_init("sipt"), str_init("set_calling"), + SR_KEMIP_BOOL, ki_set_calling, + { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR, + SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE }}, + + { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } } +}; +/* clang-format on */ + +/** + * + */ +int mod_register(char *path, int *dlflags, void *p1, void *p2) +{ + sr_kemi_modules_add(sr_kemi_sipt_exports); + return 0; +} diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c index 6e6ffcaf2..79d1756a9 100644 --- a/src/modules/siptrace/siptrace.c +++ b/src/modules/siptrace/siptrace.c @@ -41,6 +41,7 @@ #include "../../core/ip_addr.h" #include "../../core/mem/mem.h" #include "../../core/mem/shm_mem.h" +#include "../../core/receive.h" #include "../../core/rpc.h" #include "../../core/rpc_lookup.h" #include "../../lib/srdb1/db.h" @@ -54,6 +55,7 @@ #include "../../core/str.h" #include "../../core/onsend.h" #include "../../core/events.h" +#include "../../core/srapi.h" #include "../../core/kemi.h" #include "siptrace_data.h" @@ -2220,12 +2222,12 @@ static siptrace_data_t *siptrace_event_data = NULL; static int siptrace_exec_evcb_msg(siptrace_data_t *sto) { - int backup_rt; run_act_ctx_t ctx; run_act_ctx_t *bctx; sr_kemi_eng_t *keng = NULL; str evname = str_init("siptrace:msg"); sip_msg_t msg; + ksr_msg_env_links_t menv = {0}; if(_siptrace_evrt_msg_idx < 0 && _siptrace_evcb_msg.len <= 0) { return 0; @@ -2248,7 +2250,7 @@ static int siptrace_exec_evcb_msg(siptrace_data_t *sto) return -1; } - backup_rt = get_route_type(); + ksr_msg_env_push(&menv); set_route_type(EVENT_ROUTE); init_run_actions_ctx(&ctx); @@ -2267,8 +2269,9 @@ static int siptrace_exec_evcb_msg(siptrace_data_t *sto) } siptrace_event_data = NULL; + ksr_msg_env_reset(); free_sip_msg(&msg); - set_route_type(backup_rt); + ksr_msg_env_pop(&menv); if(ctx.run_flags & DROP_R_F) { return DROP_R_F; } diff --git a/src/modules/smsops/smsops_impl.c b/src/modules/smsops/smsops_impl.c index 05b4b52aa..14674ae4a 100644 --- a/src/modules/smsops/smsops_impl.c +++ b/src/modules/smsops/smsops_impl.c @@ -1187,6 +1187,7 @@ int pv_sms_ack(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) } +static str _smsops_sms_body = {0, 0}; /* * Creates the body for SMS-DELIVER from the constructed rp data */ @@ -1194,70 +1195,79 @@ int pv_sms_body(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { dumpRPData(_smsops_rp_send_data, L_DBG); - str sms_body = {0, 0}; int buffer_size = 1024, lenpos = 0, i = 0, smstext_len_pos = 0; unsigned char udh_len = 0; struct ie_concat_sm_8bit_ref *concat = NULL; // We assume a maximum size of 1024 Bytes, to be verified. - sms_body.s = (char *)pkg_malloc(buffer_size); - if(!sms_body.s) { + if(_smsops_sms_body.s == NULL) { + _smsops_sms_body.s = (char *)pkg_malloc(buffer_size); + } + if(!_smsops_sms_body.s) { LM_ERR("Error allocating %i bytes!\n", buffer_size); return -1; } + _smsops_sms_body.len = 0; + _smsops_sms_body.s[0] = '\0'; // Encode the data (RP-Data) - sms_body.s[sms_body.len++] = _smsops_rp_send_data->msg_type; - sms_body.s[sms_body.len++] = _smsops_rp_send_data->reference; - lenpos = sms_body.len; - sms_body.s[sms_body.len++] = 0x00; + _smsops_sms_body.s[_smsops_sms_body.len++] = _smsops_rp_send_data->msg_type; + _smsops_sms_body.s[_smsops_sms_body.len++] = + _smsops_rp_send_data->reference; + lenpos = _smsops_sms_body.len; + _smsops_sms_body.s[_smsops_sms_body.len++] = 0x00; if(_smsops_rp_send_data->originator.len > 0) { - sms_body.s[sms_body.len++] = + _smsops_sms_body.s[_smsops_sms_body.len++] = _smsops_rp_send_data ->originator_flags; // Type of number: ISDN/Telephony Numbering (E164), no extension i = EncodePhoneNumber(_smsops_rp_send_data->originator, - &sms_body.s[sms_body.len], buffer_size - sms_body.len); - sms_body.s[lenpos] = i + 1; - sms_body.len += i; + &_smsops_sms_body.s[_smsops_sms_body.len], + buffer_size - _smsops_sms_body.len); + _smsops_sms_body.s[lenpos] = i + 1; + _smsops_sms_body.len += i; } - lenpos = sms_body.len; - sms_body.s[sms_body.len++] = 0x00; + lenpos = _smsops_sms_body.len; + _smsops_sms_body.s[_smsops_sms_body.len++] = 0x00; if(_smsops_rp_send_data->destination.len > 0) { - sms_body.s[sms_body.len++] = + _smsops_sms_body.s[_smsops_sms_body.len++] = _smsops_rp_send_data ->destination_flags; // Type of number: ISDN/Telephony Numbering (E164), no extension i = EncodePhoneNumber(_smsops_rp_send_data->destination, - &sms_body.s[sms_body.len], buffer_size - sms_body.len); - sms_body.s[lenpos] = i + 1; - sms_body.len += i; + &_smsops_sms_body.s[_smsops_sms_body.len], + buffer_size - _smsops_sms_body.len); + _smsops_sms_body.s[lenpos] = i + 1; + _smsops_sms_body.len += i; } // Store the position of the length for later usage: - lenpos = sms_body.len; - sms_body.s[sms_body.len++] = 0x00; + lenpos = _smsops_sms_body.len; + _smsops_sms_body.s[_smsops_sms_body.len++] = 0x00; /////////////////////////////////////////////////// // T-PDU /////////////////////////////////////////////////// - sms_body.s[sms_body.len++] = + _smsops_sms_body.s[_smsops_sms_body.len++] = _smsops_rp_send_data->pdu.msg_type | _smsops_rp_send_data->pdu.flags | 0x4; // We've always got no more messages to send. // Originating Address: - sms_body.s[sms_body.len++] = + _smsops_sms_body.s[_smsops_sms_body.len++] = _smsops_rp_send_data->pdu.originating_address.len; - sms_body.s[sms_body.len++] = + _smsops_sms_body.s[_smsops_sms_body.len++] = _smsops_rp_send_data->pdu.originating_address_flags; - sms_body.len += + _smsops_sms_body.len += EncodePhoneNumber(_smsops_rp_send_data->pdu.originating_address, - &sms_body.s[sms_body.len], buffer_size - sms_body.len); + &_smsops_sms_body.s[_smsops_sms_body.len], + buffer_size - _smsops_sms_body.len); // Protocol ID - sms_body.s[sms_body.len++] = _smsops_rp_send_data->pdu.pid; + _smsops_sms_body.s[_smsops_sms_body.len++] = _smsops_rp_send_data->pdu.pid; // Encoding (0 => default 7 Bit) - sms_body.s[sms_body.len++] = _smsops_rp_send_data->pdu.coding; + _smsops_sms_body.s[_smsops_sms_body.len++] = + _smsops_rp_send_data->pdu.coding; // Service-Center-Timestamp (always 7 octets) - EncodeTime(&sms_body.s[sms_body.len]); - sms_body.len += 7; - smstext_len_pos = sms_body.len; - sms_body.s[sms_body.len++] = _smsops_rp_send_data->pdu.payload.sm.len; + EncodeTime(&_smsops_sms_body.s[_smsops_sms_body.len]); + _smsops_sms_body.len += 7; + smstext_len_pos = _smsops_sms_body.len; + _smsops_sms_body.s[_smsops_sms_body.len++] = + _smsops_rp_send_data->pdu.payload.sm.len; // Check for UDH concat = GetConcatShortMsg8bitRefIE(_smsops_rp_send_data); @@ -1266,14 +1276,15 @@ int pv_sms_body(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) return -1; } if(concat->max_num_sm && concat->seq) { - sms_body.s[sms_body.len++] = + _smsops_sms_body.s[_smsops_sms_body.len++] = 5; // always 5 for TP_UDH_IE_CONCAT_SM_8BIT_REF - sms_body.s[sms_body.len++] = TP_UDH_IE_CONCAT_SM_8BIT_REF; - sms_body.s[sms_body.len++] = + _smsops_sms_body.s[_smsops_sms_body.len++] = + TP_UDH_IE_CONCAT_SM_8BIT_REF; + _smsops_sms_body.s[_smsops_sms_body.len++] = 3; // always 3 for TP_UDH_IE_CONCAT_SM_8BIT_REF - sms_body.s[sms_body.len++] = concat->ref; - sms_body.s[sms_body.len++] = concat->max_num_sm; - sms_body.s[sms_body.len++] = concat->seq; + _smsops_sms_body.s[_smsops_sms_body.len++] = concat->ref; + _smsops_sms_body.s[_smsops_sms_body.len++] = concat->max_num_sm; + _smsops_sms_body.s[_smsops_sms_body.len++] = concat->seq; udh_len = 6; } @@ -1286,30 +1297,33 @@ int pv_sms_body(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) } i = ascii_to_gsm(_smsops_rp_send_data->pdu.payload.sm, - &sms_body.s[sms_body.len], buffer_size - sms_body.len, - &actual_text_size, paddingBits); - sms_body.len += i; - sms_body.s[smstext_len_pos] = actual_text_size + udh_len; + &_smsops_sms_body.s[_smsops_sms_body.len], + buffer_size - _smsops_sms_body.len, &actual_text_size, + paddingBits); + _smsops_sms_body.len += i; + _smsops_sms_body.s[smstext_len_pos] = actual_text_size + udh_len; } else { // Coding: ucs2 int ucs2len = utf8_to_ucs2(&_smsops_rp_send_data->pdu.payload.sm.s[0], _smsops_rp_send_data->pdu.payload.sm.len, - &sms_body.s[sms_body.len], buffer_size - sms_body.len); + &_smsops_sms_body.s[_smsops_sms_body.len], + buffer_size - _smsops_sms_body.len); if(ucs2len < 0) { // Failed in coding UCS2. LM_ERR("Error encoding SMS in UCS-2 format!\n"); return -1; } - sms_body.len += ucs2len; + _smsops_sms_body.len += ucs2len; // Update the sms text len - sms_body.s[smstext_len_pos] = (unsigned char)ucs2len + udh_len; + _smsops_sms_body.s[smstext_len_pos] = (unsigned char)ucs2len + udh_len; } // Update the len of the PDU - sms_body.s[lenpos] = (unsigned char)(sms_body.len - lenpos - 1); + _smsops_sms_body.s[lenpos] = + (unsigned char)(_smsops_sms_body.len - lenpos - 1); - return pv_get_strval(msg, param, res, &sms_body); + return pv_get_strval(msg, param, res, &_smsops_sms_body); } int pv_get_sms(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) diff --git a/src/modules/snmpstats/mibs/KAMAILIO-MIB b/src/modules/snmpstats/mibs/KAMAILIO-MIB index c2478a4e1..4f14a37bc 100644 --- a/src/modules/snmpstats/mibs/KAMAILIO-MIB +++ b/src/modules/snmpstats/mibs/KAMAILIO-MIB @@ -4,7 +4,7 @@ -- Date of Creation: Januay 2006 -- -- This MIB provides information related to the Kamailio SIP Router. --- +-- -- Copyright (c) The Internet Society (2006) -- Amendments (c) Soma Networks, Inc. (2006) -- Kamailio extras (c) Edvina AB, 2013 @@ -16,7 +16,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN IMPORTS MODULE-IDENTITY, - OBJECT-TYPE, + OBJECT-TYPE, OBJECT-IDENTITY, NOTIFICATION-TYPE, Integer32, @@ -25,7 +25,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN Counter64, Gauge32 FROM SNMPv2-SMI - + DateAndTime, TEXTUAL-CONVENTION, DisplayString, @@ -40,7 +40,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN X731AlarmStatus, X731AlarmState FROM KAMAILIO-TC - + MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP @@ -52,13 +52,13 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN kamailioModule MODULE-IDENTITY LAST-UPDATED "201301081200Z" ORGANIZATION "Kamailio" - CONTACT-INFO + CONTACT-INFO "https://www.kamailio.org" DESCRIPTION "Kamailio MIB module. This module defines objects which are necessary to monitor an instance of Kamailio. - + The objects in this MIB are intended to be used in conjunction with those rovided in KAMAILIO-SIP-COMMON-MIB and KAMAILIO-SIP-SERVER-MIB. In particular, this MIB defines the X.731 @@ -66,7 +66,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN Kamailio core itself." REVISION "200605021200Z" DESCRIPTION - "clarified some of the statistics collected, added the alarm + "clarified some of the statistics collected, added the alarm states and notifications." REVISION "200603231200Z" DESCRIPTION @@ -87,9 +87,9 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN -- kamailioObjects OBJECT-IDENTITY STATUS current - DESCRIPTION + DESCRIPTION "Sub-tree for accessible objects in the MIB." - ::= { kamailioMIB 1 } + ::= { kamailioMIB 1 } kamailioMIBEvents OBJECT-IDENTITY STATUS current @@ -99,7 +99,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN kamailioConform OBJECT-IDENTITY STATUS current - DESCRIPTION + DESCRIPTION "Sub-tree for Conformance specifications." ::= { kamailioMIB 3 } @@ -108,56 +108,56 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN -- kamailioServer OBJECT-IDENTITY STATUS current - DESCRIPTION + DESCRIPTION "Sub-tree for Server state, alarms, and management." ::= { kamailioObjects 1 } kamailioMsgs OBJECT-IDENTITY STATUS current - DESCRIPTION + DESCRIPTION "Sub-tree for tracking of individual SIP messages processed by Kamailio." ::= { kamailioObjects 2 } kamailioDialog OBJECT-IDENTITY STATUS current - DESCRIPTION + DESCRIPTION "Sub-tree for tracking of SIP Dialogs being processed by Kamailio." ::= { kamailioObjects 3 } kamailioNet OBJECT-IDENTITY STATUS current - DESCRIPTION + DESCRIPTION "Sub-tree for tracking of Network Transports being enabled in Kamailio." ::= { kamailioObjects 4 } --- +-- -- Kamailio Server Objects -- kamailioSrvMemory OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for Core Memory Statistics." + DESCRIPTION + "Sub-tree for Core Memory Statistics." ::= { kamailioServer 1 } kamailioSrvConfig OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for Core configuration - compile flags etc." + DESCRIPTION + "Sub-tree for Core configuration - compile flags etc." ::= { kamailioServer 2 } kamailioSrvCounters OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for Core Counters/Statistic variables." + DESCRIPTION + "Sub-tree for Core Counters/Statistic variables." ::= { kamailioServer 3 } kamailioSrvProcess OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for Core Processes." + DESCRIPTION + "Sub-tree for Core Processes." ::= { kamailioServer 4 } --- +-- -- Kamailio Server Configuration -- @@ -165,7 +165,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX DisplayString MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Full version of Kamailio" ::= { kamailioSrvConfig 1 } @@ -173,7 +173,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX DisplayString MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Version of Kamailio" ::= { kamailioSrvConfig 2 } @@ -181,7 +181,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX DisplayString MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Version of Kamailio" ::= { kamailioSrvConfig 3 } @@ -189,7 +189,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX DisplayString MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Architecture Kamailio is compiled for" ::= { kamailioSrvConfig 4 } @@ -197,7 +197,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX DisplayString MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Operating System Kamailio is compiled for" ::= { kamailioSrvConfig 5 } @@ -205,7 +205,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX DisplayString MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Kamailio Version ID" ::= { kamailioSrvConfig 6 } @@ -213,7 +213,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX DisplayString MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Kamailio Build time" ::= { kamailioSrvConfig 7 } @@ -221,7 +221,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX DisplayString MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Kamailio Build compiler used" ::= { kamailioSrvConfig 8 } @@ -229,19 +229,19 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX DisplayString MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Kamailio Build compile time flags" ::= { kamailioSrvConfig 9 } --- +-- -- Kamailio Server Memory data -- kamailioSrvMaxMemory OBJECT-TYPE SYNTAX Gauge32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Maximum available Shared Memory" ::= { kamailioSrvMemory 1 } @@ -249,7 +249,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Gauge32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Available free memory in the Shared Memory pool" ::= { kamailioSrvMemory 2 } @@ -257,7 +257,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Gauge32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Maximum amount of memory used in the Shared Memory pool" ::= { kamailioSrvMemory 3 } @@ -265,7 +265,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Gauge32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Current amount of memory used in the Shared Memory pool" ::= { kamailioSrvMemory 4 } @@ -273,39 +273,39 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Gauge32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Current amount of memory fragments in the Shared Memory pool" ::= { kamailioSrvMemory 5 } --- +-- -- Kamailio Server Core counters -- --- +-- -- Kamailio Network Objects -- kamailioNetTcp OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for TCP Network Transport objects (incl TLS conncetions)." + DESCRIPTION + "Sub-tree for TCP Network Transport objects (incl TLS conncetions)." ::= { kamailioNet 1 } kamailioNetWebsocket OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for Websocket Network Transport objects ." + DESCRIPTION + "Sub-tree for Websocket Network Transport objects ." ::= { kamailioNet 2 } kamailioNetHttp OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for HTTP Server Transport objects ." + DESCRIPTION + "Sub-tree for HTTP Server Transport objects ." ::= { kamailioNet 3 } kamailioNetConfig OBJECT-IDENTITY STATUS current - DESCRIPTION + DESCRIPTION "Sub-tree for transport properties" ::= { kamailioNet 4 } @@ -314,20 +314,20 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN -- kamailioNetTcpTls OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for TCP/TLS specific objects." + DESCRIPTION + "Sub-tree for TCP/TLS specific objects." ::= { kamailioNetTcp 1 } kamailioNetTcpStat OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for TCP/TLS statistics." + DESCRIPTION + "Sub-tree for TCP/TLS statistics." ::= { kamailioNetTcp 2 } kamailioNetTcpConfig OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for TCP/TLS configuration data." + DESCRIPTION + "Sub-tree for TCP/TLS configuration data." ::= { kamailioNetTcp 3 } -- @@ -337,16 +337,16 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if TCP is enabled in this server." + DEFVAL { false } ::= { kamailioNetTcpConfig 1 } kamailioNetTcpMaxConns OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Maximum number of TCP connections (tcp_max_connections)" ::= { kamailioNetTcpConfig 2 } @@ -354,7 +354,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "TCP Connection Timeout (tcp_connect_timeout)" ::= { kamailioNetTcpConfig 3 } @@ -362,7 +362,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Time in seconds after a TCP connection will be closed if it is not available for writing in this interval (tcp_send_timeout)" ::= { kamailioNetTcpConfig 4 } @@ -370,7 +370,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Lifetime in seconds for TCP sessions (tcp_connection_lifetime)" ::= { kamailioNetTcpConfig 5 } @@ -378,7 +378,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Maximum number of tcp connections (tcp_max_connections)" ::= { kamailioNetTcpConfig 6 } @@ -386,7 +386,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "True if Kamailio never tries to set up outbound TCP (or TCP/TLS) connections (tcp_no_connect)" ::= { kamailioNetTcpConfig 7 } @@ -394,7 +394,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "If enabled FDs used for sending will be cached inside the process calling tcp_send (tcp_fd_cache)" ::= { kamailioNetTcpConfig 8 } @@ -402,7 +402,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "True if TCP Async is enabled in this server (tcp_async)" ::= { kamailioNetTcpConfig 9 } @@ -410,7 +410,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "??? No description available " ::= { kamailioNetTcpConfig 10 } @@ -418,7 +418,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "??? No description available " ::= { kamailioNetTcpConfig 10 } @@ -426,7 +426,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Async TCP: Maximum bytes queued for write allowed per connection. (tcp_conn_wq_max)" ::= { kamailioNetTcpConfig 11 } @@ -434,7 +434,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Async TCP: Maximum bytes queued for write (tcp__wq_max)" ::= { kamailioNetTcpConfig 12 } @@ -442,7 +442,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Async TCP: Maximum bytes queued for write (tcp_wq_blk_size)" ::= { kamailioNetTcpConfig 12 } @@ -450,7 +450,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Buffer size used for tcp reads (tcp_rd_buf_size)" ::= { kamailioNetTcpConfig 13 } @@ -458,7 +458,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Tcp accepts will be delayed until some data is received (tcp_defer_accept)" ::= { kamailioNetTcpConfig 14 } @@ -466,7 +466,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Initial ACK for opened connections will be delayed and sent with the first data segment (tcp_delayed_ack)" ::= { kamailioNetTcpConfig 15 } @@ -474,7 +474,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Number of SYN retransmissions before aborting a connect attempt (tcp_syncnt)" ::= { kamailioNetTcpConfig 16 } @@ -482,7 +482,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Lifetime of orphaned sockets in FIN_WAIT2 state. Linux only. (tcp_linger2)" ::= { kamailioNetTcpConfig 17 } @@ -490,7 +490,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "True if TCP Keepalives are enabled (tcp_keepalive)" ::= { kamailioNetTcpConfig 18 } @@ -498,7 +498,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Time before starting to send keepalives, if the connection is idle. Linux only. (tcp_keepidle)" ::= { kamailioNetTcpConfig 19 } @@ -506,7 +506,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Time interval between keepalive probes, when the previous probe failed. Linux only. (tcp_keepintvl)" ::= { kamailioNetTcpConfig 20 } @@ -514,7 +514,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Integer32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Number of keepalives sent before dropping the connection. Linux only. (tcp_keepcnt)" ::= { kamailioNetTcpConfig 21 } @@ -522,7 +522,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Enable SIP outbound TCP keep-alive using PING-PONG (CRLFCRLF - CRLF). (tcp_crlf_ping)" ::= { kamailioNetTcpConfig 22 } @@ -530,7 +530,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Reuse TCP connections based on aliases (tcp_accept_alias)" ::= { kamailioNetTcpConfig 23 } @@ -538,7 +538,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "True if Content-Length headers are required (tcp_accept_no_cl)" ::= { kamailioNetTcpConfig 24 } @@ -556,7 +556,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Incremented each time a TCP connection is established." ::= { kamailioNetTcpStat 1 } @@ -564,7 +564,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Number of failed active TCP connection attempts." ::= { kamailioNetTcpStat 2 } @@ -572,7 +572,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Number of reset TCP connections" ::= { kamailioNetTcpStat 3 } @@ -580,7 +580,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Number of successful TCP connections" ::= { kamailioNetTcpStat 4 } @@ -588,7 +588,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Gauge32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Number of current open TCP connections" ::= { kamailioNetTcpStat 5 } @@ -596,7 +596,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Total number of accepted TCP connections (so far)." ::= { kamailioNetTcpStat 6 } @@ -604,7 +604,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Total number of successfully active opened TCP connections" ::= { kamailioNetTcpStat 7 } @@ -612,7 +612,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Number of rejected incoming TCP connections." ::= { kamailioNetTcpStat 8 } @@ -623,108 +623,108 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if UDP is active in this server." + DEFVAL { false } ::= { kamailioNetConfig 1 } kamailioNetConfUdpDtlsTransport OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if UDP/DTLS is active in this server. (Future reservation)" + DEFVAL { false } ::= { kamailioNetConfig 2 } kamailioNetConfTcpTransport OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if TCP is active in this server." + DEFVAL { false } ::= { kamailioNetConfig 3 } kamailioNetConfTcpTlsTransport OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if TCP/TLS is active in this server." + DEFVAL { false } ::= { kamailioNetConfig 4 } kamailioNetConfSctpTransport OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if Sctp is enabled in this server." + DEFVAL { false } ::= { kamailioNetConfig 5 } kamailioNetConfSctpTlsTransport OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if Sctp/TLS is enabled in this server. (Future reservation)" + DEFVAL { false } ::= { kamailioNetConfig 6 } kamailioNetConfWsTransport OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if WS - WebSocket Transport- is enabled in this server." + DEFVAL { false } ::= { kamailioNetConfig 7 } kamailioNetConfWsTlsTransport OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if WSS - WebSocket Transport with TLS- is enabled in this server." + DEFVAL { false } ::= { kamailioNetConfig 8 } kamailioNetConfHttpServer OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if the embedded HTTP server (xhttp module) is loaded in this server." + DEFVAL { false } ::= { kamailioNetConfig 9 } kamailioNetConfMsrpRelay OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if the MSRP Relay server is loaded in this server." + DEFVAL { false } ::= { kamailioNetConfig 10 } kamailioNetConfStunServer OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if the STUN Server server (SIP Outbound) is loaded in this server." + DEFVAL { false } ::= { kamailioNetConfig 11 } kamailioNetConfOutbound OBJECT-TYPE SYNTAX TruthValue MAX-ACCESS read-only STATUS current - DEFVAL { false } - DESCRIPTION + DESCRIPTION "True if the SIP Outbound module is loaded in this server." + DEFVAL { false } ::= { kamailioNetConfig 12 } -- @@ -732,14 +732,14 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN -- kamailioNetWsStat OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for Websocket statistics." + DESCRIPTION + "Sub-tree for Websocket statistics." ::= { kamailioNetWebsocket 1 } kamailioNetWsConfig OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for Websocket configuration objects." + DESCRIPTION + "Sub-tree for Websocket configuration objects." ::= { kamailioNetWebsocket 2 } -- @@ -755,7 +755,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Gauge MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "Number of currently active websocket connections" ::= { kamailioNetWsStat 1 } @@ -763,7 +763,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Gauge MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The maximum number of active websocket connections since process start" ::= { kamailioNetWsStat 2 } @@ -771,7 +771,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The number of failed websocket connections since process start" ::= { kamailioNetWsStat 3 } @@ -779,7 +779,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The number of locally closed websocket connections" ::= { kamailioNetWsStat 4 } @@ -787,7 +787,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The number of closed websocket connections by remote peer" ::= { kamailioNetWsStat 5 } @@ -795,7 +795,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The number of received websocket frames" ::= { kamailioNetWsStat 6 } @@ -803,7 +803,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The number of transmitted websocket frames" ::= { kamailioNetWsStat 7 } @@ -811,7 +811,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The number of transmitted websocket frames" ::= { kamailioNetWsStat 8 } @@ -819,7 +819,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Counter32 MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The number of transmitted websocket frames" ::= { kamailioNetWsStat 9 } @@ -829,12 +829,12 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN -- -- --- Message Statistics +-- Message Statistics -- kamailioMsgStats OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for Message Statistics." + DESCRIPTION + "Sub-tree for Message Statistics." ::= { kamailioMsgs 3 } kamailioMsgQueueDepth OBJECT-TYPE @@ -842,7 +842,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN MAX-ACCESS read-only STATUS current DESCRIPTION - "The number of packets (udp or tcp) waiting in the OS network queue, + "The number of packets (udp or tcp) waiting in the OS network queue, waiting to be processed." ::= { kamailioMsgStats 1 } @@ -851,17 +851,17 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN MAX-ACCESS read-only STATUS current DESCRIPTION - "When the kamailioMsgQueueDepth reaches this point, a minor alarm + "When the kamailioMsgQueueDepth reaches this point, a minor alarm will be generated. This value reflects the configured value; if it is set to -1, then the alarm is never sent." ::= { kamailioMsgStats 2 } - + kamailioMsgQueueMajorThreshold OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-only STATUS current DESCRIPTION - "When the kamailioMsgQueueDepth reaches this point, a major alarm + "When the kamailioMsgQueueDepth reaches this point, a major alarm will be generated. This value reflects the configured value; if it is set to -1, then the alarm is never sent." ::= { kamailioMsgStats 3 } @@ -870,7 +870,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN -- kamailioMsgAlarms OBJECT-IDENTITY STATUS current - DESCRIPTION + DESCRIPTION "Sub-tree for Message Alarms." ::= { kamailioMsgs 4 } @@ -881,16 +881,16 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN DESCRIPTION "This status variable reports the alarm levels that have been generated for the message queue depth. - - The thresholds are defined in the Kamailio configuration; if they - are not configured, this alarm status will always be clear. + + The thresholds are defined in the Kamailio configuration; if they + are not configured, this alarm status will always be clear. Specifically, in this case no bits will be toggled, and therefore this scalar will return 00. - + This scalar follows the X731AlarmStatus specs, and can take on the following values: - - underRepair(0), critical(1), major(2), minor(3), + + underRepair(0), critical(1), major(2), minor(3), alarmOutstanding(4), unknown(5)" ::= { kamailioMsgAlarms 1 } @@ -899,19 +899,19 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN MAX-ACCESS read-only STATUS current DESCRIPTION - "This variable indicates whether the minor message queue depth + "This variable indicates whether the minor message queue depth threshold has been surpassed. clear(0) the queue depth is below the configured threshold. minor(1) the queue depth has exceeded the configured threshold." ::= { kamailioMsgAlarms 2 } - + kamailioMsgQueueDepthMajorAlarm OBJECT-TYPE SYNTAX X731AlarmState MAX-ACCESS read-only STATUS current DESCRIPTION - "This variable indicates whether the major message queue depth - threshold has been surpassed. + "This variable indicates whether the major message queue depth + threshold has been surpassed. clear(0) the queue depth is below the configured threshold. major(2) the queue depth has exceeded the configured threshold." ::= { kamailioMsgAlarms 3 } @@ -920,7 +920,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN -- -- --- The Dialog Table: +-- The Dialog Table: -- contains information about currently active calls. -- @@ -932,7 +932,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN "This table contains information on all active calls in the system." ::= { kamailioDialog 1 } - + kamailioDialogTableEntry OBJECT-TYPE SYNTAX KamailioDialogTableEntry MAX-ACCESS not-accessible @@ -943,7 +943,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN INDEX { kamailioDialogIndex } ::= { kamailioDialogTable 1 } - KamailioDialogTableEntry ::= + KamailioDialogTableEntry ::= SEQUENCE { kamailioDialogIndex Unsigned32, kamailioDialogType INTEGER, @@ -959,7 +959,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN SYNTAX Unsigned32 MAX-ACCESS not-accessible STATUS current - DESCRIPTION + DESCRIPTION "The index of this dialog." ::= { kamailioDialogTableEntry 1 } @@ -970,28 +970,28 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN } MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The type of Dialog: invite(1) - the dialog was created with a SIP INVITE. subscribe(2) - the dialog was created with a SIP SUBSCRIBE." ::= { kamailioDialogTableEntry 2 } - + kamailioDialogToUri OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The URI of the To header." ::= { kamailioDialogTableEntry 3 } - + kamailioDialogFromUri OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The URI of the From header." ::= { kamailioDialogTableEntry 4 } - + kamailioDialogState OBJECT-TYPE SYNTAX INTEGER { unconfirmed(0), @@ -1004,49 +1004,49 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN DESCRIPTION "The Dialogue state: unconfirmed (0) - we do not yet have a dialog, but a request has - been made and we may create one in the future. + been made and we may create one in the future. All calls begin in this state. - early (1) - dialog migrates to this state when we receive a + early (1) - dialog migrates to this state when we receive a 101-199 response. - confirmed (2) - dialog migrates from unconfirmed OR early to this + confirmed (2) - dialog migrates from unconfirmed OR early to this state when we received a 200-299 response. - terminated (3) - dialog migrates from unconfirmed OR early to this + terminated (3) - dialog migrates from unconfirmed OR early to this state when a final 3xx-4xx-5xx-6xx is message is received. - - terminated dialogs stay present in the system for only a short period + + terminated dialogs stay present in the system for only a short period of time, and then are cleared by Kamailio." ::= { kamailioDialogTableEntry 5 } - + kamailioDialogStartTime OBJECT-TYPE SYNTAX DateAndTime MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The time this dialog was started." ::= { kamailioDialogTableEntry 6 } - + kamailioDialogLastUpdateTime OBJECT-TYPE SYNTAX DateAndTime MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The last time this dialog was updated; ie, when the last SIP message for this dialog was seen." - ::= { kamailioDialogTableEntry 7 } + ::= { kamailioDialogTableEntry 7 } kamailioDialogExpiryTime OBJECT-TYPE SYNTAX DateAndTime MAX-ACCESS read-only STATUS current - DESCRIPTION + DESCRIPTION "The time at which this dialog will automatically expire." - ::= { kamailioDialogTableEntry 8 } + ::= { kamailioDialogTableEntry 8 } kamailioDialogStats OBJECT-IDENTITY STATUS current - DESCRIPTION + DESCRIPTION "Sub-section for Dialog counters and statistics." ::= { kamailioDialog 2 } @@ -1055,10 +1055,10 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN MAX-ACCESS read-only STATUS current DESCRIPTION - "The current number of dialogs either in EARLY or CONFIRMED + "The current number of dialogs either in EARLY or CONFIRMED state." ::= { kamailioDialogStats 1 } - + kamailioCurNumDialogsInProgress OBJECT-TYPE SYNTAX Gauge32 MAX-ACCESS read-only @@ -1066,7 +1066,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN DESCRIPTION "The current number of CONFIRMED dialogs." ::= { kamailioDialogStats 2 } - + kamailioCurNumDialogsInSetup OBJECT-TYPE SYNTAX Gauge32 MAX-ACCESS read-only @@ -1074,13 +1074,13 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN DESCRIPTION "The current number of EARLY dialogs." ::= { kamailioDialogStats 3 } - + kamailioTotalNumFailedDialogSetups OBJECT-TYPE SYNTAX Counter32 MAX-ACCESS read-only STATUS current DESCRIPTION - "The total number of calls that failed with an error. + "The total number of calls that failed with an error. The following codes define a failed call:" ::= { kamailioDialogStats 4 } @@ -1089,7 +1089,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN MAX-ACCESS read-only STATUS current DESCRIPTION - "The configured minor threshold indicating the kamailio system has + "The configured minor threshold indicating the kamailio system has reached a high level of dialogs. -1 indicates the value is not configured, and the alarm will never be set." ::= { kamailioDialogStats 5 } @@ -1101,7 +1101,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN DESCRIPTION "The configured threshold indicating the kamailio system has reached a maximum number of dialogs, and perhaps performance will suffer. - -1 indicates the value is not configured, and alarms will never be + -1 indicates the value is not configured, and alarms will never be set, and the usage state will never be reported as 'busy'." ::= { kamailioDialogStats 6 } @@ -1123,7 +1123,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN DESCRIPTION "a sub-tree for Kamailio's dialog tracking states." ::= { kamailioDialog 3 } - + kamailioDialogUsageState OBJECT-TYPE SYNTAX X731UsageState MAX-ACCESS read-only @@ -1133,7 +1133,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN idle(0) - no dialogs are currently being tracked. active(1) - at least 1 dialog is being tracked. busy(2) - the maximum number of dialogs are being tracked. - + The 'busy' point is based on a configuration variable (the same as kamailioDialogMajorLimitThreshold): if this value is -1, then the server is never considered 'busy'." @@ -1144,8 +1144,8 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN -- kamailioDialogAlarms OBJECT-IDENTITY STATUS current - DESCRIPTION - "Sub-tree for call alarms." + DESCRIPTION + "Sub-tree for call alarms." ::= { kamailioDialog 4 } kamailioDialogLimitAlarmStatus OBJECT-TYPE @@ -1159,8 +1159,8 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN This scalar follows the X731AlarmStatus specs, and can take on the following values: - - underRepair(0), critical(1), major(2), minor(3), + + underRepair(0), critical(1), major(2), minor(3), alarmOutstanding(4), unknown(5)" ::= { kamailioDialogAlarms 1 } @@ -1169,14 +1169,14 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN MAX-ACCESS read-only STATUS current DESCRIPTION - "The Kamailio system is approaching or has reached its configured + "The Kamailio system is approaching or has reached its configured minor dialog limit threshold. clear(0) - the current number of dialogs is below the configured threshold. minor(1) - the current number of dialogs has reached or exceeded the configured threshold. - - The threshold is defined in the Kamailio configuration; if it + + The threshold is defined in the Kamailio configuration; if it is not configured, this alarm will not be sent." ::= { kamailioDialogAlarms 2 } @@ -1185,18 +1185,18 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN MAX-ACCESS read-only STATUS current DESCRIPTION - "The Kamailio system is approaching or has reached its configured + "The Kamailio system is approaching or has reached its configured dialog limit. clear(0) - the current number of dialogs is below the configured threshold. major(2) - the current number of dialogs has reached or exceeded the configured threshold. - - The threshold is defined in the Kamailio configuration; if it + + The threshold is defined in the Kamailio configuration; if it is not configured, this alarm will not be sent." ::= { kamailioDialogAlarms 3 } --- +-- -- Notifications -- @@ -1207,30 +1207,30 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN kamailioMIBNotifications OBJECT-IDENTITY STATUS current - DESCRIPTION + DESCRIPTION "A sub-section for reverse-mapping between SNMPv1 and SNMPv2 events." - ::= { kamailioMIBEvents 0 } - + ::= { kamailioMIBEvents 0 } + kamailioMsgQueueDepthMinorEvent NOTIFICATION-TYPE OBJECTS { kamailioMsgQueueDepth, kamailioMsgQueueMinorThreshold } STATUS current DESCRIPTION - "The message queue depth (as reported by kamailioMsgQueueDepth) has + "The message queue depth (as reported by kamailioMsgQueueDepth) has exceeded the minor configured threshold kamailioMsgQueueMinorThreshold." ::= { kamailioMIBNotifications 1 } - + kamailioMsgQueueDepthMajorEvent NOTIFICATION-TYPE OBJECTS { kamailioMsgQueueDepth, kamailioMsgQueueMajorThreshold } STATUS current DESCRIPTION - "The message queue depth (as reported by kamailioMsgQueueDepth) has + "The message queue depth (as reported by kamailioMsgQueueDepth) has exceeded the minor configured threshold kamailioMsgQueueMinorThreshold." ::= { kamailioMIBNotifications 2 } - + kamailioDialogLimitMinorEvent NOTIFICATION-TYPE OBJECTS { kamailioCurNumDialogs, kamailioDialogLimitMinorThreshold @@ -1238,7 +1238,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN STATUS current DESCRIPTION "The number of dialogs being tracked in the system (as reported by - kamailioCurNumDialogs) has exceeded the minor configured threshold + kamailioCurNumDialogs) has exceeded the minor configured threshold kamailioDialogLimitMinorThreshold." ::= { kamailioMIBNotifications 3 } @@ -1249,7 +1249,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN STATUS current DESCRIPTION "The number of dialogs being tracked in the system (as reported by - kamailioCurNumDialogs) has exceeded the major configured threshold + kamailioCurNumDialogs) has exceeded the major configured threshold kamailioDialogLimitMajorThreshold." ::= { kamailioMIBNotifications 4 } @@ -1276,10 +1276,10 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN kamailioGroups OBJECT-IDENTITY STATUS current - DESCRIPTION + DESCRIPTION "Sub-tree for defining the conformance groups." ::= { kamailioConform 2 } - + kamailioNotifications OBJECT-IDENTITY STATUS current DESCRIPTION @@ -1338,7 +1338,7 @@ KAMAILIO-MIB DEFINITIONS ::= BEGIN "A collection of objects providing stateful alarm information in Kamailio." ::= { kamailioGroups 3 } - + kamailioMsgQueueEvents NOTIFICATION-GROUP NOTIFICATIONS { kamailioMsgQueueDepthMinorEvent, diff --git a/src/modules/stirshaken/README b/src/modules/stirshaken/README index bb2e7449f..cea4604d1 100644 --- a/src/modules/stirshaken/README +++ b/src/modules/stirshaken/README @@ -556,3 +556,13 @@ reated)\n"); cd /path/to/kamailio/ make modules modules=src/modules/stirshaken/ ... + + To ensure proper functionality, the Kamailio stirshaken module requires + a minimum version of libstirshaken that includes the + stir_shaken_verify_cert_path function for performing the x509 + certificate path check. This functionality was added to libstirshaken + around 2020 + (https://github.com/signalwire/libstirshaken/commit/58e740b897ae40e2bb0 + 2ada2231a051a7eb55137). If you're using an older version of + libstirshaken that predates this commit, the stirshaken module may not + function correctly. diff --git a/src/modules/stirshaken/doc/stirshaken_admin.xml b/src/modules/stirshaken/doc/stirshaken_admin.xml index ef07e6a72..41f72e5c1 100644 --- a/src/modules/stirshaken/doc/stirshaken_admin.xml +++ b/src/modules/stirshaken/doc/stirshaken_admin.xml @@ -528,6 +528,10 @@ request_route { ... + + To ensure proper functionality, the Kamailio stirshaken module requires a minimum version of libstirshaken that includes the stir_shaken_verify_cert_path function for performing the x509 certificate path check. This functionality was added to libstirshaken around 2020 (). + If you're using an older version of libstirshaken that predates this commit, the stirshaken module may not function correctly. + diff --git a/src/modules/stirshaken/stirshaken_mod.c b/src/modules/stirshaken/stirshaken_mod.c index 95bbdeb57..5d0bc7448 100644 --- a/src/modules/stirshaken/stirshaken_mod.c +++ b/src/modules/stirshaken/stirshaken_mod.c @@ -613,23 +613,6 @@ static int ki_stirshaken_check_identity(sip_msg_t *msg) goto fail; } - if(stirshaken_vs_verify_x509_cert_path) { - - LM_DBG("Running X509 certificate path verification\n"); - - if(!vs) { - LM_ERR("Verification Service not started\n"); - goto fail; - } - - if(STIR_SHAKEN_STATUS_OK - != stir_shaken_verify_cert_path(&ss, cert_out, vs->store)) { - LM_ERR("Cert did not pass X509 path validation\n"); - stirshaken_print_error_details(&ss); - goto fail; - } - } - if(stirshaken_vs_pptg_pvname.s != 0) { memset(&val, 0, sizeof(pv_value_t)); val.flags = PV_VAL_STR; diff --git a/src/modules/textops/textops.c b/src/modules/textops/textops.c index db1929e01..aee46a301 100644 --- a/src/modules/textops/textops.c +++ b/src/modules/textops/textops.c @@ -5037,7 +5037,7 @@ static int ki_via_param_rm(sip_msg_t *msg, str *name, int idx) } } } - return (ret == 0) ? -1 : ret; + return -1; } /** diff --git a/src/modules/tls/tls_domain.c b/src/modules/tls/tls_domain.c index 6527b16a9..afc05e2f1 100644 --- a/src/modules/tls/tls_domain.c +++ b/src/modules/tls/tls_domain.c @@ -737,11 +737,27 @@ static int set_cipher_list(tls_domain_t *d) return 0; procs_no = get_max_procs(); for(i = 0; i < procs_no; i++) { +#if OPENSSL_VERSION_NUMBER < 0x030000000L if(SSL_CTX_set_cipher_list(d->ctx[i], cipher_list) == 0) { ERR("%s: Failure to set SSL context cipher list \"%s\"\n", tls_domain_str(d), cipher_list); return -1; } +#else + if(d->method == TLS_USE_TLSv1_3 || d->method == TLS_USE_TLSv1_3_PLUS) { + if(SSL_CTX_set_ciphersuites(d->ctx[i], cipher_list) == 0) { + ERR("%s: Failure to set SSL context cipher suites \"%s\"\n", + tls_domain_str(d), cipher_list); + return -1; + } + } else { + if(SSL_CTX_set_cipher_list(d->ctx[i], cipher_list) == 0) { + ERR("%s: Failure to set SSL context cipher list \"%s\"\n", + tls_domain_str(d), cipher_list); + return -1; + } + } +#endif #if !defined(OPENSSL_NO_ECDH) && OPENSSL_VERSION_NUMBER < 0x10100000L setup_ecdh(d->ctx[i]); #endif diff --git a/src/modules/tls/tls_rpc.c b/src/modules/tls/tls_rpc.c index 171a833c4..5ec44e0a7 100644 --- a/src/modules/tls/tls_rpc.c +++ b/src/modules/tls/tls_rpc.c @@ -118,7 +118,7 @@ static void tls_list(rpc_t *rpc, void *c) TCPCONN_LOCK; for(i = 0; i < TCP_ID_HASH_SIZE; i++) { for(con = tcpconn_id_hash[i]; con; con = con->id_next) { - if(con->rcv.proto != PROTO_TLS) + if(con->rcv.proto != PROTO_TLS && con->rcv.proto != PROTO_WSS) continue; tls_d = con->extra_data; rpc->add(c, "{", &handle); @@ -274,7 +274,7 @@ static void tls_kill(rpc_t *rpc, void *c) TCPCONN_LOCK; for(i = 0; i < TCP_ID_HASH_SIZE; i++) { for(con = tcpconn_id_hash[i]; con; con = con->id_next) { - if(con->rcv.proto != PROTO_TLS) + if(con->rcv.proto != PROTO_TLS && con->rcv.proto != PROTO_WSS) continue; if(con->id == kill_id) { con->state = -2; diff --git a/src/modules/tls/tls_select.c b/src/modules/tls/tls_select.c index 7945b2327..18abcc7dd 100644 --- a/src/modules/tls/tls_select.c +++ b/src/modules/tls/tls_select.c @@ -129,14 +129,14 @@ struct tcp_connection *get_cur_connection(struct sip_msg *msg) if(_tls_pv_con != 0) return _tls_pv_con; - if(msg->rcv.proto != PROTO_TLS) { + if(msg->rcv.proto != PROTO_TLS && msg->rcv.proto != PROTO_WSS) { ERR("Transport protocol is not TLS (bug in config)\n"); return 0; } c = tcpconn_get(msg->rcv.proto_reserved1, 0, 0, 0, cfg_get(tls, tls_cfg, con_lifetime)); - if(c && c->type != PROTO_TLS) { + if(c && c->type != PROTO_TLS && msg->rcv.proto != PROTO_WSS) { ERR("Connection found but is not TLS\n"); tcpconn_put(c); return 0; @@ -1415,8 +1415,6 @@ static int get_alt_count(long *res, int local, int type, sip_msg_t *msg) tcpconn_put(c); return 0; err: - if(names) - sk_GENERAL_NAME_pop_free(names, GENERAL_NAME_free); if(!local) X509_free(cert); tcpconn_put(c); diff --git a/src/modules/tm/README b/src/modules/tm/README index 12a030cc1..17fe8e391 100644 --- a/src/modules/tm/README +++ b/src/modules/tm/README @@ -757,8 +757,12 @@ failure_route["serial"] 3.1. fr_timer (integer) - Timer which hits if no final reply for a request or ACK for a negative - INVITE reply arrives (in milliseconds). + This timer is used for all SIP requests. It hits if no reply for an + request INVITE request or other request has been received within (F in + milliseconds). If a provisional reply is received for an INVITE (any + 1xx), then the fr_inv_timer will be used instead. And if no replies (at + all) for an INVITE are received before fr_timer hits, the transaction + is terminated with a 408 in failure route. Default value is 30000 ms (30 seconds). diff --git a/src/modules/tm/dlg.c b/src/modules/tm/dlg.c index b99065a94..6c97db622 100644 --- a/src/modules/tm/dlg.c +++ b/src/modules/tm/dlg.c @@ -357,7 +357,7 @@ int new_dlg_uac(str *_cid, str *_ltag, unsigned int _lseq, str *_luri, /* Make a copy of local sequence (usually CSeq) */ res->loc_seq.value = _lseq; /* And mark it as set */ - res->loc_seq.is_set = 1; + res->loc_seq.is_set = DLG_SEQ_VALSET; *_d = res; @@ -979,7 +979,7 @@ static inline int request2dlg(struct sip_msg *_m, dlg_t *_d) if(get_cseq_value(_m, &_d->rem_seq.value) < 0) goto err3; - _d->rem_seq.is_set = 1; + _d->rem_seq.is_set = DLG_SEQ_VALSET; if(get_dlg_uri(_m->from, &_d->rem_uri) < 0) goto err3; @@ -1149,7 +1149,7 @@ int dlg_request_uas( /* Neither out of order nor retransmission -> update */ _d->rem_seq.value = cseq; - _d->rem_seq.is_set = 1; + _d->rem_seq.is_set = DLG_SEQ_VALSET; /* We will als update remote target URI if the message * is target refresher diff --git a/src/modules/tm/dlg.h b/src/modules/tm/dlg.h index 732ba970b..ff37bc4bd 100644 --- a/src/modules/tm/dlg.h +++ b/src/modules/tm/dlg.h @@ -52,6 +52,10 @@ #endif /* DIALOG_CALLBACKS */ +#define DLG_SEQ_VALINIT 0 +#define DLG_SEQ_VALSET 1 +#define DLG_SEQ_VALNEW 2 + /* * Dialog sequence */ diff --git a/src/modules/tm/doc/params.xml b/src/modules/tm/doc/params.xml index ad1f55e20..d58390da2 100644 --- a/src/modules/tm/doc/params.xml +++ b/src/modules/tm/doc/params.xml @@ -18,8 +18,12 @@
<varname>fr_timer</varname> (integer) - Timer which hits if no final reply for a request or ACK for a - negative INVITE reply arrives (in milliseconds). + This timer is used for all SIP requests. It hits if no reply for an + request INVITE request or other request has been received + within (F in milliseconds). If a provisional reply is received for an + INVITE (any 1xx), then the fr_inv_timer will be used instead. And if + no replies (at all) for an INVITE are received before fr_timer hits, + the transaction is terminated with a 408 in failure route. Default value is 30000 ms (30 seconds). diff --git a/src/modules/tm/rpc_uac.c b/src/modules/tm/rpc_uac.c index 2d7bd6113..686138651 100644 --- a/src/modules/tm/rpc_uac.c +++ b/src/modules/tm/rpc_uac.c @@ -757,7 +757,7 @@ static void rpc_t_uac(rpc_t *rpc, void *c, int reply_wait) dlg.loc_seq.value = cseq; else dlg.loc_seq.value = DEFAULT_CSEQ; - dlg.loc_seq.is_set = 1; + dlg.loc_seq.is_set = DLG_SEQ_VALSET; dlg.loc_uri = get_from(&faked_msg)->uri; dlg.rem_uri = get_to(&faked_msg)->uri; @@ -1052,7 +1052,7 @@ int t_uac_send(str *method, str *ruri, str *nexthop, str *send_socket, dlg.loc_seq.value = cseq; else dlg.loc_seq.value = DEFAULT_CSEQ; - dlg.loc_seq.is_set = 1; + dlg.loc_seq.is_set = DLG_SEQ_VALSET; dlg.loc_uri = get_from(&faked_msg)->uri; dlg.rem_uri = get_to(&faked_msg)->uri; diff --git a/src/modules/tm/t_cancel.c b/src/modules/tm/t_cancel.c index d4f1be0ea..e3114c70d 100644 --- a/src/modules/tm/t_cancel.c +++ b/src/modules/tm/t_cancel.c @@ -338,44 +338,47 @@ int cancel_branch(struct cell *t, int branch, sip_msg_t *cancel_msg, LM_DBG("sending cancel...\n"); - rt = -1; - if(tm_event_callback.s == NULL || tm_event_callback.len <= 0) { - rt = route_lookup(&event_rt, evname.s); - if(rt < 0 || event_rt.rlist[rt] == NULL) { - LM_DBG("tm:local-request not found\n"); - } - } else { - keng = sr_kemi_eng_get(); - if(keng == NULL) { - LM_DBG("event callback (%s) set, but no cfg engine\n", - tm_event_callback.s); + if(flags & F_CANCEL_LOCAL) { + /* Call event */ + rt = -1; + if(tm_event_callback.s == NULL || tm_event_callback.len <= 0) { + rt = route_lookup(&event_rt, evname.s); + if(rt < 0 || event_rt.rlist[rt] == NULL) { + LM_DBG("tm:local-request not found\n"); + } + } else { + keng = sr_kemi_eng_get(); + if(keng == NULL) { + LM_DBG("event callback (%s) set, but no cfg engine\n", + tm_event_callback.s); + } } - } - // /* Check if msg is null */ - if(build_sip_msg_from_buf(&msg, crb->buffer, crb->buffer_len, 0) < 0) { - LM_ERR("fail to parse msg\n"); - } - - /* Call event */ - backup_rt = get_route_type(); - set_route_type(REQUEST_ROUTE); - init_run_actions_ctx(&ctx); - if(rt >= 0) { - LM_DBG("tm:local-request found [%d]\n", rt); - run_top_route(event_rt.rlist[rt], &msg, 0); - } else { - if(keng != NULL) { + /* Check if msg is null */ + if(build_sip_msg_from_buf(&msg, crb->buffer, crb->buffer_len, 0) < 0) { + LM_ERR("fail to parse msg\n"); + } - if(sr_kemi_route( - keng, &msg, EVENT_ROUTE, &tm_event_callback, &evname) - < 0) { - LM_ERR("error running event route kemi callback\n"); + /* Call event */ + backup_rt = get_route_type(); + set_route_type(REQUEST_ROUTE); + init_run_actions_ctx(&ctx); + if(rt >= 0) { + LM_DBG("tm:local-request found [%d]\n", rt); + run_top_route(event_rt.rlist[rt], &msg, 0); + } else { + if(keng != NULL) { + + if(sr_kemi_route( + keng, &msg, EVENT_ROUTE, &tm_event_callback, &evname) + < 0) { + LM_ERR("error running event route kemi callback\n"); + } } } + set_route_type(backup_rt); + free_sip_msg(&msg); } - set_route_type(backup_rt); - free_sip_msg(&msg); if(SEND_BUFFER(crb) >= 0) { if(unlikely(has_tran_tmcbs(t, TMCB_REQUEST_OUT))) @@ -429,7 +432,7 @@ void rpc_cancel(rpc_t *rpc, void *c) prepare_to_cancel(trans, &cancel_data.cancel_bitmap, 0); /* tell tm to cancel the call */ DBG("Now calling cancel_uacs\n"); - i = cancel_uacs(trans, &cancel_data, 0); /* don't fake 487s, + i = cancel_uacs(trans, &cancel_data, F_CANCEL_LOCAL); /* don't fake 487s, just wait for timeout */ /* t_lookup_callid REF`d the transaction for us, we must UNREF here! */ diff --git a/src/modules/tm/t_cancel.h b/src/modules/tm/t_cancel.h index b80a6dba7..d5042edd9 100644 --- a/src/modules/tm/t_cancel.h +++ b/src/modules/tm/t_cancel.h @@ -65,6 +65,8 @@ and F_CANCE_B_KILL take precedence */ #define F_CANCEL_UNREF 16 /* unref the trans after canceling */ +#define F_CANCEL_LOCAL 32 /* cancel is locally generated */ + void prepare_to_cancel(struct cell *t, branch_bm_t *cancel_bm, branch_bm_t s); int cancel_uacs(struct cell *t, struct cancel_info *cancel_data, int flags); diff --git a/src/modules/tm/t_reply.c b/src/modules/tm/t_reply.c index aa899f9ac..fba235fcb 100644 --- a/src/modules/tm/t_reply.c +++ b/src/modules/tm/t_reply.c @@ -550,7 +550,15 @@ static int _reply_light(struct cell *trans, char *buf, unsigned int len, * the chances for this increase a lot. */ if(unlikely(!trans->uas.response.dst.send_sock)) { - LM_ERR("no resolved dst to send reply to\n"); + if(unlikely(is_local(trans))) { + LM_DBG("local transaction reply [code: %u, t-flags: %x" + " buf: %.*s ...]\n", + code, trans->flags, (len > 256) ? 256 : len, buf); + } else { + LM_ERR("no resolved dst to send reply to [code: %u, t-flags: %x" + " buf: %.*s ...]\n", + code, trans->flags, (len > 256) ? 256 : len, buf); + } } else { if(likely(SEND_PR_BUFFER(rb, buf, len) >= 0)) { if(unlikely(code >= 200 && !is_local(trans) diff --git a/src/modules/tm/uac.c b/src/modules/tm/uac.c index a9a327745..c28067c9d 100644 --- a/src/modules/tm/uac.c +++ b/src/modules/tm/uac.c @@ -237,8 +237,8 @@ static inline int t_build_msg_from_buf(struct sip_msg *msg, char *buf, } #ifdef WITH_EVENT_LOCAL_REQUEST -static inline int t_run_local_req(char **buf, int *buf_len, uac_req_t *uac_r, - struct cell *new_cell, struct retr_buf *request) +static inline int t_run_local_req(char **buf, int *buf_len, int buf_offset, + uac_req_t *uac_r, struct cell *new_cell, struct retr_buf *request) { struct sip_msg lreq = {0}; struct onsend_info onsnd_info; @@ -246,6 +246,7 @@ static inline int t_run_local_req(char **buf, int *buf_len, uac_req_t *uac_r, int sflag_bk; char *buf1; int buf_len1; + char *buf2; int backup_route_type; struct cell *backup_t; int backup_branch; @@ -357,24 +358,10 @@ static inline int t_run_local_req(char **buf, int *buf_len, uac_req_t *uac_r, request->dst.proto = lreq.force_send_socket->proto; } - LM_DBG("apply new updates with Via to sip msg\n"); - buf1 = build_req_buf_from_sip_req(&lreq, (unsigned int *)&buf_len1, - &request->dst, BUILD_NEW_LOCAL_VIA | BUILD_IN_SHM); - if(likely(buf1)) { - shm_free(*buf); - *buf = buf1; - *buf_len = buf_len1; - /* a possible change of the method is not handled! */ - refresh_shortcuts = 1; - } - - } else { - normal_update: - if(unlikely(lreq.add_rm || lreq.body_lumps || lreq.new_uri.s)) { - LM_DBG("apply new updates without Via to sip msg\n"); + if(buf_offset == 0) { + LM_DBG("apply new updates with Via to sip msg\n"); buf1 = build_req_buf_from_sip_req(&lreq, (unsigned int *)&buf_len1, - &request->dst, - BUILD_NO_LOCAL_VIA | BUILD_NO_VIA1_UPDATE | BUILD_IN_SHM); + &request->dst, BUILD_NEW_LOCAL_VIA | BUILD_IN_SHM); if(likely(buf1)) { shm_free(*buf); *buf = buf1; @@ -382,6 +369,65 @@ static inline int t_run_local_req(char **buf, int *buf_len, uac_req_t *uac_r, /* a possible change of the method is not handled! */ refresh_shortcuts = 1; } + } else { + LM_DBG("apply new updates with Via to sip msg, preserving " + "prefix\n"); + buf1 = build_req_buf_from_sip_req(&lreq, (unsigned int *)&buf_len1, + &request->dst, BUILD_NEW_LOCAL_VIA); + if(likely(buf1)) { + buf2 = shm_malloc(buf_offset + buf_len1); + if(unlikely(!buf2)) { + SHM_MEM_ERROR_FMT("required (%u)\n", buf_offset + buf_len1); + pkg_free(buf1); + goto clean; + } + memcpy(buf2, *buf - buf_offset, buf_offset); + memcpy(buf2 + buf_offset, buf1, buf_len1); + shm_free(*buf - buf_offset); + pkg_free(buf1); + *buf = buf2 + buf_offset; + *buf_len = buf_len1; + } + } + + + } else { + normal_update: + if(unlikely(lreq.add_rm || lreq.body_lumps || lreq.new_uri.s)) { + if(buf_offset == 0) { + LM_DBG("apply new updates without Via to sip msg\n"); + buf1 = build_req_buf_from_sip_req(&lreq, + (unsigned int *)&buf_len1, &request->dst, + BUILD_NO_LOCAL_VIA | BUILD_NO_VIA1_UPDATE + | BUILD_IN_SHM); + if(likely(buf1)) { + shm_free(*buf); + *buf = buf1; + *buf_len = buf_len1; + /* a possible change of the method is not handled! */ + refresh_shortcuts = 1; + } + } else { + LM_DBG("apply new updates without Via to sip msg, preserving " + "prefix\n"); + buf1 = build_req_buf_from_sip_req(&lreq, + (unsigned int *)&buf_len1, &request->dst, + BUILD_NO_LOCAL_VIA | BUILD_NO_VIA1_UPDATE); + if(likely(buf1)) { + buf2 = shm_malloc(buf_offset + buf_len1); + if(unlikely(!buf2)) { + SHM_MEM_ERROR_FMT( + "required (%u)\n", buf_offset + buf_len1); + pkg_free(buf1); + goto clean; + } + memcpy(buf2, *buf - buf_offset, buf_offset); + memcpy(buf2 + buf_offset, buf1, buf_len1); + shm_free(*buf - buf_offset); + *buf = buf2 + buf_offset; + *buf_len = buf_len1; + } + } } } @@ -451,11 +497,11 @@ static inline int t_uac_prepare( /* if err's returned, the message is incorrect */ goto error3; - if(!uac_r->dialog->loc_seq.is_set) { + if(uac_r->dialog->loc_seq.is_set == DLG_SEQ_VALINIT) { /* this is the first request in the dialog, set cseq to default value now - Miklos */ uac_r->dialog->loc_seq.value = DEFAULT_CSEQ; - uac_r->dialog->loc_seq.is_set = 1; + uac_r->dialog->loc_seq.is_set = DLG_SEQ_VALSET; } /* build cell sets X/AVP lists to new transaction structure @@ -559,7 +605,7 @@ static inline int t_uac_prepare( #ifdef WITH_EVENT_LOCAL_REQUEST if(unlikely(goto_on_local_req >= 0 || tm_event_callback.len > 0)) { refresh_shortcuts = - t_run_local_req(&buf, &buf_len, uac_r, new_cell, request); + t_run_local_req(&buf, &buf_len, 0, uac_r, new_cell, request); if(unlikely(refresh_shortcuts == E_DROP)) { shm_free(buf); ret = E_DROP; @@ -677,7 +723,9 @@ int prepare_req_within(uac_req_t *uac_r, struct retr_buf **dst_req) goto send; if((uac_r->method->len == 6) && (!memcmp("CANCEL", uac_r->method->s, 6))) goto send; - uac_r->dialog->loc_seq.value++; /* Increment CSeq */ + if(uac_r->dialog->loc_seq.is_set != DLG_SEQ_VALNEW) { + uac_r->dialog->loc_seq.value++; /* Increment CSeq */ + } send: ret = t_uac_prepare(uac_r, dst_req, 0); @@ -823,6 +871,9 @@ struct retr_buf *local_ack_rb(sip_msg_t *rpl_2xx, struct cell *trans, unsigned int buf_len; char *buffer; struct dest_info dst; + dlg_t *dlg; + uac_req_t uac_req; + str method; buf_len = (unsigned)sizeof(struct retr_buf); buffer = build_dlg_ack(rpl_2xx, trans, branch, hdrs, body, &buf_len, &dst); @@ -832,10 +883,12 @@ struct retr_buf *local_ack_rb(sip_msg_t *rpl_2xx, struct cell *trans, } return 0; } + /* 'buffer' now points into a contiguous chunk of memory with enough * room to hold both the retr. buffer and the string raw buffer: it * points to the beginning of the string buffer; we iterate back to get * the beginning of the space for the retr. buffer. */ + lack = &((struct retr_buf *)buffer)[-1]; lack->buffer = buffer; lack->buffer_len = buf_len; @@ -846,6 +899,42 @@ struct retr_buf *local_ack_rb(sip_msg_t *rpl_2xx, struct cell *trans, lack->rbtype = TYPE_LOCAL_ACK; lack->my_T = trans; +#ifdef WITH_EVENT_LOCAL_REQUEST + dlg = (dlg_t *)shm_malloc(sizeof(dlg_t)); + if(dlg == 0) { + SHM_MEM_ERROR_FMT("required (%lu)\n", sizeof(dlg_t)); + return NULL; + } + memset(dlg, 0, sizeof(dlg_t)); + dlg->state = DLG_NEW; + if(dlg_response_uac(dlg, rpl_2xx, IS_NOT_TARGET_REFRESH) < 0) { + LM_ERR("failed to create new dialog\n"); + shm_free(buffer); + return NULL; + } + dlg->send_sock = dst.send_sock; + + /* Clear everything */ + memset(&uac_req, 0, sizeof(uac_req)); + method.s = ACK; + method.len = ACK_LEN; + uac_req.method = &method; + uac_req.body = body; + uac_req.dialog = dlg; + + t_run_local_req(&buffer, (int *)&buf_len, (unsigned)sizeof(struct retr_buf), + &uac_req, trans, lack); + + /* t_local_run_req could have changed the buffer, if so we need to update + * lack just in case + */ + lack = &((struct retr_buf *)buffer)[-1]; + lack->buffer = buffer; + lack->buffer_len = buf_len; + + free_dlg(dlg); +#endif + return lack; } diff --git a/src/modules/tmx/tmx_mod.c b/src/modules/tmx/tmx_mod.c index aae654783..4e1e7c782 100644 --- a/src/modules/tmx/tmx_mod.c +++ b/src/modules/tmx/tmx_mod.c @@ -333,7 +333,7 @@ static int t_cancel_branches_helper(sip_msg_t *msg, int n) LM_DBG("canceling %d/%d\n", n, (int)cancel_data.cancel_bitmap); if(cancel_data.cancel_bitmap == 0) return -1; - _tmx_tmb.cancel_uacs(t, &cancel_data, 0); + _tmx_tmb.cancel_uacs(t, &cancel_data, F_CANCEL_LOCAL); return 1; } @@ -408,7 +408,7 @@ static int ki_t_cancel_callid_reason( cancel_data.reason.cause = rcode; cancel_data.cancel_bitmap = 0; _tmx_tmb.prepare_to_cancel(trans, &cancel_data.cancel_bitmap, 0); - _tmx_tmb.cancel_uacs(trans, &cancel_data, 0); + _tmx_tmb.cancel_uacs(trans, &cancel_data, F_CANCEL_LOCAL); //_tmx_tmb.unref_cell(trans); _tmx_tmb.t_sett(bkt, bkb); diff --git a/src/modules/uac/uac_send.c b/src/modules/uac/uac_send.c index dd5de24b1..f8a77b6a6 100644 --- a/src/modules/uac/uac_send.c +++ b/src/modules/uac/uac_send.c @@ -807,7 +807,7 @@ void uac_send_tm_callback(struct cell *t, int type, struct tmcb_params *ps) /* Callback function */ uac_r.cb = uac_resend_tm_callback; /* Callback parameter */ - uac_r.cbp = (void *)tp; + uac_r.cbp = (void *)uac_send_info_clone(tp); } ret = _uac_send_tmb.t_request_within(&uac_r); @@ -816,13 +816,18 @@ void uac_send_tm_callback(struct cell *t, int type, struct tmcb_params *ps) goto error; } if(uac_r.cb_flags & TMCB_LOCAL_REQUEST_DROP) { + if(uac_r.cbp != NULL) + shm_free(uac_r.cbp); + shm_free(tp); *ps->param = NULL; tp = NULL; } - if(tp->evroute != 0) { - return; + if(tp != NULL) { + if(tp->evroute != 0) { + return; + } } done: diff --git a/src/modules/uid_domain/uid_domain_mod.c b/src/modules/uid_domain/uid_domain_mod.c index e140e003d..57a2c7d0c 100644 --- a/src/modules/uid_domain/uid_domain_mod.c +++ b/src/modules/uid_domain/uid_domain_mod.c @@ -51,7 +51,7 @@ static int mod_init(void); static void destroy(void); static int child_init(int rank); -static int is_local(struct sip_msg *msg, char *s1, char *s2); +static int uid_domain_is_local(struct sip_msg *msg, char *s1, char *s2); static int lookup_domain(struct sip_msg *msg, char *s1, char *s2); static int get_did(str *did, str *domain); @@ -122,8 +122,10 @@ static domain_t dom_buf[2]; * Exported functions */ static cmd_export_t cmds[] = { - {"is_local", is_local, 1, fixup_var_str_1, fixup_free_fparam_1, REQUEST_ROUTE | FAILURE_ROUTE | BRANCH_ROUTE}, - {"lookup_domain", lookup_domain, 2, lookup_domain_fixup, lookup_domain_fixup_free, REQUEST_ROUTE | FAILURE_ROUTE}, + {"is_local", uid_domain_is_local, 1, fixup_var_str_1, fixup_free_fparam_1, + REQUEST_ROUTE | FAILURE_ROUTE | BRANCH_ROUTE}, + {"lookup_domain", lookup_domain, 2, lookup_domain_fixup, + lookup_domain_fixup_free, REQUEST_ROUTE | FAILURE_ROUTE}, {"get_did", (cmd_function)get_did, 0, 0, 0, 0}, {"bind_domain", (cmd_function)bind_domain, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0} @@ -384,7 +386,7 @@ static void destroy(void) /* * Check if domain is local */ -static int is_local(struct sip_msg *msg, char *fp, char *s2) +static int uid_domain_is_local(struct sip_msg *msg, char *fp, char *s2) { str domain; diff --git a/src/modules/userblocklist/README b/src/modules/userblocklist/README index 33fca80b6..e13bb238c 100644 --- a/src/modules/userblocklist/README +++ b/src/modules/userblocklist/README @@ -154,9 +154,9 @@ Chapter 1. Admin Guide blocklisted or not. An additional functionality that this module provides is the ability to - handle global blocklists. This lists are loaded on startup into memory, - thus providing a better performance than the userblocklist case. These - global blocklists are useful to allow only calls to certain + handle global blocklists. These lists are loaded on startup into + memory, thus providing a better performance than the userblocklist + case. These global blocklists are useful to allow only calls to certain international destinations, i.e. block all not allowlisted numbers. They could also be used to prevent the blocklisting of important numbers, as allowlisting is supported too. This is useful for example diff --git a/src/modules/userblocklist/doc/userblocklist_admin.xml b/src/modules/userblocklist/doc/userblocklist_admin.xml index bb9c66a25..be8ae0fcd 100644 --- a/src/modules/userblocklist/doc/userblocklist_admin.xml +++ b/src/modules/userblocklist/doc/userblocklist_admin.xml @@ -20,7 +20,7 @@ An additional functionality that this module provides is the ability - to handle global blocklists. This lists are loaded on startup into + to handle global blocklists. These lists are loaded on startup into memory, thus providing a better performance than the userblocklist case. These global blocklists are useful to allow only calls to certain international destinations, i.e. block all not allowlisted numbers. diff --git a/src/modules/websocket/ws_conn.c b/src/modules/websocket/ws_conn.c index b41cb2e91..577abbe58 100644 --- a/src/modules/websocket/ws_conn.c +++ b/src/modules/websocket/ws_conn.c @@ -328,7 +328,8 @@ static void wsconn_dtor(ws_connection_t *wsc) if(!wsc) return; - LM_DBG("wsconn_dtor for [%p] refcnt [%d]\n", wsc, atomic_get(&wsc->refcnt)); + LM_DBG("wsconn id: %d / %u [%p] refcnt [%d]\n", wsc->id, wsc->id_hash, wsc, + atomic_get(&wsc->refcnt)); if(wsc->run_event) wsconn_run_route(wsc); @@ -337,12 +338,13 @@ static void wsconn_dtor(ws_connection_t *wsc) shm_free(wsc); - LM_DBG("wsconn_dtor for [%p] destroyed\n", wsc); + LM_DBG("wsconn id: %d / %u [%p] destroyed\n", wsc->id, wsc->id_hash, wsc); } int wsconn_rm(ws_connection_t *wsc, ws_conn_eventroute_t run_event_route) { - LM_DBG("wsconn_rm for [%p] refcnt [%d]\n", wsc, atomic_get(&wsc->refcnt)); + LM_DBG("remove wscon id: %d / %u [%p] refcnt [%d]\n", wsc->id, wsc->id_hash, + wsc, atomic_get(&wsc->refcnt)); if(run_event_route == WSCONN_EVENTROUTE_YES) wsc->run_event = 1; @@ -706,6 +708,7 @@ void ws_timer(unsigned int ticks, void *param) LM_DBG("ws structure without active tcp connection\n"); wsc->state = WS_S_REMOVING; wsc->rmticks = get_ticks(); + wsc->run_event = 1; } else { tcpconn_put(con); } diff --git a/utils/kamcmd/CMakeLists.txt b/utils/kamcmd/CMakeLists.txt index 0d1ec28b4..f984415ed 100644 --- a/utils/kamcmd/CMakeLists.txt +++ b/utils/kamcmd/CMakeLists.txt @@ -46,7 +46,7 @@ add_custom_command( -e "s#/usr/sbin/#${CMAKE_INSTALL_FULL_SBINDIR}/#g" -e "s#/usr/lib/${CFG_NAME}/modules/#${CMAKE_INSTALL_FULL_LIBDIR}/${MAIN_NAME}/#g" -e "s#/usr/share/doc/${CFG_NAME}/#${CMAKE_INSTALL_FULL_DOCDIR}/#g" -e - "s#$(SRC_NAME)#$(MAIN_NAME)#g" < ${CMAKE_CURRENT_SOURCE_DIR}/kamcmd.8 > + "s#${SRC_NAME}#${MAIN_NAME}#g" < ${CMAKE_CURRENT_SOURCE_DIR}/kamcmd.8 > ${CMAKE_CURRENT_BINARY_DIR}/kamcmd.8 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/kamcmd.8) diff --git a/utils/kamctl/CMakeLists.txt b/utils/kamctl/CMakeLists.txt index ca8a4f206..ec59dfb61 100644 --- a/utils/kamctl/CMakeLists.txt +++ b/utils/kamctl/CMakeLists.txt @@ -66,7 +66,7 @@ install( DESTINATION ${CMAKE_INSTALL_SBINDIR} COMPONENT kamailio-utils-bin) -# Setup and install kamdbctl stuff +# Set up and install kamdbctl stuff set(KAMDBCTL_BASE_FILES kamdbctl.base) if("db_berkeley" IN_LIST FINAL_MODULES_LIST) diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl index f9a7d92f4..63a221c88 100755 --- a/utils/kamctl/kamctl +++ b/utils/kamctl/kamctl @@ -5,7 +5,7 @@ #=================================================================== ### version for this script -VERSION='5.9.0' +VERSION='6.0.0' PATH=$PATH:/usr/local/sbin/ diff --git a/utils/kamctl/kamctlrc b/utils/kamctl/kamctlrc index 67af483d9..64cf34692 100644 --- a/utils/kamctl/kamctlrc +++ b/utils/kamctl/kamctlrc @@ -13,7 +13,7 @@ ## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, DBTEXT, or SQLITE ## by default none is loaded ## -## If you want to setup a database with kamdbctl, you must at least specify +## If you want to set up a database with kamdbctl, you must at least specify ## this parameter. # DBENGINE=MYSQL diff --git a/utils/kamctl/kamdbctl b/utils/kamctl/kamdbctl index d5713f1f7..a0ececdb7 100755 --- a/utils/kamctl/kamdbctl +++ b/utils/kamctl/kamdbctl @@ -5,7 +5,7 @@ #=================================================================== ### version for this script -VERSION='5.9.0' +VERSION='6.0.0' PATH=$PATH:/usr/local/sbin/ @@ -80,7 +80,7 @@ fi # unset USED_DBENGINE if [ -z "$DBENGINE" ] ; then - merr "database engine not specified, please setup one in the config script" + merr "database engine not specified, please set one up in the config script" exit 1 fi