|
@@ -81,6 +81,8 @@ extern time_t time_now;
|
|
|
|
|
|
extern int subscribe_to_reginfo;
|
|
|
|
|
|
+extern ims_registrar_pcscf_params_t _imsregp_params;
|
|
|
+
|
|
|
int process_contact(
|
|
|
udomain_t *_d, int expires, str contact_uri, int contact_state)
|
|
|
{
|
|
@@ -211,14 +213,23 @@ int process_contact(
|
|
|
// }
|
|
|
} else { //contact exists
|
|
|
if(contact_state == STATE_TERMINATED) {
|
|
|
- //delete contact
|
|
|
LM_DBG("This contact <%.*s> is in state terminated and is in "
|
|
|
"usrloc so removing it from usrloc\n",
|
|
|
contact_uri.len, contact_uri.s);
|
|
|
- if(ul.delete_pcontact(_d, pcontact) != 0) {
|
|
|
- LM_DBG("failed to delete pcscf contact <%.*s> - not a problem "
|
|
|
- "this may have been removed by de registration",
|
|
|
- contact_uri.len, contact_uri.s);
|
|
|
+ if(_imsregp_params.delete_delay <= 0) {
|
|
|
+ //delete contact
|
|
|
+ if(ul.delete_pcontact(_d, pcontact) != 0) {
|
|
|
+ LM_DBG("failed to delete pcscf contact <%.*s> - not a "
|
|
|
+ "problem "
|
|
|
+ "this may have been removed by de registration",
|
|
|
+ contact_uri.len, contact_uri.s);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // rather than delete update the pcontact with expire value
|
|
|
+ ci.expires = local_time_now + _imsregp_params.delete_delay;
|
|
|
+ if(ul.update_pcontact(_d, &ci, pcontact) != 0) {
|
|
|
+ LM_DBG("failed to update pcscf contact on de-register\n");
|
|
|
+ }
|
|
|
}
|
|
|
/*TODO_LATEST - put this back */
|
|
|
} else { //state is active
|