<!-- 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] 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 --> In this PR we introduce a new mode and two new parameters for accomplishing the same thing for user part also in domain part.
Docs incoming if no significant changes are needed. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4246
-- Commit Summary --
* topos: Add new contact_mode=3 and 2 new modparam for contact host domains * topos: Refactor contact_mode handling * topos: Append port and protocol param
-- File Changes --
M src/modules/topos/topos_mod.c (13) M src/modules/topos/tps_storage.c (428) M src/modules/topos/tps_storage.h (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4246.patch https://github.com/kamailio/kamailio/pull/4246.diff
miconda left a comment (kamailio/kamailio#4246)
Haven't gone much into it, but I think it is ok, still needs docs.
Would it work if the values are also with more than the host part (e.g., `host:port;some=param`)?
xkaraman left a comment (kamailio/kamailio#4246)
Hey @miconda,
As of now this will copy whatever was in the modparam string to the URI including port and params.
Bearing in mind the append_host function tries to append the port and transport if available as well. So, it could end up with two ports and params not at the end for example, so it depends on what's available, i think
`user@host:port;some=param:port_if_available;transport=if_found`
xadhoom left a comment (kamailio/kamailio#4246)
Just jumping in, without searching for open PRs I implemented a similar thing, the only difference is that I don't have a specific flag (contact_mode) for it, but just work on the host part like the xavu contact does.
Your seems more complete, I have only a question: if I'm not mistaken, with this PR you cannot enable at same time the xavu contact_user and contact host. What if a user needs to manage at same time the user part and the host part?
xkaraman left a comment (kamailio/kamailio#4246)
Yeah i think we have discussed this when implementing it. I think right now it's not possible to manage both user and host for both sides.
This might require a seperate mode or maybe combine all this into one mode if it makes sense?
xadhoom left a comment (kamailio/kamailio#4246)
In my approach I've just avoided the flag for contact_mode, and relied on the presence of both a/b params for host, like contact_host xavu is handled.
A quick "works for me" diff is here https://github.com/kamailio/kamailio/compare/master...VoiSmart:kamailio:add_...
In that way you can have manage both user part and host part, and be compatible with existing contact_host.