Module: kamailio
Branch: master
Commit: ab0e23c32b154ea38730f8be550b072a0ec10186
URL:
https://github.com/kamailio/kamailio/commit/ab0e23c32b154ea38730f8be550b072…
Author: Carsten Bock <carsten(a)ng-voice.com>
Committer: Carsten Bock <carsten(a)ng-voice.com>
Date: 2015-09-27T21:10:15+02:00
ims_usrloc_pscscf: Set contact-port to 5060, if no port present
---
Modified: modules/ims_usrloc_pcscf/pcontact.c
Modified: modules/ims_usrloc_pcscf/udomain.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ab0e23c32b154ea38730f8be550b072…
Patch:
https://github.com/kamailio/kamailio/commit/ab0e23c32b154ea38730f8be550b072…
---
diff --git a/modules/ims_usrloc_pcscf/pcontact.c b/modules/ims_usrloc_pcscf/pcontact.c
index 33e4a8a..04106bd 100644
--- a/modules/ims_usrloc_pcscf/pcontact.c
+++ b/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;
diff --git a/modules/ims_usrloc_pcscf/udomain.c b/modules/ims_usrloc_pcscf/udomain.c
index b3b431b..6aeda65 100644
--- a/modules/ims_usrloc_pcscf/udomain.c
+++ b/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) {