Module: kamailio
Branch: master
Commit: 9cc9a177daf6d5ce11fbdef714bd576716dc5a2f
URL: https://github.com/kamailio/kamailio/commit/9cc9a177daf6d5ce11fbdef714bd576…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2023-03-20T16:56:03+01:00
p_usrloc: use PRIu64 macro to find out what format is needed for uint64_t since it depends on architecture
---
Modified: src/modules/p_usrloc/ul_check.c
---
Diff: https://github.com/kamailio/kamailio/commit/9cc9a177daf6d5ce11fbdef714bd576…
Patch: https://github.com/kamailio/kamailio/commit/9cc9a177daf6d5ce11fbdef714bd576…
---
diff --git a/src/modules/p_usrloc/ul_check.c b/src/modules/p_usrloc/ul_check.c
index dfc062f266..0ed32dc99f 100644
--- a/src/modules/p_usrloc/ul_check.c
+++ b/src/modules/p_usrloc/ul_check.c
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <inttypes.h>
#include <stdint.h>
#include "../../core/mem/shm_mem.h"
@@ -136,7 +137,7 @@ int must_retry(time_t *timer, time_t interval){
if(!timer){
return -1;
}
- LM_DBG("must_retry: time is at %llu, retry at %llu.\n", (uint64_t)time(NULL),
+ LM_DBG("must_retry: time is at %" PRIu64 ", retry at %" PRIu64 ".\n", (uint64_t)time(NULL),
(uint64_t)(*timer));
if(*timer <= time(NULL)){
*timer = time(NULL) + interval;
Module: kamailio
Branch: master
Commit: 135f7b5e2114617b0bc408175ec146d248d01d3a
URL: https://github.com/kamailio/kamailio/commit/135f7b5e2114617b0bc408175ec146d…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2023-03-20T11:01:25+01:00
modules: readme files regenerated - ims_registrar_pcscf ... [skip ci]
---
Modified: src/modules/ims_registrar_pcscf/README
---
Diff: https://github.com/kamailio/kamailio/commit/135f7b5e2114617b0bc408175ec146d…
Patch: https://github.com/kamailio/kamailio/commit/135f7b5e2114617b0bc408175ec146d…
---
diff --git a/src/modules/ims_registrar_pcscf/README b/src/modules/ims_registrar_pcscf/README
index 3bfb0e6003..02327a005c 100644
--- a/src/modules/ims_registrar_pcscf/README
+++ b/src/modules/ims_registrar_pcscf/README
@@ -312,6 +312,33 @@ pcscf_save("location");
* domain - Logical domain within the registrar. If a database is used
then this must be name of the table which stores the contacts.
+ The return code may have the following values:
+ * ( 1) OK
+ * (-1) Parsing of contact data failed
+ * (-2) Deregistration in progress
+
+ For db_mode = DB_ONLY (3) setting for ims_usrloc_pcscf module modparam
+ following logic is implemented:
+ * To avoid race time conditions between a REREGISTER and the expiry
+ handler state machine in the scscf an approach is chosen to refuse
+ a REREGISTER in time window of 20 seconds after pcontact expiry on
+ the pcscf (thus allowing expiry handling to finish). REREGISTER is
+ refused in this scenario with return code -2.
+ * In case a REREGISTER arrives at pcscf and the respective pcontact
+ is expired longer than time window of 20 seconds registration also
+ is refused with return code -2 and additionaly PUBLISH is sent to
+ scscf with expiry = 0.
+ * The rc -2 shall be handled in register.cfg script as follows:
+ pcscf_save_pending("location");
+ switch ($retcode) {
+ case -1:
+ .......
+ case -2:
+ send_reply("500", "Deregister in progress - Please try again");
+ exit;
+ break;
+ }
+
4.3. pcscf_follows_service_routes(domain)
Returns true, if the request is following the "learned" service-routes
Module: kamailio
Branch: master
Commit: 38d72c3f8248b32b3ba0ff24abd1f2f7407f9d8f
URL: https://github.com/kamailio/kamailio/commit/38d72c3f8248b32b3ba0ff24abd1f2f…
Author: Annemarie Mandl <mandl(a)rpmbld.novalocal>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2023-03-20T10:57:21+01:00
ims_registrar_pcscf: changes for ul db_mode DB_ONLY
Enable registration of pcscf contact callback during download
from db location table and inserting pcontact (normally this
callback is registered during handling of REGISTER).
Refuse REGISTER when pcontact is expired since [0 to 20] seconds.
Within this time window a NOTIFY is expected from scscf and in order
to avoid race time conditions between scscf and pcscf REGISTER
will be refused. Refuse REGISTER when pcontact is expired longer
than 20 seconds - send PUBLISH (contact expired) to scscf to trigger
NOTIFY. In both REGISTER refused scenarios routing script should reply
500 - Deregistration in progress.
undo changes in ul_callback.c & ul_callback.h
corrections after comments from Henning
---
Modified: src/modules/ims_registrar_pcscf/doc/ims_registrar_pcscf_admin.xml
Modified: src/modules/ims_registrar_pcscf/ims_registrar_pcscf_mod.c
Modified: src/modules/ims_registrar_pcscf/notify.c
Modified: src/modules/ims_registrar_pcscf/save.c
---
Diff: https://github.com/kamailio/kamailio/commit/38d72c3f8248b32b3ba0ff24abd1f2f…
Patch: https://github.com/kamailio/kamailio/commit/38d72c3f8248b32b3ba0ff24abd1f2f…
Enable registration of pcscf contact callback during download from db location table and inserting pcontact (normally this callback is registered during handling of REGISTER). Refuse REGISTER when pcontact is expired since [0 to 20] seconds. Within this time window a NOTIFY is expected from scscf and in order to avoid race time conditions between scscf and pcscf REGISTER will be refused. Refuse REGISTER when pcontact is expired longer than 20 seconds - send PUBLISH (contact expired) to scscf to trigger NOTIFY. In both REGISTER refused scenarios routing script should reply 500 - Deregister in progress.
<!-- 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 case a pcontact found in location db has to be inserted into pcscf cache depending on contact state also callbacks have to be registered for this pcontact. Registering of callback_pcscf_contact_cb is enabled in this module.
Handling of contact expiry is usually triggered in the scscf (mem_timer_udomain which runs every 10 secs). Sending of NOTIFY to pcscf may take up to 20 seconds from start of expiry due to timing conditions.
To avoid race time conditions between a REREGISTER and the expiry handler state machine in the scscf an approach is chosen to refuse a REREGISTER in time window of 20 seconds after pcontact expiry on the pcscf (thus allowing expiry handling to finish). REREGISTER is refused in this scenario with new return_code -2.
In case a REREGISTER arrives at pcscf and the respective pcontact is expired longer than time window of 20 seconds registration also is refused with rc -2 and additionaly PUBLISH is sent to scscf with expiry = 0.
The rc -2 shall be handled in register.cfg script as follows:
pcscf_save_pending("location");
switch ($retcode) {
case -1:
# Missing/wrong Information in REGISTER.
send_reply("400", "Information wrong - See log.");
exit;
break;
case -2:
# De-Register in Progress, or PUBLISH ongoing due to registration expiry,
# or new REGISTER blocked because registration just expired (up to 20sec).
append_to_reply("Retry-After: 30\r\n");
send_reply("500", "Deregister in progress - Please try again");
exit;
break;
}
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3317
-- Commit Summary --
* ims_registrar_pcscf: changes for ul db_mode DB_ONLY
-- File Changes --
M src/modules/ims_registrar_pcscf/ims_registrar_pcscf_mod.c (21)
M src/modules/ims_registrar_pcscf/notify.c (4)
M src/modules/ims_registrar_pcscf/save.c (37)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3317.patchhttps://github.com/kamailio/kamailio/pull/3317.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3317
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3317(a)github.com>
Hi,
Quick question:
Looking at the Dialog module and CSeq tracking functionality, I've noticed
the following:
- on the one hand, we are storing the current CSeq for each direction in
the Dialog structure
- on the other hand, we are storing a "Delta" of the received vs. updated
CSeq as a Dialog Variable
Does replacing the Delta with the CSeq already stored with the Dialog
structure make sense?
I am asking because of my latest changes, where there may be more sources
for an updated CSeq (e.g., when sending a Request from script within the
Dialog) and more use cases for an updated CSeq (Up and Downstream).
I've updated the dialog module for my use already accordingly
https://github.com/kamailio/kamailio/compare/master...carstenbock/dialog_cs…
I wanted to hear other opinions and possible pitfalls as well...
Thanks,
Carsten
--
Carsten Bock I CTO & Founder
ng-voice GmbH
Trostbrücke 1 I 20457 Hamburg I Germany
T +49 179 2021244 I www.ng-voice.com
Registry Office at Local Court Hamburg, HRB 120189
Managing Directors: Dr. David Bachmann, Carsten Bock