Ticket #2194 defect closed fixed
small bug in SIP Via header generation
|Reported by:||antoine||Owned by:||washort|
There is a small bug in the Via.toString() method. Perhaps it can only occur in theoretical conditions (I don't know enough about the SIP protocol to know for sure).
However, here it is:
>>> from twisted.protocols import sip >>> via = sip.Via("localhost", ttl=2) >>> via.toString() 'SIP/2.0/UDP localhost:5060;ttl=2' >>> via = sip.Via("localhost", ttl=1) >>> via.toString() 'SIP/2.0/UDP localhost:5060;ttl'
As you see, if a value is exactly 1, it isn't output. This is because of the test "if value == True" at line 207. Replacing it with "if value is True" fixes the bug.