There are things need to be corrected before doing "leg collectdigits:
Please got to "resource" in this tech center
http://developer.cisco.com/web/vgapi/resources
Cisco Tcl sample scripts download and download
its-CISCO.2.0.2.0.zip You can see the example of using it.
Thanks !