From 11079bea58f77115076a57430593564b4da74526 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 24 Oct 2007 08:32:00 +0000 Subject: 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 --- pjsip/src/pjsip-ua/sip_reg.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'pjsip') 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; } -- cgit v1.2.3