Module: kamailio
Branch: 6.0
Commit: dfc590313be56564a924bd190ae89f8cf1b1f4fb
URL: 
https://github.com/kamailio/kamailio/commit/dfc590313be56564a924bd190ae89f8cf1b1f4fb

Author: Victor Seva <[email protected]>
Committer: Victor Seva <[email protected]>
Date: 2025-10-27T09:33:19+01:00

ims_registrar_scscf: fix contact_port_ip_match()

It was not matching comparation when default port was omitted

> ims_registrar_scscf [registrar_notify.c:1556]: contact_port_ip_match(): 
> Matching contact using only port and ip - comparing [127.169.7.104] and 
> [127.169.7.104:5060]

(cherry picked from commit f57f4045ac8a08585c573dcc1eb257102be1a2a9)

---

Modified: src/modules/ims_registrar_scscf/registrar_notify.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/dfc590313be56564a924bd190ae89f8cf1b1f4fb.diff
Patch: 
https://github.com/kamailio/kamailio/commit/dfc590313be56564a924bd190ae89f8cf1b1f4fb.patch

---

diff --git a/src/modules/ims_registrar_scscf/registrar_notify.c 
b/src/modules/ims_registrar_scscf/registrar_notify.c
index 25425af7a1f..63bd3ea597c 100644
--- a/src/modules/ims_registrar_scscf/registrar_notify.c
+++ b/src/modules/ims_registrar_scscf/registrar_notify.c
@@ -1521,6 +1521,13 @@ int aor_to_contact(str *aor, str *contact)
                contact->len = p - contact->s;
        }
 
+       // remove default port 5060
+       if((p = memchr(contact->s, ':', contact->len))) {
+               if(contact->len - (p - contact->s) == 5 && !memcmp(p, ":5060", 
5)) {
+                       contact->len -= 5;
+               }
+       }
+
        return ret;
 }
 

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to