[kamailio/kamailio] ims_registrar_scscf: add S-CSCF restoration (TS 23.380) (PR #4968)
<!-- Kamailio Pull Request Template --> <!-- IMPORTANT: - for detailed contributing guidelines, read: https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md - pull requests must be done to master branch, unless they are backports of fixes from master branch to a stable branch - backports to stable branches must be done with 'git cherry-pick -x ...' - code is contributed under BSD for core and main components (tm, sl, auth, tls) - code is contributed GPLv2 or a compatible license for the other components - GPL code is contributed with OpenSSL licensing exception --> #### Pre-Submission Checklist <!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply --> <!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above--> <!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list --> - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [x] LLM/AI Coding Assistants were involved in creating the C code or other included content - [x] Code is formatted with `clang-format` using the config file `.clang-format` from source code folder - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated) #### Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality) #### Checklist: <!-- Go over all points below, and after creating the PR, tick the checkboxes that apply --> - [ ] PR should be backported to stable branches - [x] Tested changes locally - [ ] Related to issue #XXXX (replace XXXX with an open issue number) #### Description <!-- Describe your changes in detail --> Back up the Contact and Path at the HSS and fetch them back over Cx, as an alternative to the usrloc database: - REGISTRATION/RE_REGISTRATION SARs carry SCSCF-Restoration-Info and Supported-Features (IMSRestorationInd) - SAA restoration info is restored into usrloc for UNREGISTERED_USER and NO_ASSIGNMENT; DIAMETER_ERROR_IN_ASSIGNMENT_TYPE with restoration info is handled as the restoration answer - new assign_server(route, domain, direction, type) for script-initiated SARs, NO_ASSIGNMENT being the originating restoration case New modparam scscf_restoration_info_enabled, default 0: an HSS without IMSRestorationInd rejects the mandatory Supported-Features AVP. With it off, behaviour is unchanged. Compared to db_mode, this needs no SQL backend (usrloc_db.c uses raw MySQL queries) and lets a replacement S-CSCF sharing the Server-Name recover bindings. Only the first binding per IMPI is restored, with placeholder Call-ID/CSeq and the default expiry, until the UE re-registers. You can view, comment on, or merge this pull request online at: https://github.com/kamailio/kamailio/pull/4968 -- Commit Summary -- * ims_registrar_scscf: add S-CSCF restoration (TS 23.380) -- File Changes -- M src/modules/ims_registrar_scscf/cxdx_avp.c (146) M src/modules/ims_registrar_scscf/cxdx_avp.h (44) M src/modules/ims_registrar_scscf/cxdx_sar.c (147) M src/modules/ims_registrar_scscf/cxdx_sar.h (1) M src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml (121) M src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c (43) M src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.h (1) M src/modules/ims_registrar_scscf/save.c (244) M src/modules/ims_registrar_scscf/save.h (15) M src/modules/ims_registrar_scscf/server_assignment.c (5) M src/modules/ims_usrloc_scscf/ucontact.c (8) -- Patch Links -- https://github.com/kamailio/kamailio/pull/4968.patch https://github.com/kamailio/kamailio/pull/4968.diff -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4968 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968@github.com>
@lyatanski pushed 1 commit. aa3c7ed33d43999921ffd7befec74b6b349c1914 ims_registrar_scscf: add S-CSCF restoration (TS 23.380) -- View it on GitHub: https://github.com/kamailio/kamailio/pull/4968/changes/5c7c5f715538907162af4... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968/before/5c7c5f715538907162af45a78b6478d0781c3050/after/aa3c7ed33d43999921ffd7befec74b6b349c1914@github.com>
lyatanski left a comment (kamailio/kamailio#4968) Hi, any suggestions for improvements or concerns? In general, the change is behind feature flags so it should not have any impact on workflows, unless enabled -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4968#issuecomment-6037241135 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968/c6037241135@github.com>
henningw left a comment (kamailio/kamailio#4968) Thanks for the PR. I had a quick look to the code. There are multiple function calls that don't seem check the return value and can fail (many cxdx_add_avp_list, some snprintf). Checking the return value and possible output an LM_ERR and stopping the function execution would be probably a good idea. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4968#issuecomment-6038840969 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968/c6038840969@github.com>
lyatanski left a comment (kamailio/kamailio#4968) Thank you for taking time to look into it. This is going to be a bit longer explanation, so please bear with me Basically the SCSCF keeps state - the subscriber it services. This state is lost on restart - being it upgrade, crash or god forbid - it is deployed in k8s and it is evicted. The question is how to make it so there will be no service degradation. ### The current state You might ask why not use the already implemented functionality with storing this information in a database and retrieving it on startup. That would be a good question and it has some limitations: - database choice is limited due to hardcoded SQL in `src/modules/ims_usrloc_scscf/usrloc_db.c` lines 87 all the way trough 119 - it is read only on startup. Imagine you want to perform rollout upgrade. The new instance starts and while it becomes ready the state in the old changes. You will be working with stale data We can work on improving these limitations, but it will require schema migration and additional rereading of the database. Possibly in the process making existing users of this functionality unhappy. ### The PR So why not check what the standards recommend. And so it happens in simple terms it says **"the HSS is the source of truth, if the SCSCF feels lost, it could go and ask it". This asking is over Cx interface with Diameter SAR. This PR as adding exactly that functionality.** The benefits are as follows: - standards compliant - no need to connect any database to the SCSCF, we reuse already existing Cx interface - greater flexibility when to go check the data - it is a decision in a routing block in the configuration file - does not change any existing functionality so whoever is happy with their current approach is not affected So in summary, is is alternative approach for something kind of already existing. I hope this helps and I remain available if there are things to improve or clarify. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4968#issuecomment-6056255211 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968/c6056255211@github.com>
henningw left a comment (kamailio/kamailio#4968) Thank you for adding the context, my remark was about some coding topics. I had a question in the other PR from your side (#4976) about the motivation. But thank you, great to have it here included as well! -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4968#issuecomment-6057531884 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968/c6057531884@github.com>
@lyatanski pushed 1 commit. 4ea9121ac6fd0ca144de68378e49903341efafcb ims_registrar_scscf: add S-CSCF restoration (TS 23.380) -- View it on GitHub: https://github.com/kamailio/kamailio/pull/4968/changes/aa3c7ed33d43999921ffd... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968/before/aa3c7ed33d43999921ffd7befec74b6b349c1914/after/4ea9121ac6fd0ca144de68378e49903341efafcb@github.com>
@lyatanski pushed 1 commit. 8979c284bc96bd2285e74cd713a607e8236a5526 ims_registrar_scscf: add S-CSCF restoration (TS 23.380) -- View it on GitHub: https://github.com/kamailio/kamailio/pull/4968/changes/4ea9121ac6fd0ca144de6... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968/before/4ea9121ac6fd0ca144de68378e49903341efafcb/after/8979c284bc96bd2285e74cd713a607e8236a5526@github.com>
lyatanski left a comment (kamailio/kamailio#4968) Thank you, checks added -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4968#issuecomment-6058443757 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968/c6058443757@github.com>
lyatanski left a comment (kamailio/kamailio#4968) Hi, any additional concerns or comments? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4968#issuecomment-6119066764 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968/c6119066764@github.com>
miconda left a comment (kamailio/kamailio#4968) Probably it can be merged if no other comments. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4968#issuecomment-6266716513 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968/c6266716513@github.com>
henningw left a comment (kamailio/kamailio#4968) Thanks again, merged. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4968#issuecomment-6269947802 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968/c6269947802@github.com>
Merged #4968 into master. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4968#event-33655082225 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4968/issue_event/33655082225@github.com>
participants (3)
-
Daniel-Constantin Mierla -
Henning Westerholt -
Lyubomir Yatanski