(!globals.no_ring_during_call&&globals.main_stream!=globals.ring_stream))){//if there is a ring stream and not an active call or if there is an active call and we are allowed to ring during it AND the ring stream is not the main stream
if(switch_test_flag(globals.call_list,TFLAG_MASTER)&&globals.main_stream->outdev==outdev){/*so we are the active stream so we need to dupe it basically */
audio_stream=create_audio_stream(-1,outdev);
created_stream=1;
}
switch_mutex_unlock(globals.pvt_lock);
}
if(!audio_stream){
stream->write_function(stream,"Failed to engage audio device\n");