summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vossel <dvossel@digium.com>2009-12-07 18:08:46 +0000
committerDavid Vossel <dvossel@digium.com>2009-12-07 18:08:46 +0000
commit86dc66625c3572b00511c868ed56ac9025513583 (patch)
treeb0be4214d7f42491c28bee52f26d90528e7b1928
parent26daf5086340b314f25323eb79e5b5b479b49637 (diff)
Merged revisions 233471 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r233471 | dvossel | 2009-12-07 12:07:38 -0600 (Mon, 07 Dec 2009) | 9 lines fixes missing Contact header angle brackets (closes issue #16298) Reported by: mgernoth Patches: reg_parse_issue_1.4.diff uploaded by dvossel (license 671) Tested by: dvossel ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233472 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5d7759440..a126654e5 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -9741,7 +9741,9 @@ static int respprep(struct sip_request *resp, struct sip_pvt *p, const char *msg
add_header(resp, "Expires", tmp);
if (p->expiry) { /* Only add contact if we have an expiry time */
char contact[SIPBUFSIZE];
- snprintf(contact, sizeof(contact), "%s;expires=%d", (p->method == SIP_SUBSCRIBE ? p->our_contact : p->fullcontact), p->expiry);
+ const char *contact_uri = p->method == SIP_SUBSCRIBE ? p->our_contact : p->fullcontact;
+ char *brackets = strchr(contact_uri, '<');
+ snprintf(contact, sizeof(contact), "%s%s%s;expires=%d", brackets ? "" : "<", contact_uri, brackets ? "" : ">", p->expiry);
add_header(resp, "Contact", contact); /* Not when we unregister */
}
} else if (!ast_strlen_zero(p->our_contact) && resp_needs_contact(msg, p->method)) {