diff --git a/ChangeLog b/ChangeLog index 154f76a77..981791104 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,598 @@ +===================== 2025-03-20 Version 5.8.6 Released ===================== + +===================== Changes Since Version 5.8.5 =========================== + + +commit b51884ad027033ee00fbc64ff3aca9499c1f6c75 +Author: Daniel-Constantin Mierla +Date: Thu Mar 20 08:26:32 2025 +0100 + + Makefile.defs: version set to 5.8.6 + +commit a66faa10092aac8c4ec2122ceb77e285a2fecbce +Author: Daniel-Constantin Mierla +Date: Thu Mar 20 08:21:34 2025 +0100 + + pkg/kamailio: version set 5.8.6 for rpms and alpine + +commit d6d1641b81e130fa14b8daf617d595fe2818f084 +Author: Daniel-Constantin Mierla +Date: Thu Mar 20 08:19:59 2025 +0100 + + pkg/kamailio/deb: set version to 5.8.6 + +commit e83be98778dde043df7251155ac63c5d651ed45b +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) + (cherry picked from commit 00544a66aad09faf345d54bef7f464f2749ef548) + +commit 89b1f907da5428de79670df28d0fd7135a8379ff +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) + (cherry picked from commit f24315c2bc4ec7b9507516a96603e91ae2ce0fd1) + +commit 1d3eed5c186d2b4584459fb5d3fcdd8458a01186 +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) + (cherry picked from commit f761cad5b462820af060d6e07410f0dd84c1a52f) + +commit c9503124f1e5d066163c505470124b9a1bd4b9e6 +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) + (cherry picked from commit 813d3ed6a532cc0baa98d27ef9eea579e5ca1688) + +commit f807c4d249bff27007dc8898a338ad7be4f45ea7 +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) + (cherry picked from commit b3cb2b38c5d81c48b0b6315cb7feb99d236d15e3) + +commit 2b0b8714b7f75d13be6f8156f4f8efbf6401f0b7 +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) + (cherry picked from commit 0cbf7eede6dbd3198664160b77d1b4d0337833b8) + +commit 0f0b34aaffffbab3e9454f2cbfa03af849868a55 +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) + (cherry picked from commit 2b3dd3b477afef88421377b703aefe217b9e915b) + +commit 0890a38d534e57527f87802b83c2b9d69cea843c +Author: Daniel-Constantin Mierla +Date: Thu Mar 6 13:36:52 2025 +0100 + + Revert "secfilter: fix secf_check_dst bug" + + This reverts commit 874148e9335fdf22e9187ff3dce524dc0fa21879. + +commit 11af1f47dd40d57a38848fbbd358054ee42043a2 +Author: Daniel-Constantin Mierla +Date: Mon Feb 24 09:57:38 2025 +0100 + + sl: stats for 1xx replies + + - GH #4144 + + (cherry picked from commit f43c132db9b1dc71f623d592fb46d487ba492c7d) + (cherry picked from commit ed21e7c97677572d732fa1020528fe92f3a9ee35) + +commit 83d8ebf769ec1313228e5b89164a13cb9314ab4d +Author: Dennis Yurasov +Date: Fri Feb 21 10:42:58 2025 +0100 + + dialog: fixed DLG_FLAG_CHANGED_PROF value and setting DLG_FLAG_DEL + + - GH #4151 + + (cherry picked from commit 2b1ca7813cf5014553c807c1a5034c404b3685a5) + (cherry picked from commit c20ad4abaec2632acfa069a73b1c0b195ccb8334) + +commit 211abf00128a20b667a760b89d0ccb60b03692cd +Author: Daniel-Constantin Mierla +Date: Fri Feb 21 10:35:22 2025 +0100 + + dialog: get vars via value instead of reference for kemi functions + + - do lock/unlock + - GH #4151 + + (cherry picked from commit 3b213f1d008656682f1733d59f6c3bacd474c4b9) + (cherry picked from commit ea0fc8e213f6703d87a000216a2cc18764732fce) + +commit da3a94f0ce67709806f0aedfd6818e9be65432f8 +Author: Daniel-Constantin Mierla +Date: Sun Feb 16 12:06:57 2025 +0100 + + dialog: set keepalive local cseq value to 0 + + (cherry picked from commit 5d3ae2acfab38eda88c6369c0db18a286faba2e3) + (cherry picked from commit 0c09b213cbd0a8b12128fa4fb16c01907684b0a6) + +commit 2a076e07ba9a1289ee89f4eba2cba872d65d36df +Author: Daniel-Constantin Mierla +Date: Sun Feb 16 10:36:57 2025 +0100 + + core: socket info - print index values in error message for overflow + + (cherry picked from commit 413c90202975886f4dfcb579a1157a19c3065341) + (cherry picked from commit be47356fda7ee3862f335fd5b192e54c33dfe85c) + +commit 2e5863f54086ae695564861569f009c96b58dbf1 +Author: Daniel-Constantin Mierla +Date: Sun Feb 16 10:23:18 2025 +0100 + + registrar: remove unnecessary condition + + (cherry picked from commit 6b7af1beb7fdaaec1b5d069fdfff3e3af5ca43ca) + (cherry picked from commit dddb8b0c99f2822be5fff2693a105b391480bc77) + +commit 9fbc51b7f9d4bcb618f68a2b54427ce17d4362aa +Author: Daniel-Constantin Mierla +Date: Sat Feb 15 15:28:35 2025 +0100 + + db_redis: clean the keyname variable + + (cherry picked from commit aae4cb323d4ea9d07b4b8aec61a6c9bc03e2ab83) + (cherry picked from commit c59d29abbdc65784ea6fbe6eb237dbadd3fb370d) + +commit 7e5cf1d7dbcb027dd6aaeca3ad7df582bef2265e +Author: Daniel-Constantin Mierla +Date: Fri Feb 14 12:38:04 2025 +0100 + + tsilo: free duplicated ruri and contact on error cases + + (cherry picked from commit d029de6380f8e30e0c82435b820744c21a5fbc78) + (cherry picked from commit a6e99ff231ca5a42bd053d3a8f2f9d02682ab07d) + +commit e3c734871f1858e88617060f859c347788bd23b0 +Author: Daniel-Constantin Mierla +Date: Fri Feb 14 12:23:39 2025 +0100 + + dlgs: return -1 for 0 tags count + + (cherry picked from commit 6a2a82555ee8bbfaca1e825c19d1532f22c2c629) + (cherry picked from commit 975d3449ae01a9078009772e0e1b86c9a996d982) + +commit 99852d486bd4180c4f571864bfccda526f3e259d +Author: Daniel-Constantin Mierla +Date: Fri Feb 14 12:17:23 2025 +0100 + + http_client: free dumplicated name in case of errors + + (cherry picked from commit 39ba53a2499dd1f0e080bb011d7438a60ea5faec) + (cherry picked from commit 7274e353d7c05f5387c64aaf90197c9a8e8d1dd4) + +commit e804235ebdd344020891307b838769fbb3ad8385 +Author: Daniel-Constantin Mierla +Date: Fri Feb 14 12:03:57 2025 +0100 + + call_control: free pv field in case of error + + (cherry picked from commit 8a96379cc1ef7aa42bc4be49834c538a3bffdf14) + (cherry picked from commit 44764414c48fed1b90580cf62dd33e975f1f7ecd) + +commit 23de8c670eea22ae6cce3f3d8e5b9d7d3f7dd9b4 +Author: Daniel-Constantin Mierla +Date: Fri Feb 14 11:39:11 2025 +0100 + + sca: free replaces hdr on anchor lump failure + + (cherry picked from commit 01782191418f3d65c4aa5cb273140fec928d153a) + (cherry picked from commit c8acc1f6e5441fd4514c2b7ead1e2bbe441f7895) + +commit eaa0d1af8a46fe9a74d0eb1bbb2fbf2089f4e3fb +Author: Daniel-Constantin Mierla +Date: Fri Feb 14 10:16:00 2025 +0100 + + xmlrpc: removed unnecessary code + + (cherry picked from commit e65b03cdd946d735a3ef33ae3582bcfad464d2c7) + (cherry picked from commit 6d06293f3fe1c5897a3e01272fdc9ac409925f3d) + +commit 83a4165fc62710027ddf006058c66f082d01b51f +Author: Daniel-Constantin Mierla +Date: Fri Feb 14 08:37:23 2025 +0100 + + ctl: refactored error handling and removed unnecessary code + + (cherry picked from commit edbb5b11e9453be3519e6e9a945937307c95709e) + (cherry picked from commit 691eb2600c1fcf24d0d1f9b2648e7257499537a8) + +commit ce55c093d490fd19f10c50e11d12e188b64c1686 +Author: Daniel-Constantin Mierla +Date: Thu Feb 13 11:45:06 2025 +0100 + + pv: free next field on error when parsing xav* names + + (cherry picked from commit b875e7368dcc8e221007caafa3599c3e354404f7) + (cherry picked from commit 8b7637140c5362bf90046ccb3b34ea74ef658c0a) + +commit 33aebcd3a4f17df390153ad38cf73b4a701fd74f +Author: Daniel-Constantin Mierla +Date: Thu Feb 13 11:01:20 2025 +0100 + + topoh: check on pointer only for via decode return + + - code reformatted + + (cherry picked from commit d0cd3c4b40fd791143122622a6d74703e1375832) + (cherry picked from commit c7a4dd132478ff2d5f46c85594a44fee9c570f6d) + +commit 33921fd3fc01f95dae2c0a8e7e146c798d8c2338 +Author: Daniel-Constantin Mierla +Date: Thu Feb 13 10:50:32 2025 +0100 + + tm: rpc uac - jump to error when failing to create delayed context + + (cherry picked from commit aa081dbd1ee1901c6174ffddd556bda47b6ef732) + (cherry picked from commit d0df1eef55cd9bb0bca2b0db007d94dbe4e8e95c) + +commit 34d093a1e7a60f9d13458fed46a513c5efdeaffa +Author: Daniel-Constantin Mierla +Date: Thu Feb 13 10:42:27 2025 +0100 + + tm: jump to error when failing to built content length for uac cancel + + (cherry picked from commit 27e1e9102f07047a3d2c2f28baa708f14be556a6) + (cherry picked from commit d505c876c534cc4a4b8aff5ef1b5e28b151d8d06) + +commit 994bc2e752f2f969d04067329f34b29aadd77934 +Author: Daniel-Constantin Mierla +Date: Thu Feb 13 10:32:51 2025 +0100 + + tm: split reverse rte list function + + (cherry picked from commit e85d07e5b42ff25f81b74f68ab412e0ab27e7170) + (cherry picked from commit a5576fb3476e327ef10135a85cf20f2e720803db) + +commit ad7a3cc3751af2417e6000a2d689c35e9dddda36 +Author: Daniel-Constantin Mierla +Date: Thu Feb 13 09:48:33 2025 +0100 + + xprint: break on first resolved ip address + + (cherry picked from commit 7c908137826071b8180bd93ff8ba3994be66da3a) + (cherry picked from commit de5986433283b2fcff09b064420d43327270d390) + +commit 90122e3a46169e9f10dc7d8e01638d5f89cfaae5 +Author: Daniel-Constantin Mierla +Date: Thu Feb 13 09:43:43 2025 +0100 + + ctl: fifo - clean intermediary buffer + + (cherry picked from commit 4c4d7f7967a99d4dd4acdc5e198bce493bf15d67) + (cherry picked from commit c68522f5c3c59cb915feb873bd3351e57a8db579) + +commit 1f6dc4df8572c07280478858087182f273c25fe3 +Author: Daniel-Constantin Mierla +Date: Thu Feb 13 09:40:00 2025 +0100 + + xmlrpc: clean allocated buffer + + (cherry picked from commit ff712539566c903312ebba2f8e2585f9c80ffdcf) + (cherry picked from commit e1398e53e9825db6c20590e1576d960ac0c3c429) + +commit 184f25c845bffc39d3aabff90d1f5683d0cb009c +Author: Daniel-Constantin Mierla +Date: Thu Feb 13 09:18:00 2025 +0100 + + xprint: init globals when declared + + (cherry picked from commit b17038ec072b1854fa2fae1c2d4725c1471ef8ac) + (cherry picked from commit cf3b3849cb2a3c4060281377e2adee09de5d47d9) + +commit 5e836af2ff198481bde0485a315bbfdf39043f9d +Author: Daniel-Constantin Mierla +Date: Wed Feb 12 17:48:42 2025 +0100 + + ctl: free rpc struct in case of error + + (cherry picked from commit 4a71d3c9e6a4f92ef33ce8e62372b2c4dba62a56) + (cherry picked from commit 5024235f876df4b3239ef746de700ade362cc7b2) + +commit f123ebae553624525ca04d34ddd4c9453eac855a +Author: Daniel-Constantin Mierla +Date: Tue Feb 11 12:41:26 2025 +0100 + + core: check for unexpected long value return by pathconf() + + (cherry picked from commit 2ba6d4ff2727031e7bca5d3d1da016bfe508b8df) + (cherry picked from commit 718692c6d402b6942e0b1e8ebd8e64b306813495) + +commit 42260f34079ddad7662742a64696d2550ee1cce9 +Author: Daniel-Constantin Mierla +Date: Tue Feb 11 11:30:34 2025 +0100 + + core: pass fd - check for unexpected read size overflow + + (cherry picked from commit 6c12477f1dad2279431d703d1a4f63fcfc6543b8) + (cherry picked from commit ac0a4a5052e9aaf6531130675c8140fdd5c11e97) + +commit 77f2671979d0dcd70cdd3f490a0dad00ba5c8fc5 +Author: Daniel-Constantin Mierla +Date: Tue Feb 11 10:25:34 2025 +0100 + + tsilo: clean allocated memory on error for append by contact + + (cherry picked from commit 6fb38cb33095c11a1c90d7b88140ac159b9fd5ca) + (cherry picked from commit f1549b99a69bf0dec4aad564afa1d6e328621752) + +commit 874148e9335fdf22e9187ff3dce524dc0fa21879 +Author: pepelux +Date: Fri Feb 7 19:08:56 2025 +0100 + + secfilter: fix secf_check_dst bug + + (cherry picked from commit 578c2abb36b9101bfc1dddc1505f7239e928b98e) + (cherry picked from commit 086d228b29ab414a65521da78695786a979ef754) + +commit 8473c30705289dd5bf94c6426d2e8ba4c49e19b5 +Author: Daniel-Constantin Mierla +Date: Thu Feb 6 08:07:46 2025 +0100 + + core: socket info - use unsigned for current size in buffer for get flags + + (cherry picked from commit 462f9730eb55a3abbd50b9170eb6318eb43eb999) + (cherry picked from commit eed2ccbb658b28433e71a95e9715934aa64c4cfb) + +commit 88780735710c688293dcc3e1d52fd8aba2f2bb75 +Author: Daniel-Constantin Mierla +Date: Wed Feb 5 13:30:17 2025 +0100 + + textops: catch return 0 when removing via param + + (cherry picked from commit 65645c761e94cedde04f100764d5c506590cb200) + (cherry picked from commit a88946a84133660d5b2a466a231dff226c9db995) + +commit 0f8b36091a64de012377bd2460e299529886a45c +Author: Daniel-Constantin Mierla +Date: Tue Feb 4 08:05:28 2025 +0100 + + msrp: send failure response after referening the buffer + + (cherry picked from commit 5f8adb625b6bae81ef44613d774106bf3a943bb0) + (cherry picked from commit 4ff58bb3e02b76e2489144867c8b0dc5041dc621) + +commit 96945faccf3d689c1a2e90aca3b65bf69926647f +Author: Daniel-Constantin Mierla +Date: Mon Feb 3 13:36:10 2025 +0100 + + core: mem f malloc - additional check when getting to search very big fragments + + (cherry picked from commit ac909a7a019922676076bc47a28a3801c749becc) + (cherry picked from commit 9d3392a55831124121b078201985c417c9f9982d) + +commit 724a58813d50dcfe965e69914fbdc93291811a85 +Author: Daniel-Constantin Mierla +Date: Sat Feb 1 07:40:11 2025 +0100 + + msrp: variable for extra headers used in local replies + + (cherry picked from commit 7a73e08b0e5b4c3fbeb4f097c1f891d06c74651d) + (cherry picked from commit c29d9d661b3954906cdee7e98a4f9b6502673490) + +commit f270f8a6c86cc2541801914223858da13f39de7d +Author: Daniel-Constantin Mierla +Date: Thu Jan 30 11:32:53 2025 +0100 + + seas: remove redundant check + + (cherry picked from commit ab1b032771be9adbb1d643cd44beac0e09a31553) + (cherry picked from commit c8be39750902ad69818f8247898070fce2d6a3a3) + +commit f4aed91f5ab78cddbe782e94306c3cf4c49b09c6 +Author: Sergey Safarov +Date: Wed Jan 29 09:12:44 2025 +0200 + + janssonrpcc: fixed warning var may be used uninitialized + + (cherry picked from commit 3039c02404e05da05a031f6ccf68913a8c1c80eb) + (cherry picked from commit ddd98b09c80dc0d15af080e37961b59ecde17689) + +commit dfe9da5c1c79612cb6166dfabf89abd1cea9baf7 +Author: pinacolada1610 +Date: Thu Jan 23 16:21:04 2025 +0300 + + tcp: fix for local TCP/TLS socket matching with 'tcp_reuse_port' enabled + + - Changed the logic for matching a listening TCP/TLS-socket in tcp_reuse_port scenario, now it considers local port as well. + With 'tcp_reuse_port' option enabled, the local port is meaningful and helps to differenciate between sockets on the same IP but different ports. + + (cherry picked from commit 0cb6e35d581398d2c5a7086a0d98b113fbb16138) + (cherry picked from commit 1e362f2ba51c6ee9a9e005675a30202e42ceb3a7) + +commit 270ac18eeb5601fa5043a85961a62a4b2fb466f9 +Author: Ovidiu Sas +Date: Wed Jan 29 01:40:24 2025 +0000 + + db_oracle: fix warning: passing argument 2 of ‘db_do_close’ from incompatible pointer type [-Wincompatible-pointer-types] + + (cherry picked from commit 577a87861a8566e00f2700dfb227dcc8b26393b4) + (cherry picked from commit 022940dec70272a19c86604d2fa9af83d8790bb1) + +commit 614e056628f6221cde6d6a307109edf489750095 +Author: Daniel-Constantin Mierla +Date: Mon Jan 27 16:06:04 2025 +0100 + + http_async_client: check returned cell inside check_multi_info() + + (cherry picked from commit b16550fa72d23084b4221769fe74b1f3c357c9fd) + (cherry picked from commit b4718cd7dca8e037664dbc49a1cfac684906ecea) + +commit ce3806e6b8ac668f149e655d07467826acb03775 +Author: Daniel-Constantin Mierla +Date: Mon Jan 27 10:20:49 2025 +0100 + + htable: wrapped maco code in do {} while(0) + + (cherry picked from commit 65a296b3478503ed3519ea9156d8f46f5cb9ce2a) + (cherry picked from commit dfa9239cf6df7644e9fe6b83cfc33aff518a19c6) + +commit 7997d33aa6cae817da0e55cca802eb49b145711b +Author: Bastian Triller +Date: Tue Jan 14 12:35:21 2025 +0100 + + htable: Fix expiry on assignment + + Update cell expiry on assignment for htables w/o updateexpiry (analogue to #4079). + + (cherry picked from commit 75994f40c99ffa2c7c33e5fce5e3d3cd8db7d780) + (cherry picked from commit b38925b0b3628539840de2b6240da75b9f9f3cc6) + +commit 626253c7d41a67fed8c5f3af64caa3c184a509d2 +Author: Daniel-Constantin Mierla +Date: Sun Jan 26 18:07:54 2025 +0100 + + core/parser/sdp: proper test for media ip separator + + (cherry picked from commit 200cdb318569191cd012dfe99b252f98fe9623b9) + (cherry picked from commit 9c44aec667fc3c088612dd31935bce2eb082812d) + +commit a8f9aa75a08b1fc0bcc66bfc8119e0fe278b1365 +Author: Daniel-Constantin Mierla +Date: Fri Jan 24 16:48:51 2025 +0100 + + presence: do not break on one notify sending failure + + - try all of them, debug message with successful and failure counters + - GH #4118 + + (cherry picked from commit 65e51b776290a1981e9ac27fbe6b47813516bc8b) + (cherry picked from commit 9e21ce85d0c97679f9e14f9c31108f2dcdad772e) + +commit ac730f356aee48488801951290123a758388c1a8 +Author: Daniel-Constantin Mierla +Date: Thu Jan 23 11:51:07 2025 +0100 + + core: more checks for extract_candidate() + + (cherry picked from commit 3198b66aa5dbda1c6a03f46a610073671cbd5157) + (cherry picked from commit a5ac9e04b91971da44256373904450501f9a4493) + +commit ed3d6809dcc66ac18efb313fbf9e3f7bd130a19d +Author: Daniel-Constantin Mierla +Date: Thu Jul 11 19:38:24 2024 +0200 + + htable: do not print item name before is computed + + (cherry picked from commit e2193b9cd7f59377c54e0424c0d4a1628a5a60de) + +commit fddfbdcce2587e9b40f6c2fe77334d3b3b1dbb6c +Author: Xenofon Karamanos +Date: Tue Jan 28 11:31:57 2025 +0000 + + outbound: Fix flow_token_secret bug + + - flow_token_secret is of type str and not char* + - check the length of the string instead of memory for initialization + + (cherry picked from commit 046ba41e431fec7fad0c82a9091ea9e27d9f677d) + +commit 95feca55b38991e045d57ab8cdb9b75bcdb7070e +Author: Victor Seva +Date: Thu Dec 12 14:50:42 2024 +0100 + + outbound: reformat exported structures + + (cherry picked from commit 793a494f5b23f2ef5e82664924c3bed3893105bb) + +commit 1b4aa300292dd6bdd64e174111939293fbbd76ed +Author: Daniel-Constantin Mierla +Date: Tue Jan 28 17:46:16 2025 +0100 + + kamctl: renegenerate db creation files + + - GH #4124 + +commit 0cf639eceb6a8fea50d19184add989e049dfb6ca +Author: Sergey Safarov +Date: Sat Nov 23 22:02:16 2024 +0200 + + pkg/kamailio: added support for CentOS 10 [skip-ci] + + (cherry picked from commit cdafda78c9fc98d9d9fdb7f94e77c9bc60ebf4d1) + +commit 0e51b497a19c525a89d5fead5e0854b2b18317dd +Author: Sergey Safarov +Date: Thu Jan 23 14:47:56 2025 +0200 + + pkg/kamailio: simplified systemd unit files installation [skip ci] + + (cherry picked from commit c47108eacba1a6cf7e8564a00ff0850f621d29aa) + +commit b05e8e854bde2ef4ac4c40f227e0794f1a6583ff +Author: Victor Seva +Date: Wed Dec 11 00:09:02 2024 +0100 + + db_unixodbc: fix incompatible-pointer-types warning + + > dbase.c: In function 'db_unixodbc_close_impl': + > dbase.c:261:32: error: passing argument 2 of 'db_do_close' from incompatible pointer type [-Wincompatible-pointer-types] + > 261 | return db_do_close(_h, db_unixodbc_free_connection); + > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ + > | | + > | void (*)(struct my_con *) + > In file included from val.h:34, + > from dbase.c:33: + > ../../lib/srdb1/db.h:495:40: note: expected 'void (*)(struct pool_con *)' but argument is of type 'void (*)(struct my_con *)' + > 495 | void db_do_close(db1_con_t *_h, void (*free_connection)(struct pool_con *)); + > | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + > make[2]: *** [../../Makefile.rules:101: dbase.o] Error 1 + + related #4064 + + (cherry picked from commit 7f24bc09863220b4c14e2046708c10ff0891c038) + +commit cd68ed205895b981d61d84de5138e25329455cd9 +Author: Victor Seva +Date: Tue Dec 10 23:58:06 2024 +0100 + + db_sqlite: fix incompatible-pointer-types warning + + fixes #4064 + + (cherry picked from commit 06cc2560e5358468178ef3e5c795a8a0ec67b693) + + + ===================== 2025-01-23 Version 5.8.5 Released ===================== ===================== Changes Since Version 5.8.4 =========================== diff --git a/pkg/kamailio/alpine/APKBUILD b/pkg/kamailio/alpine/APKBUILD index 3a8fe938c..f55461f9a 100644 --- a/pkg/kamailio/alpine/APKBUILD +++ b/pkg/kamailio/alpine/APKBUILD @@ -4,7 +4,7 @@ # Maintainer: Nathan Angelacos pkgname=kamailio -pkgver=5.8.5 +pkgver=5.8.6 pkgrel=0 # If building from a git snapshot, specify the gitcommit diff --git a/pkg/kamailio/deb/bionic/changelog b/pkg/kamailio/deb/bionic/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/bionic/changelog +++ b/pkg/kamailio/deb/bionic/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/bookworm/changelog b/pkg/kamailio/deb/bookworm/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/bookworm/changelog +++ b/pkg/kamailio/deb/bookworm/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/bullseye/changelog b/pkg/kamailio/deb/bullseye/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/bullseye/changelog +++ b/pkg/kamailio/deb/bullseye/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/buster/changelog b/pkg/kamailio/deb/buster/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/buster/changelog +++ b/pkg/kamailio/deb/buster/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/debian/changelog b/pkg/kamailio/deb/debian/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/debian/changelog +++ b/pkg/kamailio/deb/debian/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/focal/changelog b/pkg/kamailio/deb/focal/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/focal/changelog +++ b/pkg/kamailio/deb/focal/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/jammy/changelog b/pkg/kamailio/deb/jammy/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/jammy/changelog +++ b/pkg/kamailio/deb/jammy/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/jessie/changelog b/pkg/kamailio/deb/jessie/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/jessie/changelog +++ b/pkg/kamailio/deb/jessie/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/noble/changelog b/pkg/kamailio/deb/noble/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/noble/changelog +++ b/pkg/kamailio/deb/noble/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/precise/changelog b/pkg/kamailio/deb/precise/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/precise/changelog +++ b/pkg/kamailio/deb/precise/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/sid/changelog b/pkg/kamailio/deb/sid/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/sid/changelog +++ b/pkg/kamailio/deb/sid/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/stretch/changelog b/pkg/kamailio/deb/stretch/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/stretch/changelog +++ b/pkg/kamailio/deb/stretch/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/trusty/changelog b/pkg/kamailio/deb/trusty/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/trusty/changelog +++ b/pkg/kamailio/deb/trusty/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/wheezy/changelog b/pkg/kamailio/deb/wheezy/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/wheezy/changelog +++ b/pkg/kamailio/deb/wheezy/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/deb/xenial/changelog b/pkg/kamailio/deb/xenial/changelog index 11564ff94..51a405e5f 100644 --- a/pkg/kamailio/deb/xenial/changelog +++ b/pkg/kamailio/deb/xenial/changelog @@ -1,3 +1,9 @@ +kamailio (5.8.6) unstable; urgency=medium + + * version set 5.8.6 + + -- Victor Seva Thu, 20 Mar 2025 08:19:52 +0100 + kamailio (5.8.5) unstable; urgency=medium * version set 5.8.5 diff --git a/pkg/kamailio/obs/kamailio.spec b/pkg/kamailio/obs/kamailio.spec index f160ec6d7..956c5b111 100644 --- a/pkg/kamailio/obs/kamailio.spec +++ b/pkg/kamailio/obs/kamailio.spec @@ -1,5 +1,5 @@ %define name kamailio -%define ver 5.8.5 +%define ver 5.8.6 %define rel dev1.0%{dist} %if 0%{?fedora} @@ -116,21 +116,21 @@ %bcond_without wolfssl %endif -%if 0%{?rhel} == 9 +%if 0%{?rhel} == 9 || 0%{?rhel} == 10 %if 0%{?centos_ver} %define dist_name centos %define dist_version %{?centos} -%define dist .el9.centos +%define dist .el%{?centos_ver}.centos %endif %if 0%{?almalinux_ver} %define dist_name centos %define dist_version %{?almalinux} -%define dist .el9.almalinux +%define dist .el%{?almalinux_ver}.almalinux %endif %if 0%{?rocky_ver} %define dist_name centos %define dist_version %{?rocky} -%define dist .el9.rocky +%define dist .el%{?rocky_ver}.rocky %endif %if 0%{?centos_ver} == 0 && 0%{?almalinux_ver} == 0 && 0%{?rocky_ver} == 0 %define dist_name rhel @@ -1205,7 +1205,6 @@ sed -i -e 's|/usr/sbin/kamailio|/usr/sbin/kamailio --atexit=no|' pkg/kamailio/ob %build -ln -s ../obs pkg/kamailio/%{dist_name}/%{dist_version} %if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel} >= 8 export FREERADIUS=1 %endif @@ -1444,29 +1443,29 @@ install -d %{buildroot}%{_sharedstatedir}/kamailio # On RedHat 6 like install -d %{buildroot}%{_var}/run/kamailio install -d %{buildroot}%{_sysconfdir}/rc.d/init.d -install -m755 pkg/kamailio/%{dist_name}/%{dist_version}/kamailio.init \ +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/%{dist_name}/%{dist_version}/kamailio.service %{buildroot}%{_unitdir}/kamailio.service -install -Dpm 0644 pkg/kamailio/%{dist_name}/%{dist_version}/kamailio@.service %{buildroot}%{_unitdir}/kamailio@.service -install -Dpm 0644 pkg/kamailio/%{dist_name}/%{dist_version}/sipcapture.service %{buildroot}%{_unitdir}/sipcapture.service -install -Dpm 0644 pkg/kamailio/%{dist_name}/%{dist_version}/kamailio.tmpfiles %{buildroot}%{_tmpfilesdir}/kamailio.conf -install -Dpm 0644 pkg/kamailio/%{dist_name}/%{dist_version}/sipcapture.tmpfiles %{buildroot}%{_tmpfilesdir}/sipcapture.conf +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/%{dist_name}/%{dist_version}/kamailio.sysconfig \ +install -m644 pkg/kamailio/obs/kamailio.sysconfig \ %{buildroot}%{_fillupdir}/sysconfig.kamailio -install -m644 pkg/kamailio/%{dist_name}/%{dist_version}/sipcapture.sysconfig \ +install -m644 pkg/kamailio/obs/sipcapture.sysconfig \ %{buildroot}%{_fillupdir}/sysconfig.sipcapture %else install -d %{buildroot}%{_sysconfdir}/sysconfig -install -m644 pkg/kamailio/%{dist_name}/%{dist_version}/kamailio.sysconfig \ +install -m644 pkg/kamailio/obs/kamailio.sysconfig \ %{buildroot}%{_sysconfdir}/sysconfig/kamailio -install -m644 pkg/kamailio/%{dist_name}/%{dist_version}/sipcapture.sysconfig \ +install -m644 pkg/kamailio/obs/sipcapture.sysconfig \ %{buildroot}%{_sysconfdir}/sysconfig/sipcapture %endif diff --git a/src/Makefile.defs b/src/Makefile.defs index 30a1de0fe..4c8dc3468 100644 --- a/src/Makefile.defs +++ b/src/Makefile.defs @@ -106,7 +106,7 @@ INSTALL_FLAVOUR=$(FLAVOUR) # version number VERSION = 5 PATCHLEVEL = 8 -SUBLEVEL = 5 +SUBLEVEL = 6 EXTRAVERSION = # memory manager switcher diff --git a/src/core/autover.h b/src/core/autover.h index 17c234bad..9752050ce 100644 --- a/src/core/autover.h +++ b/src/core/autover.h @@ -2,6 +2,6 @@ * DO NOT EDIT IT */ -#define REPO_VER "b035a8" -#define REPO_HASH "b035a8" +#define REPO_VER "fb71db" +#define REPO_HASH "fb71db" #define REPO_STATE "" diff --git a/src/core/dns_cache.c b/src/core/dns_cache.c index 91da25924..05da8bacd 100644 --- a/src/core/dns_cache.c +++ b/src/core/dns_cache.c @@ -3919,7 +3919,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/mem/f_malloc.c b/src/core/mem/f_malloc.c index 9d71cc43f..e8ca39cab 100644 --- a/src/core/mem/f_malloc.c +++ b/src/core/mem/f_malloc.c @@ -496,13 +496,17 @@ void *fm_malloc(void *qmp, size_t size) * The free hash bitmap is used to jump directly to non-empty * hash buckets. */ - do { - for(f = qm->free_hash[hash].first; f; f = f->next_free) - if(f->size >= size) - goto found; - hash++; /* try in next hash cell */ - } while((hash < F_HASH_SIZE) - && ((hash = fm_bmp_first_set(qm, hash)) >= 0)); + if(likely(hash < F_HASH_SIZE)) { + do { + for(f = qm->free_hash[hash].first; f; f = f->next_free) { + if(f->size >= size) { + goto found; + } + } + hash++; /* try in next hash cell */ + } while((hash < F_HASH_SIZE) + && ((hash = fm_bmp_first_set(qm, hash)) >= 0)); + } } #else /* F_MALLOC_HASH_BITMAP */ for(hash = GET_HASH(size); hash < F_HASH_SIZE; hash++) { diff --git a/src/core/parser/sdp/sdp_helpr_funcs.c b/src/core/parser/sdp/sdp_helpr_funcs.c index ed3471293..26a975a96 100644 --- a/src/core/parser/sdp/sdp_helpr_funcs.c +++ b/src/core/parser/sdp/sdp_helpr_funcs.c @@ -314,7 +314,7 @@ int extract_candidate(str *body, sdp_stream_cell_t *stream) int len, fl; sdp_ice_attr_t *ice_attr; - if((body->len < 12) || (strncasecmp(body->s, "a=candidate:", 12) != 0)) { + if((body->len <= 12) || (strncasecmp(body->s, "a=candidate:", 12) != 0)) { /*LM_DBG("We are not pointing to an a=candidate: attribute =>`%.*s'\n", body->len, body->s); */ return -1; } @@ -332,6 +332,10 @@ int extract_candidate(str *body, sdp_stream_cell_t *stream) 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; + } space = memchr(start, 32, len); if(space == NULL) { LM_ERR("no component in `a=candidate'\n"); @@ -557,7 +561,7 @@ int extract_mediaip(str *body, str *mediaip, int *pf, char *line) * - for length, at least 6: ' IP[4|6] x...' * - white space after */ - if(cp + 6 > mediaip->s + mediaip->len && cp[4] != ' ') { + if(cp + 6 > mediaip->s + mediaip->len || cp[4] != ' ') { LM_ERR("invalid content for `%s' line\n", line); return -1; } diff --git a/src/core/pass_fd.c b/src/core/pass_fd.c index 7c2810404..702497f81 100644 --- a/src/core/pass_fd.c +++ b/src/core/pass_fd.c @@ -33,6 +33,7 @@ #include #include #include /* for NULL definition on openbsd */ +#include #include #include #ifdef NO_MSG_WAITALL @@ -287,9 +288,14 @@ again: /* blocking recv_all */ n = recv_all( unix_socket, (char *)data + ret, data_len - ret, MSG_WAITALL); - if(n >= 0) + if(n >= 0) { + if(ret >= INT_MAX - n) { + LM_ERR("int size overflowing: %d + %d\n", ret, n); + ret = -1; + goto error; + } ret += n; - else { + } else { ret = n; goto error; } diff --git a/src/core/socket_info.c b/src/core/socket_info.c index 8efa59461..a1695d185 100644 --- a/src/core/socket_info.c +++ b/src/core/socket_info.c @@ -1393,7 +1393,7 @@ static int get_flags(int family) struct ifinfomsg *ifi; char buf[NETLINK_BUFFER_SIZE]; char *p = buf; - int nll = 0; + unsigned int nll = 0; int nl_sock = -1; fill_nl_req(req, RTM_GETLINK, family); @@ -1407,22 +1407,22 @@ static int get_flags(int family) } while(1) { - if((sizeof(buf) - nll) == 0) { - LM_ERR("netlink buffer overflow in get_flags"); - goto error; - } rtn = recv(nl_sock, p, sizeof(buf) - nll, 0); if(rtn <= 0) { LM_ERR("failed to receive data (%d/%d)\n", rtn, errno); goto error; } + if(nll >= sizeof(buf) - rtn) { + LM_ERR("netlink buffer overflow [%u/%d]\n", nll, rtn); + goto error; + } nlp = (struct nlmsghdr *)p; if(nlp->nlmsg_type == NLMSG_DONE) { LM_DBG("done\n"); break; } if(nlp->nlmsg_type == NLMSG_ERROR) { - LM_DBG("Error on message to netlink"); + LM_DBG("error on message to netlink"); break; } p += rtn; diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c index e65520fa7..f91962ab3 100644 --- a/src/core/tcp_main.c +++ b/src/core/tcp_main.c @@ -1330,6 +1330,7 @@ inline static int tcp_do_connect(union sockaddr_union *server, union sockaddr_union my_name; socklen_t my_name_len; struct ip_addr ip; + unsigned short port; #ifdef TCP_ASYNC int n; #endif /* TCP_ASYNC */ @@ -1435,14 +1436,19 @@ inline static int tcp_do_connect(union sockaddr_union *server, from = &my_name; /* update from with the real "from" address */ su2ip_addr(&ip, &my_name); find_socket: +#ifdef SO_REUSEPORT + port = cfg_get(tcp, tcp_cfg, reuse_port) ? su_getport(from) : 0; +#else + port = 0; +#endif #ifdef USE_TLS if(unlikely(type == PROTO_TLS)) { - *res_si = find_si(&ip, 0, PROTO_TLS); + *res_si = find_si(&ip, port, PROTO_TLS); } else { - *res_si = find_si(&ip, 0, PROTO_TCP); + *res_si = find_si(&ip, port, PROTO_TCP); } #else - *res_si = find_si(&ip, 0, PROTO_TCP); + *res_si = find_si(&ip, port, PROTO_TCP); #endif if(unlikely(*res_si == 0)) { diff --git a/src/core/ut.h b/src/core/ut.h index 1efd7abd2..93aba97dc 100644 --- a/src/core/ut.h +++ b/src/core/ut.h @@ -546,7 +546,8 @@ inline static int pathmax(void) #endif if(pathmax == 0) { /* init */ pathmax = pathconf("/", _PC_PATH_MAX); - pathmax = (pathmax <= 0) ? PATH_MAX_GUESS : pathmax + 1; + pathmax = (pathmax <= 0 || pathmax >= INT_MAX - 1) ? PATH_MAX_GUESS + : pathmax + 1; } return pathmax; } diff --git a/src/modules/call_control/call_control.c b/src/modules/call_control/call_control.c index ca0be44fe..3fff459b6 100644 --- a/src/modules/call_control/call_control.c +++ b/src/modules/call_control/call_control.c @@ -289,6 +289,9 @@ int cc_parse_param(void *val, AVP_List **avps) if(!(mp->next)) { PKG_MEM_ERROR; pkg_free(p0); + if(mp->pv) { + pkg_free(mp->pv); + } pkg_free(mp); return -1; } diff --git a/src/modules/ctl/binrpc_run.c b/src/modules/ctl/binrpc_run.c index 2e87ae791..2a0eae1c7 100644 --- a/src/modules/ctl/binrpc_run.c +++ b/src/modules/ctl/binrpc_run.c @@ -1025,7 +1025,7 @@ static int rpc_add(struct binrpc_ctx *ctx, char *fmt, ...) int err; str st; str *sp; - struct rpc_struct_l *rs; + struct rpc_struct_l *rs = NULL; str null_value = str_init(""); double d; @@ -1069,12 +1069,14 @@ static int rpc_add(struct binrpc_ctx *ctx, char *fmt, ...) if(err < 0) goto error_add; rs = new_rpc_struct(); - if(rs == 0) + if(rs == NULL) goto error_mem; rs->offset = binrpc_pkt_len(&ctx->out.pkt); err = binrpc_end_struct(&ctx->out.pkt); - if(err < 0) + if(err < 0) { + ctl_free(rs); goto error_add; + } clist_append(&ctx->out.structs, rs, next, prev); *(va_arg(ap, void **)) = rs; break; @@ -1180,7 +1182,7 @@ static int rpc_struct_add(struct rpc_struct_l *s, char *fmt, ...) va_list ap; int err; struct binrpc_val avp; - struct rpc_struct_l *rs; + struct rpc_struct_l *rs = NULL; str *sp; str null_value = str_init(""); @@ -1226,7 +1228,7 @@ static int rpc_struct_add(struct rpc_struct_l *s, char *fmt, ...) goto error_add; } rs = new_rpc_struct(); - if(rs == 0) { + if(rs == NULL) { LM_ERR("not enough memory (%c)\n", *fmt); goto error_mem; } @@ -1234,6 +1236,7 @@ static int rpc_struct_add(struct rpc_struct_l *s, char *fmt, ...) err = binrpc_end_struct(&s->pkt); if(err < 0) { LM_ERR("failed to end struct (%c)\n", *fmt); + ctl_free(rs); goto error_add; } clist_append(&s->substructs, rs, next, prev); @@ -1289,8 +1292,8 @@ static int rpc_array_add(struct rpc_struct_l *s, char *fmt, ...) va_list ap; int err; str st; - str *sp; - struct rpc_struct_l *rs; + str *sp = NULL; + struct rpc_struct_l *rs = NULL; str null_value = str_init(""); double d; @@ -1334,12 +1337,14 @@ static int rpc_array_add(struct rpc_struct_l *s, char *fmt, ...) if(err < 0) goto error_add; rs = new_rpc_struct(); - if(rs == 0) + if(rs == NULL) goto error_mem; rs->offset = binrpc_pkt_len(&s->pkt); err = binrpc_end_struct(&s->pkt); - if(err < 0) + if(err < 0) { + ctl_free(rs); goto error_add; + } clist_append(&s->substructs, rs, next, prev); *(va_arg(ap, void **)) = rs; break; diff --git a/src/modules/ctl/fifo_server.c b/src/modules/ctl/fifo_server.c index 94a700cf5..d8bfafc59 100644 --- a/src/modules/ctl/fifo_server.c +++ b/src/modules/ctl/fifo_server.c @@ -1259,7 +1259,7 @@ err: static int rpc_struct_printf(struct text_chunk *c, char *name, char *fmt, ...) { int n, buf_size; - char *buf; + char *buf = NULL; char *buf0; va_list ap; str s, nm; @@ -1288,7 +1288,7 @@ static int rpc_struct_printf(struct text_chunk *c, char *name, char *fmt, ...) &nm, 1); /* Escape all characters, including : and , */ if(!m) { rpc_fault(ctx, 500, "Internal Server Error"); - goto err; + goto error; } s.s = buf; @@ -1298,7 +1298,7 @@ static int rpc_struct_printf(struct text_chunk *c, char *name, char *fmt, ...) rpc_fault(ctx, 500, "Internal Server Error"); free_chunk(m); ERR("Error while creating text_chunk structure"); - goto err; + goto error; } l->flags |= CHUNK_MEMBER_VALUE; @@ -1312,6 +1312,7 @@ static int rpc_struct_printf(struct text_chunk *c, char *name, char *fmt, ...) c->next = m; if(c == ctx->last) ctx->last = m; + ctl_free(buf); return 0; } /* Else try again with more space. */ @@ -1323,12 +1324,12 @@ static int rpc_struct_printf(struct text_chunk *c, char *name, char *fmt, ...) if((buf0 = ctl_realloc(buf, buf_size)) == 0) { rpc_fault(ctx, 500, "Internal Server Error (No memory left)"); ERR("No memory left\n"); - goto err; + goto error; } buf = buf0; } - return 0; -err: + +error: if(buf) ctl_free(buf); return -1; diff --git a/src/modules/db_oracle/dbase.c b/src/modules/db_oracle/dbase.c index f1e433024..1393db9f7 100644 --- a/src/modules/db_oracle/dbase.c +++ b/src/modules/db_oracle/dbase.c @@ -174,7 +174,7 @@ db1_con_t *db_oracle_init(const str *_url) */ void db_oracle_close(db1_con_t *_h) { - db_do_close(_h, db_oracle_free_connection); + db_do_close(_h, (void *)db_oracle_free_connection); } diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c index c1ea95882..d6a4cb858 100644 --- a/src/modules/db_redis/redis_dbase.c +++ b/src/modules/db_redis/redis_dbase.c @@ -614,7 +614,10 @@ static int db_redis_build_type_keys(km_redis_con_t *con, const str *table_name, if(set_keys) { // add key for parent set // :::index:: - pkg_free(keyname.s); + if(keyname.s) { + pkg_free(keyname.s); + keyname.s = NULL; + } keyname.len = table->version_code.len + table_name->len + 9 + type->type.len; keyname.s = pkg_malloc(keyname.len + 1); @@ -628,12 +631,16 @@ static int db_redis_build_type_keys(km_redis_con_t *con, const str *table_name, type->type.s); if(db_redis_key_add_str(set_keys, &keyname) != 0) { LM_ERR("Failed to add query key to set key list\n"); + pkg_free(keyname.s); + keyname.s = NULL; goto err; } } } - if(keyname.s) + if(keyname.s) { pkg_free(keyname.s); + keyname.s = NULL; + } } return 0; diff --git a/src/modules/db_sqlite/dbase.c b/src/modules/db_sqlite/dbase.c index 97af64d39..a3e9b82f7 100644 --- a/src/modules/db_sqlite/dbase.c +++ b/src/modules/db_sqlite/dbase.c @@ -126,14 +126,17 @@ db1_con_t *db_sqlite_init(const str *_url) * No function should be called after this */ -static void db_sqlite_free_connection(struct sqlite_connection *con) +static void db_sqlite_free_connection(struct pool_con *con) { + struct sqlite_connection *_c; + if(!con) return; + _c = (struct sqlite_connection *)con; - sqlite3_close(con->conn); - free_db_id(con->hdr.id); - pkg_free(con); + sqlite3_close(_c->conn); + free_db_id(_c->hdr.id); + pkg_free(_c); } void db_sqlite_close(db1_con_t *_h) diff --git a/src/modules/db_unixodbc/connection.c b/src/modules/db_unixodbc/connection.c index 92b1cdb9e..d56f2ac37 100644 --- a/src/modules/db_unixodbc/connection.c +++ b/src/modules/db_unixodbc/connection.c @@ -179,14 +179,17 @@ err2: /* * Close the connection and release memory */ -void db_unixodbc_free_connection(struct my_con *con) +void db_unixodbc_free_connection(struct pool_con *con) { + struct my_con *_c; + if(!con) return; - SQLFreeHandle(SQL_HANDLE_ENV, con->env); - SQLDisconnect(con->dbc); - SQLFreeHandle(SQL_HANDLE_DBC, con->dbc); - pkg_free(con); + _c = (struct my_con *)con; + SQLFreeHandle(SQL_HANDLE_ENV, _c->env); + SQLDisconnect(_c->dbc); + SQLFreeHandle(SQL_HANDLE_DBC, _c->dbc); + pkg_free(_c); } diff --git a/src/modules/db_unixodbc/connection.h b/src/modules/db_unixodbc/connection.h index d94f0b48e..a37bb1e39 100644 --- a/src/modules/db_unixodbc/connection.h +++ b/src/modules/db_unixodbc/connection.h @@ -83,7 +83,7 @@ struct my_con *db_unixodbc_new_connection(struct db_id *id); /* * Close the connection and release memory */ -void db_unixodbc_free_connection(struct my_con *con); +void db_unixodbc_free_connection(struct pool_con *con); char *db_unixodbc_build_conn_str(const struct db_id *id, char *buf); diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c index 79221a148..75d783330 100644 --- a/src/modules/dialog/dialog.c +++ b/src/modules/dialog/dialog.c @@ -1768,32 +1768,36 @@ static int fixup_dlg_bridge(void **param, int param_no) return 0; } -static str *ki_dlg_get_var_helper( - sip_msg_t *msg, str *sc, str *sf, str *st, str *key) +static int ki_dlg_get_var_helper( + sip_msg_t *msg, str *sc, str *sf, str *st, str *key, str *val) { dlg_cell_t *dlg = NULL; unsigned int dir = 0; - str *val = NULL; if(sc == NULL || sc->s == NULL || sc->len == 0) { LM_ERR("invalid Call-ID parameter\n"); - return val; + return -1; } if(sf == NULL || sf->s == NULL || sf->len == 0) { LM_ERR("invalid From tag parameter\n"); - return val; + return -1; } if(st == NULL) { LM_ERR("invalid To tag parameter\n"); - return val; + return -1; } dlg = get_dlg(sc, sf, st, &dir); - if(dlg == NULL) - return val; - val = get_dlg_varref(dlg, key); + if(dlg == NULL) { + LM_DBG("dialog not found for call-id: %.*s\n", sc->len, sc->s); + return -1; + } + if(get_dlg_varval(dlg, key, val) != 0) { + dlg_release(dlg); + return -1; + } dlg_release(dlg); - return val; + return 0; } /** @@ -1804,18 +1808,15 @@ static sr_kemi_xval_t _sr_kemi_dialog_xval = {0}; static sr_kemi_xval_t *ki_dlg_get_var( sip_msg_t *msg, str *sc, str *sf, str *st, str *key) { - str *val = NULL; - memset(&_sr_kemi_dialog_xval, 0, sizeof(sr_kemi_xval_t)); - val = ki_dlg_get_var_helper(msg, sc, sf, st, key); - if(!val) { + if(ki_dlg_get_var_helper(msg, sc, sf, st, key, &_sr_kemi_dialog_xval.v.s) + < 0) { sr_kemi_xval_null(&_sr_kemi_dialog_xval, SR_KEMI_XVAL_NULL_NONE); return &_sr_kemi_dialog_xval; } _sr_kemi_dialog_xval.vtype = SR_KEMIP_STR; - _sr_kemi_dialog_xval.v.s = *val; return &_sr_kemi_dialog_xval; } @@ -2420,8 +2421,12 @@ static int ki_dlg_var_sets(sip_msg_t *msg, str *name, str *val) int ret; dlg = dlg_get_msg_dialog(msg); + if(dlg) { + dlg_cell_lock(dlg); + } ret = set_dlg_variable_unsafe(dlg, name, val); if(dlg) { + dlg_cell_unlock(dlg); dlg_release(dlg); } @@ -2434,7 +2439,6 @@ static int ki_dlg_var_sets(sip_msg_t *msg, str *name, str *val) static sr_kemi_xval_t *ki_dlg_var_get_mode(sip_msg_t *msg, str *name, int rmode) { dlg_cell_t *dlg; - str *pval; memset(&_sr_kemi_dialog_xval, 0, sizeof(sr_kemi_xval_t)); @@ -2443,14 +2447,12 @@ static sr_kemi_xval_t *ki_dlg_var_get_mode(sip_msg_t *msg, str *name, int rmode) sr_kemi_xval_null(&_sr_kemi_dialog_xval, rmode); return &_sr_kemi_dialog_xval; } - pval = get_dlg_varref(dlg, name); - if(pval == NULL || pval->s == NULL) { + if(get_dlg_varval(dlg, name, &_sr_kemi_dialog_xval.v.s) < 0) { sr_kemi_xval_null(&_sr_kemi_dialog_xval, rmode); goto done; } _sr_kemi_dialog_xval.vtype = SR_KEMIP_STR; - _sr_kemi_dialog_xval.v.s = *pval; done: dlg_release(dlg); @@ -2488,7 +2490,12 @@ static int ki_dlg_var_rm(sip_msg_t *msg, str *name) dlg_cell_t *dlg; dlg = dlg_get_msg_dialog(msg); - set_dlg_variable_unsafe(dlg, name, NULL); + if(dlg) { + dlg_cell_lock(dlg); + set_dlg_variable_unsafe(dlg, name, NULL); + dlg_cell_unlock(dlg); + dlg_release(dlg); + } return 1; } diff --git a/src/modules/dialog/dlg_hash.h b/src/modules/dialog/dlg_hash.h index e4b583f00..513ca586e 100644 --- a/src/modules/dialog/dlg_hash.h +++ b/src/modules/dialog/dlg_hash.h @@ -68,7 +68,7 @@ #define DLG_FLAG_TM (1 << 9) /*!< dialog is set in transaction */ #define DLG_FLAG_EXPIRED (1 << 10) /*!< dialog is expired */ -#define DLG_FLAG_CHANGED_PROF (1 << 10) /*!< dialog-profiles changed DMQ*/ +#define DLG_FLAG_CHANGED_PROF (1 << 11) /*!< dialog-profiles changed - DMQ */ #define DLG_FLAG_DB_LOAD_EXTRA (1 << 12) /*!< dialog loaded extra from db */ /* internal flags stored in db */ diff --git a/src/modules/dialog/dlg_req_within.c b/src/modules/dialog/dlg_req_within.c index fb5f2e51e..0b7b140fd 100644 --- a/src/modules/dialog/dlg_req_within.c +++ b/src/modules/dialog/dlg_req_within.c @@ -374,7 +374,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; @@ -384,16 +385,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, @@ -785,7 +785,7 @@ int dlg_send_ka(dlg_cell_t *dlg, int dir) if(di->loc_seq.value > 1) di->loc_seq.value -= 2; else - di->loc_seq.value -= 1; + di->loc_seq.value = 0; LM_DBG("sending OPTIONS to %s\n", (dir == DLG_CALLER_LEG) ? "caller" : "callee"); @@ -841,7 +841,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); @@ -862,8 +862,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/dlg_var.c b/src/modules/dialog/dlg_var.c index db5f61c4e..336872829 100644 --- a/src/modules/dialog/dlg_var.c +++ b/src/modules/dialog/dlg_var.c @@ -197,8 +197,8 @@ int set_dlg_variable_unsafe(struct dlg_cell *dlg, str *key, str *val) it_prev->next = it->next; else *var_list = it->next; - /* Set the delete-flag for the current var: */ - it->vflags &= DLG_FLAG_DEL; + /* set the delete-flag for the current var */ + it->vflags |= DLG_FLAG_DEL; } else { /* replace the current it with var and free the it */ var->next = it->next; diff --git a/src/modules/dlgs/dlgs_mod.c b/src/modules/dlgs/dlgs_mod.c index e9821d05d..dbb91e1f9 100644 --- a/src/modules/dlgs/dlgs_mod.c +++ b/src/modules/dlgs/dlgs_mod.c @@ -341,7 +341,7 @@ static int ki_dlgs_tags_count(sip_msg_t *msg, str *vtags) int ret; ret = dlgs_tags_count(msg, vtags); - return (ret <= 0) ? (ret - 1) : ret; + return (ret == 0 || ret == -1) ? (ret - 1) : ret; } /** diff --git a/src/modules/htable/ht_api.c b/src/modules/htable/ht_api.c index 0c9052212..b20f34bc8 100644 --- a/src/modules/htable/ht_api.c +++ b/src/modules/htable/ht_api.c @@ -491,9 +491,7 @@ int ht_set_cell_ex( it->value.s.s[it->value.s.len] = '\0'; if(exv <= 0) { - if(ht->updateexpire) { - it->expire = now + ht->htexpire; - } + HT_UPDATE_EXPIRE(ht, it, now); } else { it->expire = now + exv; } @@ -509,11 +507,7 @@ int ht_set_cell_ex( cell->next = it->next; cell->prev = it->prev; if(exv <= 0) { - if(ht->updateexpire) { - cell->expire = now + ht->htexpire; - } else { - cell->expire = it->expire; - } + HT_COPY_EXPIRE(ht, cell, now, it); } else { it->expire = now + exv; } @@ -530,9 +524,7 @@ int ht_set_cell_ex( it->value.n = val->n; if(exv <= 0) { - if(ht->updateexpire) { - it->expire = now + ht->htexpire; - } + HT_UPDATE_EXPIRE(ht, it, now); } else { it->expire = now + exv; } @@ -551,11 +543,7 @@ int ht_set_cell_ex( return -1; } if(exv <= 0) { - if(ht->updateexpire) { - cell->expire = now + ht->htexpire; - } else { - cell->expire = it->expire; - } + HT_COPY_EXPIRE(ht, cell, now, it); } else { it->expire = now + exv; } @@ -573,9 +561,7 @@ int ht_set_cell_ex( it->value.n = val->n; if(exv <= 0) { - if(ht->updateexpire) { - it->expire = now + ht->htexpire; - } + HT_UPDATE_EXPIRE(ht, it, now); } else { it->expire = now + exv; } diff --git a/src/modules/htable/ht_api.h b/src/modules/htable/ht_api.h index e24a93b1f..cda0aea26 100644 --- a/src/modules/htable/ht_api.h +++ b/src/modules/htable/ht_api.h @@ -140,4 +140,20 @@ ht_cell_t *ht_iterator_get_current(str *iname); void ht_slot_lock(ht_t *ht, int idx); void ht_slot_unlock(ht_t *ht, int idx); + +#define HT_UPDATE_EXPIRE(ht, it, now) \ + do { \ + if(ht->updateexpire || (now && it->expire && it->expire < now)) { \ + it->expire = now + ht->htexpire; \ + } \ + } while(0) +#define HT_COPY_EXPIRE(ht, it, now, src) \ + do { \ + if(ht->updateexpire || (now && it->expire && it->expire < now)) { \ + it->expire = now + ht->htexpire; \ + } else { \ + it->expire = src->expire; \ + } \ + } while(0) + #endif diff --git a/src/modules/htable/ht_var.c b/src/modules/htable/ht_var.c index e79c7869e..4d7707f95 100644 --- a/src/modules/htable/ht_var.c +++ b/src/modules/htable/ht_var.c @@ -38,8 +38,8 @@ int pv_get_ht_cell(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) if(hpv->ht == NULL) { hpv->ht = ht_get_table(&hpv->htname); if(hpv->ht == NULL) { - LM_ERR("htable not found for getting $sht(%.*s=>%.*s)\n", - hpv->htname.len, hpv->htname.s, htname.len, htname.s); + LM_ERR("htable not found for getting $sht(%.*s=>...)\n", + hpv->htname.len, hpv->htname.s); return pv_get_null(msg, param, res); } } @@ -77,8 +77,8 @@ int pv_set_ht_cell( if(hpv->ht == NULL) hpv->ht = ht_get_table(&hpv->htname); if(hpv->ht == NULL) { - LM_ERR("htable not found for setting $sht(%.*s=>%.*s)\n", - hpv->htname.len, hpv->htname.s, htname.len, htname.s); + LM_ERR("htable not found for setting $sht(%.*s=>...)\n", + hpv->htname.len, hpv->htname.s); return -1; } diff --git a/src/modules/http_async_client/http_multi.c b/src/modules/http_async_client/http_multi.c index 30ae016d7..7edc0ddc1 100644 --- a/src/modules/http_async_client/http_multi.c +++ b/src/modules/http_async_client/http_multi.c @@ -604,7 +604,7 @@ void check_multi_info(struct http_m_global *g) CURL *easy; CURLcode res; - struct http_m_cell *cell; + struct http_m_cell *cell = NULL; double tmp_time; LM_DBG("REMAINING: %d\n", g->still_running); @@ -616,9 +616,15 @@ void check_multi_info(struct http_m_global *g) curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &eff_url); - LM_DBG("DONE: %s => (%d) %s\n", eff_url, res, cell->error); + LM_DBG("DONE: %s => (%d)\n", eff_url, res); cell = http_m_cell_lookup(easy); + if(cell == NULL) { + LM_ERR("failed to get the cell\n"); + curl_multi_remove_handle(g->multi, easy); + curl_easy_cleanup(easy); + continue; + } if(msg->data.result != 0) { LM_ERR("handle %p returned error %d: %s\n", easy, res, cell->error); diff --git a/src/modules/http_client/curlcon.c b/src/modules/http_client/curlcon.c index 16dfb6cc0..3582ecde1 100644 --- a/src/modules/http_client/curlcon.c +++ b/src/modules/http_client/curlcon.c @@ -582,21 +582,29 @@ int curl_parse_conn(void *param, cfg_parser_t *parser, unsigned int flags) t.start.line, t.start.col); return -1; } - pkg_str_dup(&name, &t.val); + if(pkg_str_dup(&name, &t.val) < 0) { + return -1; + } ret = cfg_get_token(&t, parser, 0); - if(ret < 0) + if(ret < 0) { + pkg_free(name.s); return -1; + } if((ret > 0) || (t.type != ']')) { LM_ERR("%s:%d:%d: Syntax error, ']' expected\n", parser->file, t.start.line, t.start.col); + pkg_free(name.s); return -1; } - if(cfg_eat_eol(parser, flags)) + if(cfg_eat_eol(parser, flags)) { + pkg_free(name.s); return -1; + } raw_cc = pkg_malloc(sizeof(raw_http_client_conn_t)); if(raw_cc == NULL) { + pkg_free(name.s); return -1; } memset(raw_cc, 0, sizeof(raw_http_client_conn_t)); diff --git a/src/modules/janssonrpcc/janssonrpc_server.c b/src/modules/janssonrpcc/janssonrpc_server.c index 3fb4d7c62..5a98a6fc1 100644 --- a/src/modules/janssonrpcc/janssonrpc_server.c +++ b/src/modules/janssonrpcc/janssonrpc_server.c @@ -130,6 +130,7 @@ int jsonrpc_parse_server(char *server_s, jsonrpc_server_group_t **group_ptr) param_t *pit = NULL; param_t *freeme = NULL; str conn; + conn.s = NULL; str addr; addr.s = NULL; str srv; diff --git a/src/modules/microhttpd/microhttpd_mod.c b/src/modules/microhttpd/microhttpd_mod.c index f1ee8334b..3bfef79b0 100644 --- a/src/modules/microhttpd/microhttpd_mod.c +++ b/src/modules/microhttpd/microhttpd_mod.c @@ -176,6 +176,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; @@ -359,7 +366,7 @@ 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; @@ -371,6 +378,9 @@ static int ksr_mhttpd_send_reply( _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; } @@ -433,23 +443,68 @@ static int fixup_mhttpd_send_reply(void **param, int param_no) } + 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 */ @@ -460,13 +515,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/msrp/msrp_cmap.c b/src/modules/msrp/msrp_cmap.c index a1e79e844..072fe5f75 100644 --- a/src/modules/msrp/msrp_cmap.c +++ b/src/modules/msrp/msrp_cmap.c @@ -156,6 +156,7 @@ int msrp_cmap_save(msrp_frame_t *mf) char sbuf[MSRP_SBUF_SIZE]; str srcaddr; str srcsock; + str xhdrs; int msize; int expires; msrp_citem_t *it; @@ -172,16 +173,18 @@ int msrp_cmap_save(msrp_frame_t *mf) expires = msrp_auth_max_expires; if(expires < msrp_auth_min_expires) { LM_DBG("expires is lower than min value\n"); - srcaddr.len = snprintf(sbuf, MSRP_SBUF_SIZE, "Min-Expires: %d\r\n", + xhdrs.len = snprintf(sbuf, MSRP_SBUF_SIZE, "Min-Expires: %d\r\n", msrp_auth_min_expires); - msrp_reply(mf, &msrp_reply_423_code, &msrp_reply_423_text, &srcaddr); + xhdrs.s = sbuf; + msrp_reply(mf, &msrp_reply_423_code, &msrp_reply_423_text, &xhdrs); return -3; } if(expires > msrp_auth_max_expires) { LM_DBG("expires is greater than max value\n"); - srcaddr.len = snprintf(sbuf, MSRP_SBUF_SIZE, "Max-Expires: %d\r\n", + xhdrs.len = snprintf(sbuf, MSRP_SBUF_SIZE, "Max-Expires: %d\r\n", msrp_auth_max_expires); - msrp_reply(mf, &msrp_reply_423_code, &msrp_reply_423_text, &srcaddr); + xhdrs.s = sbuf; + msrp_reply(mf, &msrp_reply_423_code, &msrp_reply_423_text, &xhdrs); return -4; } if(msrp_frame_get_first_from_path(mf, &fpeer) < 0) { diff --git a/src/modules/outbound/outbound_mod.c b/src/modules/outbound/outbound_mod.c index e5ed17126..2e1251e3a 100644 --- a/src/modules/outbound/outbound_mod.c +++ b/src/modules/outbound/outbound_mod.c @@ -59,29 +59,36 @@ static unsigned int ob_force_no_flag = (unsigned int)-1; static str ob_key = {0, 0}; static str flow_token_secret = {0, 0}; +/* clang-format off */ static cmd_export_t cmds[] = { - {"bind_ob", (cmd_function)bind_ob, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}; + {"bind_ob", (cmd_function)bind_ob, 1, 0, 0, 0}, + {0, 0, 0, 0, 0, 0} +}; static param_export_t params[] = { - {"force_outbound_flag", PARAM_INT, &ob_force_flag}, - {"force_no_outbound_flag", PARAM_INT, &ob_force_no_flag}, - {"flow_token_secret", PARAM_STRING, &flow_token_secret}, {0, 0, 0}}; + {"force_outbound_flag", PARAM_INT, &ob_force_flag}, + {"force_no_outbound_flag", PARAM_INT, &ob_force_no_flag}, + {"flow_token_secret", PARAM_STR, &flow_token_secret}, + {0, 0, 0} +}; struct module_exports exports = { - "outbound", DEFAULT_DLFLAGS, /* dlopen flags */ - cmds, /* exported functions */ - params, /* exported parameters */ - 0, /* exported·RPC·methods */ - 0, /* exported pseudo-variables */ - 0, /* response·function */ - mod_init, /* module initialization function */ - 0, /* per-child initialization function */ - destroy /* destroy function */ + "outbound", + DEFAULT_DLFLAGS, /* dlopen flags */ + cmds, /* exported functions */ + params, /* exported parameters */ + 0, /* RPC method exports */ + 0, /* exported pseudo-variables */ + 0, /* response handling function */ + mod_init, /* module initialization function */ + 0, /* per-child init function */ + destroy /* module destroy function */ }; +/* clang-format on */ static void mod_init_openssl(void) { - if(flow_token_secret.s) { + if(flow_token_secret.s && flow_token_secret.len > 0) { assert(ob_key.len == SHA_DIGEST_LENGTH); LM_DBG("flow_token_secret mod param set. use persistent ob_key"); #if OPENSSL_VERSION_NUMBER < 0x030000000L diff --git a/src/modules/presence/notify.c b/src/modules/presence/notify.c index 9a8af778c..62554d179 100644 --- a/src/modules/presence/notify.c +++ b/src/modules/presence/notify.c @@ -1555,6 +1555,8 @@ int query_db_notify(str *pres_uri, pres_ev_t *event, subs_t *watcher_subs) subs_t *subs_array = NULL, *s = NULL; str *notify_body = NULL, *aux_body = NULL; int ret_code = -1; + int retOK = 0; + int retErr = 0; subs_array = get_subs_dialog(pres_uri, event, NULL); if(subs_array == NULL) { @@ -1584,7 +1586,9 @@ int query_db_notify(str *pres_uri, pres_ev_t *event, subs_t *watcher_subs) < 0) { LM_ERR("Could not send notify for [event]=%.*s\n", event->name.len, event->name.s); - goto done; + retErr++; + } else { + retOK++; } if(aux_body != NULL) { @@ -1597,7 +1601,10 @@ int query_db_notify(str *pres_uri, pres_ev_t *event, subs_t *watcher_subs) } } - ret_code = 1; + LM_DBG("sent ok: %d - err: %d\n", retOK, retErr); + if(retOK > 0) { + ret_code = 1; + } done: free_subs_list(subs_array, PKG_MEM_TYPE, 0); diff --git a/src/modules/pua_reginfo/notify.c b/src/modules/pua_reginfo/notify.c index cb64be195..8bcf391c8 100644 --- a/src/modules/pua_reginfo/notify.c +++ b/src/modules/pua_reginfo/notify.c @@ -303,10 +303,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/pv_xavp.c b/src/modules/pv/pv_xavp.c index a64c5847d..5fa953da1 100644 --- a/src/modules/pv/pv_xavp.c +++ b/src/modules/pv/pv_xavp.c @@ -516,6 +516,10 @@ done: error: if(xname != NULL) { + if(xname->next != NULL) { + pkg_free(xname->next); + xname->next = NULL; + } pv_xavp_name_destroy(xname); pkg_free(xname); } @@ -953,6 +957,10 @@ done: error: if(xname != NULL) { + if(xname->next != NULL) { + pkg_free(xname->next); + xname->next = NULL; + } pv_xavu_name_destroy(xname); pkg_free(xname); } @@ -1100,6 +1108,10 @@ done: error: if(xname != NULL) { + if(xname->next != NULL) { + pkg_free(xname->next); + xname->next = NULL; + } pv_xavi_name_destroy(xname); pkg_free(xname); } diff --git a/src/modules/registrar/save.c b/src/modules/registrar/save.c index 1f5b7e0ac..cc07ac711 100644 --- a/src/modules/registrar/save.c +++ b/src/modules/registrar/save.c @@ -953,8 +953,6 @@ int save(struct sip_msg *_m, udomain_t *_d, int _cflags, str *_uri) return -1; } } - if(u == NULL) - goto error; rerrno = R_FINE; ret = 1; diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c index 2694239cb..ed1a47de7 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c @@ -614,6 +614,7 @@ int sca_call_info_seize_held_call(sip_msg_t *msg, sca_call_info *call_info, anchor = anchor_lump(msg, msg->eoh - msg->buf, 0, HDR_OTHER_T); if(anchor == NULL) { LM_ERR("Failed to anchor lump\n"); + pkg_free(replaces_hdr.s); goto done; } @@ -637,7 +638,6 @@ int sca_call_info_seize_held_call(sip_msg_t *msg, sca_call_info *call_info, // we restore the original owner and dialog. if(sca_appearance_update_owner_unsafe(app, contact_uri) < 0) { LM_ERR("sca_call_info_seize_held_call: failed to update owner\n"); - pkg_free(replaces_hdr.s); goto done; } diff --git a/src/modules/seas/ha.c b/src/modules/seas/ha.c index 6134f3d37..53759afd9 100644 --- a/src/modules/seas/ha.c +++ b/src/modules/seas/ha.c @@ -154,7 +154,7 @@ static inline int parse_ping( } string++; } - if(!(ping_period_s && pings_lost_s && ping_timeout_s)) { + if(!(pings_lost_s && ping_timeout_s)) { LM_ERR("malformed ping config string. Unparseable :[%s]\n", string); return -1; } diff --git a/src/modules/sl/sl_stats.c b/src/modules/sl/sl_stats.c index e97604558..91f1ae892 100644 --- a/src/modules/sl/sl_stats.c +++ b/src/modules/sl/sl_stats.c @@ -146,7 +146,7 @@ void update_sl_stats(int code) my_stats = &(*sl_stats)[process_no]; - if(code >= 700 || code < 200) { + if(code >= 700 || code < 100) { my_stats->err[RT_xxx]++; } else if(code >= 600) { my_stats->err[RT_6xx]++; @@ -201,7 +201,7 @@ void update_sl_stats(int code) my_stats->err[RT_3xx]++; break; } - } else { /* 2xx */ + } else if(code >= 200) { switch(code) { case 200: my_stats->err[RT_200]++; @@ -213,6 +213,8 @@ void update_sl_stats(int code) my_stats->err[RT_2xx]++; break; } + } else { /* 1xx */ + my_stats->err[RT_1xx]++; } } diff --git a/src/modules/textops/textops.c b/src/modules/textops/textops.c index 6baf40de6..2a09c2dc6 100644 --- a/src/modules/textops/textops.c +++ b/src/modules/textops/textops.c @@ -4947,11 +4947,7 @@ static int ki_via_param_rm(sip_msg_t *msg, str *name, int idx) LM_ERR("no memory for delete operation\n"); return -1; } - if(ret < 0) { - ret = 1; - } else { - ret++; - } + ret++; } } if(ret > 0) { @@ -4962,7 +4958,7 @@ static int ki_via_param_rm(sip_msg_t *msg, str *name, int idx) } } } - return ret; + return (ret == 0) ? -1 : ret; } /** diff --git a/src/modules/tls/tls_select.c b/src/modules/tls/tls_select.c index 8b1a0457c..ad8654b10 100644 --- a/src/modules/tls/tls_select.c +++ b/src/modules/tls/tls_select.c @@ -127,14 +127,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; diff --git a/src/modules/tm/rpc_uac.c b/src/modules/tm/rpc_uac.c index e63da4fb8..2d7bd6113 100644 --- a/src/modules/tm/rpc_uac.c +++ b/src/modules/tm/rpc_uac.c @@ -778,7 +778,7 @@ static void rpc_t_uac(rpc_t *rpc, void *c, int reply_wait) dctx = rpc->delayed_ctx_new(c); if(dctx == 0) { rpc->fault(c, 500, "internal error: failed to create context"); - return; + goto error01; } uac_req.cb = rpc_uac_callback; uac_req.cbp = dctx; diff --git a/src/modules/tm/t_msgbuilder.c b/src/modules/tm/t_msgbuilder.c index 65c7be46a..1fec2aa37 100644 --- a/src/modules/tm/t_msgbuilder.c +++ b/src/modules/tm/t_msgbuilder.c @@ -674,6 +674,26 @@ static inline int get_contact_uri(struct sip_msg *msg, str *uri) return 0; } +/** + * reverse rte list + */ +static inline rte_t *tm_reverse_rte_list(rte_t *head) +{ + rte_t *prev = NULL; + rte_t *current = NULL; + rte_t *next = NULL; + + current = head; + while(current != NULL) { + next = current->next; + current->next = prev; + prev = current; + current = next; + } + + return prev; +} + /** * Extract route set from the message (out of Record-Route, if reply, OR * Route, if request). @@ -684,7 +704,7 @@ static inline int get_uac_rs(sip_msg_t *msg, int is_req, struct rte **rtset) { struct hdr_field *ptr; rr_t *p, *new_p; - struct rte *t, *head, *old_head; + struct rte *t, *head; head = 0; for(ptr = is_req ? msg->route : msg->record_route; ptr; ptr = ptr->next) { @@ -734,14 +754,7 @@ static inline int get_uac_rs(sip_msg_t *msg, int is_req, struct rte **rtset) if(is_req) { /* harvesting the R/RR HF above inserts at head, which suites RRs (as * they must be reversed, anyway), but not Rs => reverse once more */ - old_head = head; - head = 0; - while(old_head) { - t = old_head; - old_head = old_head->next; - t->next = head; - head = t; - } + head = tm_reverse_rte_list(head); } *rtset = head; @@ -751,7 +764,6 @@ err: return -1; } - static inline unsigned short uri2port(const struct sip_uri *puri) { if(puri->port.s) { @@ -1739,7 +1751,8 @@ char *build_uac_cancel(str *headers, str *body, struct cell *cancelledT, char branch_buf[MAX_BRANCH_PARAM_LEN]; str branch_str; struct hostport hp; - str content_length, via; + str content_length; + str via = STR_NULL; LM_DBG("sing FROM=<%.*s>, TO=<%.*s>, CSEQ_N=<%.*s>\n", cancelledT->from_hdr.len, cancelledT->from_hdr.s, @@ -1778,7 +1791,7 @@ char *build_uac_cancel(str *headers, str *body, struct cell *cancelledT, /* Content Length */ if(print_content_length(&content_length, body) < 0) { LM_ERR("failed to print content-length\n"); - return 0; + goto error01; } /* Content-Length */ *len += (body ? (CONTENT_LENGTH_LEN + content_length.len + CRLF_LEN) : 0); diff --git a/src/modules/topoh/th_msg.c b/src/modules/topoh/th_msg.c index 1984875e0..54d3caffe 100644 --- a/src/modules/topoh/th_msg.c +++ b/src/modules/topoh/th_msg.c @@ -177,10 +177,8 @@ int th_mask_via(sip_msg_t *msg, str *via_prefix) vlen = th_skip_rw(via->name.s, via->bsize); LM_DBG("body: %d: [%.*s]\n", vlen, vlen, via->name.s); if(i != 1) { - out.s = th_mask_encode( - via->name.s, vlen, via_prefix, &out.len); - if(out.s == NULL) - { + out.s = th_mask_encode(via->name.s, vlen, via_prefix, &out.len); + if(out.s == NULL) { LM_ERR("cannot encode via %d\n", i); return -1; } @@ -372,11 +370,11 @@ int th_unmask_via(sip_msg_t *msg, str *ip, str *cookie) LM_DBG("body: %d: [%.*s]\n", vlen, vlen, via->name.s); if(i != 1) { /* Skip if via is not encoded */ - if (th_uri_prefix_checks - && (via->host.len != ip->len - || strncasecmp(via->host.s, ip->s, ip->len) - != 0)) { - LM_DBG("via %d is not encoded - skip\n",i); + if(th_uri_prefix_checks + && (via->host.len != ip->len + || strncasecmp(via->host.s, ip->s, ip->len) + != 0)) { + LM_DBG("via %d is not encoded - skip\n", i); continue; } @@ -404,7 +402,7 @@ int th_unmask_via(sip_msg_t *msg, str *ip, str *cookie) out.s = th_mask_decode(vp->value.s, vp->value.len, &th_vparam_prefix, 0, &out.len); } - if(out.s == NULL || out.len <= 0) { + if(out.s == NULL) { LM_ERR("cannot decode via %d\n", i); return -1; } @@ -599,7 +597,7 @@ int th_flip_record_route(sip_msg_t *msg, str *uri_prefix, str *ip, int mode) case 1: /* encode */ if(act != 0 && mode == 1) { out.s = th_mask_encode(rr->nameaddr.uri.s, - rr->nameaddr.uri.len, uri_prefix, &out.len); + rr->nameaddr.uri.len, uri_prefix, &out.len); if(out.s == NULL) { LM_ERR("cannot encode r-r %d\n", i); return -1; @@ -665,10 +663,10 @@ int th_unmask_route(sip_msg_t *msg, str *uri_prefix) i++; if(i != 1) { /* Skip if route is not encoded */ - if (th_uri_prefix_checks - && ((rr->nameaddr.uri.lenlen) - || (strncasecmp(rr->nameaddr.uri.s, - uri_prefix->s, uri_prefix->len) + if(th_uri_prefix_checks + && ((rr->nameaddr.uri.len < uri_prefix->len) + || (strncasecmp(rr->nameaddr.uri.s, + uri_prefix->s, uri_prefix->len) != 0))) { LM_DBG("rr %d is not encoded: [%.*s] - missing prefix\n", i, rr->nameaddr.uri.len, rr->nameaddr.uri.s); @@ -721,12 +719,12 @@ int th_unmask_ruri(sip_msg_t *msg, str *uri_prefix) str out; /* Do nothing if ruri is not encoded */ - if (th_uri_prefix_checks - && ((REQ_LINE(msg).uri.lenlen) + if(th_uri_prefix_checks + && ((REQ_LINE(msg).uri.len < uri_prefix->len) || (strncasecmp(REQ_LINE(msg).uri.s, uri_prefix->s, uri_prefix->len) != 0))) { - LM_DBG("ruri [%.*s] is not encoded",REQ_LINE(msg).uri.len, + LM_DBG("ruri [%.*s] is not encoded", REQ_LINE(msg).uri.len, REQ_LINE(msg).uri.s); return 0; } @@ -784,11 +782,11 @@ int th_unmask_refer_to(sip_msg_t *msg, str *uri_prefix) uri = &(get_refer_to(msg)->uri); /* Do nothing if refer_to is not encoded */ - if (th_uri_prefix_checks - && ((uri->lenlen) + if(th_uri_prefix_checks + && ((uri->len < uri_prefix->len) || (strncasecmp(uri->s, uri_prefix->s, uri_prefix->len) != 0))) { - LM_DBG("refer-to [%.*s] is not encoded",uri->len,uri->s); + LM_DBG("refer-to [%.*s] is not encoded", uri->len, uri->s); return 0; } diff --git a/src/modules/tsilo/tsilo.c b/src/modules/tsilo/tsilo.c index 5fe6535ba..383b09328 100644 --- a/src/modules/tsilo/tsilo.c +++ b/src/modules/tsilo/tsilo.c @@ -442,19 +442,19 @@ static int w_ts_append_by_contact2( if(ts_check_uri(&ruri) < 0) { LM_ERR("failed to parse R-URI.\n"); - return -1; + goto error; } /* parse Contact header */ if((!_msg->contact && parse_headers(_msg, HDR_CONTACT_F, 0) != 0) || !_msg->contact) { LM_WARN("missing contact header or the value is empty/malformed.\n"); - return -1; + goto error; } if(_msg->contact) { if(parse_contact(_msg->contact) < 0) { LM_WARN("failed to parse Contact header.\n"); - return -1; + goto error; } if(parse_uri(((struct contact_body *)_msg->contact->parsed) ->contacts->uri.s, @@ -464,7 +464,7 @@ static int w_ts_append_by_contact2( != 0) { if(ts_check_uri(&_msg->contact->body) < 0) { /* one more attempt */ LM_WARN("failed to parse Contact header.\n"); - return -1; + goto error; } } @@ -473,7 +473,7 @@ static int w_ts_append_by_contact2( tmp_contact.s = (char *)pkg_malloc(tmp_contact.len + 1); if(tmp_contact.s == NULL) { PKG_MEM_ERROR; - return -1; + goto error; } memcpy(tmp_contact.s, ((struct contact_body *)_msg->contact->parsed)->contacts->uri.s, @@ -485,7 +485,7 @@ static int w_ts_append_by_contact2( < 0) { /* one more attempt */ LM_ERR("problems when calling ts_append_contact(), cannot copy " "Contact parameter.\n"); - return -1; + goto error; } } } @@ -499,6 +499,18 @@ static int w_ts_append_by_contact2( pkg_free(tmp_contact.s); return rc; + +error: + if(ruri.s != NULL) { + pkg_free(ruri.s); + } + if(contact.s != NULL) { + pkg_free(contact.s); + } + if(tmp_contact.s != NULL) { + pkg_free(tmp_contact.s); + } + return -1; } /** @@ -521,11 +533,11 @@ static int ki_ts_append_by_contact(sip_msg_t *_msg, str *_table, str *_ruri) /* parse Contact header */ if((!_msg->contact && parse_headers(_msg, HDR_CONTACT_F, 0) != 0) || !_msg->contact) - return -1; + goto error; if(_msg->contact) { if(parse_contact(_msg->contact) < 0) - return -1; + goto error; if(parse_uri(((struct contact_body *)_msg->contact->parsed) ->contacts->uri.s, ((struct contact_body *)_msg->contact->parsed) @@ -533,7 +545,7 @@ static int ki_ts_append_by_contact(sip_msg_t *_msg, str *_table, str *_ruri) &curi) != 0) { if(ts_check_uri(&_msg->contact->body) < 0) /* one more attempt */ - return -1; + goto error; } tmp_contact.len = ((struct contact_body *)_msg->contact->parsed) @@ -541,7 +553,7 @@ static int ki_ts_append_by_contact(sip_msg_t *_msg, str *_table, str *_ruri) tmp_contact.s = (char *)pkg_malloc(tmp_contact.len + 1); if(tmp_contact.s == NULL) { PKG_MEM_ERROR; - return -1; + goto error; } memcpy(tmp_contact.s, ((struct contact_body *)_msg->contact->parsed)->contacts->uri.s, @@ -551,7 +563,7 @@ static int ki_ts_append_by_contact(sip_msg_t *_msg, str *_table, str *_ruri) if(pkg_str_dup(&contact, &tmp_contact) < 0) { if(pkg_str_dup(&contact, &_msg->contact->body) < 0) /* one more attempt */ - return -1; + goto error; } } @@ -563,6 +575,18 @@ static int ki_ts_append_by_contact(sip_msg_t *_msg, str *_table, str *_ruri) pkg_free(tmp_contact.s); return rc; + +error: + if(ruri.s != NULL) { + pkg_free(ruri.s); + } + if(contact.s != NULL) { + pkg_free(contact.s); + } + if(tmp_contact.s != NULL) { + pkg_free(tmp_contact.s); + } + return -1; } /** @@ -601,27 +625,33 @@ static int w_ts_append_by_contact3( if(ts_check_uri(&ruri) < 0) { LM_ERR("failed to parse R-URI.\n"); + pkg_free(ruri.s); return -1; } /* parse Contact header */ if(fixup_get_svalue(_msg, (gparam_t *)_contact, &contact_fixed) != 0) { LM_ERR("failed to convert contact parameter\n"); + pkg_free(ruri.s); return -1; } if(contact_fixed.s == NULL || contact_fixed.len <= 0) { LM_ERR("invalid contact parameter value\n"); + pkg_free(ruri.s); return -1; } if(pkg_str_dup(&contact, &contact_fixed) < 0) { LM_ERR("failed to copy r-uri parameter\n"); + pkg_free(ruri.s); return -1; } if(ts_check_uri(&contact) < 0) { LM_ERR("failed to parse Contact parameter.\n"); + pkg_free(ruri.s); + pkg_free(contact.s); return -1; } @@ -646,16 +676,22 @@ static int ki_ts_append_by_contact_uri( int rc; /* parse R-URI */ - if(ts_check_uri(_ruri) < 0) + if(ts_check_uri(_ruri) < 0) { return -1; - if(pkg_str_dup(&ruri, _ruri) < 0) + } + if(pkg_str_dup(&ruri, _ruri) < 0) { return -1; + } /* parse Contact header */ - if(ts_check_uri(_contact) < 0) + if(ts_check_uri(_contact) < 0) { + pkg_free(ruri.s); return -1; - if(pkg_str_dup(&contact, _contact) < 0) + } + if(pkg_str_dup(&contact, _contact) < 0) { + pkg_free(ruri.s); return -1; + } /* contact must be of syntax: sip:@: with no parameters list */ rc = ts_append(_msg, &ruri, &contact, _table->s); diff --git a/src/modules/xmlrpc/xmlrpc.c b/src/modules/xmlrpc/xmlrpc.c index 347af5658..ac6f9a2a1 100644 --- a/src/modules/xmlrpc/xmlrpc.c +++ b/src/modules/xmlrpc/xmlrpc.c @@ -2019,7 +2019,7 @@ static int rpc_struct_printf( struct rpc_struct *s, char *member_name, char *fmt, ...) { int n, buf_size; - char *buf; + char *buf = NULL; va_list ap; str st, name; struct xmlrpc_reply *reply; @@ -2071,6 +2071,7 @@ static int rpc_struct_printf( if(add_xmlrpc_reply(out, &member_suffix) < 0) goto err; + mxr_free(buf); return 0; } /* Else try again with more space. */ @@ -2085,7 +2086,7 @@ static int rpc_struct_printf( goto err; } } - return 0; + err: if(buf) mxr_free(buf); @@ -2740,7 +2741,7 @@ static int ki_xmlrpc_reply(sip_msg_t *msg, int rcode, str *reason) if(add_xmlrpc_reply(&reply, &int_suffix) < 0) goto error; if(add_xmlrpc_reply(&reply, &success_suffix) < 0) - return -1; + goto error; } if(send_reply(msg, &reply.body) < 0) goto error; diff --git a/src/modules/xprint/xp_lib.c b/src/modules/xprint/xp_lib.c index a5610a26c..59c2d8730 100644 --- a/src/modules/xprint/xp_lib.c +++ b/src/modules/xprint/xp_lib.c @@ -56,7 +56,10 @@ static str str_null = STR_STATIC_INIT(""); static str str_empty = STR_STATIC_INIT(""); static str str_per = STR_STATIC_INIT("%"); -static str str_hostname, str_domainname, str_fullname, str_ipaddr; +static str str_hostname = STR_NULL; +static str str_domainname = STR_NULL; +static str str_fullname = STR_NULL; +static str str_ipaddr = STR_NULL; enum xl_host_t { @@ -1834,14 +1837,7 @@ int xl_mod_init() PKG_MEM_ERROR; return -1; } - if(gethostname(s, HOSTNAME_MAX) < 0) { - str_fullname.len = 0; - str_fullname.s = NULL; - str_hostname.len = 0; - str_hostname.s = NULL; - str_domainname.len = 0; - str_domainname.s = NULL; - } else { + if(gethostname(s, HOSTNAME_MAX) >= 0) { str_fullname.len = strlen(s); s = pkg_reallocxf( s, str_fullname.len + 1); /* this will leave the ending \0 */ @@ -1869,8 +1865,6 @@ int xl_mod_init() } } - str_ipaddr.len = 0; - str_ipaddr.s = NULL; if(str_fullname.len) { he = resolvehost(str_fullname.s); if(he) { @@ -1893,6 +1887,7 @@ int xl_mod_init() if(str_ipaddr.s) { memcpy(str_ipaddr.s, s, str_ipaddr.len); str_ipaddr.s[str_ipaddr.len] = '\0'; + break; } else { pkg_free(s); s = NULL; diff --git a/utils/kamctl/db_berkeley/kamailio/nds_trusted_domains b/utils/kamctl/db_berkeley/kamailio/nds_trusted_domains new file mode 100644 index 000000000..945173fcf --- /dev/null +++ b/utils/kamctl/db_berkeley/kamailio/nds_trusted_domains @@ -0,0 +1,12 @@ +METADATA_COLUMNS +id(int) trusted_domain(str) +METADATA_KEY + +METADATA_READONLY +0 +METADATA_LOGFLAGS +0 +METADATA_DEFAULTS +NIL|'' +nds_trusted_domains| +nds_trusted_domains|1 diff --git a/utils/kamctl/db_berkeley/kamailio/s_cscf b/utils/kamctl/db_berkeley/kamailio/s_cscf new file mode 100644 index 000000000..f2b9d3f92 --- /dev/null +++ b/utils/kamctl/db_berkeley/kamailio/s_cscf @@ -0,0 +1,12 @@ +METADATA_COLUMNS +id(int) name(str) s_cscf_uri(str) +METADATA_KEY + +METADATA_READONLY +0 +METADATA_LOGFLAGS +0 +METADATA_DEFAULTS +NIL|''|'' +s_cscf| +s_cscf|1 diff --git a/utils/kamctl/db_berkeley/kamailio/s_cscf_capabilities b/utils/kamctl/db_berkeley/kamailio/s_cscf_capabilities new file mode 100644 index 000000000..38da4a353 --- /dev/null +++ b/utils/kamctl/db_berkeley/kamailio/s_cscf_capabilities @@ -0,0 +1,12 @@ +METADATA_COLUMNS +id(int) id_s_cscf(int) capability(int) +METADATA_KEY + +METADATA_READONLY +0 +METADATA_LOGFLAGS +0 +METADATA_DEFAULTS +NIL|0|0 +s_cscf_capabilities| +s_cscf_capabilities|1 diff --git a/utils/kamctl/db_redis/kamailio/nds_trusted_domains b/utils/kamctl/db_redis/kamailio/nds_trusted_domains new file mode 100644 index 000000000..006103922 --- /dev/null +++ b/utils/kamctl/db_redis/kamailio/nds_trusted_domains @@ -0,0 +1,2 @@ +id/int,trusted_domain/string, +1 diff --git a/utils/kamctl/db_redis/kamailio/s_cscf b/utils/kamctl/db_redis/kamailio/s_cscf new file mode 100644 index 000000000..e35a8e1c2 --- /dev/null +++ b/utils/kamctl/db_redis/kamailio/s_cscf @@ -0,0 +1,2 @@ +id/int,name/string,s_cscf_uri/string, +1 diff --git a/utils/kamctl/db_redis/kamailio/s_cscf_capabilities b/utils/kamctl/db_redis/kamailio/s_cscf_capabilities new file mode 100644 index 000000000..6c070b010 --- /dev/null +++ b/utils/kamctl/db_redis/kamailio/s_cscf_capabilities @@ -0,0 +1,2 @@ +id/int,id_s_cscf/int,capability/int, +1 diff --git a/utils/kamctl/db_sqlite/ims_icscf-create.sql b/utils/kamctl/db_sqlite/ims_icscf-create.sql new file mode 100644 index 000000000..18b433fe3 --- /dev/null +++ b/utils/kamctl/db_sqlite/ims_icscf-create.sql @@ -0,0 +1,25 @@ +CREATE TABLE nds_trusted_domains ( + id INTEGER PRIMARY KEY NOT NULL, + trusted_domain VARCHAR(83) DEFAULT '' NOT NULL +); + +INSERT INTO version (table_name, table_version) values ('nds_trusted_domains','1'); + +CREATE TABLE s_cscf ( + id INTEGER PRIMARY KEY NOT NULL, + name VARCHAR(83) DEFAULT '' NOT NULL, + s_cscf_uri VARCHAR(83) DEFAULT '' NOT NULL +); + +INSERT INTO version (table_name, table_version) values ('s_cscf','1'); + +CREATE TABLE s_cscf_capabilities ( + id INTEGER PRIMARY KEY NOT NULL, + id_s_cscf INTEGER DEFAULT 0 NOT NULL, + capability INTEGER DEFAULT 0 NOT NULL +); + +CREATE INDEX s_cscf_capabilities_idx_capability ON s_cscf_capabilities (capability); +CREATE INDEX s_cscf_capabilities_idx_id_s_cscf ON s_cscf_capabilities (id_s_cscf); + +INSERT INTO version (table_name, table_version) values ('s_cscf_capabilities','1'); diff --git a/utils/kamctl/dbtext/kamailio/nds_trusted_domains b/utils/kamctl/dbtext/kamailio/nds_trusted_domains new file mode 100644 index 000000000..5efb379ff --- /dev/null +++ b/utils/kamctl/dbtext/kamailio/nds_trusted_domains @@ -0,0 +1,2 @@ +id(int,auto) trusted_domain(string) +0:nds_trusted_domains:1 diff --git a/utils/kamctl/dbtext/kamailio/s_cscf b/utils/kamctl/dbtext/kamailio/s_cscf new file mode 100644 index 000000000..6d32c1f1b --- /dev/null +++ b/utils/kamctl/dbtext/kamailio/s_cscf @@ -0,0 +1,2 @@ +id(int,auto) name(string) s_cscf_uri(string) +0:s_cscf:1 diff --git a/utils/kamctl/dbtext/kamailio/s_cscf_capabilities b/utils/kamctl/dbtext/kamailio/s_cscf_capabilities new file mode 100644 index 000000000..a7dfd529b --- /dev/null +++ b/utils/kamctl/dbtext/kamailio/s_cscf_capabilities @@ -0,0 +1,2 @@ +id(int,auto) id_s_cscf(int) capability(int) +0:s_cscf_capabilities:1 diff --git a/utils/kamctl/mongodb/kamailio/nds_trusted_domains.json b/utils/kamctl/mongodb/kamailio/nds_trusted_domains.json new file mode 100644 index 000000000..5cd75fcaf --- /dev/null +++ b/utils/kamctl/mongodb/kamailio/nds_trusted_domains.json @@ -0,0 +1,16 @@ +{ + "name": "nds_trusted_domains", + "version": 1, + "columns": [ + "id": { + "type": "int", + "default": null, + "null": false + }, + "trusted_domain": { + "type": "string", + "default": "", + "null": false + } + ] +} diff --git a/utils/kamctl/mongodb/kamailio/s_cscf.json b/utils/kamctl/mongodb/kamailio/s_cscf.json new file mode 100644 index 000000000..2558ea718 --- /dev/null +++ b/utils/kamctl/mongodb/kamailio/s_cscf.json @@ -0,0 +1,21 @@ +{ + "name": "s_cscf", + "version": 1, + "columns": [ + "id": { + "type": "int", + "default": null, + "null": false + }, + "name": { + "type": "string", + "default": "", + "null": false + }, + "s_cscf_uri": { + "type": "string", + "default": "", + "null": false + } + ] +} diff --git a/utils/kamctl/mongodb/kamailio/s_cscf_capabilities.json b/utils/kamctl/mongodb/kamailio/s_cscf_capabilities.json new file mode 100644 index 000000000..c94ae631b --- /dev/null +++ b/utils/kamctl/mongodb/kamailio/s_cscf_capabilities.json @@ -0,0 +1,21 @@ +{ + "name": "s_cscf_capabilities", + "version": 1, + "columns": [ + "id": { + "type": "int", + "default": null, + "null": false + }, + "id_s_cscf": { + "type": "int", + "default": 0, + "null": false + }, + "capability": { + "type": "int", + "default": 0, + "null": false + } + ] +} diff --git a/utils/kamctl/mysql/ims_icscf-create.sql b/utils/kamctl/mysql/ims_icscf-create.sql new file mode 100644 index 000000000..f8c76f243 --- /dev/null +++ b/utils/kamctl/mysql/ims_icscf-create.sql @@ -0,0 +1,25 @@ +CREATE TABLE `nds_trusted_domains` ( + `id` INT(10) AUTO_INCREMENT PRIMARY KEY NOT NULL, + `trusted_domain` VARCHAR(83) DEFAULT '' NOT NULL +); + +INSERT INTO version (table_name, table_version) values ('nds_trusted_domains','1'); + +CREATE TABLE `s_cscf` ( + `id` INT(10) AUTO_INCREMENT PRIMARY KEY NOT NULL, + `name` VARCHAR(83) DEFAULT '' NOT NULL, + `s_cscf_uri` VARCHAR(83) DEFAULT '' NOT NULL +); + +INSERT INTO version (table_name, table_version) values ('s_cscf','1'); + +CREATE TABLE `s_cscf_capabilities` ( + `id` INT(10) AUTO_INCREMENT PRIMARY KEY NOT NULL, + `id_s_cscf` INT(11) DEFAULT 0 NOT NULL, + `capability` INT(11) DEFAULT 0 NOT NULL +); + +CREATE INDEX idx_capability ON s_cscf_capabilities (`capability`); +CREATE INDEX idx_id_s_cscf ON s_cscf_capabilities (`id_s_cscf`); + +INSERT INTO version (table_name, table_version) values ('s_cscf_capabilities','1'); diff --git a/utils/kamctl/oracle/ims_icscf-create.sql b/utils/kamctl/oracle/ims_icscf-create.sql new file mode 100644 index 000000000..e988b5b2a --- /dev/null +++ b/utils/kamctl/oracle/ims_icscf-create.sql @@ -0,0 +1,49 @@ +CREATE TABLE nds_trusted_domains ( + id NUMBER(10) PRIMARY KEY, + trusted_domain VARCHAR2(83) DEFAULT '' +); + +CREATE OR REPLACE TRIGGER nds_trusted_domains_tr +before insert on nds_trusted_domains FOR EACH ROW +BEGIN + auto_id(:NEW.id); +END nds_trusted_domains_tr; +/ +BEGIN map2users('nds_trusted_domains'); END; +/ +INSERT INTO version (table_name, table_version) values ('nds_trusted_domains','1'); + +CREATE TABLE s_cscf ( + id NUMBER(10) PRIMARY KEY, + name VARCHAR2(83) DEFAULT '', + s_cscf_uri VARCHAR2(83) DEFAULT '' +); + +CREATE OR REPLACE TRIGGER s_cscf_tr +before insert on s_cscf FOR EACH ROW +BEGIN + auto_id(:NEW.id); +END s_cscf_tr; +/ +BEGIN map2users('s_cscf'); END; +/ +INSERT INTO version (table_name, table_version) values ('s_cscf','1'); + +CREATE TABLE s_cscf_capabilities ( + id NUMBER(10) PRIMARY KEY, + id_s_cscf NUMBER(10) DEFAULT 0 NOT NULL, + capability NUMBER(10) DEFAULT 0 NOT NULL +); + +CREATE OR REPLACE TRIGGER s_cscf_capabilities_tr +before insert on s_cscf_capabilities FOR EACH ROW +BEGIN + auto_id(:NEW.id); +END s_cscf_capabilities_tr; +/ +BEGIN map2users('s_cscf_capabilities'); END; +/ +CREATE INDEX ORA_idx_capability ON s_cscf_capabilities (capability); +CREATE INDEX ORA_idx_id_s_cscf ON s_cscf_capabilities (id_s_cscf); + +INSERT INTO version (table_name, table_version) values ('s_cscf_capabilities','1'); diff --git a/utils/kamctl/postgres/ims_icscf-create.sql b/utils/kamctl/postgres/ims_icscf-create.sql new file mode 100644 index 000000000..f8bb8030d --- /dev/null +++ b/utils/kamctl/postgres/ims_icscf-create.sql @@ -0,0 +1,25 @@ +CREATE TABLE nds_trusted_domains ( + id SERIAL PRIMARY KEY NOT NULL, + trusted_domain VARCHAR(83) DEFAULT '' NOT NULL +); + +INSERT INTO version (table_name, table_version) values ('nds_trusted_domains','1'); + +CREATE TABLE s_cscf ( + id SERIAL PRIMARY KEY NOT NULL, + name VARCHAR(83) DEFAULT '' NOT NULL, + s_cscf_uri VARCHAR(83) DEFAULT '' NOT NULL +); + +INSERT INTO version (table_name, table_version) values ('s_cscf','1'); + +CREATE TABLE s_cscf_capabilities ( + id SERIAL PRIMARY KEY NOT NULL, + id_s_cscf INTEGER DEFAULT 0 NOT NULL, + capability INTEGER DEFAULT 0 NOT NULL +); + +CREATE INDEX s_cscf_capabilities_idx_capability ON s_cscf_capabilities (capability); +CREATE INDEX s_cscf_capabilities_idx_id_s_cscf ON s_cscf_capabilities (id_s_cscf); + +INSERT INTO version (table_name, table_version) values ('s_cscf_capabilities','1'); diff --git a/utils/kamctl/xhttp_pi/acc-mod b/utils/kamctl/xhttp_pi/acc-mod index a7d058c08..5485b15de 100644 --- a/utils/kamctl/xhttp_pi/acc-mod +++ b/utils/kamctl/xhttp_pi/acc-mod @@ -1,4 +1,4 @@ - + acc show acc @@ -51,7 +51,7 @@ - + acc_cdrs show acc_cdrs @@ -92,7 +92,7 @@ - + missed_calls show missed_calls diff --git a/utils/kamctl/xhttp_pi/alias_db-mod b/utils/kamctl/xhttp_pi/alias_db-mod index c59a1befb..62c97d72b 100644 --- a/utils/kamctl/xhttp_pi/alias_db-mod +++ b/utils/kamctl/xhttp_pi/alias_db-mod @@ -1,4 +1,4 @@ - + dbaliases show dbaliases diff --git a/utils/kamctl/xhttp_pi/auth_db-mod b/utils/kamctl/xhttp_pi/auth_db-mod index e1b966631..019d367cb 100644 --- a/utils/kamctl/xhttp_pi/auth_db-mod +++ b/utils/kamctl/xhttp_pi/auth_db-mod @@ -1,4 +1,4 @@ - + subscriber show subscriber diff --git a/utils/kamctl/xhttp_pi/avpops-mod b/utils/kamctl/xhttp_pi/avpops-mod index 9b8b6da74..845714526 100644 --- a/utils/kamctl/xhttp_pi/avpops-mod +++ b/utils/kamctl/xhttp_pi/avpops-mod @@ -1,4 +1,4 @@ - + usr_preferences show usr_preferences diff --git a/utils/kamctl/xhttp_pi/carrierroute-mod b/utils/kamctl/xhttp_pi/carrierroute-mod index e170941af..0623cf1c3 100644 --- a/utils/kamctl/xhttp_pi/carrierroute-mod +++ b/utils/kamctl/xhttp_pi/carrierroute-mod @@ -1,4 +1,4 @@ - + carrierroute show carrierroute @@ -63,7 +63,7 @@ - + carrierfailureroute show carrierfailureroute @@ -122,7 +122,7 @@ - + carrier_name show carrier_name @@ -157,7 +157,7 @@ - + domain_name show domain_name diff --git a/utils/kamctl/xhttp_pi/cpl-mod b/utils/kamctl/xhttp_pi/cpl-mod index 33e1cb303..a35dc31d3 100644 --- a/utils/kamctl/xhttp_pi/cpl-mod +++ b/utils/kamctl/xhttp_pi/cpl-mod @@ -1,4 +1,4 @@ - + cpl show cpl diff --git a/utils/kamctl/xhttp_pi/dialog-mod b/utils/kamctl/xhttp_pi/dialog-mod index fec8aef9e..db4295cb8 100644 --- a/utils/kamctl/xhttp_pi/dialog-mod +++ b/utils/kamctl/xhttp_pi/dialog-mod @@ -1,4 +1,4 @@ - + dialog show dialog @@ -99,7 +99,7 @@ - + dialog_vars show dialog_vars diff --git a/utils/kamctl/xhttp_pi/dialplan-mod b/utils/kamctl/xhttp_pi/dialplan-mod index 87d853f9c..c84f022e7 100644 --- a/utils/kamctl/xhttp_pi/dialplan-mod +++ b/utils/kamctl/xhttp_pi/dialplan-mod @@ -1,4 +1,4 @@ - + dialplan show dialplan diff --git a/utils/kamctl/xhttp_pi/dispatcher-mod b/utils/kamctl/xhttp_pi/dispatcher-mod index 9a63dbc67..b24acda44 100644 --- a/utils/kamctl/xhttp_pi/dispatcher-mod +++ b/utils/kamctl/xhttp_pi/dispatcher-mod @@ -1,4 +1,4 @@ - + dispatcher show dispatcher diff --git a/utils/kamctl/xhttp_pi/domain-mod b/utils/kamctl/xhttp_pi/domain-mod index 040a96aed..10049b306 100644 --- a/utils/kamctl/xhttp_pi/domain-mod +++ b/utils/kamctl/xhttp_pi/domain-mod @@ -1,4 +1,4 @@ - + domain show domain @@ -39,7 +39,7 @@ - + domain_attrs show domain_attrs diff --git a/utils/kamctl/xhttp_pi/domainpolicy-mod b/utils/kamctl/xhttp_pi/domainpolicy-mod index 1e2b1e92b..93bf0fd8e 100644 --- a/utils/kamctl/xhttp_pi/domainpolicy-mod +++ b/utils/kamctl/xhttp_pi/domainpolicy-mod @@ -1,4 +1,4 @@ - + domainpolicy show domainpolicy diff --git a/utils/kamctl/xhttp_pi/drouting-mod b/utils/kamctl/xhttp_pi/drouting-mod index 11739f463..0d95ab170 100644 --- a/utils/kamctl/xhttp_pi/drouting-mod +++ b/utils/kamctl/xhttp_pi/drouting-mod @@ -1,4 +1,4 @@ - + dr_gateways show dr_gateways @@ -48,7 +48,7 @@ - + dr_rules show dr_rules @@ -101,7 +101,7 @@ - + dr_gw_lists show dr_gw_lists @@ -139,7 +139,7 @@ - + dr_groups show dr_groups diff --git a/utils/kamctl/xhttp_pi/group-mod b/utils/kamctl/xhttp_pi/group-mod index b99bc21c7..3f71a7552 100644 --- a/utils/kamctl/xhttp_pi/group-mod +++ b/utils/kamctl/xhttp_pi/group-mod @@ -1,4 +1,4 @@ - + grp show grp @@ -42,7 +42,7 @@ - + re_grp show re_grp diff --git a/utils/kamctl/xhttp_pi/htable-mod b/utils/kamctl/xhttp_pi/htable-mod index fa330bb85..c01eee869 100644 --- a/utils/kamctl/xhttp_pi/htable-mod +++ b/utils/kamctl/xhttp_pi/htable-mod @@ -1,4 +1,4 @@ - + htable show htable diff --git a/utils/kamctl/xhttp_pi/imc-mod b/utils/kamctl/xhttp_pi/imc-mod index 4109b6abd..f4fc9e251 100644 --- a/utils/kamctl/xhttp_pi/imc-mod +++ b/utils/kamctl/xhttp_pi/imc-mod @@ -1,4 +1,4 @@ - + imc_rooms show imc_rooms @@ -39,7 +39,7 @@ - + imc_members show imc_members diff --git a/utils/kamctl/xhttp_pi/ims_icscf-mod b/utils/kamctl/xhttp_pi/ims_icscf-mod new file mode 100644 index 000000000..9bb4f8f10 --- /dev/null +++ b/utils/kamctl/xhttp_pi/ims_icscf-mod @@ -0,0 +1,111 @@ + + nds_trusted_domains + show + nds_trusted_domains + DB1_QUERY + + idupdate + trusted_domain + + + add + nds_trusted_domains + DB1_INSERT + + trusted_domain + + + update + nds_trusted_domains + DB1_UPDATE + + id= + + + trusted_domain + + + delete + nds_trusted_domains + DB1_DELETE + + id= + + + + + s_cscf + show + s_cscf + DB1_QUERY + + idupdate + name + s_cscf_uri + + + add + s_cscf + DB1_INSERT + + name + s_cscf_uri + + + update + s_cscf + DB1_UPDATE + + id= + + + name + s_cscf_uri + + + delete + s_cscf + DB1_DELETE + + id= + + + + + s_cscf_capabilities + show + s_cscf_capabilities + DB1_QUERY + + idupdate + id_s_cscf + capability + + + add + s_cscf_capabilities + DB1_INSERT + + id_s_cscf + capability + + + update + s_cscf_capabilities + DB1_UPDATE + + id= + + + id_s_cscf + capability + + + delete + s_cscf_capabilities + DB1_DELETE + + id= + + + diff --git a/utils/kamctl/xhttp_pi/ims_icscf-table b/utils/kamctl/xhttp_pi/ims_icscf-table new file mode 100644 index 000000000..1c78977bb --- /dev/null +++ b/utils/kamctl/xhttp_pi/ims_icscf-table @@ -0,0 +1,23 @@ + + + nds_trusted_domains + mysql + idDB1_INT + trusted_domainDB1_STR + + + + s_cscf + mysql + idDB1_INT + nameDB1_STR + s_cscf_uriDB1_STR + + + + s_cscf_capabilities + mysql + idDB1_INT + id_s_cscfDB1_INT + capabilityDB1_INT + diff --git a/utils/kamctl/xhttp_pi/lcr-mod b/utils/kamctl/xhttp_pi/lcr-mod index f9876b612..b329d1f9d 100644 --- a/utils/kamctl/xhttp_pi/lcr-mod +++ b/utils/kamctl/xhttp_pi/lcr-mod @@ -1,4 +1,4 @@ - + lcr_gw show lcr_gw @@ -69,7 +69,7 @@ - + lcr_rule_target show lcr_rule_target @@ -116,7 +116,7 @@ - + lcr_rule show lcr_rule diff --git a/utils/kamctl/xhttp_pi/matrix-mod b/utils/kamctl/xhttp_pi/matrix-mod index 808f3d861..a5607b3f6 100644 --- a/utils/kamctl/xhttp_pi/matrix-mod +++ b/utils/kamctl/xhttp_pi/matrix-mod @@ -1,4 +1,4 @@ - + matrix show matrix diff --git a/utils/kamctl/xhttp_pi/mohqueue-mod b/utils/kamctl/xhttp_pi/mohqueue-mod index f26475cf0..bb8981e2b 100644 --- a/utils/kamctl/xhttp_pi/mohqueue-mod +++ b/utils/kamctl/xhttp_pi/mohqueue-mod @@ -1,4 +1,4 @@ - + mohqcalls show mohqcalls @@ -48,7 +48,7 @@ - + mohqueues show mohqueues diff --git a/utils/kamctl/xhttp_pi/msilo-mod b/utils/kamctl/xhttp_pi/msilo-mod index acfe004b1..e79dcc0b8 100644 --- a/utils/kamctl/xhttp_pi/msilo-mod +++ b/utils/kamctl/xhttp_pi/msilo-mod @@ -1,4 +1,4 @@ - + silo show silo diff --git a/utils/kamctl/xhttp_pi/mtree-mod b/utils/kamctl/xhttp_pi/mtree-mod index 8faf525b3..8118b52f7 100644 --- a/utils/kamctl/xhttp_pi/mtree-mod +++ b/utils/kamctl/xhttp_pi/mtree-mod @@ -1,4 +1,4 @@ - + mtree show mtree @@ -36,7 +36,7 @@ - + mtrees show mtrees diff --git a/utils/kamctl/xhttp_pi/pdt-mod b/utils/kamctl/xhttp_pi/pdt-mod index 2eaf839d8..991fa088d 100644 --- a/utils/kamctl/xhttp_pi/pdt-mod +++ b/utils/kamctl/xhttp_pi/pdt-mod @@ -1,4 +1,4 @@ - + pdt show pdt diff --git a/utils/kamctl/xhttp_pi/permissions-mod b/utils/kamctl/xhttp_pi/permissions-mod index 5bbd4bfd5..4e62446bd 100644 --- a/utils/kamctl/xhttp_pi/permissions-mod +++ b/utils/kamctl/xhttp_pi/permissions-mod @@ -1,4 +1,4 @@ - + trusted show trusted @@ -48,7 +48,7 @@ - + address show address diff --git a/utils/kamctl/xhttp_pi/pi_framework.xml b/utils/kamctl/xhttp_pi/pi_framework.xml index 95180efed..eea514219 100644 --- a/utils/kamctl/xhttp_pi/pi_framework.xml +++ b/utils/kamctl/xhttp_pi/pi_framework.xml @@ -341,6 +341,29 @@ roomDB1_STR flagDB1_INT + + + nds_trusted_domains + mysql + idDB1_INT + trusted_domainDB1_STR + + + + s_cscf + mysql + idDB1_INT + nameDB1_STR + s_cscf_uriDB1_STR + + + + s_cscf_capabilities + mysql + idDB1_INT + id_s_cscfDB1_INT + capabilityDB1_INT + lcr_gw @@ -1033,7 +1056,7 @@ - '!=' '!=' --> - + acc show acc @@ -1086,7 +1109,7 @@ - + acc_cdrs show acc_cdrs @@ -1127,7 +1150,7 @@ - + missed_calls show missed_calls @@ -1180,7 +1203,7 @@ - + dbaliases show dbaliases @@ -1224,7 +1247,7 @@ - + subscriber show subscriber @@ -1271,7 +1294,7 @@ - + usr_preferences show usr_preferences @@ -1324,7 +1347,7 @@ - + carrierroute show carrierroute @@ -1389,7 +1412,7 @@ - + carrierfailureroute show carrierfailureroute @@ -1448,7 +1471,7 @@ - + carrier_name show carrier_name @@ -1483,7 +1506,7 @@ - + domain_name show domain_name @@ -1518,7 +1541,7 @@ - + cpl show cpl @@ -1562,7 +1585,7 @@ - + dialog show dialog @@ -1663,7 +1686,7 @@ - + dialog_vars show dialog_vars @@ -1707,7 +1730,7 @@ - + dialplan show dialplan @@ -1763,7 +1786,7 @@ - + dispatcher show dispatcher @@ -1813,7 +1836,7 @@ - + domain show domain @@ -1854,7 +1877,7 @@ - + domain_attrs show domain_attrs @@ -1901,7 +1924,7 @@ - + domainpolicy show domainpolicy @@ -1948,7 +1971,7 @@ - + dr_gateways show dr_gateways @@ -1998,7 +2021,7 @@ - + dr_rules show dr_rules @@ -2051,7 +2074,7 @@ - + dr_gw_lists show dr_gw_lists @@ -2089,7 +2112,7 @@ - + dr_groups show dr_groups @@ -2133,7 +2156,7 @@ - + grp show grp @@ -2177,7 +2200,7 @@ - + re_grp show re_grp @@ -2215,7 +2238,7 @@ - + htable show htable @@ -2262,7 +2285,7 @@ - + imc_rooms show imc_rooms @@ -2303,7 +2326,7 @@ - + imc_members show imc_members @@ -2347,7 +2370,118 @@ - + + nds_trusted_domains + show + nds_trusted_domains + DB1_QUERY + + idupdate + trusted_domain + + + add + nds_trusted_domains + DB1_INSERT + + trusted_domain + + + update + nds_trusted_domains + DB1_UPDATE + + id= + + + trusted_domain + + + delete + nds_trusted_domains + DB1_DELETE + + id= + + + + + s_cscf + show + s_cscf + DB1_QUERY + + idupdate + name + s_cscf_uri + + + add + s_cscf + DB1_INSERT + + name + s_cscf_uri + + + update + s_cscf + DB1_UPDATE + + id= + + + name + s_cscf_uri + + + delete + s_cscf + DB1_DELETE + + id= + + + + + s_cscf_capabilities + show + s_cscf_capabilities + DB1_QUERY + + idupdate + id_s_cscf + capability + + + add + s_cscf_capabilities + DB1_INSERT + + id_s_cscf + capability + + + update + s_cscf_capabilities + DB1_UPDATE + + id= + + + id_s_cscf + capability + + + delete + s_cscf_capabilities + DB1_DELETE + + id= + + + + lcr_gw show lcr_gw @@ -2418,7 +2552,7 @@ - + lcr_rule_target show lcr_rule_target @@ -2465,7 +2599,7 @@ - + lcr_rule show lcr_rule @@ -2518,7 +2652,7 @@ - + matrix show matrix @@ -2559,7 +2693,7 @@ - + mohqcalls show mohqcalls @@ -2609,7 +2743,7 @@ - + mohqueues show mohqueues @@ -2656,7 +2790,7 @@ - + silo show silo @@ -2724,7 +2858,7 @@ - + mtree show mtree @@ -2762,7 +2896,7 @@ - + mtrees show mtrees @@ -2803,7 +2937,7 @@ - + pdt show pdt @@ -2844,7 +2978,7 @@ - + trusted show trusted @@ -2894,7 +3028,7 @@ - + address show address @@ -2941,7 +3075,7 @@ - + pl_pipes show pl_pipes @@ -2982,7 +3116,7 @@ - + presentity show presentity @@ -3044,7 +3178,7 @@ - + active_watchers show active_watchers @@ -3154,7 +3288,7 @@ - + watchers show watchers @@ -3207,7 +3341,7 @@ - + xcap show xcap @@ -3263,7 +3397,7 @@ - + pua show pua @@ -3349,7 +3483,7 @@ - + purplemap show purplemap @@ -3393,7 +3527,7 @@ - + aliases show aliases @@ -3491,7 +3625,7 @@ - + rls_presentity show rls_presentity @@ -3547,7 +3681,7 @@ - + rls_watchers show rls_watchers @@ -3648,7 +3782,7 @@ - + rtpengine show rtpengine @@ -3695,7 +3829,7 @@ - + rtpproxy show rtpproxy @@ -3742,7 +3876,7 @@ - + sca_subscriptions show sca_subscriptions @@ -3813,7 +3947,7 @@ - + secfilter show secfilter @@ -3854,7 +3988,7 @@ - + sip_trace show sip_trace @@ -3922,7 +4056,7 @@ - + speed_dial show speed_dial @@ -3978,7 +4112,7 @@ - + version show version @@ -4016,7 +4150,7 @@ - + topos_d show topos_d @@ -4120,7 +4254,7 @@ - + topos_t show topos_t @@ -4227,7 +4361,7 @@ - + uacreg show uacreg @@ -4304,7 +4438,7 @@ - + uid_credentials show uid_credentials @@ -4360,7 +4494,7 @@ - + uid_user_attrs show uid_user_attrs @@ -4407,7 +4541,7 @@ - + uid_domain show uid_domain @@ -4448,7 +4582,7 @@ - + uid_domain_attrs show uid_domain_attrs @@ -4495,7 +4629,7 @@ - + uid_global_attrs show uid_global_attrs @@ -4539,7 +4673,7 @@ - + uid_uri show uid_uri @@ -4586,7 +4720,7 @@ - + uid_uri_attrs show uid_uri_attrs @@ -4639,7 +4773,7 @@ - + uri show uri @@ -4683,7 +4817,7 @@ - + userblocklist show userblocklist @@ -4727,7 +4861,7 @@ - + globalblocklist show globalblocklist @@ -4768,7 +4902,7 @@ - + location show location @@ -4866,7 +5000,7 @@ - + location_attrs show location_attrs diff --git a/utils/kamctl/xhttp_pi/pipelimit-mod b/utils/kamctl/xhttp_pi/pipelimit-mod index 48fdea63a..a2f3686fa 100644 --- a/utils/kamctl/xhttp_pi/pipelimit-mod +++ b/utils/kamctl/xhttp_pi/pipelimit-mod @@ -1,4 +1,4 @@ - + pl_pipes show pl_pipes diff --git a/utils/kamctl/xhttp_pi/presence-mod b/utils/kamctl/xhttp_pi/presence-mod index 59a58fa07..652c2a421 100644 --- a/utils/kamctl/xhttp_pi/presence-mod +++ b/utils/kamctl/xhttp_pi/presence-mod @@ -1,4 +1,4 @@ - + presentity show presentity @@ -60,7 +60,7 @@ - + active_watchers show active_watchers @@ -170,7 +170,7 @@ - + watchers show watchers @@ -223,7 +223,7 @@ - + xcap show xcap @@ -279,7 +279,7 @@ - + pua show pua diff --git a/utils/kamctl/xhttp_pi/purple-mod b/utils/kamctl/xhttp_pi/purple-mod index c2e9edde4..b54a802a8 100644 --- a/utils/kamctl/xhttp_pi/purple-mod +++ b/utils/kamctl/xhttp_pi/purple-mod @@ -1,4 +1,4 @@ - + purplemap show purplemap diff --git a/utils/kamctl/xhttp_pi/registrar-mod b/utils/kamctl/xhttp_pi/registrar-mod index 747675fc6..c5aad1091 100644 --- a/utils/kamctl/xhttp_pi/registrar-mod +++ b/utils/kamctl/xhttp_pi/registrar-mod @@ -1,4 +1,4 @@ - + aliases show aliases diff --git a/utils/kamctl/xhttp_pi/rls-mod b/utils/kamctl/xhttp_pi/rls-mod index 92d72b96e..dada3b76e 100644 --- a/utils/kamctl/xhttp_pi/rls-mod +++ b/utils/kamctl/xhttp_pi/rls-mod @@ -1,4 +1,4 @@ - + rls_presentity show rls_presentity @@ -54,7 +54,7 @@ - + rls_watchers show rls_watchers diff --git a/utils/kamctl/xhttp_pi/rtpengine-mod b/utils/kamctl/xhttp_pi/rtpengine-mod index c9680f7d7..df9eafce9 100644 --- a/utils/kamctl/xhttp_pi/rtpengine-mod +++ b/utils/kamctl/xhttp_pi/rtpengine-mod @@ -1,4 +1,4 @@ - + rtpengine show rtpengine diff --git a/utils/kamctl/xhttp_pi/rtpproxy-mod b/utils/kamctl/xhttp_pi/rtpproxy-mod index 18860d4d2..c13a40ee8 100644 --- a/utils/kamctl/xhttp_pi/rtpproxy-mod +++ b/utils/kamctl/xhttp_pi/rtpproxy-mod @@ -1,4 +1,4 @@ - + rtpproxy show rtpproxy diff --git a/utils/kamctl/xhttp_pi/sca-mod b/utils/kamctl/xhttp_pi/sca-mod index d774b40fd..0aed314d1 100644 --- a/utils/kamctl/xhttp_pi/sca-mod +++ b/utils/kamctl/xhttp_pi/sca-mod @@ -1,4 +1,4 @@ - + sca_subscriptions show sca_subscriptions diff --git a/utils/kamctl/xhttp_pi/secfilter-mod b/utils/kamctl/xhttp_pi/secfilter-mod index abad1bc50..3a45d6d42 100644 --- a/utils/kamctl/xhttp_pi/secfilter-mod +++ b/utils/kamctl/xhttp_pi/secfilter-mod @@ -1,4 +1,4 @@ - + secfilter show secfilter diff --git a/utils/kamctl/xhttp_pi/siptrace-mod b/utils/kamctl/xhttp_pi/siptrace-mod index 09d62d305..ce7e1cc64 100644 --- a/utils/kamctl/xhttp_pi/siptrace-mod +++ b/utils/kamctl/xhttp_pi/siptrace-mod @@ -1,4 +1,4 @@ - + sip_trace show sip_trace diff --git a/utils/kamctl/xhttp_pi/speeddial-mod b/utils/kamctl/xhttp_pi/speeddial-mod index d452b0fb7..883c7dfd8 100644 --- a/utils/kamctl/xhttp_pi/speeddial-mod +++ b/utils/kamctl/xhttp_pi/speeddial-mod @@ -1,4 +1,4 @@ - + speed_dial show speed_dial diff --git a/utils/kamctl/xhttp_pi/standard-mod b/utils/kamctl/xhttp_pi/standard-mod index 11d90d2a3..95b1068e9 100644 --- a/utils/kamctl/xhttp_pi/standard-mod +++ b/utils/kamctl/xhttp_pi/standard-mod @@ -1,4 +1,4 @@ - + version show version diff --git a/utils/kamctl/xhttp_pi/topos-mod b/utils/kamctl/xhttp_pi/topos-mod index 55004e12c..cfae6af96 100644 --- a/utils/kamctl/xhttp_pi/topos-mod +++ b/utils/kamctl/xhttp_pi/topos-mod @@ -1,4 +1,4 @@ - + topos_d show topos_d @@ -102,7 +102,7 @@ - + topos_t show topos_t diff --git a/utils/kamctl/xhttp_pi/uac-mod b/utils/kamctl/xhttp_pi/uac-mod index c1017f540..284be1b47 100644 --- a/utils/kamctl/xhttp_pi/uac-mod +++ b/utils/kamctl/xhttp_pi/uac-mod @@ -1,4 +1,4 @@ - + uacreg show uacreg diff --git a/utils/kamctl/xhttp_pi/uid_auth_db-mod b/utils/kamctl/xhttp_pi/uid_auth_db-mod index 2f538898b..93cbea723 100644 --- a/utils/kamctl/xhttp_pi/uid_auth_db-mod +++ b/utils/kamctl/xhttp_pi/uid_auth_db-mod @@ -1,4 +1,4 @@ - + uid_credentials show uid_credentials diff --git a/utils/kamctl/xhttp_pi/uid_avp_db-mod b/utils/kamctl/xhttp_pi/uid_avp_db-mod index d419d74d6..61dfb043b 100644 --- a/utils/kamctl/xhttp_pi/uid_avp_db-mod +++ b/utils/kamctl/xhttp_pi/uid_avp_db-mod @@ -1,4 +1,4 @@ - + uid_user_attrs show uid_user_attrs diff --git a/utils/kamctl/xhttp_pi/uid_domain-mod b/utils/kamctl/xhttp_pi/uid_domain-mod index e4a058b1b..639b68b64 100644 --- a/utils/kamctl/xhttp_pi/uid_domain-mod +++ b/utils/kamctl/xhttp_pi/uid_domain-mod @@ -1,4 +1,4 @@ - + uid_domain show uid_domain @@ -39,7 +39,7 @@ - + uid_domain_attrs show uid_domain_attrs diff --git a/utils/kamctl/xhttp_pi/uid_gflags-mod b/utils/kamctl/xhttp_pi/uid_gflags-mod index d11f09ba7..a856f4cc1 100644 --- a/utils/kamctl/xhttp_pi/uid_gflags-mod +++ b/utils/kamctl/xhttp_pi/uid_gflags-mod @@ -1,4 +1,4 @@ - + uid_global_attrs show uid_global_attrs diff --git a/utils/kamctl/xhttp_pi/uid_uri_db-mod b/utils/kamctl/xhttp_pi/uid_uri_db-mod index dab23a8e1..b9de6f2a6 100644 --- a/utils/kamctl/xhttp_pi/uid_uri_db-mod +++ b/utils/kamctl/xhttp_pi/uid_uri_db-mod @@ -1,4 +1,4 @@ - + uid_uri show uid_uri @@ -45,7 +45,7 @@ - + uid_uri_attrs show uid_uri_attrs diff --git a/utils/kamctl/xhttp_pi/uri_db-mod b/utils/kamctl/xhttp_pi/uri_db-mod index 36ac282ce..d396f34da 100644 --- a/utils/kamctl/xhttp_pi/uri_db-mod +++ b/utils/kamctl/xhttp_pi/uri_db-mod @@ -1,4 +1,4 @@ - + uri show uri diff --git a/utils/kamctl/xhttp_pi/userblocklist-mod b/utils/kamctl/xhttp_pi/userblocklist-mod index 1affb5d8e..bd9347734 100644 --- a/utils/kamctl/xhttp_pi/userblocklist-mod +++ b/utils/kamctl/xhttp_pi/userblocklist-mod @@ -1,4 +1,4 @@ - + userblocklist show userblocklist @@ -42,7 +42,7 @@ - + globalblocklist show globalblocklist diff --git a/utils/kamctl/xhttp_pi/usrloc-mod b/utils/kamctl/xhttp_pi/usrloc-mod index bfc2c9359..9f456baeb 100644 --- a/utils/kamctl/xhttp_pi/usrloc-mod +++ b/utils/kamctl/xhttp_pi/usrloc-mod @@ -1,4 +1,4 @@ - + location show location @@ -96,7 +96,7 @@ - + location_attrs show location_attrs