[asterisk-bugs] [Asterisk 0018591]: [patch] race condition in setting local capabilities for Setup when fastStart is enabled

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Jan 9 14:15:47 CST 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18591 
====================================================================== 
Reported By:                under
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18591
Category:                   Channels/chan_h323
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.0 - SECURITY ONLY! Test 1.6.2 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-01-09 13:57 CST
Last Modified:              2011-01-09 14:15 CST
====================================================================== 
Summary:                    [patch] race condition in setting local capabilities
for Setup when fastStart is enabled
Description: 
When fastStart is enabled, terminal capabilities (supported codecs/dtmf
modes) should be sent in Setup to remote peer. But sometimes they are not
set and Setup is sent empty. This leads to voice path is not created
(remote peer doesn't know what are our capabilities). Some equipment drop
this call immediately.

This happens due to race condition.
Sometimes "oh323_pvt.cd.call_token" is set AFTER openh323 "asks" chan_h323
for local capabilities (because it "asks" in separate thread from the one
where MyMakeCall() is invoked).

And therefore, when openh323 "asks" for local capabilities, chan_h323 is
unable to find "oh323_pvt" structure in set_local_capabilities() by call
reference and call_token, because call_token was not set yet (it happens in
different thread, as I already wrote).

However "oh323_pvt.cd.call_reference" is set ok, because it's set under
H323Connection::Lock().

Same logic should be used for "call_token" to prevent race condition.
====================================================================== 

---------------------------------------------------------------------- 
 (0130339) under (reporter) - 2011-01-09 14:15
 https://issues.asterisk.org/view.php?id=18591#c130339 
---------------------------------------------------------------------- 
in the attached patch error logging of this case is enabled and actual fix
is implemented. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-09 14:15 under          Note Added: 0130339                          
======================================================================




More information about the asterisk-bugs mailing list