You can't get VOIP to work on the Apple iPhone. Trust me, I've tried researching this before I had the iPhone. Nobody has figured a correct way to do this. There are a couple of websites out there that promoto VOIP for the iPhone but these are not true VOIP methods.
These sites basically make the iPhone dial itself first and than piggy backs onto your Wi-Fi system to make an internet call. The big problem here is that since the method requires you to call yourself, you have to use your valuable cell phone minutes to enable each call. What's the point of doing that?
The only advantage of those methods is if you don't have a landline and you want to dial international numbers. This method gives you cheaper international rates than the regular cell phone companies give you.
One site like this is called s4iphone.com