#### 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
Introduce new function: `allow_register_include_port()` to be able to check the 
whole Contact header including port.

Example, register.deny content is:
```
        ALL : "^sip:.*192.168.0.101:5062"
```

If the Contact is: "Contact: 
<sip:testuser1004@192.168.0.101:5062>" then this will check the 
Contact hf including port of it.

Otherwise if usual `allow_register()` function is used, then only the 
"testuser1004@192.168.0.101" will be taken into account, which will 
lead the regex to be failing and letting the check to pass through.

The func `allow_register_include_port()` works similarly as `allow_register()` 
except it checks Contact's port.

A separate function was created in order to not complicate things by 
introducing one more parameter to the
existing function `allow_register()`, which already takes a variable amount of 
parameters, so 1 or 2 parameters
(depending on if it is a "basename" or "allow-file, 
deny-file").

Documentation updated accordingly.
Additionally, "Register File Format" section has been added to the 
doc (to provide allow/deny file examples).

Full backwards compatibility is kept in place,
no need for users of the module to change anything in their configuration or 
kamailio script itself.

You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/3846

-- Commit Summary --

  * permissions: introduce func `allow_register_include_port()`

-- File Changes --

    M src/modules/permissions/doc/permissions.xml (7)
    M src/modules/permissions/doc/permissions_admin.xml (142)
    M src/modules/permissions/permissions.c (56)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/3846.patch
https://github.com/kamailio/kamailio/pull/3846.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3846
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/3...@github.com>
_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to