Browse Source

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]
Victor Seva 1 week ago
parent
commit
f57f4045ac
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/modules/ims_registrar_scscf/registrar_notify.c

+ 7 - 0
src/modules/ims_registrar_scscf/registrar_notify.c

@@ -1517,6 +1517,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;
 }