You have to leave it active, contact the the other carrier and order their service and request the number be ported. AFTER they port the number the current carrier will automatically drop the service for it. If COX is the current carrier, you may have to return the modem, or if using for internet also, expect to pay a rental fee for the modem. Modems are only provided at no charge when they have phone service through them.
ALSO, make sure you are not on a 1 or 2 year discounted plan with the phone service. Early termination of the plan could result in early termination fees.