« Back to TCL-API

Collect Digit for Confirmation

Combination View Flat View Tree View
Threads [ Previous | Next ]
How do I collect a single digit for confirmation?  I get an error with everything I try.  I just want to have the user press 1 to confirm.
 
Thank You

Did you set "param(maxDigits) 1" ?
 
param(maxDigits)¿Maximum number of digits to collect before returning.
 
It's easier you show how you do it and what error you got to find out the probelm.
 
Thanks !

I tried that but still have not had any success.  Here is what I currently have.
 
proc init { } {
leg setupack leg_incoming
leg proceeding leg_incoming
leg connect leg_incoming

 
proc act_Setup { } {
global params
global pattern
init
media play leg_incoming flash:en_media_record.au
set params(maxDigits) 1
set pattern(1) "1"
leg collectdigits leg_incoming params pattern
}  
 
proc act_Call { } {
set confirm [infotag get evt_dcdigits]
if { $confirm == 1 } {
set callInfo(displayInfo) "hello"
leg setup 4000 callInfo leg_incoming
}
else {
call close
}
}
 
proc act_Cleanup { } {
call close 

 
#---------------------------------- 
#   State Machine 
#---------------------------------- 
 set TopFSM(CALL_INIT,ev_setup_indication) "act_Setup PROMPT"
 set TopFSM(PROMPT,ev_collectdigits_done)  "act_Call CALLACTIVE" 
 set TopFSM(CALLDISCONNECT,ev_disconnected)"act_Cleanup same_state"
 set TopFSM(CALLDISCONNECT,ev_disconnect_done) "act_Cleanup same_state"
 
 fsm define TopFSM CALL_INIT

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 !