[asterisk-bugs] [Asterisk 0017326]: [patch] Computation of Content-Length is wrong under some circumstances

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Jun 7 20:55:36 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17326 
====================================================================== 
Reported By:                kenner
Assigned To:                mnicholson
====================================================================== 
Project:                    Asterisk
Issue ID:                   17326
Category:                   Channels/chan_sip/Interoperability
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
JIRA:                       SWP-1451 
Regression:                 No 
Reviewboard Link:           https://reviewboard.asterisk.org/r/693/ 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 262655 
Request Review:              
====================================================================== 
Date Submitted:             2010-05-12 10:14 CDT
Last Modified:              2010-06-07 20:55 CDT
====================================================================== 
Summary:                    [patch] Computation of Content-Length is wrong under
some circumstances
Description: 
add_sdp has a bug in the computation of Content-Length.  It first computes
the length by adding together the sizes of a large number of things, then
outputs the length, THEN the things.  That's error-prone if the computation
doesn't agree with what's written.  And, in fact, it doesn't, in some
cases. In each of the cases where it write a dummy media line, that line
isn't included into the count.  This causes interoperability issues with
the Polycom VSX 7000 since it checks the Content-Length.  I have the fairly
obvious patch to account for the length of these lines, but it just makes
the kludge of that part of the code worse.  My recommendation is to not use
add_line, but instead to build up a single string and then take the size of
that string for the header and then outut it.

====================================================================== 

---------------------------------------------------------------------- 
 (0123091) kenner (reporter) - 2010-06-07 20:55
 https://issues.asterisk.org/view.php?id=17326#c123091 
---------------------------------------------------------------------- 
This works too and I attached the backport I used. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-06-07 20:55 kenner         Note Added: 0123091                          
======================================================================




More information about the asterisk-bugs mailing list