<!-- 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
**Use origin-host of CCR response as destination-host of subsequent CCR 
requests**
When connecting to a diameter node which using relay, it may load balance 
requests to multiple servers for handling. This change ensures that subsequent 
requests are sent to the same server.

**Honour AVP_Time_Quota_Threshold in CCR response**
Charging server indicates it want an interim update X number of seconds before 
all quota has been used.

**Add new modparam «strip_plus_from_e164»**
The existing formatitng routine check if it's a tel: or sip: uri, and sets 
E.164 or SIP according to that. If it's E.164, it strips "tel:" 
too. A subscription id with leading "+" is actually of type SIP.

I didn't want to make a breaking change here, so I introduced a new setting 
which fixes the behaviour.

**Moved subscription id formatting into a common function**
For more clean code, and one place to make further adjustments.

**Handle CCR response without AVP_Validity_Time**
If missing, various places in the module reported immediate expire.

**Handle IMS_RAR (Re-auth) request from charging server**
Typical scenario is that there's a missing interim update, and the server 
want to check if the session is still alive. At reception we try a lookup and 
if found, schedule a new request.

**Handle IMS_ASR (Abort) request from charging server**
Similar handling as for re-auth, but for server-initiated termination of the 
call.

**Fixed issue with signed/unsigned int related to check for Expires header**
cscf_get_expires_hdr() returns signed (-1 for not found), while that value was 
added
to the outgoing diameter request unsigned. That again resulted in an Expires 
AVP with
a really large value, and was rejected by the charging server.

Most probably cscf_get_expires_hdr() should be changed to return unsigned since 
the value theoretical can be that big, but since that is a common function for 
the ims modules it would require more testing than I'm capable of right now.

**Use str_dup() and str_free() from ims_getters instead of locally defined**
Those were needed more places.

-- 

I'm a little bit unsure about updating a string allocated in shm, where the 
length is changed (look in ims_ro.c, credit_control_session_callback()). Is the 
correct way to do a shm_free() and then reallocate, or is there a more simple 
way of doing it?
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * cdp: Add support for re-auth on ro sessions initiated from charging server
  * ims_charging: Various changes to make module compatible to other charging 
servers

-- File Changes --

    M src/modules/cdp/acctstatemachine.c (2)
    M src/modules/cdp/diameter_code_avp.h (2)
    M src/modules/cdp/peerstatemachine.c (8)
    M src/modules/cdp/session.c (2)
    M src/modules/ims_charging/Ro_data.c (40)
    M src/modules/ims_charging/Ro_data.h (5)
    M src/modules/ims_charging/ccr.c (8)
    M src/modules/ims_charging/config.h (1)
    M src/modules/ims_charging/dialog.c (18)
    M src/modules/ims_charging/doc/ims_charging_admin.xml (20)
    M src/modules/ims_charging/ims_charging_mod.c (59)
    M src/modules/ims_charging/ims_ro.c (234)
    M src/modules/ims_charging/ims_ro.h (3)
    M src/modules/ims_charging/ro_db_handler.c (43)
    M src/modules/ims_charging/ro_db_handler.h (5)
    M src/modules/ims_charging/ro_session_hash.c (45)
    M src/modules/ims_charging/ro_session_hash.h (6)
    M src/modules/ims_charging/ro_timer.c (8)
    M utils/kamctl/mysql/ims_charging-create.sql (3)

-- Patch Links --

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3640
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