cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Walkthrough Wednesdays
1022
Views
3
Helpful
11
Replies
Leonardo Tadeu
Collaborator

Validate Wrong Extensions

Hello

When dial a wrong extension the message you to reenter the destination did not play, and after a while the call is transfered to the operator.

Follow my script.

Extension Range: 9xxx

How can i do this?

Regards

Leonardo Santana

11 REPLIES 11
Raghavendra G V
Cisco Employee

Hi Leonardo,

You can use pattern for leg collectdigits as below if you want to match specific pattern.

set pattern(1) "9..."

leg collectdigits $legID params pattern

for more information refer TCL IVR document in below link.

https://developer.cisco.com/site/collaboration/call-control/voice-gateway/documentation/

Thanks,

Raghavendra

Hello Raghavendra,

Where do i put this commands?

At proc init ?

Regards

Leonardo Santana

Hi Leonard,

you need to put pattern before leg collectdigits in act_Setup . you can also try to check the first digit after collecting all digits.

Thanks,

Raghavendra

Can you give an example im my script.

I tried but not work.

Regards

Leonardo Santana

when you dial wrong extension, the script should get digit collect status cd_006. could you please collect logs by enabling below debugs.

debug voip app

Thanks,

Raghavendra

Hi Leonardo,

Per Raghavendra's suggestion- This is how he means on your script:

proc act_Setup { } {

    global param1

    global selectCnt

    global dest

    global beep

    global callInfo

    global dnis

    global fcnt

    global aaPilot

    global oprtr

    global busyPrompt

    global legConnected

    puts "proc act_Setup"

    set busyPrompt _dest_unreachable.au

    set beep 0

    init_perCallVars

    infotag set med_language 1

    if { ($dnis == "") || ($dnis == $aaPilot) } {

        leg proceeding leg_incoming

        leg connect leg_incoming

        set legConnected true

    puts "\nNo DNIS\n"

        set param1(dialPlan) true

        set pattern(1) "9..."

        leg collectdigits leg_incoming param1 pattern

        media play leg_incoming _welcome.au %s1000 _enter_dest.au

    } else {

        set fcnt 6

    leg setupack leg_incoming

        handoff callappl leg_incoming default "DESTINATION=$dnis"

        fsm setstate HANDOFF

        media play leg_incoming "flash:/aguarde.au"

    }

}

Hello i try this,

it works but its not playing the audio (en_reenter_dest.au,) after the wrong extension

Regards

Leonardo Santana

Hi Leonardo, Try this?

http://www.cisco.com/c/en/us/td/docs/ios/voice/tcl/developer/guide/tclivrv2/tclivrv2_ch5.html

