You'll need to purchase an IMEI through a seller on sites like eBay or ApplenBerry. But when you say "Apple has locked my phone" did you attempt to enter an IMEI unlock before and failed?
Not apple AT&T locked it. I canceled my contract early and they blocked my phone from using other carriers. I have unblocked my other 2 thru ............ but they can't do my iPhone. When I change the sims it's asking for a unlock pin code.
For that, you'll need an IMEI unlock. Your device is blacklisted. Using an IMEI unlock will put your device back on the whitelist. UltraSn0w may work. I'm assuming it's a 4 or a 4S?
In the case of the 4S, I'd just pay the 10$ or so for an IMEI unlock and get it over with once and for all. You can do whatever you want with the device and it'll still be unlocked regardless. IMEI unlocks are linked to your device, not a SIM like SAM unlocks or instances like UltraSn0w.