That is the million dollar question.
My take is the military has lost the fight. They should have neutralized the leader first.
Yes it appears the coup is failing. There is a report that Erdogan has landed back in Turkey. Too bad as the country will now go into a full Islamic autocracy.