[sr-dev] git:master:8ef14254: modules/ims_usrloc_scscf: add extra state for IMPUs in UNREG state with no contacts

jaybeepee jason.penton at gmail.com
Mon Sep 12 16:58:35 CEST 2016


Module: kamailio
Branch: master
Commit: 8ef142541fe9e8750335463fafd8d9a2cd03fb44
URL: https://github.com/kamailio/kamailio/commit/8ef142541fe9e8750335463fafd8d9a2cd03fb44

Author: jaybeepee <jason.penton at gmail.com>
Committer: jaybeepee <jason.penton at gmail.com>
Date: 2016-09-12T16:57:21+02:00

modules/ims_usrloc_scscf: add extra state for IMPUs in UNREG state with no contacts

---

Modified: modules/ims_usrloc_scscf/impurecord.c
Modified: modules/ims_usrloc_scscf/ul_callback.c
Modified: modules/ims_usrloc_scscf/ul_callback.h

---

Diff:  https://github.com/kamailio/kamailio/commit/8ef142541fe9e8750335463fafd8d9a2cd03fb44.diff
Patch: https://github.com/kamailio/kamailio/commit/8ef142541fe9e8750335463fafd8d9a2cd03fb44.patch

---

diff --git a/modules/ims_usrloc_scscf/impurecord.c b/modules/ims_usrloc_scscf/impurecord.c
index cf41149..97adf93 100644
--- a/modules/ims_usrloc_scscf/impurecord.c
+++ b/modules/ims_usrloc_scscf/impurecord.c
@@ -473,7 +473,11 @@ static inline void process_impurecord(impurecord_t* _r) {
     } else {
         if (!hascontacts) {
             LM_DBG("This impu is not to be deleted but has no contacts - changing state to IMPU_UNREGISTERED\n");
-            _r->reg_state = IMPU_UNREGISTERED;
+			//run callback  here UL_IMPU_UNREG_NC for UL_IMPU_UNREG_NC
+			if (_r->reg_state != IMPU_UNREGISTERED && exists_ulcb_type(_r->cbs, UL_IMPU_UNREG_NC)) {
+				run_ul_callbacks(_r->cbs, UL_IMPU_UNREG_NC, _r, 0);
+			}
+			_r->reg_state = IMPU_UNREGISTERED;
         }
     }
     
diff --git a/modules/ims_usrloc_scscf/ul_callback.c b/modules/ims_usrloc_scscf/ul_callback.c
index 392953f..1099282 100644
--- a/modules/ims_usrloc_scscf/ul_callback.c
+++ b/modules/ims_usrloc_scscf/ul_callback.c
@@ -129,6 +129,7 @@ int register_ulcb( struct impurecord* r, struct ucontact* c, int types, ul_cb f,
 				|| (types & UL_IMPU_REG_NC_DELETE)
 				|| (types & UL_IMPU_NR_DELETE)
 				|| (types & UL_IMPU_UNREG_EXPIRED)
+				|| (types & UL_IMPU_UNREG_NC)
 				|| (types & UL_IMPU_UPDATE_CONTACT)
                                 || (types & UL_IMPU_DELETE_CONTACT)
                                 || (types & UL_IMPU_EXPIRE_CONTACT)
diff --git a/modules/ims_usrloc_scscf/ul_callback.h b/modules/ims_usrloc_scscf/ul_callback.h
index 2302881..2d2ff7d 100644
--- a/modules/ims_usrloc_scscf/ul_callback.h
+++ b/modules/ims_usrloc_scscf/ul_callback.h
@@ -67,7 +67,8 @@ struct impurecord;
 #define UL_IMPU_DELETE_CONTACT		(1<<12)		/* explciti contact delete from IMPU (dereg) */
 #define UL_IMPU_DELETE_CONTACT_IMPLICIT	(1<<13)		/* implicit contact delete frim IMPU (expiry, etc) */
 #define UL_IMPU_EXPIRE_CONTACT		(1<<14)		/* a new contact has been inserted for this IMPU */
-#define ULCB_MAX               	((1<<15)-1)
+#define UL_IMPU_UNREG_NC                (1<<15)                /* Unregistered no contacts */
+#define ULCB_MAX               	((1<<16)-1)
 
 /*! \brief callback function prototype */
 typedef void (ul_cb) (struct impurecord* r, struct ucontact *c, int type, void *param);




More information about the sr-dev mailing list