Collect Digit for Confirmation

Version 1
    This document was generated from CDN thread

    Created by: JAMES DEPHILLIP II on 19-10-2010 03:32:17 PM
    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

    Subject: RE: Collect Digit for Confirmation
    Replied by: Yaw-Ming Chen on 19-10-2010 04:19:21 PM
    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 !

    Subject: RE: Collect Digit for Confirmation
    Replied by: JAMES DEPHILLIP II on 19-10-2010 04:57:42 PM
    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

    Subject: RE: Collect Digit for Confirmation
    Replied by: Yaw-Ming Chen on 19-10-2010 05:12:02 PM
    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 !