How do airlines judge when and where it's safe to fly near a conflict zone?

The conflict in the Middle East is continuing to disrupt global air traffic with nearly 4000 flights a day being cancelled across the region.