Some users have reported a loss of visual voicemail after the update to iOS 4.0.x. In these cases, either no new visual voicemail messages appear, or tapping the voicemail icon in the Phone app results in simply dialing the user’s own number (to manually access traditional voicemail).
Fixes
Call voicemail (try this first). In some cases, this issue can be resolved by simply dialing your own number to manually access voicemail, at which point you may be prompted for your voicemail password. After entering your password, visual voicemail messages may appear.
Reset password on AT&T website (try this next). Log in to your myWireless Account and select My Services. Then choose the Reset Voicemail Password link from the right column under Phone/Device Support. After resetting your password, you’ll get a text message with a new password. You should then see a message indicating that your password is wrong, at which point you should enter the new password. Otherwise, tap voicemail and enter the new password.
Restore, but not from backup (try this last). It appears that bad holdover data from iPhone backups (especially those created for previous iPhone models) can cause this issue. Restoring as a new phone will delete contacts and other data, but may resolve the problem. To do so, connect your iPhone or iPod touch to your computer, click “Restore” in iTunes, then choose “setup as new phone.”
Some incidences of this issue may require a DFU restore.