proc act_GotDest { } {

    global dest

    global callInfo

    global oprtr

    global busyPrompt

    puts "\n proc act_GotDest"

    set status [infotag get evt_status]

    set callInfo(alertTime) 30

    if {  ($status == "cd_004") } {

        set dest [infotag get evt_dcdigits]

    if { $dest == "0" } {

        set dest $oprtr

    }

        handoff callappl leg_incoming default "DESTINATION=$dest"

    } elseif { ($status == "cd_001") || ($status == "cd_002") } {

    set dest $oprtr

        handoff callappl leg_incoming default "DESTINATION=$dest"

    }    else {

    if { $status == "cd_006" } {

        set busyPrompt _dest_unreachable.au (--> You can change the prompt here as "Extension entered is not valid")

        act_Select

    }

Now the audio is playing, but its playing two times the message.

Regards

Leonardo Santana

Can you try a return after act_Select

if { $status == "cd_006" } {

        set busyPrompt _dest_unreachable.au (--> You can change the prompt here as "Extension entered is not valid")

        act_Select

          return

    }

I have the same problem.   I have included  the "return" after "act_Select". Could someone check if I did right, if not how can i proceed.

    if { $status == "cd_006" } {

                set busyPrompt _dest_unreachable.au

        }

        puts "\nCall [infotag get con_all] got event $status collecting destination"

        set dest [infotag get evt_dcdigits]

        if { $dest == "0" } {

                set dest $oprtr

                handoff callappl leg_incoming default "DESTINATION=$dest"

        } else {

                act_Select

                return

AddedVGW01#show call application voice pandurata

Script Name : pandurata

       URL  : flash:its-CISCO.2.0.3.0.tcl

       Type : Service

       State: Registered

       Life : Configured

       Exec Instances: 0

Parameters registered under pandurata namespace:

  name                                            type  default value   description

  uid-len                    I     10              the number of digits in UID

  warning-time           I     30              the time (in secs) within which a user is warned before the calling time expires (call terminates)

  pin-len                    I     4               the number of digits in PIN

  retry-count              I     3               the number of attempts to reenter PIN

  redirect-number      S                     the telephone number where a call is redirected to

Script Code Begin:

--------------------------------

TCL Script  version 2.0 - 2.1

# Script Locked by: khom

# Script Version: 2.0.1.0

# Script Name: its_CISCO

# Script Lock Date: Wed Jul  2 09:22:04 2003

#------------------------------------------------------------------

# November 27, 2001, Satish Ananthanarayana (sanantha@cisco.com)

#

# Copyright (c) 2001 by cisco Systems, Inc.

# All rights reserved.

#------------------------------------------------------------------

#

# Description:

#       This is a TCL IVR script for the IOS Telephony Service and

#       Call Manager (CM) offload scenario. The IVR script plays a

#       welcome prompt to the user and prompts the user to enter a

#       destination number when the user dials the auto-attendant number

#       (aa-pilot configured in the CLI). The script collects the digits that

#       the user has entered and hands the call to the enhanced session

#       application (named Default).  The session application

#       returns once there is a disconnect (if the call is established)

#       or if a call setup problem occurs.

#       The operator support is also included, if the user does not dial

#       any number or enters "0" the user will be transfered to an operator

#       (if operator number is configured in the CLI). If the user enters

#       an invalid number, the user will be prompted again to re-enter

#       the number for upto 3 times before disconnecting the call.

#

#-------------------------------------------------------------------

#

proc init { } {

    global param1

    global selectCnt

    global callInfo

    global legConnected

    set param1(interruptPrompt) true

    set param1(abortKey) *

    set param1(terminationKey) #

    set param1(initialDigitTimeout) 3

    set param1(interDigitTimeout) 4

    set selectCnt 0

    set legConnected false

}

proc init_ConfigVars { } {

    global destination

    global aaPilot

    global oprtr

        global param1

        if [infotag get cfg_avpair_exists initial-Digit-Timeout] {

        set param1(initialDigitTimeout) [string trim [infotag get cfg_avpair initial-Digit-Timeout]]

    } else {

        set param1(initialDigitTimeout) 3

    }

if [infotag get cfg_avpair_exists inter-Digit-Timeout] {

        set param1(interDigitTimeout) [string trim [infotag get cfg_avpair inter-Digit-Timeout]]

    } else {

        set param1(interDigitTimeout) 4

    }

# aa-pilot is the IVR number configured on the gateway to be used by the customer

# operator is the operator number for assisted calling

    if [infotag get cfg_avpair_exists aa-pilot] {

        set aaPilot [string trim [infotag get cfg_avpair aa-pilot]]

    } else {

        set aaPilot "NONE"

    }

    if [infotag get cfg_avpair_exists operator] {

        set oprtr [string trim [infotag get cfg_avpair operator]]

    } else {

        set oprtr "NONE"

    }

}

proc init_perCallVars { } {

    puts "\nproc init_perCallvars"

    global ani

    global digit_enabled

    global fcnt

    global retrycnt

    global dnis

    set fcnt 0

    set retrycnt 6

    set ani ""

    set dnis ""

    set digit_enabled "FALSE"

    set ani [infotag get leg_ani]

    puts "\nANI $ani"

    set dnis [infotag get leg_dnis]

    puts "\nDNIS $dnis"

}

proc act_Setup { } {

    global param1

    global selectCnt

    global dest

    global beep

    global callInfo

    global dnis

    global fcnt

    global aaPilot

    global oprtr

    global busyPrompt

    global legConnected

    puts "proc act_Setup"

    set busyPrompt _dest_unreachable.au

    set beep 0

    init_perCallVars

    infotag set med_language 1

    if { ($dnis == "") || ($dnis == $aaPilot) } {

        leg proceeding leg_incoming

        leg connect leg_incoming

        set legConnected true

        puts "\nNo DNIS\n"

        set param1(dialPlan) true

        leg collectdigits leg_incoming param1

        media play leg_incoming _welcome.au %s1000 _enter_dest.au

    } else {

        set fcnt 6

        leg setupack leg_incoming

        handoff callappl leg_incoming default "DESTINATION=$dnis"

        fsm setstate HANDOFF

    }

}

proc act_GotDest { } {

    global dest

    global callInfo

    global oprtr

    global busyPrompt

    puts "\n proc act_GotDest"

    set status [infotag get evt_status]

    set callInfo(alertTime) 30

    if {  ($status == "cd_004") } {

        set dest [infotag get evt_dcdigits]

        if { $dest == "0" } {

                set dest $oprtr

        }

        handoff callappl leg_incoming default "DESTINATION=$dest"

    } elseif { ($status == "cd_001") || ($status == "cd_002") } {

        set dest $oprtr

        handoff callappl leg_incoming default "DESTINATION=$dest"

    }   else {

        if { $status == "cd_006" } {

                set busyPrompt _dest_unreachable.au

        }

        puts "\nCall [infotag get con_all] got event $status collecting destination"

        set dest [infotag get evt_dcdigits]

        if { $dest == "0" } {

                set dest $oprtr

                handoff callappl leg_incoming default "DESTINATION=$dest"

        } else {

                act_Select

                        return

        }

    }

}

proc act_CallSetupDone { } {

    global busyPrompt

    global legConnected

    set status [infotag get evt_handoff_string]

    if { [string length $status] != 0} {

        regexp {([0-9][0-9][0-9])} $status StatusCode

        puts "IP IVR Disconnect Status = $status"

        switch $StatusCode {

          "016" {

              puts "\n Connection success"

              fsm setstate CONTINUE

              act_Cleanup

          }

          default {

              if { $legConnected == "false" } {

                  leg proceeding leg_incoming

                  leg connect leg_incoming

                  set legConnected true

              }

              puts "\n Call failed.  Play prompt and collect digit"

              if { ($StatusCode == "017") } {

                  set busyPrompt _dest_busy.au

              }

              act_Select

          }

        }

    } else {

        puts "\n Caller disconnected"

        fsm setstate CALLDISCONNECT

        act_Cleanup

    }

}

proc act_Select { } {

    global destination

    global promptFlag2

    global destBusy

    global param1

    global fcnt

    global retrycnt

    global busyPrompt

    puts "\n proc act_Select"

    set promptFlag2 0

    set param1(interruptPrompt) true

    set param1(abortKey) *

    set param1(terminationKey) #

    set param1(dialPlan) true

    set param1(dialPlanTerm) true

    leg collectdigits leg_incoming param1

    if { $fcnt < $retrycnt } {

        media play leg_incoming $busyPrompt %s500 _reenter_dest.au

        incr fcnt

        fsm setstate GETDEST

    } else {

        act_DestBusy

    }

}

proc act_DestBusy { } {

    puts "\n proc act_DestBusy"

    media play leg_incoming _disconnect.au

    fsm setstate CALLDISCONNECT

}

proc act_Cleanup { } {

    call close

}

requiredversion 2.0

init

init_ConfigVars

#----------------------------------

#   State Machine

#----------------------------------

  set fsm(any_state,ev_disconnected)   "act_Cleanup  same_state"

  set fsm(CALL_INIT,ev_setup_indication) "act_Setup  GETDEST"

  set fsm(GETDEST,ev_collectdigits_done) "act_GotDest HANDOFF"

  set fsm(HANDOFF,ev_returned)   "act_CallSetupDone  CONTINUE"

  set fsm(CALLDISCONNECT,ev_media_done) "act_Cleanup  same_state"

  fsm define fsm CALL_INIT

# Script Approval Signature: C/775c

--------------------------------

Daniel Sobrinho
Content for Community-Ad