[svn-commits] dvossel: branch 1.6.2 r233473 - in /branches/1.6.2: ./ channels/chan_sip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Dec 7 12:09:28 CST 2009


Author: dvossel
Date: Mon Dec  7 12:09:26 2009
New Revision: 233473

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=233473
Log:
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
  ........
................

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/channels/chan_sip.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_sip.c?view=diff&rev=233473&r1=233472&r2=233473
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Mon Dec  7 12:09:26 2009
@@ -9388,7 +9388,9 @@
 		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)) {




More information about the svn-commits mailing list