浏览代码

modules/ims_usrloc_scscf: new mod param contact_delete_delay
contact_delete_delay: length of time to delay before deleting contact in state delay delete

Richard Good 9 年之前
父节点
当前提交
392748691a
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 3 0
      modules/ims_usrloc_scscf/udomain.c
  2. 3 0
      modules/ims_usrloc_scscf/ul_mod.c

+ 3 - 0
modules/ims_usrloc_scscf/udomain.c

@@ -77,6 +77,8 @@ struct contact_list* contact_list;
 struct ims_subscription_list* ims_subscription_list;
 extern int subs_hash_size;
 
+extern int contact_delete_delay;
+
 /*!
  * \brief Create a new domain structure
  * \param  _n is pointer to str representing name of the domain, the string is
@@ -830,6 +832,7 @@ void unref_contact_unsafe(ucontact_t* c) {
             LM_WARN("reference dropped below zero... this should not happen\n");
         }
 	c->state = CONTACT_DELAYED_DELETE;
+        c->expires = time(NULL) + contact_delete_delay;
 //        delete_scontact(c);
     }
 }

+ 3 - 0
modules/ims_usrloc_scscf/ul_mod.c

@@ -119,6 +119,8 @@ struct dlg_binds dlgb;
 int sub_dialog_hash_size = 9;
 shtable_t sub_dialog_table;
 
+int contact_delete_delay = 30;   //If contact is put into delay delete state this is how long we delay before deleting
+
 new_shtable_t pres_new_shtable;
 insert_shtable_t pres_insert_shtable;
 search_shtable_t pres_search_shtable;
@@ -149,6 +151,7 @@ static param_export_t params[] = {
 	{"subs_hash_size",    	INT_PARAM, &subs_hash_size  },
         {"contacts_hash_size", 	INT_PARAM, &contacts_hash_size  },
 	{"nat_bflag",         	INT_PARAM, &nat_bflag       },
+        {"contact_delete_delay", INT_PARAM, &contact_delete_delay       },
 	{"usrloc_debug_file", 	PARAM_STR, &usrloc_debug_file},
 	{"enable_debug_file", 	INT_PARAM, &usrloc_debug},
     {"user_data_dtd",     	PARAM_STRING, &scscf_user_data_dtd},