diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-12-07 18:09:26 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-12-07 18:09:26 +0000 |
commit | 35dbd8ee15986dcda2ed3d2528bb9717132a83ad (patch) | |
tree | e3b363ef434d9bdd554f5f37631050184cd7c939 /channels/chan_sip.c | |
parent | 37a4a82bc35b62085ffc763ed25d2f47439d6705 (diff) |
Merged revisions 233472 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r233472 | dvossel | 2009-12-07 12:08:46 -0600 (Mon, 07 Dec 2009) | 15 lines
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: http://svn.digium.com/svn/asterisk/branches/1.6.2@233473 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 8bae5f760..725b1fbbc 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -9388,7 +9388,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)) { |