Ceasefire talks via middlemen from Qatar, Egypt and the US had been dragging on for several months, at times without hope.