Browse Source

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.
Kristiyan Peychev 3 years ago
parent
commit
07b19ef060

+ 4 - 1
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;

+ 2 - 1
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;