This howTo assumes that vocal has been configured as all-in-one system or the
auto-provision capability is being enabled on a host running the provisioning
server in a multi-host installation.
1. Install the Auto-Provisining RPM.
    #> rpm -i AtaAuto-<version>.i386.rpm
2. Make sure firewall rules on the linux box allows for TFTP requests.
3. Configuration flags in ATA
   3a.Make sure dhcp option is set to 1 in ATA. 
   Q. When hookup the brand new ATA from the box, how to set the dhcp on in ATA.
   A. Pick up the phone connected to ATA and press the button on ATA. You
      should here a command prompt. punch in 20# then 1# and then 3. This
      will save dhcp=1 in ATA.

   3b. Make sure useTftp option in ATA is turned on.
   Q. When hookup the brand new ATA from the box, how to set the useTftp on 
      in ATA.
   A. Pick up the phone connected to ATA and press the button on ATA. You
      should here a command prompt. punch in 305# then 1# and then 3. This
      will save useTftp=1 in ATA. 
Note: Make sure to power cycle the ATA after setting the flags.

5. If tftp is not installed, install the tftp rpm first( you can get RPM
   from http://rpmfind.net/linux/RPM/redhat
   a. If installing from source RPM, first create binary RPM from source
   rpm.  
       rpm --rebuild tftp-0.28-2.src.rpm
   b. install binary rpm
      rpm -i  tftp_binary_rpm
6. Setting up the tftp server
   a. Copy or replace the old in.tftpd
      #> cp /usr/local/vocal/bin/in.tftpd /usr/sbin/in.tftpd

7. In dir /etc/xinetd.d, create/modify /etc/xinetd.d/tftp to have 
   following entry
service tftp
{
  socket_type = dgram
  protocol    = udp
  wait        = yes
  user        = root
  server      = /usr/sbin/in.tftpd
  server_args = -h http://localhost/vocalconf/private/atatftp.pl/ -u nobody -s /
  disable     = no
  flags       = NOLIBWRAP
  passenv     =
  log_type    = SYSLOG daemon info
  log_on_failure = HOST EXIT
  log_on_success = HOST EXIT
}

8. Restart the xinetd
   #> /etc/rc.d/init.d/xinetd restart

9. Setup the dhcp server
   A nice site to get the dhcp server running
    http://www.tldp.org/HOWTO/mini/DHCP/x369.html#DHCPSERVER

10. Modify the /etc/dhcpd.conf file to include

group {

option tftp-server-name "host_IP_running_tftpd";
host ata1 {
hardware ethernet enter_the_mac_address_of_ata_here;
}
}

add one such entry for each ATA that needs provisioning

11. The file /usr/local/vocal/cgi-bin/private/atatftp.pl needs to be
supplied with the password that you chose for vocal provisioning. Search for
word "hello" in it and replace it with vocal provisoning password.

12. From cco.cisco.com, get the software of ATA 186.The distribution 
contains the files cfgfmt.c and ptag.dat. Extract the contents of ATA
software in a dir say ciscoATA.Compile the file cfgfmt.c 
#> cd ciscoATA
#> gcc -o cfgfmt cfgfmt.c

and copy the binary "cfgfmt" and ptag.dat from ATA software
to /usr/local/vocal/bin
#> cp cfgfmt /usr/local/vocal/bin
#> cp ptag.dat /usr/local/vocal/bin

   Note: In order to upgrade the software on the ATA along with the
   provisioning do following.
   a. Copy ata18x-xx-xx-xxx.zup file in /usr/local/vocal/etc
   #> cp ata18x-xx-xx-xxx.zup /usr/local/vocal/etc
   b. Lets say the version of software is v2, 2.15 and the zup file is
      ata18x-v2-15-020723a.zup, edit /usr/local/vocal/etc/ataParams.txt 
      and add following
   upgradecode:3,0x301,0x0400,0x0200,{TFTP_HOST},69,0x020723a,ata18x-v2-15-020723a.zup

13. Debugging help. To know if things are working fine or not, look for the following
   files for debug info.
   a. /var/log/messages
   All message related to DHCP and TFTP request will be logged in this file, when
   this are working fine a typical output will look like

   ===
   Oct  3 11:06:59 veer-lnx2 dhcpd: DHCPDISCOVER from 00:09:e8:8e:34:2f via eth0
   Oct  3 11:07:00 veer-lnx2 dhcpd: DHCPOFFER on 10.1.1.32 to 00:09:e8:8e:34:2f via eth0
   Oct  3 11:07:00 veer-lnx2 dhcpd: DHCPREQUEST for 10.1.1.32 from 00:09:e8:8e:34:2f via eth0
   Oct  3 11:07:00 veer-lnx2 dhcpd: DHCPACK on 10.1.1.32 to 00:09:e8:8e:34:2f via eth0
   Oct  3 11:07:01 veer-lnx2 in.tftpd[5087]: stat=0
   Oct  3 11:22:00 veer-lnx2 xinetd[2388]: EXIT: tftp status=0
   ===

   b. /tmp/.atalog
   All the message going from autoprovisioning scripts are logged in the file. A
   sucess scenario output would look like
   
   ====
   MAC address is ata0009e88e342f
   setting UID0 to 1003
   setting SipOutBoundProxy to 10.1.1.1
   ===

   c. /etc/httpd/logs/access-log
   A cgi script request from the TFTP server, to server ATA186 request will be logged
   in this file. A typical output will look like
   
   ====
   127.0.0.1 - - [03/Oct/2002:11:07:01 -0700] "GET /vocalconf/private/atatftp.pl/ata0009e88e342f HTTP/1.0" 200 113 "-" "-"
   ====

   d. /etc/http/logs/error-log
   Any error encountered in executing the cgi scripts will be logged in this file. A
   typical error scenario would look like

   ===
   [Wed Oct  2 17:28:07 2002] [error] [client 127.0.0.1] script not found or unable to stat: /usr/local/vocal
[Wed Oct  2 17:35:31 2002] [error] [client 127.0.0.1] Premature end of script headers: /usr/local/vocal/cgi-bin/private/atatftp.pl
   ===

14. Hookup the ATA and power up. The ATA will talk to the dhcp server,
will get the address of TFTP server from DHCP response and send a RRQ
request to tftp server with mac address. Tftp server in turn will invoke
the provisioning process, and send the configuration back to ATA with
its provisoned number. To check the provisioned number run

http://ATA_IP_ADDRESS/dev

Field UID0 is the provised number. To get the ATA IP address, pickup the
phone and tap the button on ATA and you should here command option. Press
80# and it will speak the IP address.


======================================================================

Copyright 2000-2003, Cisco Systems, Inc.
THE INFORMATION HEREIN IS PROVIDED ON AN "AS IS" BASIS, WITHOUT ANY
WARRANTIES OR REPRESENTATIONS, EXPRESS, IMPLIED OR STATUTORY, INCLUDING
WITHOUT LIMITATION, WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY OR
FITNESS FOR A PARTICULAR PURPOSE.

$Id: ATA186HowToProvision.txt,v 1.5.2.1 2003/03/28 05:25:53 bko Exp $
