From 37a2a8923004fb67fb77c7c6762818d15758c317 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Mon, 7 Jul 2025 16:57:43 +0200 Subject: [PATCH] MT#63077 Remove already applied upstream patches and refresh old ones Upgrading to 6.0.2 * sipwise/lost-add-method-parameter-to-http_connect-calls.patch: rework Change-Id: I2b43c934f1b9897174dcda9c434c1cbb586858bd --- .../patches/debian/no_lib64_on_64_bits.patch | 2 +- debian/patches/series | 7 +- .../patches/sipwise/add_check_avp_name.patch | 12 +++- .../patches/sipwise/add_lcr_rate_module.patch | 24 +++++-- debian/patches/sipwise/add_tcap_module.patch | 12 +++- .../cfgutils-allow-lock_set_size-14.patch | 2 +- ...rt-profile_get_size-for-all-profiles.patch | 4 +- .../sipwise/kamctl-TMPDIR-config.patch | 4 +- ...thod-parameter-to-http_connect-calls.patch | 17 +++-- .../sipwise/sca-add-pai_avp-parameter.patch | 6 +- .../sipwise/sca-call-info-unsubscribe.patch | 10 +-- debian/patches/sipwise/sca-debug.patch | 24 +++---- .../sipwise/sca-fix-notify-after-bye.patch | 4 +- ...on-hold-detection-when-upstream-flow.patch | 6 +- .../sca-fix-pickup-when-upstream-flow.patch | 16 ++--- .../patches/sipwise/sca-rr-is-direction.patch | 18 ++--- ...presence_dfks-add-missing-definition.patch | 21 ------ ...cription.rr.s-separately-since-it-co.patch | 71 ------------------- 18 files changed, 97 insertions(+), 163 deletions(-) delete mode 100644 debian/patches/upstream/presence_dfks-add-missing-definition.patch delete mode 100644 debian/patches/upstream/sca-reserve-subscription.rr.s-separately-since-it-co.patch diff --git a/debian/patches/debian/no_lib64_on_64_bits.patch b/debian/patches/debian/no_lib64_on_64_bits.patch index 13d61d6e8..7881804b1 100644 --- a/debian/patches/debian/no_lib64_on_64_bits.patch +++ b/debian/patches/debian/no_lib64_on_64_bits.patch @@ -7,7 +7,7 @@ Subject: no_lib64_on_64_bits 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Makefile.defs b/src/Makefile.defs -index 7d91127..8fcde6e 100644 +index 855f83c..56309f7 100644 --- a/src/Makefile.defs +++ b/src/Makefile.defs @@ -454,15 +454,7 @@ endif diff --git a/debian/patches/series b/debian/patches/series index 53d66dac2..d41b7b1ef 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -26,10 +26,6 @@ sipwise/sca-fix-on-hold-detection-when-upstream-flow.patch sipwise/sca-debug.patch sipwise/sca-fix-notify-after-bye.patch sipwise/sca-add-pai_avp-parameter.patch -# -## 6.0 branch -upstream/presence_dfks-add-missing-definition.patch -upstream/sca-reserve-subscription.rr.s-separately-since-it-co.patch ## upstream master # ### relevant for upstream @@ -48,6 +44,7 @@ sipwise/usrloc-don-t-synchronize-on-destroy-for-DB_ONLY.patch sipwise/presence_offline_cleanup.patch ### active development sipwise/permissions-don-t-allow-reloads-in-the-middle-of-ong.patch +sipwise/add_check_avp_name.patch ### Don't just put stuff in any order ### use gbp pq import/export tooling to help maintain patches ### @@ -64,4 +61,4 @@ sipwise/permissions-don-t-allow-reloads-in-the-middle-of-ong.patch ## git checkout -- debian/ ### git commit + git-review as usual ### -sipwise/add_check_avp_name.patch + diff --git a/debian/patches/sipwise/add_check_avp_name.patch b/debian/patches/sipwise/add_check_avp_name.patch index d67536a2a..0cab3983b 100644 --- a/debian/patches/sipwise/add_check_avp_name.patch +++ b/debian/patches/sipwise/add_check_avp_name.patch @@ -1,6 +1,16 @@ +From: Sipwise Development Team +Date: Mon, 7 Jul 2025 16:31:45 +0200 +Subject: add_check_avp_name + +--- + src/core/usr_avp.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/core/usr_avp.c b/src/core/usr_avp.c +index d189669..aafe7e7 100644 --- a/src/core/usr_avp.c +++ b/src/core/usr_avp.c -@@ -391,6 +391,10 @@ static inline int match_by_id(avp_t *avp +@@ -391,6 +391,10 @@ static inline int match_by_id(avp_t *avp, avp_id_t id) static inline int match_by_name(avp_t *avp, avp_id_t id, str *name) { str *avp_name; diff --git a/debian/patches/sipwise/add_lcr_rate_module.patch b/debian/patches/sipwise/add_lcr_rate_module.patch index 1f905fb80..2f5e71ea2 100644 --- a/debian/patches/sipwise/add_lcr_rate_module.patch +++ b/debian/patches/sipwise/add_lcr_rate_module.patch @@ -12,9 +12,11 @@ Subject: add_lcr_rate_module create mode 100644 src/modules/lcr_rate/Makefile create mode 100644 src/modules/lcr_rate/lcr_rate_mod.c +diff --git a/src/Makefile.groups b/src/Makefile.groups +index fae0dbd..f54d81d 100644 --- a/src/Makefile.groups +++ b/src/Makefile.groups -@@ -109,6 +109,9 @@ +@@ -109,6 +109,9 @@ mod_list_sctp=sctp # - modules depending on openssl library mod_list_autheph=auth_ephemeral @@ -24,7 +26,7 @@ Subject: add_lcr_rate_module # - modules related to SIMPLE presence extensions mod_list_presence=presence presence_conference presence_dialoginfo \ presence_mwi presence_profile presence_reginfo \ -@@ -287,8 +290,8 @@ +@@ -287,8 +290,8 @@ mod_list_all=$(sort $(mod_list_basic) $(mod_list_extra) \ $(mod_list_microhttpd) \ $(mod_list_nghttp2) \ $(mod_list_gcrypt) \ @@ -35,7 +37,7 @@ Subject: add_lcr_rate_module ### --- Groups defined for source code compilation ### -@@ -345,6 +348,8 @@ +@@ -345,6 +348,8 @@ module_group_cassandra=$(module_group_cassandra_driver) $(module_group_db) module_group_ignore= $(sort $(filter-out $(module_group_default), $(mod_list_all))) @@ -44,9 +46,11 @@ Subject: add_lcr_rate_module ### --- Groups defined for pacKaging ### +diff --git a/src/core/mod_fix.c b/src/core/mod_fix.c +index 767c6a4..d0f1841 100644 --- a/src/core/mod_fix.c +++ b/src/core/mod_fix.c -@@ -598,6 +598,7 @@ +@@ -598,6 +598,7 @@ int fixup_free_igp_spve(void **param, int param_no) FIXUP_F_SPVE_T(spve_spve, 1, 2, 2, 0) FIXUP_F_SPVE_T(spve_uint, 1, 2, 1, FPARAM_INT) FIXUP_F_SPVE_T(spve_str, 1, 2, 1, FPARAM_STR) @@ -54,7 +58,7 @@ Subject: add_lcr_rate_module FIXUP_F_SPVE_T(spve_null, 1, 1, 1, 0) /** get the corresp. fixup_free* function. -@@ -644,6 +645,8 @@ +@@ -644,6 +645,8 @@ free_fixup_function mod_fix_get_fixup_free(fixup_function f) return 0; if(f == fixup_spve_str) return fixup_free_spve_str; @@ -63,9 +67,11 @@ Subject: add_lcr_rate_module return 0; } +diff --git a/src/core/mod_fix.h b/src/core/mod_fix.h +index 6ec0280..26968a7 100644 --- a/src/core/mod_fix.h +++ b/src/core/mod_fix.h -@@ -138,6 +138,8 @@ +@@ -138,6 +138,8 @@ int fixup_spve_uint(void **param, int param_no); int fixup_free_spve_uint(void **param, int param_no); int fixup_spve_str(void **param, int param_no); int fixup_free_spve_str(void **param, int param_no); @@ -74,6 +80,9 @@ Subject: add_lcr_rate_module int fixup_spve_all(void **param, int param_no); int fixup_free_spve_all(void **param, int param_no); +diff --git a/src/modules/lcr_rate/Makefile b/src/modules/lcr_rate/Makefile +new file mode 100644 +index 0000000..9a3cee1 --- /dev/null +++ b/src/modules/lcr_rate/Makefile @@ -0,0 +1,9 @@ @@ -86,6 +95,9 @@ Subject: add_lcr_rate_module +LIBS+=-lswrate + +include ../../Makefile.modules +diff --git a/src/modules/lcr_rate/lcr_rate_mod.c b/src/modules/lcr_rate/lcr_rate_mod.c +new file mode 100644 +index 0000000..7c32acf --- /dev/null +++ b/src/modules/lcr_rate/lcr_rate_mod.c @@ -0,0 +1,517 @@ diff --git a/debian/patches/sipwise/add_tcap_module.patch b/debian/patches/sipwise/add_tcap_module.patch index 2cfe2c2cc..2366b7963 100644 --- a/debian/patches/sipwise/add_tcap_module.patch +++ b/debian/patches/sipwise/add_tcap_module.patch @@ -10,9 +10,11 @@ Subject: add_tcap_module create mode 100644 src/modules/tcap/Makefile create mode 100644 src/modules/tcap/tcap_mod.c +diff --git a/src/Makefile.groups b/src/Makefile.groups +index f54d81d..6242bb7 100644 --- a/src/Makefile.groups +++ b/src/Makefile.groups -@@ -208,6 +208,9 @@ +@@ -208,6 +208,9 @@ mod_list_erlang=erlang # - modules depending on systemd library mod_list_systemd=log_systemd systemdops @@ -22,7 +24,7 @@ Subject: add_tcap_module # - modules depending on libnsq (+libev libevbuffsock libcurl libjson-c) library mod_list_nsq=nsq -@@ -351,6 +354,9 @@ +@@ -351,6 +354,9 @@ module_group_ignore= $(sort $(filter-out $(module_group_default), $(mod_list_all # pkg lcrrate module module_group_klcrrate=$(mod_list_lcrrate) @@ -32,6 +34,9 @@ Subject: add_tcap_module ### --- Groups defined for pacKaging ### # Standard modules in main pkg +diff --git a/src/modules/tcap/Makefile b/src/modules/tcap/Makefile +new file mode 100644 +index 0000000..d1e7b4d --- /dev/null +++ b/src/modules/tcap/Makefile @@ -0,0 +1,9 @@ @@ -44,6 +49,9 @@ Subject: add_tcap_module +LIBS+=-ltcap + +include ../../Makefile.modules +diff --git a/src/modules/tcap/tcap_mod.c b/src/modules/tcap/tcap_mod.c +new file mode 100644 +index 0000000..c0a726b --- /dev/null +++ b/src/modules/tcap/tcap_mod.c @@ -0,0 +1,392 @@ diff --git a/debian/patches/sipwise/cfgutils-allow-lock_set_size-14.patch b/debian/patches/sipwise/cfgutils-allow-lock_set_size-14.patch index 011c514ec..c6ed1b1e2 100644 --- a/debian/patches/sipwise/cfgutils-allow-lock_set_size-14.patch +++ b/debian/patches/sipwise/cfgutils-allow-lock_set_size-14.patch @@ -7,7 +7,7 @@ Subject: cfgutils: allow lock_set_size > 14 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/src/modules/cfgutils/cfgutils.c b/src/modules/cfgutils/cfgutils.c -index fd0a5e5..ececa12 100644 +index 2d3809e..1b42d1e 100644 --- a/src/modules/cfgutils/cfgutils.c +++ b/src/modules/cfgutils/cfgutils.c @@ -4,6 +4,7 @@ diff --git a/debian/patches/sipwise/dialog-support-profile_get_size-for-all-profiles.patch b/debian/patches/sipwise/dialog-support-profile_get_size-for-all-profiles.patch index 5393a944b..43a3429b4 100644 --- a/debian/patches/sipwise/dialog-support-profile_get_size-for-all-profiles.patch +++ b/debian/patches/sipwise/dialog-support-profile_get_size-for-all-profiles.patch @@ -111,10 +111,10 @@ index 209c4ea..fd71c30 100644 /*! * \brief Search a dialog profile in the global list diff --git a/src/modules/dialog/doc/dialog_admin.xml b/src/modules/dialog/doc/dialog_admin.xml -index 4a522cd..ee6933c 100644 +index 2653f15..4486405 100644 --- a/src/modules/dialog/doc/dialog_admin.xml +++ b/src/modules/dialog/doc/dialog_admin.xml -@@ -3067,6 +3067,28 @@ dlg_set_state("early"); +@@ -3070,6 +3070,28 @@ dlg_set_state("early"); diff --git a/debian/patches/sipwise/kamctl-TMPDIR-config.patch b/debian/patches/sipwise/kamctl-TMPDIR-config.patch index e6d0c0d76..bd2db212a 100644 --- a/debian/patches/sipwise/kamctl-TMPDIR-config.patch +++ b/debian/patches/sipwise/kamctl-TMPDIR-config.patch @@ -13,7 +13,7 @@ Subject: kamctl: TMPDIR config 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl -index f9a7d92..ddf5a9d 100755 +index 63a221c..8d5d7c8 100755 --- a/utils/kamctl/kamctl +++ b/utils/kamctl/kamctl @@ -80,6 +80,10 @@ if [ -z "$STARTUP_CONFIG_FILE" ]; then @@ -99,7 +99,7 @@ index f7408b5..478864a 100644 trap "rm $path; clear; echo monitor ^C-ed; exit 1" 2 attempt=0 diff --git a/utils/kamctl/kamdbctl b/utils/kamctl/kamdbctl -index d5713f1..d876c2c 100755 +index a0ececd..4648364 100755 --- a/utils/kamctl/kamdbctl +++ b/utils/kamctl/kamdbctl @@ -303,7 +303,7 @@ case $1 in diff --git a/debian/patches/sipwise/lost-add-method-parameter-to-http_connect-calls.patch b/debian/patches/sipwise/lost-add-method-parameter-to-http_connect-calls.patch index 637db2cf5..5a70fc039 100644 --- a/debian/patches/sipwise/lost-add-method-parameter-to-http_connect-calls.patch +++ b/debian/patches/sipwise/lost-add-method-parameter-to-http_connect-calls.patch @@ -7,19 +7,18 @@ Subject: lost: add method parameter to http_connect() calls 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/lost/functions.c b/src/modules/lost/functions.c -index 96886db..b57adf5 100644 +index 278f5ea69..e84904798 100644 --- a/src/modules/lost/functions.c +++ b/src/modules/lost/functions.c -@@ -190,7 +190,7 @@ int lost_held_function(struct sip_msg *_m, char *_con, char *_pidf, char *_url, - str geo = STR_NULL; /* return value geolocation uri */ - str res = STR_NULL; /* return value pidf */ - str err = STR_NULL; /* return value error */ -- +@@ -192,6 +192,7 @@ int lost_held_function(struct sip_msg *_ + str res = STR_NULL; /* return value pidf */ + str err = STR_NULL; /* return value error */ + + str method = str_init("POST"); str url = STR_NULL; str did = STR_NULL; str que = STR_NULL; -@@ -294,7 +294,7 @@ int lost_held_function(struct sip_msg *_m, char *_con, char *_pidf, char *_url, +@@ -295,7 +296,7 @@ int lost_held_function(struct sip_msg *_ LM_DBG("using connection [%.*s]\n", con.len, con.s); /* send via connection */ @@ -28,7 +27,7 @@ index 96886db..b57adf5 100644 } else { /* we have no connection ... do a NAPTR lookup */ if(lost_parse_host(did.s, &host, &flag) > 0) { -@@ -821,6 +821,7 @@ int lost_function(struct sip_msg *_m, char *_con, char *_uri, char *_name, +@@ -814,6 +815,7 @@ int lost_function(struct sip_msg *_m, ch str err = STR_NULL; /* return value error */ str tmp = STR_NULL; @@ -36,7 +35,7 @@ index 96886db..b57adf5 100644 str url = STR_NULL; str urn = STR_NULL; str req = STR_NULL; -@@ -1095,7 +1096,7 @@ int lost_function(struct sip_msg *_m, char *_con, char *_uri, char *_name, +@@ -1088,7 +1090,7 @@ int lost_function(struct sip_msg *_m, ch pkg_free(urlrep); /* clean up */ urlrep = NULL; } else { diff --git a/debian/patches/sipwise/sca-add-pai_avp-parameter.patch b/debian/patches/sipwise/sca-add-pai_avp-parameter.patch index 75d8f10cf..4d066a65c 100644 --- a/debian/patches/sipwise/sca-add-pai_avp-parameter.patch +++ b/debian/patches/sipwise/sca-add-pai_avp-parameter.patch @@ -59,10 +59,10 @@ index f57dcd6..18049cd 100644 typedef struct _sca_config sca_config; diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index 0152847..37bed99 100644 +index 8aaca65..fdaba18 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -1145,20 +1145,33 @@ static int sca_call_info_insert_asserted_identity( +@@ -1146,20 +1146,33 @@ static int sca_call_info_insert_asserted_identity( str aor = STR_NULL; str hdr = STR_NULL; int len; @@ -102,7 +102,7 @@ index 0152847..37bed99 100644 #define SCA_P_ASSERTED_IDENTITY_HDR_PREFIX "P-Asserted-Identity: " #define SCA_P_ASSERTED_IDENTITY_HDR_PREFIX_LEN strlen("P-Asserted-Identity: ") -@@ -1204,7 +1217,7 @@ static int sca_call_info_insert_asserted_identity( +@@ -1205,7 +1218,7 @@ static int sca_call_info_insert_asserted_identity( rc = 1; done: diff --git a/debian/patches/sipwise/sca-call-info-unsubscribe.patch b/debian/patches/sipwise/sca-call-info-unsubscribe.patch index 7a9716ddf..424b5fb3c 100644 --- a/debian/patches/sipwise/sca-call-info-unsubscribe.patch +++ b/debian/patches/sipwise/sca-call-info-unsubscribe.patch @@ -7,10 +7,10 @@ Subject: sca-call-info-unsubscribe 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/modules/sca/sca_subscribe.c b/src/modules/sca/sca_subscribe.c -index ca42fd1..8cddf7c 100644 +index 5e34cea..844b918 100644 --- a/src/modules/sca/sca_subscribe.c +++ b/src/modules/sca/sca_subscribe.c -@@ -1172,6 +1172,8 @@ int ki_sca_handle_subscribe_uris(sip_msg_t *msg, str *uri_to, str *uri_from) +@@ -1178,6 +1178,8 @@ int ki_sca_handle_subscribe_uris(sip_msg_t *msg, str *uri_to, str *uri_from) int released = 0; int_str val; sca_to_body_t tmp_to; @@ -19,7 +19,7 @@ index ca42fd1..8cddf7c 100644 memset(&tmp_to, 0, sizeof(tmp_to)); if(parse_headers(msg, HDR_EOH_F, 0) < 0) { -@@ -1267,12 +1269,17 @@ int ki_sca_handle_subscribe_uris(sip_msg_t *msg, str *uri_to, str *uri_from) +@@ -1273,12 +1275,17 @@ int ki_sca_handle_subscribe_uris(sip_msg_t *msg, str *uri_to, str *uri_from) } } @@ -39,7 +39,7 @@ index ca42fd1..8cddf7c 100644 // this will remove the subscription if expires == 0 if(sca_subscription_update_unsafe(sca, sub, &req_sub, idx) < 0) { SCA_SUB_REPLY_ERROR(sca, 500, -@@ -1328,10 +1335,25 @@ int ki_sca_handle_subscribe_uris(sip_msg_t *msg, str *uri_to, str *uri_from) +@@ -1334,10 +1341,25 @@ int ki_sca_handle_subscribe_uris(sip_msg_t *msg, str *uri_to, str *uri_from) if(released) { LM_INFO("released %d appearances for subscriber %.*s\n", released, STR_FMT(&req_sub.subscriber)); @@ -65,7 +65,7 @@ index ca42fd1..8cddf7c 100644 // in-dialog request, but we didn't find it. if(!SCA_STR_EMPTY(to_tag)) { SCA_SUB_REPLY_ERROR( -@@ -1370,6 +1392,8 @@ int ki_sca_handle_subscribe_uris(sip_msg_t *msg, str *uri_to, str *uri_from) +@@ -1376,6 +1398,8 @@ int ki_sca_handle_subscribe_uris(sip_msg_t *msg, str *uri_to, str *uri_from) // we got an in-dialog SUBSCRIBE with an "Expires: 0" header, // but the dialog wasn't in our table. just reply with the // subscription info we got, without saving or creating anything. diff --git a/debian/patches/sipwise/sca-debug.patch b/debian/patches/sipwise/sca-debug.patch index c70a4484c..c725c7919 100644 --- a/debian/patches/sipwise/sca-debug.patch +++ b/debian/patches/sipwise/sca-debug.patch @@ -47,10 +47,10 @@ index fcc94c4..79f56ba 100644 } } diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index 74f091c..b90b893 100644 +index 7d64cc4..e687060 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -982,6 +982,8 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -983,6 +983,8 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, if(!upstream && !SCA_CALL_INFO_IS_SHARED_CALLER(call_info)) { // caller isn't SCA, no more to do. update callee in reply handler. @@ -59,7 +59,7 @@ index 74f091c..b90b893 100644 rc = 1; goto done; } -@@ -999,6 +1001,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -1000,6 +1002,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, } if(sca_call_is_held(msg)) { @@ -67,7 +67,7 @@ index 74f091c..b90b893 100644 state = SCA_APPEARANCE_STATE_HELD; if(call_info->state == SCA_APPEARANCE_STATE_HELD_PRIVATE) { state = SCA_APPEARANCE_STATE_HELD_PRIVATE; -@@ -1007,13 +1010,17 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -1008,13 +1011,17 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, } } else if(!SCA_STR_EMPTY(&to->tag_value)) { // this is a reINVITE from an SCA line that put the call on hold @@ -85,7 +85,7 @@ index 74f091c..b90b893 100644 } } -@@ -1186,6 +1193,8 @@ static int sca_call_info_insert_asserted_identity( +@@ -1187,6 +1194,8 @@ static int sca_call_info_insert_asserted_identity( memcpy(hdr.s + hdr.len, CRLF, CRLF_LEN); hdr.len += CRLF_LEN; @@ -94,7 +94,7 @@ index 74f091c..b90b893 100644 // append the PAI header before the sdp body if(insert_new_lump_before(anchor, hdr.s, hdr.len, HDR_PAI_T) == NULL) { LM_ERR("Failed to add PAI header %.*s\n", STR_FMT(&hdr)); -@@ -1227,11 +1236,19 @@ static int sca_call_info_invite_reply_200_handler(sip_msg_t *msg, +@@ -1228,11 +1237,19 @@ static int sca_call_info_invite_reply_200_handler(sip_msg_t *msg, if(SCA_CALL_INFO_IS_SHARED_CALLEE(call_info) && (!SCA_STR_EQ(from_aor, to_aor))) { @@ -114,7 +114,7 @@ index 74f091c..b90b893 100644 goto done; } -@@ -1259,6 +1276,8 @@ static int sca_call_info_invite_reply_200_handler(sip_msg_t *msg, +@@ -1260,6 +1277,8 @@ static int sca_call_info_invite_reply_200_handler(sip_msg_t *msg, &from->tag_value, NULL, slot_idx); if(app == NULL) { // no SCA line is involved with this call @@ -123,7 +123,7 @@ index 74f091c..b90b893 100644 rc = 1; goto done; } -@@ -1433,6 +1452,8 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) +@@ -1434,6 +1453,8 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) sca_appearance_update_state_unsafe(app, state); // can't send NOTIFYs until we unlock the slot below } @@ -132,7 +132,7 @@ index 74f091c..b90b893 100644 } done: -@@ -1600,7 +1621,11 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, +@@ -1601,7 +1622,11 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, str *tag = NULL; if(msg->first_line.type == SIP_REQUEST) { @@ -144,7 +144,7 @@ index 74f091c..b90b893 100644 slot_idx = sca_uri_lock_shared_appearance(sca, from_aor); if(slot_idx < 0) { LM_ERR("sca_call_info_bye_handler: failed to acquire " -@@ -1654,6 +1679,10 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, +@@ -1655,6 +1680,10 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, goto done; } } @@ -155,7 +155,7 @@ index 74f091c..b90b893 100644 } if(slot_idx >= 0) { -@@ -1709,6 +1738,7 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, +@@ -1710,6 +1739,7 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, } } } else { @@ -163,7 +163,7 @@ index 74f091c..b90b893 100644 // this is just a backup to catch anything missed on the BYE request if(SCA_CALL_INFO_IS_SHARED_CALLEE(call_info)) { slot_idx = sca_hash_table_index_for_key(sca->appearances, to_aor); -@@ -2100,28 +2130,37 @@ int sca_call_info_update( +@@ -2101,28 +2131,37 @@ int sca_call_info_update( if(sca_uri_is_shared_appearance(sca, &from_aor)) { if((update_mask & SCA_CALL_INFO_SHARED_CALLER)) { call_info.ua_shared |= SCA_CALL_INFO_SHARED_CALLER; diff --git a/debian/patches/sipwise/sca-fix-notify-after-bye.patch b/debian/patches/sipwise/sca-fix-notify-after-bye.patch index 1c6d49603..bd4b3e8e8 100644 --- a/debian/patches/sipwise/sca-fix-notify-after-bye.patch +++ b/debian/patches/sipwise/sca-fix-notify-after-bye.patch @@ -7,10 +7,10 @@ Subject: sca-fix-notify-after-bye 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index b90b893..0152847 100644 +index e687060..8aaca65 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -721,7 +721,7 @@ static int sca_call_info_uri_update(str *aor, sca_call_info *call_info, +@@ -722,7 +722,7 @@ static int sca_call_info_uri_update(str *aor, sca_call_info *call_info, dialog.id.s = dlg_buf; if(sca_dialog_build_from_tags( diff --git a/debian/patches/sipwise/sca-fix-on-hold-detection-when-upstream-flow.patch b/debian/patches/sipwise/sca-fix-on-hold-detection-when-upstream-flow.patch index e7f4bcf91..34ac21c52 100644 --- a/debian/patches/sipwise/sca-fix-on-hold-detection-when-upstream-flow.patch +++ b/debian/patches/sipwise/sca-fix-on-hold-detection-when-upstream-flow.patch @@ -7,10 +7,10 @@ Subject: sca-fix-on-hold-detection-when-upstream-flow 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index 15a032b..74f091c 100644 +index ccbc877..7d64cc4 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -955,11 +955,13 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -956,11 +956,13 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, int state = SCA_APPEARANCE_STATE_UNKNOWN; int rc = -1; str *target_aor = from_aor; @@ -24,7 +24,7 @@ index 15a032b..74f091c 100644 } LM_DBG("For From-AOR %.*s To-AOR: %.*s: From: <%.*s> To: <%.*s> " -@@ -978,7 +980,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -979,7 +981,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, goto done; } diff --git a/debian/patches/sipwise/sca-fix-pickup-when-upstream-flow.patch b/debian/patches/sipwise/sca-fix-pickup-when-upstream-flow.patch index 752edd152..8e8911a1b 100644 --- a/debian/patches/sipwise/sca-fix-pickup-when-upstream-flow.patch +++ b/debian/patches/sipwise/sca-fix-pickup-when-upstream-flow.patch @@ -7,10 +7,10 @@ Subject: sca-fix-pickup-when-upstream-flow 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index aec5493..15a032b 100644 +index fc9d039..ccbc877 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -954,6 +954,13 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -955,6 +955,13 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, str state_str = STR_NULL; int state = SCA_APPEARANCE_STATE_UNKNOWN; int rc = -1; @@ -24,7 +24,7 @@ index aec5493..15a032b 100644 LM_DBG("For From-AOR %.*s To-AOR: %.*s: From: <%.*s> To: <%.*s> " "Contact: <%.*s> Call-Info: appearance-index=%d\n", -@@ -967,7 +974,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -968,7 +975,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, < 0) { LM_ERR("sca_call_info_invite_request_handler: failed to register " "callback for INVITE %.*s ACK\n", @@ -33,7 +33,7 @@ index aec5493..15a032b 100644 goto done; } -@@ -985,7 +992,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -986,7 +993,7 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, < 0) { LM_ERR("sca_call_info_invite_request_handler: failed to register " "callback for INVITE %.*s ACK\n", @@ -42,7 +42,7 @@ index aec5493..15a032b 100644 goto done; } -@@ -1018,16 +1025,16 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, +@@ -1019,16 +1026,16 @@ int sca_call_info_invite_request_handler(sip_msg_t *msg, } if(sca_appearance_update_index( @@ -63,7 +63,7 @@ index aec5493..15a032b 100644 goto done; } -@@ -1372,6 +1379,7 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) +@@ -1373,6 +1380,7 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) str *tag; int slot_idx = -1; int state = SCA_APPEARANCE_STATE_IDLE; @@ -71,7 +71,7 @@ index aec5493..15a032b 100644 memset(&from, 0, sizeof(from)); memset(&to, 0, sizeof(to)); -@@ -1385,19 +1393,24 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) +@@ -1386,19 +1394,24 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) goto done; } @@ -105,7 +105,7 @@ index aec5493..15a032b 100644 STR_FMT(tag)); goto done; } -@@ -1425,10 +1438,10 @@ done: +@@ -1426,10 +1439,10 @@ done: sca_hash_table_unlock_index(sca->appearances, slot_idx); if(state != SCA_APPEARANCE_STATE_IDLE) { diff --git a/debian/patches/sipwise/sca-rr-is-direction.patch b/debian/patches/sipwise/sca-rr-is-direction.patch index e9fec62ac..567a382ce 100644 --- a/debian/patches/sipwise/sca-rr-is-direction.patch +++ b/debian/patches/sipwise/sca-rr-is-direction.patch @@ -47,10 +47,10 @@ index f1f8bf1..f57dcd6 100644 }; typedef struct _sca_mod sca_mod; diff --git a/src/modules/sca/sca_call_info.c b/src/modules/sca/sca_call_info.c -index 3d54711..aec5493 100644 +index 0bf57b6..fc9d039 100644 --- a/src/modules/sca/sca_call_info.c +++ b/src/modules/sca/sca_call_info.c -@@ -1369,6 +1369,7 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) +@@ -1370,6 +1370,7 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) { sca_appearance *app; sca_to_body_t from, to; @@ -58,7 +58,7 @@ index 3d54711..aec5493 100644 int slot_idx = -1; int state = SCA_APPEARANCE_STATE_IDLE; -@@ -1385,13 +1386,19 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) +@@ -1386,13 +1387,19 @@ void sca_call_info_ack_from_handler(sip_msg_t *msg, str *from_aor, str *to_aor) } if(sca_uri_lock_if_shared_appearance(sca, from_aor, &slot_idx)) { @@ -81,7 +81,7 @@ index 3d54711..aec5493 100644 goto done; } -@@ -1436,11 +1443,15 @@ done: +@@ -1437,11 +1444,15 @@ done: /* XXX needs extract routines */ void sca_call_info_ack_cb(struct cell *t, int type, struct tmcb_params *params) { @@ -98,7 +98,7 @@ index 3d54711..aec5493 100644 memset(&to, 0, sizeof(to)); -@@ -1471,8 +1482,18 @@ void sca_call_info_ack_cb(struct cell *t, int type, struct tmcb_params *params) +@@ -1472,8 +1483,18 @@ void sca_call_info_ack_cb(struct cell *t, int type, struct tmcb_params *params) } // on ACK, ensure SCA callee state is promoted to ACTIVE. @@ -119,7 +119,7 @@ index 3d54711..aec5493 100644 if(app && app->state == SCA_APPEARANCE_STATE_ACTIVE_PENDING) { LM_DBG("promoting %.*s appearance-index %d to active\n", STR_FMT(&to_aor), app->index); -@@ -1494,6 +1515,9 @@ done: +@@ -1495,6 +1516,9 @@ done: if(from_aor.s != NULL) { pkg_free(from_aor.s); } @@ -129,7 +129,7 @@ index 3d54711..aec5493 100644 if(to.flags & SCA_UTIL_FLAG_TO_BODY_ALLOC) { free_to(to.hdr); } -@@ -1558,6 +1582,7 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, +@@ -1559,6 +1583,7 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, sca_appearance *app = NULL; int slot_idx = -1; int rc = -1; @@ -137,7 +137,7 @@ index 3d54711..aec5493 100644 if(msg->first_line.type == SIP_REQUEST) { if(SCA_CALL_INFO_IS_SHARED_CALLER(call_info)) { -@@ -1575,14 +1600,20 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, +@@ -1576,14 +1601,20 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, } if(app == NULL) { // try to find it by tags @@ -161,7 +161,7 @@ index 3d54711..aec5493 100644 goto done; } -@@ -1623,8 +1654,14 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, +@@ -1624,8 +1655,14 @@ static int sca_call_info_bye_handler(sip_msg_t *msg, sca_call_info *call_info, goto done; } diff --git a/debian/patches/upstream/presence_dfks-add-missing-definition.patch b/debian/patches/upstream/presence_dfks-add-missing-definition.patch deleted file mode 100644 index 3a6d7c029..000000000 --- a/debian/patches/upstream/presence_dfks-add-missing-definition.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Victor Seva -Date: Wed, 12 Mar 2025 23:09:16 +0100 -Subject: [PATCH] presence_dfks: add missing definition - -(cherry picked from commit fb00af35fa36120491c85d47d3e71b5c6c22a2db) ---- - src/modules/presence_dfks/presence_dfks.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/modules/presence_dfks/presence_dfks.c b/src/modules/presence_dfks/presence_dfks.c -index da72109..1e67ee6 100644 ---- a/src/modules/presence_dfks/presence_dfks.c -+++ b/src/modules/presence_dfks/presence_dfks.c -@@ -46,6 +46,7 @@ MODULE_VERSION - static int mod_init(void); - - /** API structures */ -+add_event_t pres_add_event; - sl_api_t slb; - presence_api_t pres; - pua_api_t pua; diff --git a/debian/patches/upstream/sca-reserve-subscription.rr.s-separately-since-it-co.patch b/debian/patches/upstream/sca-reserve-subscription.rr.s-separately-since-it-co.patch deleted file mode 100644 index 8b0860ecf..000000000 --- a/debian/patches/upstream/sca-reserve-subscription.rr.s-separately-since-it-co.patch +++ /dev/null @@ -1,71 +0,0 @@ -From: Victor Seva -Date: Thu, 22 May 2025 09:04:51 +0200 -Subject: sca: reserve subscription.rr.s separately since it could be updated - -(cherry picked from commit fd04bcc152dd6ef88fbb819b0b77aee7ca817878) ---- - src/modules/sca/sca_subscribe.c | 24 +++++++++++++++--------- - 1 file changed, 15 insertions(+), 9 deletions(-) - -diff --git a/src/modules/sca/sca_subscribe.c b/src/modules/sca/sca_subscribe.c -index 8cddf7c..844b918 100644 ---- a/src/modules/sca/sca_subscribe.c -+++ b/src/modules/sca/sca_subscribe.c -@@ -626,9 +626,6 @@ sca_subscription *sca_subscription_create(str *aor, int event, str *subscriber, - - len += sizeof(sca_subscription); - len += sizeof(char) * (aor->len + subscriber->len); -- if(!SCA_STR_EMPTY(rr)) { -- len += sizeof(char) * rr->len; -- } - - sub = (sca_subscription *)shm_malloc(len); - if(sub == NULL) { -@@ -660,18 +657,20 @@ sca_subscription *sca_subscription_create(str *aor, int event, str *subscriber, - SCA_STR_COPY(&sub->target_aor, aor); - len += aor->len; - -+ // we shm_malloc this parts separately in case we need to update in-memory -+ // info for this subscriber. This is likely to happen if the -+ // subscriber goes off-line for some reason. - if(!SCA_STR_EMPTY(rr)) { -- sub->rr.s = (char *)sub + len; -+ sub->rr.s = (char *)shm_malloc(rr->len); -+ if(sub->rr.s == NULL) { -+ SHM_MEM_ERROR; -+ goto error; -+ } - SCA_STR_COPY(&sub->rr, rr); -- len += rr->len; - } - // dialog.id holds call-id + from-tag + to-tag; dialog.call_id, - // dialog.from_tag, and dialog.to_tag point to offsets within - // dialog.id. -- // -- // we shm_malloc this separately in case we need to update in-memory -- // dialog saved for this subscriber. This is likely to happen if the -- // subscriber goes off-line for some reason. - len = sizeof(char) * (call_id->len + from_tag->len + to_tag->len); - sub->dialog.id.s = (char *)shm_malloc(len); - if(sub->dialog.id.s == NULL) { -@@ -702,6 +701,9 @@ sca_subscription *sca_subscription_create(str *aor, int event, str *subscriber, - - error: - if(sub != NULL) { -+ if(sub->rr.s != NULL) { -+ shm_free(sub->rr.s); -+ } - if(sub->dialog.id.s != NULL) { - shm_free(sub->dialog.id.s); - } -@@ -734,6 +736,10 @@ void sca_subscription_free(void *value) - LM_DBG("Freeing %s subscription from %.*s\n", - sca_event_name_from_type(sub->event), STR_FMT(&sub->subscriber)); - -+ if(!SCA_STR_EMPTY(&sub->rr)) { -+ shm_free(sub->rr.s); -+ } -+ - if(!SCA_STR_EMPTY(&sub->dialog.id)) { - shm_free(sub->dialog.id.s); - }