The Japanese group NEC is to sell its portable phone factories in Mexico, and is considering getting rid of almost all its other foreign telecommunications equipment plants abroad within two years.