Have you been holding out on unlocking your AT&T handset because you don't want to nuke your jailbreak? Now you can safely unlock your iPhone and keep your jailbreak thanks to an updated version of Redsn0w.
First, you need to approach AT&T and request the unlock code. You can only do this if your handset is currently off-contract. Once AT&T have agreed to unlock your handset you need to wait anything between a few hours to a few days for the unlock code to be issued by Apple. Once this has happened you will receive an email, by which time you are ready to move onto the unlocking stage.
The next process will work for all iPhones except the iPhone 4S. Redsn0w does not work on this model and you have to take a different approach. Fortunately, there won't be many off-contract AT&T iPhone 4S devices out and about yet.
Next, you need to download the latest version of Redsn0wfor Windows or Mac, extract the files and run the executable. Once you've done this select Jailbreak and then you will be guided into putting your handset into DFU mode, but you'll need nimble fingers to do this -- so follow the instructions Redsn0w gives you quickly but carefully. If you fail to follow the instructions fast enough, go back and try again.
If you've never put an iOS device into DFU mode before you might want to familiarize yourself with the process first.
Once your iPhone is in DFU mode and Redsn0w has detected it, you're ready to proceed. Uncheck Install Cydia and check Deactivate the click Next. You're not actually carrying out a jailbreak here, just preparing the handset to receive the activation and unlock code from iTunes.
Once that is done, connect your iPhone to iTunes via a cable and activate it. This will unlock your iPhone while keeping your jailbreak intact.
Image credits: AT&T/ZDNet