how does an ip phone recognize the network that belong to and start the dhcp process when it pluged to a switch?
the only information that learn is just a voice vlan ID. Is it he register mac address to the CCM or something else?
Yes, you are on the right track here :) Here are the steps involved with an IP Phone startup;
1. Obtaining Power from the Switch
If a phone is not using external power, the switch provides in-line power through the Ethernet cable attached to the phone.
2. Loading the Stored Phone Image
The Cisco IP Phone has non-volatile Flash memory in which it stores firmware images and user-defined preferences. At startup, the phone runs a bootstrap loader that loads a phone image stored in Flash memory. Using this image, the phone initializes its software and hardware.
3. Configuring VLAN
If the Cisco IP Phone is connected to a Cisco Catalyst switch, the switch next informs the phone of the voice VLAN defined on the switch. The phone needs to know its VLAN membership before it can proceed with the Dynamic Host Configuration Protocol (DHCP) request for an IP address.
4. Obtaining an IP Address
If the Cisco IP Phone is using DHCP to obtain an IP address, the phone queries the DHCP server to obtain one. If you are not using DHCP in your network, you must assign static IP addresses to each phone locally.
5. Accessing a TFTP Server
In addition to assigning an IP address, the DHCP server directs the Cisco IP Phone to a TFTP Server. If the phone has a statically-defined IP address, you must configure the TFTP server locally on the phone; the phone then contacts the TFTP server directly.
Note You can also assign an alternative TFTP server to use instead of the one assigned by DHCP.
6. Requesting the CTL file
The TFTP server stores the certificate trust list (CTL) file. This file contains a list of Cisco CallManagers and TFTP servers that the phone is authorized to connect to. It also contains the certificates necessary for establishing a secure connection between the phone and Cisco CallManager.
7. Requesting the Configuration File
The TFTP server has configuration files, which define parameters for connecting to Cisco CallManager and other information for the phone.
8. Contacting Cisco CallManager
The configuration file defines how the Cisco IP Phone communicates with Cisco CallManager and provides a phone with its load ID. After obtaining the file from the TFTP server, the phone attempts to make a connection to the highest priority Cisco CallManager on the list. If security is implemented, the phone makes a TLS connection. Otherwise, it makes a non-secure TCP connection.
If the phone was manually added to the database, Cisco CallManager identifies the phone. If the phone was not manually added to the database and auto-registration is enabled in Cisco CallManager, the phone attempts to auto-register itself in the Cisco CallManager database.
Note Auto-registration is disabled when security is enabled on Cisco CallManager.
From this doc;
There is also a very detailed step by step here;
Troubleshooting Cisco IP Phone Registration Problems with Cisco CallManager 3.x and 4.x
Hope this helps!