aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-07 18:07:38 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-07 18:07:38 +0000
commitb5ea37214751edd0f84306539ef456a2513e0241 (patch)
tree51d820157f3399d187e7e6128f16fe548d5a2713 /channels
parent4d43ba031a8e7265a53c8e9086239d4678128f7e (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@233471 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-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 098f6b6ad..a40e5aa00 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -6411,7 +6411,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)) {