Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCL scripts in Cisco 5300

Status
Not open for further replies.

travis909

ISP
Jun 17, 2003
6
0
0
US
I need to learn very specific things about the TCL scripting to expand my business. TCL makes the 5300 a very powerful system, but to harness its power, I need to be able to do basic scripting.

The first thing I have tried to do is to take one of the builtin Cisco scripts and simply copy it to the ftp server and use it from there. I am having a difficult time doing this and getting an error when I load the script.

PGC.LAX.c5300.1#sh call application voice summary
name description

session Basic app to do DID, or supply dialtone.
fax_hop_on Script to talk to a fax redialer
clid_authen Authenticate with (ani, dnis)
clid_authen_collect Authenticate with (ani, dnis), collect if that fails
clid_authen_npw Authenticate with (ani, NULL)
clid_authen_col_npw Authenticate with (ani, NULL), collect if that fails
clid_col_npw_3 Authenticate with (ani, NULL), and 3 tries collecting
clid_col_npw_npw Authenticate with (ani, NULL) and 3 tries without pw
DEFAULT Default system session application
lib_off_app Libretto Offramp
fax_on_vfc_onramp_ap Fax onramp for VFC

TCL Script Version 2.0 supported.
TCL Script Version 1.1 supported.
Voice Browser Version 1.0 for VoiceXML 1.0 supported.

PGC.LAX.c5300.1#show call application voice clid_authen

This is the script I copy/paste to file ftp://10.77.226.203/travis/travistest.tcl
You may view the script by going to ftp://65.77.226.203/travis/travistest.tcl
You will see that it is an exact copy of clid_authen.

Code:
# app_clid_authen.tcl
#----------------------------------
# September 1998, David Ramsthaler
#
# Copyright (c) 1998, 1999, 2000 by cisco Systems, Inc.
# All rights reserved.
#------------------
# Mimic the clid_authen script in the SP1.0 release.
#
# It authenticates using (ani, dnis) for (account, password). If
# that fails, play a message and end the call.
#
# If authentication passes, it collects the destination number and
# places the call.
#
# The main routine is at the bottom. Start reading the script there.
#

proc init { } {
    global param

    set param(interruptPrompt) true
    set param(abortKey) *
    set param(terminationKey) #
    set param(dialPlan) true
}

----- REST OF SCRIPT OMMITED IN POST, complete script in TCL file on FTP server --------


Now, once I have an exact copy of clid_authen on the FTP server, I try to load it.
But, when I load it, I get a "missing close-brace" error. I have looked at the file many times,
and I do not see a missing close-brace. And, the file is an EXACT copy of clid_authen.
Do you know what is going wrong here ?


PGC.LAX.c5300.1#conf t
PGC.LAX.c5300.1(config)#call application voice TRAVISTEST ftp://10.77.226.203/travis/travistest.tcl
Cannot run script ftp://10.77.226.203/travis/travistest.tcl, unloading

Putting TRAVISTEST on script retry queue.

PGC.LAX.c5300.1(config)#
Jun 18 16:31:47.010: TclFreeUnusedInterp:
Jun 18 16:34:03.076: hifs ifs file read succeeded. size=1024, url=ftp://10.77.22
6.203/travis/travistest.tcl
Jun 18 16:34:03.080: TCL script failure
Result:
missing close-brace
Jun 18 16:34:03.080: LanguageIVR TCL script failure errorInfo:
missing close-brace
while executing
"proc act_Authenticated { } ..."
Jun 18 16:34:03.080: TCL script failure
Result:
missing close-brace
Jun 18 16:34:03.080: LanguageIVR TCL script failure errorInfo:
missing close-brace
while executing
"proc act_Authenticated { } ..."
PGC.LAX.c5300.1(config)#



 
Post the procedure act_Authenticated.
 
Full Script (it's short) can be viewed at ftp://65.77.226.203/travis/travistest.tcl

Here is the procedure. It is straight out of embedded Cisco image.

proc act_Authenticated { } {
global param

set ani [infotag get leg_ani]
set status [infotag get evt_status]
set roaming [infotag get aaa_roaming $ani]

if { ($status == "au_000") ||
($roaming == "match") } {

set did [infotag get leg_isdid]
set dnis [infotag get leg_dnis]
set dnislen [string len $dnis ]

if { $did && $dnislen } {
leg proceeding leg_incoming
leg connect leg_incoming
leg setup $dnis callInfo leg_incoming
fsm setstate PLACECALL

} else {
playtone leg_incoming tn_dial
leg collectdigits leg_incoming param

}

} else {

media play leg_incoming flash:auth_failed.au
fsm setstate CALLDISCONNECT
}
}
 
I get no errors from this on pure syntax, though the
parens around the variable tests are new to me.

It passed the tkcon and ramdebugger tests.
I don't suppose there is a verbose/debug mode for
your tcl script execution callable from the router
console?
Otherwise I don't know what to tell you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top