This wikiHow teaches you how to automatically switch calls to voicemail on iPhone. This guide is for setting up an English iPhone and iPad.
Step
Part 1 of 2: Knowing the Voicemail Number

Step 1. Open the Phone app on the Iphone
Touch icon
on the homepage to open the app.

Step 2. Touch the Keypad button at the bottom of the screen
This will open the phone number keypad so you can enter the number to call.

Step 3. Enter *#67# on the number pad
This command will allow you to see the phone number that directed you to the voice mailbox.

Step 4. Touch the Call button
It has a white phone icon in the center of a green circle and is located below the number pad. This button will process the command number, and show the voicemail number on a new page.

Step 5. Write down the voicemail number
You can see the phone number at the top of the screen. This number will divert incoming calls to your voice mailbox.
You can press the iPhone home button and the power button at the same time to capture the screen of this page

Step 6. Touch Dismiss
This button will close the call page.
Part 2 of 2: Diverting Calls to Voicemail

Step 1. Open the iPhone settings menu
Find and touch the icon
on the homepage to open the settings menu.

Step 2. Swipe down and then touch Phone
This option is next to the icon
and is in the middle of the settings menu page.

Step 3. Touch Call Forwarding on the menu
This will open call forwarding settings in a new page.

Step 4. Slide the Call Forwarding button to
When this option is activated, all incoming calls will be diverted to the number you selected.
You will be asked to enter a phone number to divert calls to

Step 5. Enter the voicemail number
Enter the voice mailbox number on this page. This will redirect all incoming calls to voicemail.
Alternatively, you can enter an unused phone number on this page. By doing this, calls will not be routed to voicemail. However, it can show as if your number is disconnected and not being used anymore

Step 6. Touch the < Call Forwarding button on the top left
This will save the voicemail number, and divert all incoming calls to the voicemail box.