From 4fb8accc6747ad56fec3dc84d70cb2b8bbd7316e Mon Sep 17 00:00:00 2001 From: herlesupreeth Date: Tue, 27 Feb 2024 21:01:44 +0100 Subject: [PATCH] ims_registrar_pcscf: update registered state to pending registration if contact exists --- src/modules/ims_registrar_pcscf/save.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modules/ims_registrar_pcscf/save.c b/src/modules/ims_registrar_pcscf/save.c index 7e425230d0d..679abc99ca5 100644 --- a/src/modules/ims_registrar_pcscf/save.c +++ b/src/modules/ims_registrar_pcscf/save.c @@ -477,8 +477,15 @@ int save_pending(struct sip_msg *_m, udomain_t *_d) ul.unlock_udomain(_d, &ci.via_host, ci.via_port, ci.via_prot); return -2; } - } else { - LM_DBG("Contact already exists - not doing anything for now\n"); + } else if(pcontact->reg_state == PCONTACT_DEREG_PENDING_PUBLISH) { + LM_DBG("Contact already exists - Updating contact [%.*s]: setting " + "state to PCONTACT_REG_PENDING\n", + pcontact->aor.len, pcontact->aor.s); + + memset(&ci_, 0, sizeof(struct pcontact_info)); + ci_.reg_state = PCONTACT_REG_PENDING; + ci_.num_service_routes = 0; + ul.update_pcontact(_d, &ci_, pcontact); } }