瀏覽代碼

modules/ims_usrloc_scscf: added support for UE types required by registrar

jaybeepee 9 年之前
父節點
當前提交
6620a44738
共有 2 個文件被更改,包括 7 次插入0 次删除
  1. 4 0
      modules/ims_usrloc_scscf/ucontact.c
  2. 3 0
      modules/ims_usrloc_scscf/usrloc.h

+ 4 - 0
modules/ims_usrloc_scscf/ucontact.c

@@ -114,6 +114,10 @@ ucontact_t* new_ucontact(str* _dom, str* _aor, str* _contact, ucontact_info_t* _
     /*Copy parameter list into shm**/
     /*Copy parameter list into shm**/
     param = _ci->params;
     param = _ci->params;
     while(param) {
     while(param) {
+        LM_DBG("Checking param [%.*s]\n", param->name.len, param->name.s);
+        if (param->name.len == 16 && (memcmp(param->name.s, "+g.3gpp.icsi-ref", 16)==0)) {
+            c->is_3gpp = 1;
+        }
 	/*Copy first param in curr*/
 	/*Copy first param in curr*/
 	curr = shm_malloc(sizeof (param_t));
 	curr = shm_malloc(sizeof (param_t));
 	curr->len = param->len;
 	curr->len = param->len;

+ 3 - 0
modules/ims_usrloc_scscf/usrloc.h

@@ -151,6 +151,8 @@ typedef enum contact_state {
 /*! \brief Valid contact is a contact that either didn't expire yet or is permanent */
 /*! \brief Valid contact is a contact that either didn't expire yet or is permanent */
 #define VALID_CONTACT(c, t)   (((c->expires>t) || (c->expires==0)) && c->state!=CONTACT_DELETED && c->state!=CONTACT_DELETE_PENDING && c->state!=CONTACT_EXPIRE_PENDING_NOTIFY)
 #define VALID_CONTACT(c, t)   (((c->expires>t) || (c->expires==0)) && c->state!=CONTACT_DELETED && c->state!=CONTACT_DELETE_PENDING && c->state!=CONTACT_EXPIRE_PENDING_NOTIFY)
 
 
+#define VALID_UE_TYPE(c, t)   ((t==0) || (t==1 && c->is_3gpp) || (t==2 && !c->is_3gpp))
+
 struct hslot;
 struct hslot;
 /*!< Hash table slot */
 /*!< Hash table slot */
 struct socket_info;
 struct socket_info;
@@ -298,6 +300,7 @@ typedef struct ucontact {
     struct contact_hslot* slot; /*!< Collision slot in the hash table array we belong to */
     struct contact_hslot* slot; /*!< Collision slot in the hash table array we belong to */
     unsigned int sl; 			/*!< Hash slot number we belong to */
     unsigned int sl; 			/*!< Hash slot number we belong to */
     int ref_count;
     int ref_count;
+    int is_3gpp;
     contact_state_t state;
     contact_state_t state;
     str domain; /*!< Pointer to domain name (NULL terminated) */
     str domain; /*!< Pointer to domain name (NULL terminated) */
     str aor; /*!< Pointer to the AOR string in record structure*/
     str aor; /*!< Pointer to the AOR string in record structure*/