I think the problem is the phone is not originally from AT&T. So the AT&T unlock code will not work. He said he brought it from ebay. maybe even from another country. So his current location's provider will not have that code. (if i understand him correctly). if he want a working code, he probably need to contact the oversea provider the phone originally made in.
In this case, it is quite not possible. unless the seller from ebay knows the code or check for him from his local provider. otherwise, the only option here is to flash unlock it by yourself. please follow the guide on this forum. is the first few sticky thread.