By Jonathan Head
BBC's East Asia correspondent
Mr Gambari met Aung San Suu Kyi but not key military leaders
The mission of the UN special envoy to Burma, Ibrahim Gambari, which began with high hopes nearly two years ago, is now over.
That much is clear after this, his fifth visit since May 2006.
After a break of almost a year, Mr Gambari returned to Burma last September, armed with the full weight of the international community's revulsion over the scenes of unarmed demonstrators being gunned down by Burmese soldiers on the streets of Rangoon.
His mission was backed by all UN member states, even China, which has long rejected putting outside pressure on the military government. It is hard to imagine a stronger mandate.
Mr Gambari had three main objectives. The first was to get a dialogue going between the generals and opposition figures, especially Aung San Suu Kyi who has been kept in complete isolation in her home in Rangoon since 2003.
This, he hoped, would eventually lead to a more credible process of democratisation than the military's tightly-controlled Seven Stage Roadmap to Democracy.
He also pushed for the release of all political prisoners, including those detained during the September uprising, and he asked for the UN to be allowed to set up a joint poverty alleviation drive with the government.
Reeling from the blast of international outrage, the generals appeared to be willing to accommodate Mr Gambari at first, designating the admittedly low-ranking Labour Minister Aung Kyi to liaise with Ms Suu Kyi, and releasing some detainees.
But this conciliatory mood lasted less than a month.
On his next visit in late October, Mr Gambari was shunned by Senior General Than Shwe, the key decision-maker in the ruling military council.
It was a bad sign. The meetings between Aung San Suu Kyi and the labour minister went nowhere, and then stopped altogether.
Ms Suu Kyi will be barred from political office under the new plans
Mr Gambari remained upbeat, and said he had been given a promise by the generals that he could return to Burma anytime he chose.
But for the next four months they stonewalled him. And now we know why.
The Seven Stage Roadmap, which, with no timetable, had always seemed like a military-fabricated illusion, suddenly got one.
Without warning, the government announced that there would be a general election by 2010, with a referendum on the new constitution it has spent the past 14 years drawing up no later than May this year.
This was unexpected. And it left Mr Gambari with no hand left to play when he was finally allowed back this month.
Critics were quick to point out the obvious flaws in the military's plan.
The constitution was drawn up by about 1,000 appointed delegates, who were confined to a purpose-built convention centre during the long drafting process.
The public had no input, and details of the constitution were still unclear even when the referendum was announced.
What is known is that the charter will reserve 25% of the seats in a new parliament for the armed forces, and that Aung San Suu Kyi will be specifically barred from holding government office because she was once married to a foreigner.
Criticising the draft constitution is punishable by up to 20 years in prison; criticising the referendum could get you three years behind bars; and about 2,000 political prisoners remain in captivity.
It is impossible to conceive how a free vote could take place in such conditions.
But that hardly matters to Than Shwe and his colleagues. Now the government has something it can flourish in the faces of those who insist it takes concrete steps towards democratic rule.
UN Secretary General Ban Ki-moon gamely urged the generals to make their roadmap to democracy and its constitution more inclusive, but over the weekend they threw his suggestion back in Mr Gambari's face.
Burma's leaders have shown that they will crush any dissent
"It is impossible to review or rewrite the constitution," said Information Minister Kyaw Hsan, who is usually the mouthpiece for the more hard-line thinking inside the government.
He then went on to accuse Mr Gambari of bias, lashing out at him for carrying out a letter from Aung San Suu Kyi last November.
The diplomat who was supposed to represent the will of the international community was being publicly scolded by a pariah regime.
It was a telling sign of how little clout the UN envoy now carries.
His proposals to include the opposition in the political process, and to have international observers monitor the referendum, were instantly rejected.
Despair and resignation
This could well be Ibrahim Gambari's last visit. It is hard to see why he would wish to put himself through such humiliation again. So what will happen in Burma?
After miscalculating the results of the 1990 election, which they lost by a huge margin to Aung San Suu Kyi's National League for Democracy, the generals are unlikely to leave much to chance this time.
There is little optimism on the streets of Burma right now
The date of the referendum will only be announced 21 days beforehand.
There will be no discussion of the constitution's merits. There will be heavy mobilisation in support of it by the military's political wing, the USDA.
They may even make identifiable boxes for yes and no votes at the polling stations, to intimidate opponents.
Then they have two years in which to prepare for the election - two years in which the opposition will continue to be harassed and jailed.
Some opposition figures are now debating whether it is worth continuing to confront the military, at such high cost.
They argue that perhaps the best option is to use the generals' willingness to embrace change, however limited, and try to push a little further.
There is a sense of despair and resignation, after the brief euphoria last September.
There is of course always the possibility of unexpected events interfering with the military's plans - a power struggle at the top, or another mass uprising driven by economic desperation.
But recent history will have taught the Burmese people that they cannot count on such miracles.