Skip to content

Commit

Permalink
ims_usrloc_pscscf: Set contact-port to 5060, if no port present
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenbock committed Sep 27, 2015
1 parent eb81caa commit ab0e23c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/ims_usrloc_pcscf/pcontact.c
Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion modules/ims_usrloc_pcscf/udomain.c
Expand Up @@ -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) {
Expand Down

0 comments on commit ab0e23c

Please sign in to comment.