PRO_BR_IVR.tcl

Version 1
    This document was generated from CDN thread

    Created by: Daniel R. A. Sobrinho on 17-07-2013 07:34:22 AM
    Hi,

    Recently we have made a script IVR with 4 options and a deviation by any action.
    However, there were some complaints about the calling number, for not being routed to the IP phones Cisco 3905.
    Would know tell me if there is anything that can be done in this script to be calling number routed to IP Phones?

    Following the sample of script.

    Best regards
    Daniel

    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Yaw-Ming Chen on 25-07-2013 01:01:45 PM
    Daniel R. A. Sobrinho:
    Hi,

    Recently we have made a script IVR with 4 options and a deviation by any action.
    However, there were some complaints about the calling number, for not being routed to the IP phones Cisco 3905.
    Would know tell me if there is anything that can be done in this script to be calling number routed to IP Phones?

    Following the sample of script.

    Best regards
    Daniel

    If we don't see calling party number been routed to router or to all phones then script could play a role but not route to certain type of phone that might not related to script. If you can attached script we can take a look.

    Thanks
    Yawming

    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Daniel R. A. Sobrinho on 26-07-2013 09:11:30 AM
    Hi Yawming,

    How can I procced to send for you the Script?

    # PRO_BR_IVR.tcl
    # Script Version 1.0.1
    # Created by XXXXXX
    #------------------------------------------------------------------
    # January 2013, CCCCCC,XXXXXX
    # Copyright (c) 1998, 1999 by Cisco Systems, Inc.
    # All rights reserved.
    #------------------------------------------------------------------
    #

    proc init { } {
        global param
        set param(interruptPrompt) true
        set param(abortKey) *
        set param(terminationKey) #
        set param(maxDigits) 1
        set param(interDigitTimeout) 15
    }
    proc act_Setup { } {
        global param
        global x
        set x 0
        
        leg setupack leg_incoming  
        leg proceeding leg_incoming
        leg connect leg_incoming
        media play leg_incoming "flash:/Prosegur_BR_URA.wav"
        leg collectdigits leg_incoming param
        }
    proc act_GotDest { } {
        global dest
        global param
        global x
        set status [infotag get evt_status]
        if {  $status == "cd_005" } {
        set opt [infotag get evt_dcdigits]
        
            if { $opt == "1" } {
                set dest 139707
                puts "Operacional"
                media play leg_incoming "flash:/silencio.wav"
            }
            if { $opt == "2" } {
                set dest 139714
                puts "Tesouraria"
                media play leg_incoming "flash:/silencio.wav"
            }
            if { $opt == "3" } {
                set dest 139717
                puts "Gerencia"
                media play leg_incoming "flash:/silencio.wav"
            }
            if { $opt == "4" } {
                set dest 139797
                puts "Vigilancia"
                media play leg_incoming "flash:/silencio.wav"
            }
            if { $opt != "1" } {
                if { $opt != "2"} {
                    if { $opt != "3"} {
                        if { $opt != "4"} {
                            puts "Opcao invalida"
                            media play leg_incoming "flash:/opt_invalida.wav"
                            #leg collectdigits leg_incoming param
                            fsm setstate REPEATMENU
                            
                        }
                    }
                }    
            }    
        }        
        if { $status == "cd_001" } {
            set dest 139797
            puts "Timeout-recepcao"
            media play leg_incoming "flash:/silencio.wav"
     
        }
        if { $status == "cd_007" } {
            call close
        }
    }
    proc act_PlayMenu { } {
        global param
        puts "menu-ura-play"
        media play leg_incoming "flash:/Prosegur_BR_URA.wav"
        leg collectdigits leg_incoming param
    }
    proc act_PlaceCall { } {
        global dest
        set status2 [infotag get evt_status]
        puts "Place Call"
        
        if { $status2 == "ms_004" } {
        call close
            }
        #leg proceeding leg_incoming
        leg setup $dest callInfo leg_incoming
    }
    proc act_Cleanup { } {
        puts "Call Clean up"
        call close
    }
    requiredversion 2.0
    init
    #----------------------------------
    #   State Machine
    #----------------------------------
      set TopFSM(CALL_INIT,ev_disconnected) "act_Cleanup,CALL_END"
      set TopFSM(CALL_INIT,ev_setup_indication) "act_Setup,GETDEST"
      set TopFSM(GETDEST,ev_collectdigits_done) "act_GotDest,PLACECALL"
      set TopFSM(REPEATMENU,ev_media_done) "act_PlayMenu,GETDEST"
      set TopFSM(PLACECALL,ev_media_done) "act_PlaceCall,CLEAN"
      set TopFSM(CLEAN,ev_disconnected) "act_Cleanup,CALLDISCONNECTED"
      set TopFSM(CALLDISCONNECTED,ev_disconnected) "act_Cleanup,same_state"
      set TopFSM(CALLDISCONNECTED,ev_media_done)  "act_Cleanup,same_state"
      set TopFSM(CALLDISCONNECTED,ev_disconnect_done) "act_Cleanup,same_state"
      set TopFSM(CALLDISCONNECTED,ev_leg_timer) "act_Cleanup,same_state"

    fsm define TopFSM  CALL_INIT

    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Daniel R. A. Sobrinho on 26-07-2013 09:37:46 AM
    Hi Yawming

    The last message have the output of the same script.

    Thanks,
    Daniel



    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Yaw-Ming Chen on 26-07-2013 09:31:58 AM
    If this is your script then you don't need to send again. We will take a look. If not if can either attach script if you can share your script or send to
    developer-support@cisco.com if you don't want to share it.

    Thanks,

    Yawming

    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Yaw-Ming Chen on 26-07-2013 09:53:51 AM
    I don'd see any problem of setup the call.
    What is the protocol used for both incoming and ourgoing leg ?
    Let's do these:

    1st, we use infotag to make sure Tcl API does have calling number
    proc act_Setup { } {
        global param
        global x
        set x 0
        
        leg setupack leg_incoming  
        leg proceeding leg_incoming
        leg connect leg_incoming
        set ani [infotag get leg_ani]
        puts "******** ANI is $ani *********"

        media play leg_incoming "flash:/Prosegur_BR_URA.wav"
        leg collectdigits leg_incoming param
        }

    2nd, we need debug for not working case
    deb voip app tcl
    deb voip app scr
    deb voip ccapi inout

    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Yaw-Ming Chen on 26-07-2013 11:21:43 AM
    If you add this puts command in your act_Setup procedure we can tell if PSTN sent easily

       set ani [infotag get leg_ani]
        puts "******** ANI is $ani *********"


    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Daniel R. A. Sobrinho on 26-07-2013 11:08:50 AM
    Hi Yawming,

    The protocol is H.323. So I think that PSTN is not sending the ANI, Yestarday I have requested them to active this service on the lines.
    I have done the same test in another gateway and it works fine.

    Best regards,
    Daniel Sobrinho

    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Yaw-Ming Chen on 30-07-2013 03:16:03 PM
    Looks like you only collect 1 digit so you can utilize initialDigitTimeout.
    But 3 second is very short for that so use carefully.

    param(initialDigitTimeout)—Initial digit timeout value in seconds. The default is 10.

    Thanks,

    Yawming

    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Daniel R. A. Sobrinho on 30-07-2013 02:34:49 PM
    Hi Yawming,

    How can I  change timeout option for 3 seconds, before flow to extension 139717 ?

    proc act_GotDest { } {
        global dest
        global param
        global x
        set status [infotag get evt_status]
        if {  $status == "cd_005" } {
        set opt [infotag get evt_dcdigits]
        
            if { $opt == "1" } {
                set dest 139707
                puts "Operacional"
                media play leg_incoming "flash:/silencio.wav"
            }
            if { $opt == "2" } {
                set dest 139714
                puts "Tesouraria"
                media play leg_incoming "flash:/silencio.wav"
            }
            if { $opt == "3" } {
                set dest 139716
                puts "Gerencia"
                media play leg_incoming "flash:/silencio.wav"
            }
            if { $opt == "4" } {
                set dest 139718
                puts "Vigilancia"
                media play leg_incoming "flash:/silencio.wav"
            }
            if { $opt != "1" } {
                if { $opt != "2"} {
                    if { $opt != "3"} {
                        if { $opt != "4"} {
                            puts "Opcao invalida"
                            media play leg_incoming "flash:/opt_invalida.wav"
                            #leg collectdigits leg_incoming param
                            fsm setstate REPEATMENU
                            
                        }
                    }
                }    
            }    
        }        
        if { $status == "cd_001" } {
            set dest 139717
            puts "Timeout-recepcao"
            media play leg_incoming "flash:/silencio.wav"

     
        }
        if { $status == "cd_007" } {
            call close

    Best regards,
    Daniel

    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Daniel R. A. Sobrinho on 30-07-2013 02:49:24 PM
    Regarding the last information of ANI.

    Call from A to B.
    A ---PSNT----E1->GWY--->CUCM--->Phone B
    I have applied the line on script as you recommend and I can see the calling number has been sent . So, I noticed that after phone <A> hang up, the phone  <B> continued up and with timeslot of E1 connected. Only after pleace phone on hook that call clear

    Jul 30 19:40:23.333: //78482//TCL :/tcl_PutsObjCmd: Call Clean up
    Jul 30 19:40:23.333:
    Jul 30 19:40:33.754: //78509//TCL :/tcl_PutsObjCmd: ******** ANI is 00001121263600 *********
    Jul 30 19:40:33.754:
    Jul 30 19:40:42.010: //78509//TCL :/tcl_PutsObjCmd: Gerencia
    Jul 30 19:40:42.010:
    Jul 30 19:40:43.038: //78509//TCL :/tcl_PutsObjCmd: Place Call
    Jul 30 19:40:43.038:
    Jul 30 19:40:52.894: //78509//TCL :/tcl_PutsObjCmd: Call Clean up
    ------------------------
    Mobile call
    Jul 30 19:49:57.769: //78596//TCL :/tcl_PutsObjCmd: ******** ANI is 0976626888 *********
    Jul 30 19:49:57.769:
    Jul 30 19:50:42.194: //78596//TCL :/tcl_PutsObjCmd: Timeout-recepcao
    Jul 30 19:50:42.194:
    Jul 30 19:50:43.206: //78596//TCL :/tcl_PutsObjCmd: Place Call
    Jul 30 19:50:43.206:
    Jul 30 19:50:57.739: //78596//TCL :/tcl_PutsObjCmd: Call Clean up


    Best regards,
    Daniel

    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Daniel R. A. Sobrinho on 31-07-2013 07:06:09 AM
    Hi Yawming,

    The problem that I have faced was with timeout of Menu. We have 4 options. If the user did not select one of that the the call flow to other extension but the timeout is very hight almost 20 seconds.

    How can I change the timeout to be more fast.?

    Best regards,
    Daniel

    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Raghavendra Gutty Veeranagappa on 31-07-2013 07:23:54 AM
    Hi Daniel,
    you can try to reduce below values
       
      param(initialDigitTimeout) 5
      param(interDigitTimeout) 5

    Thanks,
    Raghavendra

    Subject: RE: New Message from Daniel R. A. Sobrinho in Voice Gateway API (VGAPI) - T
    Replied by: Lisandro Quinteros on 31-07-2013 07:36:03 AM
    HI,  What yaw-ming said its okey use this command under pro init{}

    set param(initialDigitTimeout) 3
    You Could also add
    param(interDigitTimeout) 3

    With this the timeout for menú Will be set to 3 seconds.
    But also Take care becouse in your script you are also playing and audio called flash:/silencio.wav
    Is this audio right? Is this an empty audio with no sound?



    Enviado desde Samsung Mobile



    -------- Mensaje original --------
    De: Cisco Developer Community Forums <cdicuser@developer.cisco.com>
    Fecha:
    A: cdicuser@developer.cisco.com
    Asunto: New Message from Daniel R. A. Sobrinho in Voice Gateway API (VGAPI) - TCL-API: RE: PRO_BR_IVR.tcl


    Daniel R. A. Sobrinho has created a new message in the forum "TCL-API": -------------------------------------------------------------- Hi Yawming,

    The problem that I have faced was with timeout of Menu. We have 4 options. If the user did not select one of that the the call flow to other extension but the timeout is very hight almost 20 seconds.

    How can I change the timeout to be more fast.?

    Best regards,
    Daniel
    --
    To respond to this post, please click the following link: http://developer.cisco.com/web/vgapi/forums/-/message_boards/view_message/17807970 or simply reply to this email.

    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Daniel R. A. Sobrinho on 31-07-2013 02:42:02 PM
    Hi Lisandro Quinteros ,

    Yes, the audio silence is a 1 second audio. In some routers we change to an audio <the call has been transfered> something like that..

    Tks,
    Daniel

    Subject: RE: PRO_BR_IVR.tcl
    Replied by: Daniel R. A. Sobrinho on 31-07-2013 03:35:17 PM
    Hey Guys,

    It is work now.

    Thank you
    Daniel Sobrinho