summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-10-24 08:32:00 +0000
committerBenny Prijono <bennylp@teluu.com>2007-10-24 08:32:00 +0000
commit11079bea58f77115076a57430593564b4da74526 (patch)
tree285f94e8876e36bf99a50c4c9cd3b4c10633c7ae /pjsip
parent9fca1ce48cbf46d84dd25391a9d41a580e1733a0 (diff)
Fixed ticket #401: Unable to register when account URI contains display name
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1518 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsip-ua/sip_reg.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/pjsip/src/pjsip-ua/sip_reg.c b/pjsip/src/pjsip-ua/sip_reg.c
index 7e061537..a1edc9b1 100644
--- a/pjsip/src/pjsip-ua/sip_reg.c
+++ b/pjsip/src/pjsip-ua/sip_reg.c
@@ -713,6 +713,7 @@ static void tsx_callback(void *token, pjsip_event *event)
hdr = contact[i];
if (hdr->expires >= 0 && hdr->expires < expiration) {
pjsip_contact_hdr *our_contact;
+ const pjsip_uri *uri1, *uri2;
our_contact = (pjsip_contact_hdr*)
regc->contact_hdr_list.next;
@@ -722,9 +723,15 @@ static void tsx_callback(void *token, pjsip_event *event)
/* Only set expiration time if this is the same Contact
* that we register.
*/
- if (pjsip_uri_cmp(PJSIP_URI_IN_CONTACT_HDR,
- hdr->uri,
- our_contact->uri)==0)
+
+ /* Exclude the display name when comparing the URI.
+ * This is because a well known open source proxy server
+ * doesn't return the display name in the Contact header
+ * of the REGISTER response.
+ */
+ uri1 = pjsip_uri_get_uri(hdr->uri);
+ uri2 = pjsip_uri_get_uri(our_contact->uri);
+ if (pjsip_uri_cmp(PJSIP_URI_IN_CONTACT_HDR, uri1, uri2)==0)
{
expiration = contact[i]->expires;
}