You are charged an early termination fee.
Explanation:
When you sign a contract you will have to see if you are viable to pay an early termination fee in case you decide to terminate a contract in between and if so how much it will cost to do so.
There are no other legal obligations in place usually unless directly specified in the service contract.
Usually the fee is to cover for the cost procured or that will be procured on securing newer services in the face of the termination.