Here is a sample config to setup auto-provisioning for Cisco handsets. This only covers the part of distributing the config files to the handsets and not the config file creation part.
This assumes that VLAN100 is the VOICE VLAN and PCs are connecting via the PC port at the back of the phones.
!
ip dhcp pool VOICE
network 192.168.100.0 255.255.255.0
default-router 192.168.100.1
dns-server 192.168.100.1
option 66 ascii "http://auto.provisioning.url/"
lease infinite
!
interface Vlan100
description VoiceVLAN
ip address 192.168.100.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
!
interface FastEthernet3
description ToVoiceSwitch
switchport mode trunk
switchport voice vlan 100
!