[kamailio/kamailio] topos: add enable_register_publish (PR #3766)
Added enable_register_publish parameter to enable REGISTER and PUBLISH method for topos If set to 1 REGISTER and PUBLISH will be enabled for topos Currently only via header will be applied for topos and if mask_callid is set to 1 call-ID will be masked. Other headers should be manged by the user as required. <!-- 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, ...) - [ ] Each component has a single commit (if not, squash them into one commit) - [ ] 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) - [ ] 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 - [ ] Tested changes locally - [ ] Related to issue #XXXX (replace XXXX with an open issue number) #### Description <!-- Describe your changes in detail --> You can view, comment on, or merge this pull request online at: https://github.com/kamailio/kamailio/pull/3766 -- Commit Summary -- * add enable_register_publish -- File Changes -- M src/modules/topos/topos_mod.c (2) M src/modules/topos/tps_msg.c (132) M src/modules/topos/tps_msg.h (2) M src/modules/topos/tps_storage.c (6) -- Patch Links -- https://github.com/kamailio/kamailio/pull/3766.patch https://github.com/kamailio/kamailio/pull/3766.diff -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766@github.com>
@toharish pushed 1 commit. 56bfbdfa659f7bc33ecafa35217cd3861f6451a3 Update tps_msg.c -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3766/files/3e66fc6b654b56e15687db0... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/push/17255516833@github.com>
@toharish pushed 1 commit. 1ba8444c45698d2e5d7944d8597abc5af17b80d9 Update tps_storage.c -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3766/files/56bfbdfa659f7bc33ecafa3... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/push/17255575601@github.com>
@toharish pushed 1 commit. 9769806b96148a2ede4612605c6d4af047c137f7 topos:Update tps_msg.c -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3766/files/1ba8444c45698d2e5d7944d... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/push/17463270184@github.com>
From description I understand that only Via is removed for REGISTER (and PUBLISH). The Contact stays the same, in that case Path still has to be used in order to get the traffic back to topos-instance. Also, the incoming Path headers are kept. Is it right? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-1988770264 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c1988770264@github.com>
Interested in that one, as I by chance have an immediate need for it. Will test it today. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-1991461000 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c1991461000@github.com>
From description I understand that only Via is removed for REGISTER (and PUBLISH). The Contact stays the same, in that case Path still has to be used in order to get the traffic back to topos-instance. Also, the incoming Path headers are kept. Is it right? Yes, Via and Call-ID mask is done in this pull request, other headers can be managed in kamailio native script/ksr as per the end user requirement. Registration will have the location information and authentication information, hence it needs to be handled as per requirement.
-- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-1991522529 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c1991522529@github.com>
I tested it for REGISTER, and it seems to break if the registrar sends e.g. a 4xx with no contact back, causing the log line ``` ERROR: topos [tps_storage.c:1407]: tps_db_load_dialog(): invalid dlg uuid provided ``` Is this something you've experienced, @toharish ? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-1991720869 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c1991720869@github.com>
I tested it for REGISTER, and it seems to break if the registrar sends e.g. a 4xx with no contact back, causing the log line
``` ERROR: topos [tps_storage.c:1407]: tps_db_load_dialog(): invalid dlg uuid provided ```
Is this something you've experienced, @toharish ?
Thinking of it: if the Contact is not handled by topos, where is the lookup key `cparam_name` stored? Could it be that this only works with `contact_mode=2`? If so, could you please provide a full example to reprooduce it? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-1992001900 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c1992001900@github.com>
I tested it for REGISTER, and it seems to break if the registrar sends e.g. a 4xx with no contact back, causing the log line ``` ERROR: topos [tps_storage.c:1407]: tps_db_load_dialog(): invalid dlg uuid provided ```
Is this something you've experienced, @toharish ?
Thinking of it: if the Contact is not handled by topos, where is the lookup key `cparam_name` stored? Could it be that this only works with `contact_mode=2`? If so, could you please provide a full example to reprooduce it?
ERROR: topos [tps_storage.c:1407]: tps_db_load_dialog(): invalid dlg uuid provided ,This error was noticed before the last commit [9769806]. After this update it was fine. I have tested with more than 135000 active registrations and many failures. I have used contact_mode=1. In this case contact is stored but not replaced. This can be further worked out to replace the contact, however I felt it may vary based on the user requirement, hence it was left to the users to modify it in the kamailio script as required. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-1992152386 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c1992152386@github.com>
ERROR: topos [tps_storage.c:1407]: tps_db_load_dialog(): invalid dlg uuid provided ,This error was noticed before the last commit [[9769806](https://github.com/kamailio/kamailio/commit/9769806b96148a2ede4612605c6d4af0...)]. After this update it was fine. I have tested with more than 135000 active registrations and many failures.
I'm also getting this with your latest commit. Do you have a bare minimum config that works for you, so I can verify? Also, I've tested with contact_mode=1 too, but for an INVITE, topos adds a `tps=btpsh-xxxx`, do you do this manually? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-1992310266 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c1992310266@github.com>
ERROR: topos [tps_storage.c:1407]: tps_db_load_dialog(): invalid dlg uuid provided ,This error was noticed before the last commit [[9769806](https://github.com/kamailio/kamailio/commit/9769806b96148a2ede4612605c6d4af0...)]. After this update it was fine. I have tested with more than 135000 active registrations and many failures.
I'm also getting this with your latest commit. Do you have a bare minimum config that works for you, so I can verify?
Also, I've tested with contact_mode=1 too, but for an INVITE, topos adds a `tps=btpsh-xxxx`, do you do this manually?
It is not required to add btph/atph to contact as Registration will not create a Dialog for another Indialog Method will not be orginated with this contact. For registration no change is done in the contact field by Topos. modparam("topoh", "mask_key", "THIS_IS_TEST_KEY") modparam("topoh", "mask_callid", 1) modparam("topoh", "callid_prefix", "TXX") modparam("topoh", "use_mode", 1) modparam("topos", "storage", "redis") modparam("topos_redis", "serverid", "tps") modparam("topos", "contact_mode", 1) modparam("topos", "rr_update", 1) modparam("topos", "contact_host", EXTIP ) modparam("topos", "mask_callid", 1) modparam("topos", "enable_register_publish",1) This works perfectly for me, where TOPOS hide Via and mask Call-ID. Form. To and Requst URI chages as done manually/ through Dispatcher ds_select_domaincall in dispatcher. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-1992397254 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c1992397254@github.com>
ERROR: topos [tps_storage.c:1407]: tps_db_load_dialog(): invalid dlg uuid provided ,This error was noticed before the last commit [[9769806](https://github.com/kamailio/kamailio/commit/9769806b96148a2ede4612605c6d4af0...)]. After this update it was fine. I have tested with more than 135000 active registrations and many failures.
I'm also getting this with your latest commit. Do you have a bare minimum config that works for you, so I can verify? Also, I've tested with contact_mode=1 too, but for an INVITE, topos adds a `tps=btpsh-xxxx`, do you do this manually?
It is not required to add btph/atph to contact as Registration will not create a Dialog for another Indialog Method will not be orginated with this contact. For registration no change is done in the contact field by Topos.
modparam("topoh", "mask_key", "THIS_IS_TEST_KEY") modparam("topoh", "mask_callid", 1) modparam("topoh", "callid_prefix", "TXX") modparam("topoh", "use_mode", 1)
modparam("topos", "storage", "redis") modparam("topos_redis", "serverid", "tps")
modparam("topos", "contact_mode", 1) modparam("topos", "rr_update", 1) modparam("topos", "contact_host", EXTIP )
modparam("topos", "mask_callid", 1) modparam("topos", "enable_register_publish",1) This works perfectly for me, where TOPOS hide Via and mask Call-ID. Form. To and Requst URI chages as done manually/ through Dispatcher ds_select_domaincall in dispatcher.
@agranig any updates form you testing -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2030269656 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2030269656@github.com>
@toharish pushed 1 commit. 86402aee2f1730922000902e15a095b54c5a6b4d Update tps_msg.c -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3766/files/9769806b96148a2ede46126... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/push/17933580791@github.com>
This PR is stale because it has been open 6 weeks with no activity. Remove stale label or comment or this will be closed in 2 weeks. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2126085650 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2126085650@github.com>
Closed #3766. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#event-13060088673 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/issue_event/13060088673@github.com>
Reopened #3766. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#event-13182335512 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/issue_event/13182335512@github.com>
@toharish do you still like to get this merged? Not sure what the last result from your testing discussion was. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2172750125 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2172750125@github.com>
Would love to get this merged, but didn't succeed testing it successfully on my machine. Maybe I did something wrong? A second pair of eyes would be highly appreciated. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2172759113 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2172759113@github.com>
Would love to get this merged, but didn't succeed testing it successfully on my machine. Maybe I did something wrong? A second pair of eyes would be highly appreciated.
Yes for sure one more round of check will be good so that anything missed out can be checked. But for my Application I am using for REGISTER with call-ID mask and it works perfectly and its more than 8 months working with more than 160000 registrations -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2174186105 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2174186105@github.com>
This PR is stale because it has been open 6 weeks with no activity. Remove stale label or comment or this will be closed in 2 weeks. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2257354569 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2257354569@github.com>
Any update regarding the tests from @agranig or somebody else? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2257527522 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2257527522@github.com>
This PR is stale because it has been open 6 weeks with no activity. Remove stale label or comment or this will be closed in 2 weeks. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2342511353 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2342511353@github.com>
Closed #3766. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#event-14391185373 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/issue_event/14391185373@github.com>
Reopened #3766. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#event-14395127881 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/issue_event/14395127881@github.com>
This PR is stale because it has been open 6 weeks with no activity. Remove stale label or comment or this will be closed in 2 weeks. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2463661930 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2463661930@github.com>
@agranig pushed 1 commit. fa53a6da06a8210e7233fccc1f3524472e429248 Merge branch 'master' into enable_register_publish-parameter -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3766/files/86402aee2f1730922000902... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/before/86402aee2f1730922000902e15a095b54c5a6b4d/after/fa53a6da06a8210e7233fccc1f3524472e429248@github.com>
Trying to get this tested based on latest master. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2485791103 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2485791103@github.com>
@agranig pushed 1 commit. bc1da947930feba1ca3a3fc95a3bfd10e0f37ab0 topos: fix code formatting -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3766/files/fa53a6da06a8210e7233fcc... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/before/fa53a6da06a8210e7233fccc1f3524472e429248/after/bc1da947930feba1ca3a3fc95a3bfd10e0f37ab0@github.com>
@agranig pushed 1 commit. 31f207f152f42071374c6e795f7854f0ad6f7fa7 add enable_register_publish -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3766/files/bc1da947930feba1ca3a3fc... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/before/bc1da947930feba1ca3a3fc95a3bfd10e0f37ab0/after/31f207f152f42071374c6e795f7854f0ad6f7fa7@github.com>
@agranig pushed 1 commit. 891517365dcb31f9e360bc88deb6cb5a839b3f1a topos: add enable_register_publish modparam -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3766/files/31f207f152f42071374c6e7... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/before/31f207f152f42071374c6e795f7854f0ad6f7fa7/after/891517365dcb31f9e360bc88deb6cb5a839b3f1a@github.com>
@agranig pushed 1 commit. fa08d737e6568f83eb880d9c14dbff4640b6613d topos: add enable_register_publish modparam -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3766/files/891517365dcb31f9e360bc8... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/before/891517365dcb31f9e360bc88deb6cb5a839b3f1a/after/fa08d737e6568f83eb880d9c14dbff4640b6613d@github.com>
Tried to clean it up and rebase on top of current master and fix some code indentation etc. However, it doesn't seem to work as expected to me. What works: [x] Hiding Via header What doesn't: [ ] Contact hiding [ ] No typos key param added to Contact, so the 401 is not rewritten back (regarding Via) and Kamailio doesn't know where to send the response to @toharish could you please post an example of a REGISTER leaving Kamailio, so we can check what's supposed to be hidden? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2486026430 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2486026430@github.com>
@agranig pushed 1 commit. 6f4a19f110f6f7761663689168164ba234b8f265 Merge branch 'master' into enable_register_publish-parameter -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3766/files/fa08d737e6568f83eb880d9... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/before/fa08d737e6568f83eb880d9c14dbff4640b6613d/after/6f4a19f110f6f7761663689168164ba234b8f265@github.com>
Tried to clean it up and rebase on top of current master and fix some code indentation etc.
However, it doesn't seem to work as expected to me.
What works: [x] Hiding Via header
What doesn't: [ ] Contact hiding [ ] No typos key param added to Contact, so the 401 is not rewritten back (regarding Via) and Kamailio doesn't know where to send the response to
@toharish could you please post an example of a REGISTER leaving Kamailio, so we can check what's supposed to be hidden?
[reg1.txt](https://github.com/user-attachments/files/17831070/reg1.txt) @agranig I have attached the working SIP trace when this module is used. I am able to send 401 properly to the orginator without any addtional configuration in this PR I had planned only change of CALLID and hide via, If required we can plan for contact with topos key. Since there is no indialog messages in registration I feel that topos key may not be required. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2488556814 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2488556814@github.com>
The key will be required because when you register and rewrite the Contact, you have to handle the R-URI for inbound new requests (INVITES for instance) too. So a REGISTER needs to be handled pretty much the same way as a dialog-forming request such as an INVITE. I'm currently looking into some ways to handle this generically. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2488672986 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2488672986@github.com>
The key will be required because when you register and rewrite the Contact, you have to handle the R-URI for inbound new requests (INVITES for instance) too. So a REGISTER needs to be handled pretty much the same way as a dialog-forming request such as an INVITE.
I'm currently looking into some ways to handle this generically.
@agranig You are right this will be topos key is required when we rewrite the contact. But in this PR I have not changed the contact. Contact changes can also be done locally from the script by saving AoR and location information in redis. The Idea behind this PR was to change via and Call-ID which cannot be directly changed from the script. Contact rewrite, request uri rewrite etc.. from this module can be done in differenet PR. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2488738915 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2488738915@github.com>
There are currently some conflicts that prevents a merge of this PR. I am also not sure whats the status of this extension is, if there are still necessary changes. As the 6.0 release is scheduled for middle of next week, maybe you can give an update if this is ready or need more time. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2583130645 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2583130645@github.com>
github-actions[bot] left a comment (kamailio/kamailio#3766) This PR is stale because it has been open 6 weeks with no activity. Remove stale label or comment or this will be closed in 2 weeks. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#issuecomment-2675968622 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/c2675968622@github.com>
Closed #3766. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3766#event-16643744567 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/3766/issue_event/16643744567@github.com>
participants (5)
-
Andreas Granig -
Daniel-Constantin Mierla -
github-actions[bot] -
Harish S -
Henning Westerholt