Browse Source

ims_usrloc_pscscf: Set contact-port to 5060, if no port present

Carsten Bock 10 years ago
parent
commit
ab0e23c32b
2 changed files with 3 additions and 2 deletions
  1. 1 1
      modules/ims_usrloc_pcscf/pcontact.c
  2. 2 1
      modules/ims_usrloc_pcscf/udomain.c

+ 1 - 1
modules/ims_usrloc_pcscf/pcontact.c

@@ -182,7 +182,7 @@ int new_pcontact(struct udomain* _d, str* _contact, struct pcontact_info* _ci, s
         (*_c)->rinstance.len = rinstance.len;
 	(*_c)->contact_host.s = sip_uri.host.s;
 	(*_c)->contact_host.len = sip_uri.host.len;
-	(*_c)->contact_port = sip_uri.port_no;
+	(*_c)->contact_port = sip_uri.port_no?sip_uri.port_no:5060;
 	(*_c)->contact_user.s = sip_uri.user.s;
 	(*_c)->contact_user.len = sip_uri.user.len;
 

+ 2 - 1
modules/ims_usrloc_pcscf/udomain.c

@@ -506,9 +506,10 @@ int get_pcontact(udomain_t* _d, pcontact_info_t* contact_info, struct pcontact**
 	for (i = 0; i < _d->table[sl].n; i++) {
             LM_DBG("comparing contact with aorhash [%u], aor [%.*s]\n", c->aorhash, c->aor.len, c->aor.s);
             LM_DBG("  contact host [%.*s:%d]\n", c->contact_host.len, c->contact_host.s, c->contact_port);
+
 		if ((c->aorhash == aorhash) && (c->contact_host.len == contact_info->via_host.len) && (memcmp(contact_info->via_host.s, c->contact_host.s, c->contact_host.len)==0) && (c->contact_port == contact_info->via_port)
                         && (!(contact_info->searchflag&SEARCH_RECEIVED) || ((contact_info->searchflag&SEARCH_RECEIVED)
-                        && (c->received_host.len == contact_info->received_host.len && (memcmp(c->received_host.s, contact_info->received_host.s, contact_info->received_host.len)==0))
+                        && ((c->received_host.len == contact_info->received_host.len) && (memcmp(c->received_host.s, contact_info->received_host.s, contact_info->received_host.len)==0))
                         && (c->received_port == contact_info->received_port)))) {
                     LM_DBG("found contact with URI [%.*s]\n", c->aor.len, c->aor.s);
                     if (has_rinstance) {