AFTER an 11-day partial ban on signing up new customers, TIM, Oi and Claro, three of Brazil’s four big mobile-phone firms, are back in business. On July 23rd the telecoms regulator, Anatel, imposed the sanctions as a wake-up call about the need for better management and more investment. State by state, it punished the company most complained about: TIM, a subsidiary of Telecom Italia, in 18 states and the Federal District; Oi, which is partly owned by Portugal Telecom, in five; and Claro, which belongs to Mexico’s América Móvil, in three. Vivo, a subsidiary of Spain’s Telefónica that is the biggest operator, escaped by not being worst anywhere.

Shuttle diplomacy in Brasília between regulator, government and companies’ bosses followed. Vivo was asked for detailed investment plans. The other three presented hastily rewritten budgets, bringing forward 4 billion reais ($2 billion) planned for future years to make a total of 20 billion reais to be spent by 2014.

Even 20 billion reais may be too little to avert a telecoms crunch. According to a report in Exame, a business magazine, Anatel thinks the sector needs to invest 240 billion reais in the next decade. But the regulator may not be able to extract more from the industry at the moment. Three of the four firms have parents or big shareholders in cash-strapped southern Europe. They will probably need their Brazilian operations to make up for falling profits at home.

Brazil’s telecoms companies inherited dreadful infrastructure and proportionally few customers when the industry was privatised in the 1990s. Before then, getting a fixed line meant waiting for years—or renting one on the grey market for a small fortune. In 1998 the country had just four mobile phones for every 100 people.

Since then, the industry has invested hundreds of billions of reais, improving coverage and cutting costs. In 2009 TIM launched a price war to grab market share. Cost-conscious chatterboxes snapped up deals offering calls of unlimited duration within the same network. The number of lines in use rose by half, to above 250m. Venko, a local phone maker, now offers a handset that holds four chips, automatically choosing the cheapest for each call.

But capacity did not expand in line with demand. Operators struggled to build new masts, stymied by local planning-rules. Profits and call quality slumped. In June consumer-defence associations said that mobile telephony was now Brazil’s most moaned-about product. One image widely shared on social networks reworks a famous scene from a soap opera. The heroine has climbed onto a roof (showing some thigh) to retrieve a kite. In the altered version, she brandishes a phone, shouting: “I did it! I got a signal from TIM!”

Anatel has not escaped criticism for its part in the mess. Its sanctions were “more or less fair”, says Marceli Passoni of Informa, a consultancy, but its methods left much to be desired. Most of the complaints it cited were about overbilling, not poor coverage. The regulator lacked the capacity to monitor crunchier data on quality. A report published on July 24th by a government-spending watchdog said it was falling short in monitoring firms’ performance and customer satisfaction.