You could also try to put in a sim card without a pin code, and then go to Settings -> General -> Cellular -> "enable 3G" or for iPhone 5 "enable LTE", if 3G/LTE don't show up, go back to General -> Cellular. And then se if it shows, enable and disable fast a couple of times and 3G should appear in the status bar. When it shows, wait for a couple seconds with "enable 3G" on, 2-3 seconds later disable it and enable it again. There you go, you should now be able to get a service, on operator locked iPhones, you will have to activate the phone, but then you could use your original sim card on the phone to activate it. You may have to activate through signing in with Apple ID.
Any questions just comment