Module: kamailio
Branch: master
Commit: 812df26470b50d626ce9ee03b9272373b231ce2a
URL:
https://github.com/kamailio/kamailio/commit/812df26470b50d626ce9ee03b927237…
Author: Supreeth Herle <herlesupreeth(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-12-04T20:29:40+01:00
ims_ipsec_pcscf: handle IPSec registration case where first SIP REGISTER does not have VIA
port as 5060
---
Modified: src/modules/ims_ipsec_pcscf/cmd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/812df26470b50d626ce9ee03b927237…
Patch:
https://github.com/kamailio/kamailio/commit/812df26470b50d626ce9ee03b927237…
---
diff --git a/src/modules/ims_ipsec_pcscf/cmd.c b/src/modules/ims_ipsec_pcscf/cmd.c
index c863eff5407..80a714559ba 100644
--- a/src/modules/ims_ipsec_pcscf/cmd.c
+++ b/src/modules/ims_ipsec_pcscf/cmd.c
@@ -855,7 +855,9 @@ int ipsec_create(struct sip_msg *m, udomain_t *d, int _cflags)
ipsec_t *old_s = NULL;
// Update contacts only for initial registration, for re-registration the existing
contacts shouldn't be updated.
- if(ci.via_port == SIP_PORT) {
+ if(ci.via_port == SIP_PORT
+ || (pcontact->security_temp->data.ipsec->port_ps == 0
+ && pcontact->security_temp->data.ipsec->port_pc == 0)) {
LM_DBG("Registration for contact with AOR [%.*s], VIA [%d://%.*s:%d], "
"received_host [%d://%.*s:%d]\n",
ci.aor.len, ci.aor.s, ci.via_prot, ci.via_host.len,