The situation is still very confused but my impression is that the coup has probably failed. If a government is not overthrown within a few hours of a coup taking place then the coup generally cannot succeed.
In a case where soldiers are confronted by civilians it is notoriously difficult to get soldiers to open fire unless they are absolutely sure of the legitimacy of the government which is giving the order for them to do so. A coup that runs into the sort of opposition this one is running into from sections of the civilian population generally cannot succeed precisely because it is so difficult to persuade soldiers to open fire in such a situation.
The coup plotters seem to have made two key mistakes:
(1) they did not immediately arrest the senior members of the government probably because since the coup seems to have been led by middle ranking officers they did not have direct access to them. The result however was that the government was left intact and in a position to mobilise opposition to the coup.
(2) they did not announce who they were making it possible for the government to present them as merely a faction within the military as opposed to the entire military led in the endeavour by the military’s senior leadership. Note however that senior officers did not immediately rush out to condemn the coup or to declare their loyalty to Erdogan suggesting that they tacitly approved the coup even if they were not prepared to lead it.
As of now none of this is certain. We should know the final outcome of the coup attempt within the next few hours.