Changes between Initial Version and Version 2 of Ticket #1864


Ignore:
Timestamp:
Jul 14, 2015 8:25:18 AM (6 years ago)
Author:
nanang
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1864

    • Property Status changed from new to closed
    • Property Resolution changed from to fixed
    • Property Summary changed from Assertion in PJSIP when remote remove and add back media lines in the SDP to Assert and crash when remote remove and add back media lines in SDP
  • Ticket #1864 – Description

    initial v2  
    1 When remote remove and add back media lines, it will hit the assertion "Currently no media transport reuse" in pjsua_call_media_init(), which is caused by improper stopping and clean up of the removed media. 
     1Reported scenarios: 
     2 
     3==== Scenario 1 - assertion of "Currently no media transport reuse" ==== 
     4 1. receive offer with 2 media lines, RTP/SAVP and RTP/AVP, both active 
     5 1. accept with 2 media lines in answer, RTP/SAVP gets port zeroed and RTP/AVP active (SRTP mode is set to disabled) 
     6 1. receive reoffer with only 1 media line, RTP/AVP 
     7 1. accept the reoffer 
     8 1. receive reoffer with 2 media lines as in no 1, and assert occurs 
     9It is caused by improper stopping and clean up of the removed media. 
     10 
     11  
     12==== Scenario 2 - crash after accessing invalid call_med->tp pointer ==== 
     13 1. receive offer with 2 media lines, RTP/SAVP and RTP/AVP, both active 
     14 1. send answer with 2 media lines, RTP/SAVP gets port zeroed and RTP/AVP active (SRTP mode is set to disabled) 
     15 1. receive reoffer with only 1 media line, RTP/AVP 
     16 1. reject the reoffer (e.g: because of no matching codec) 
     17 1. receive reoffer with 2 media lines as in no 1, crash occurs 
     18This seems to be a bug in r5124 (initial fix of scenario 1), it stops the removed media stream and cleans up its media transport right after receiving reoffer with less media lines (no 3), so when the SDP nego fails (the re-offer is rejected), call media states become inconsistent. Note that in SDP reoffer/answer, we shouldn't modify the media streams before SDP nego is done, as if SDP nego fails, the media streams should be maintained as if there is no SDP reoffer. 
     19 
     20Also revisiting a related ticket #1626, where it modifies the media streams before SDP nego: the assertion happens because it gets into unknown media type block handler, while it should never do. So we need to update the fix, e.g: only set the media type when it is undefined. 
     21 
     22Thanks to Brian Walker for the reports.