From 07b19ef0604a48148f1bb14787516334820e5a3a Mon Sep 17 00:00:00 2001 From: Kristiyan Peychev Date: Tue, 8 Mar 2022 10:40:51 +0200 Subject: [PATCH] ims_registrar_scscf: add a new contact state for notifications Add the `deregistered` state to IMS_Registrar_events_enum_t, allowing the registrar to distinguish between UE unregsitration, which do not require a notification to be sent, and network-originated deregistration requests. --- src/modules/ims_registrar_scscf/registrar_notify.c | 5 ++++- src/modules/ims_registrar_scscf/registrar_notify.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/ims_registrar_scscf/registrar_notify.c b/src/modules/ims_registrar_scscf/registrar_notify.c index 761b0146241..4dd6223431e 100644 --- a/src/modules/ims_registrar_scscf/registrar_notify.c +++ b/src/modules/ims_registrar_scscf/registrar_notify.c @@ -495,6 +495,7 @@ int event_reg(udomain_t* _d, impurecord_t* r_passed, ucontact_t* c_passed, int e //richard: we only use reg unreg expired and refresh case IMS_REGISTRAR_CONTACT_UNREGISTERED: + case IMS_REGISTRAR_CONTACT_DEREGISTERED: case IMS_REGISTRAR_CONTACT_UNREGISTERED_IMPLICIT: case IMS_REGISTRAR_CONTACT_REGISTERED: case IMS_REGISTRAR_CONTACT_REFRESHED: @@ -1967,7 +1968,8 @@ str get_reginfo_partial(impurecord_t *r, ucontact_t *c, int event_type, unsigned if (//richard we only use expired and unregistered (event_type == IMS_REGISTRAR_CONTACT_EXPIRED || - event_type == IMS_REGISTRAR_CONTACT_UNREGISTERED) + event_type == IMS_REGISTRAR_CONTACT_UNREGISTERED || + event_type == IMS_REGISTRAR_CONTACT_DEREGISTERED) ) { //check if impu record has any other active contacts - if not then set this to terminated - if so then keep this active //check if asserted is present in any of the path headers @@ -2011,6 +2013,7 @@ str get_reginfo_partial(impurecord_t *r, ucontact_t *c, int event_type, unsigned event = r_expired; expires = 0; break; + case IMS_REGISTRAR_CONTACT_DEREGISTERED: case IMS_REGISTRAR_CONTACT_UNREGISTERED: state = r_terminated; event = r_unregistered; diff --git a/src/modules/ims_registrar_scscf/registrar_notify.h b/src/modules/ims_registrar_scscf/registrar_notify.h index 6bfc6d3ce38..04d4958488d 100644 --- a/src/modules/ims_registrar_scscf/registrar_notify.h +++ b/src/modules/ims_registrar_scscf/registrar_notify.h @@ -116,7 +116,8 @@ typedef enum { IMS_REGISTRAR_CONTACT_EXPIRED, /**< A contact has expired and will be removed */ IMS_REGISTRAR_CONTACT_UNREGISTERED, /**< User unregistered with Expires 0 */ IMS_REGISTRAR_CONTACT_UNREGISTERED_IMPLICIT, /**< User unregistered implicitly, ie not via explicit deregister */ - IMS_REGISTRAR_SUBSEQUENT_SUBSCRIBE + IMS_REGISTRAR_SUBSEQUENT_SUBSCRIBE, + IMS_REGISTRAR_CONTACT_DEREGISTERED, /**< User's registration was terminated with RTR */ } IMS_Registrar_events_enum_t; extern IMS_Registrar_events_enum_t IMS_Registrar_events;