[asterisk-commits] file: branch 1.6.1 r176032 - in /branches/1.6.1: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 16 09:38:20 CST 2009


Author: file
Date: Mon Feb 16 09:38:20 2009
New Revision: 176032

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=176032
Log:
Merged revisions 176030 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r176030 | file | 2009-02-16 11:36:19 -0400 (Mon, 16 Feb 2009) | 16 lines
  
  Merged revisions 176029 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r176029 | file | 2009-02-16 11:33:53 -0400 (Mon, 16 Feb 2009) | 9 lines
    
    Don't have the Via header stored as a stringfield as it can change often during the lifetime of a dialog.
    
    This issue crept up with subscriptions on the AA50. When an outgoing NOTIFY is sent a new branch value
    is created and the Via header is changed to reflect it. Since this was a stringfield a new spot in the
    pool was used for the value while the old was left untouched/unused. If the current pool was full a new
    pool was created. This would cause memory usage to increase steadily.
    
    (issue #AA50-2332)
  ........
................

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

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

Modified: branches/1.6.1/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.6.1/channels/chan_sip.c?view=diff&rev=176032&r1=176031&r2=176032
==============================================================================
--- branches/1.6.1/channels/chan_sip.c (original)
+++ branches/1.6.1/channels/chan_sip.c Mon Feb 16 09:38:20 2009
@@ -1290,7 +1290,6 @@
 		AST_STRING_FIELD(peermd5secret);
 		AST_STRING_FIELD(cid_num);	/*!< Caller*ID number */
 		AST_STRING_FIELD(cid_name);	/*!< Caller*ID name */
-		AST_STRING_FIELD(via);		/*!< Via: header */
 		AST_STRING_FIELD(fullcontact);	/*!< The Contact: that the UA registers with us */
 			/* we only store the part in <brackets> in this field. */
 		AST_STRING_FIELD(our_contact);	/*!< Our contact header */
@@ -1299,6 +1298,7 @@
 		AST_STRING_FIELD(url);		/*!< URL to be sent with next message to peer */
 		AST_STRING_FIELD(parkinglot);		/*!< Parkinglot */
 	);
+	char via[128];                          /*!< Via: header */
 	struct sip_socket socket;		/*!< The socket used for this dialog */
 	unsigned int ocseq;			/*!< Current outgoing seqno */
 	unsigned int icseq;			/*!< Current incoming seqno */
@@ -2904,10 +2904,10 @@
 	const char *rport = ast_test_flag(&p->flags[0], SIP_NAT) & SIP_NAT_RFC3581 ? ";rport" : "";
 
 	/* z9hG4bK is a magic cookie.  See RFC 3261 section 8.1.1.7 */
-	ast_string_field_build(p, via, "SIP/2.0/%s %s:%d;branch=z9hG4bK%08x%s",
-			       get_transport_pvt(p),
-			       ast_inet_ntoa(p->ourip.sin_addr),
-			       ntohs(p->ourip.sin_port), (int) p->branch, rport);
+	snprintf(p->via, sizeof(p->via), "SIP/2.0/%s %s:%d;branch=z9hG4bK%08x%s",
+		 get_transport_pvt(p),
+		 ast_inet_ntoa(p->ourip.sin_addr),
+		 ntohs(p->ourip.sin_port), (int) p->branch, rport);
 }
 
 /*! \brief NAT fix - decide which IP address to use for Asterisk server?




More information about the asterisk-commits mailing list