Guest

Cisco TCL Scripts for IOS Gateways

TCL Ware Frequently Asked Questions

Document ID: 17762



Questions

Introduction
TCL IVR 1.0
Gateway
RADIUS
Downloads
Related Information

Introduction



This document contains frequently asked questions that address the most common problem areas dealing with the Cisco Tool Command Language (TCL) Interactive Voice Response (IVR) scripting environment, which helps customers to meet their needs in script customization and new IVR script creation.

For more information on document conventions, refer to the Conventions Used in Cisco Technical Tips.

TCL IVR 1.0



Q. When the user aborts a playPrompt entry by hitting the abortKey, does playPrompt return "collect fail" or does it reset to continue collecting input?



A. Neither. It should return "collect aborted" and stop collecting input. The message "collect fail" is returned if the digits entered do not match the patterns.

Q. How do you code PIN numbers and card numbers? Which RADIUS fields are used (name for card number and password for PIN number)?



A. The card number is a combination of the entered account number and PIN number. When a user is prompted to enter a card number, the collected digits are passed through $info(digits). That field is split into two variables (account number and PIN number) and then passed to the RADIUS server for authorization.

Q. I am not running under Solaris. Will lockScript work for me?



A. No, lockScript is a Solaris binary. If you want to bypass having to use lockScript, and you are using Cisco IOS® Software Release12.0(7) T image, issue the test voip scripts command.This command turns off the signature mechanism. You have to run it again if you reboot the machine, so currently it cannot be used in a production environment.

Q. Can you show me an example of regexp used within an IVR script ? I get "syntax error in regexp" even with the simplest patterns. For example, I am testing for a single digit collected in the variable digits_collected, with the command:

if {regexp {^[0-9]$} $digits_collected First_digit} { ....

}

Also, the debug finds a syntax error.

A. You need to enclose your regexp in brackets ([]).

if {[regexp {^[0-9$]} $digits_collected First_ digit]} {

.....

}

 

Q. What type of program is lockScript?



A. lockScript is a Solaris binary executable.

Q. How do I use lockScript?



A. After making changes to your script, run the command line lockScript <user ID> your_script.tcl, which creates a new file your_script.1.1.1.tcl. Then load your script on the router. Use the following command to accomplish this:

lockScript <UID>./scripts (your script) 

Gateway



Q. Is there a difference between the NAS_IP_ADDRESS and the Gateway ID?



A. No, they are the same.

Q. Is the connectionId unique or can two gateways generate the same connectionId at the same time?



A. The connectionId is unique to the gateway, so each gateway generates its own connectionId.

Q. How does a gateway know whether a script is a version 1.0 or 2.0 script?



A. The Cisco TCL script file name needs to have a .tcl extension for both version 1 and version 2 infrastructure. The gateway reads the script and scans for the FSM command. If this command is found, then it uses version 2 infrastructure. For version 2.0 scripts there is a command to add to the script requiredversion majorversion.minorversion . This command verifies that the script is running with the correct version of TCL IVR application programming interface (API).

Q. When will Cisco support more languages in the gateway?



A. At this moment, Cisco does not have an immediate plan to provide more language support and prompts for the debit card application. It must be ensured that additional languages can be successfully and effectively supported through the Cisco TCL customized scripts, especially with the Clapton project. The feedback from Clapton customers will enable Cisco to assess the necessity to support additional languages.

Q. How does a gateway Cisco TCL IVR infrastructure go with the script version?



A. Cisco TCL IVR infrastructure version number:

  • 1.0 12.0(4) XH 1.0.x
  • 1.1 12.0(7) T 1.1.x
  • 2.0 (TBD) 2.0.x

Q. Can you tell me how the Connect Time, Disconnect Time, and Setup Time are encoded?



A. The Network Time Protocol (NTP) time formats for Disconnect Time, Connect Time, and Setup Time are displayed as: %H:%M:%S.%k %Z %tw %tn %td %Y where:

  • %H is hours (00 to 23)
  • %M is minutes (00 to 59)
  • %S is seconds (00 to 59)
  • %k is milliseconds (000 to 999)
  • %Z is the timezone string
  • %tw is the day of week (Monday through Sunday)
  • %TN is the month name (January through December)
  • %td is the day of month (01 to 31)
  • %Y is the year including century (for example,1998)

For example, the vendor-specific attribute (VSA) number 25 for Setup Time is "18:27:28.032 UTC Wed Dec 9 1998"

RADIUS



Q. What is the current version of the RADIUS Vendor-Specific Attributes Implementation Guide? Do you know if a new one exists? If yes, is it possible to get it ?



A. The alpha draft is the current version of the RADIUS Vendor-Specific Attributes Implementation Guide. There is no newer version than this.

Q. Does the Cisco TCL script development library support the RADIUS VSA "h323-return-code" and "h323-redirect-number"?



A. All the vendor-specific attributes (VSAs) published in the document are supported in Cisco IOS® Software. The script, however, only supports credit-amount, credit-time, and returnCode for the prepaid application. That is because the billing system Cisco uses, MIND CTI, currently supports only these three VSAs.

Q. Why can't my RADIUS send as many attributes (in quantity and of type) to the gateway as I desire? As the debug output below shows, the RADIUS sends five attributes (h323-return-code, h323-redirect-number, h323-preferred-lang, h323-credit-time, and h323-credit-amount) within vendor-specific attribute (VSA) (attribute 26). However, I am getting "ReturnCode: Uknown variable name, RedirectNumber: Uknown variable name and PrefLang: Uknown variable name." The variables names are the same as in the documentation. How do you explain this behavior?

DEC 14 19:05:51.734: RADIUS: Received from id 2 212.16.129.16:1645, Access-Accept, len 177
      DEC 14 19:05:51.734: Attribute 26 29 0000000968176833
      DEC 14 19:05:51.734: Attribute 26 37 00000009671F6833
      DEC 14 19:05:51.734: Attribute 26 31 000000096B196833
      DEC 14 19:05:51.734: Attribute 26 29 0000000966176833
      DEC 14 19:05:51.734: Attribute 26 31 0000000965196833
      DEC 14 19:05:51.734: RADIUS: saved authorization data for user 61953D5C at 61953 E84
      DEC 14 19:05:51.734: RADIUS: cisco AVPair ":h323-return-code = 51"
      DEC 14 19:05:51.734: RADIUS: cisco AVPair ":h323-redirect-number =384910" 
      DEC 14 19:05:51.734: RADIUS: cisco AVPair ":h323-preferred-lang = 1" 
      DEC 14 19:05:51.734: RADIUS: cisco AVPair ":h323-credit-time=2345" 
      DEC 14 19:05:51.734: RADIUS: cisco AVPair ":h323-credit-amount=6700"
After this, Cisco IOS Software takes control of this information. And we can only access it through the "getVariable radius ..." library function. I want to see if the values return by RADIUS and the values displayed by the TCL script are the same but I received the error message "Uknown variable name."
DEC 14 19:05:51.738: cid(2) ta_get_event returning authorized
      DEC 14 19:05:51.738: :/getVariable/
      DEC 14 19:05:51.738: :/puts/
      DEC 14 19:05:51.738: Event: authorized
      DEC 14 19:05:51.738: :/puts/
      DEC 14 19:05:51.738: ReturnCode: Uknown variable name
      DEC 14 19:05:51.738: :/getVariable/
      DEC 14 19:05:51.738: :/puts/
      DEC 14 19:05:51.738: RedirectNumber: Uknown variable name
      DEC 14 19:05:51.738: :/getVariable/
      DEC 14 19:05:51.738: :/puts/
      DEC 14 19:05:51.738: PrefLang: Uknown variable name
      DEC 14 19:05:51.738: :/getVariable/
      DEC 14 19:05:51.738: :/puts/
      DEC 14 19:05:51.738: CrediAmount: 6700
      DEC 14 19:05:51.738: :/getVariable/
      DEC 14 19:05:51.738: :/puts/
      DEC 14 19:05:51.738: CrediTime: 2345
      DEC 14 19:05:51.742: :[callID]
      DEC 14 19:05:51.742: :/puts/
      DEC 14 19:05:51.742: cid( 2) app running state select_language
      DEC 14 19:05:51.746: TA_PlayPromptCmd() 00:04:27.512
The TCL sentences that I type are:
set ev [authorize $account $pin "" [ani] info]
      set returncode [getVariable radius returnCode] 
      puts "Event: $ev" 
      puts "ReturnCode: $returncode" 
      puts "RedirectNumber: [getVariable radius redirectNumber]"
      puts "PrefLang: [getVariable radius preferredLang]" 
      puts "CrediAmount: [getVariable radius creditAmount]" 
      puts "CrediTime: [getVariable radius creditTime]"


A. This is because there is an extra space between the attribute name and the = sign. For example, see the output below for the difference between credit-time and return-code:

DEC 14 19:05:51.734: RADIUS: cisco AVPair ":h323-return-code = 51"
      DEC 14 19:05:51.734: RADIUS: cisco AVPair ":h323-redirect-number = 384910"
      DEC 14 19:05:51.734: RADIUS: cisco AVPair ":h323-preferred-lang = 1"
      DEC 14 19:05:51.734: RADIUS: cisco AVPair ":h323-credit-time=2345"
      DEC 14 19:05:51.734: RADIUS: cisco AVPair ":h323-credit-amount=6700"

Follow the format exactly as with credit-time and credit-amount and remove the spaces.

Q. The disconnect cause is not equal to 10. How is it encoded? Is this a bug?

1d10h: RADIUS: added cisco VSA 30 Len 24 "h323-disconnect-cause=10"
  ...
  1d10h: Attribute 26 32 000000091E1A6833
  1d10h: RADIUS: added cisco VSA 30 Len 24 "h323-disconnect-cause=10"
  d10h: Attribute 26 32 000000091E1A6833


A. No, it is not a bug. All of the H.323 vendor-specific attributes (VSAs) are of type string and coded in a "attribute=value" format. The upshot is that h323-disconnect-cause=10 is not sent as subattribute 30 value of 10, but subattribute 30, value of "h323-disconnect-cause=10". So the debug that you see is:

1d10h: Attribute 26 32 000000091E1A6833 ^^^^^^^---------- vendor 9 ^^------- subattribute 
   30 ^^----- length 26 ^^^^- "h3"

The entire string in the debugs is not printed, so only "h3" is seen from the whole "h323-disconnect-cause=10" string.

Downloads



Q. Can we download audio files from Cisco's FTP server?



A. The zip file called TCLWare_1_1_0.zip contains the Cisco audio files. This resides on the FTP server at ftp/skynyrd. Logon as anonymous for your user ID and use your email address for the password. Try the FTPget command and be certain to set the transfer mode to binary. If you perform the FTP on a Solaris platform, issue the unzip command and not thegunzip command. WinZip works properly on a Microsoft Windows NT platform.

Q. How do I write a simple script for our voice application so it will accept a call, play a voice prompt asking the user to enter a conference room number, confirm the number is a defined number of digits in length, and, finally, pass the call along based on the dial-peer list in the router. This is all on a Cisco AS5300 running Cisco IOS Software Release 12.0(7)T. Can you point to any sample scripts along these lines (or more detailed scripts that I can cut down)? I'm reading the Cisco TCL IVR Programmers Guide now.



A. The clid_authen_collect script can be helpful in this situation. You will find this script and all the audio files on the Ftpeng server in /skynyrd/TCLware_1_1_0.zip. Use the FTP facility at ftpeng.cisco.com and logon as anonymous for your user ID and use your email address for the password. Go to the /skynyrd directory and you will find all above mentioned files. Try the FTPget command and be certain to set the transfer mode to binary. If you perform the FTP on a Solaris platform, use the unzip command and not the gunzip command. WinZip works properly on a Microsoft Windows NT platform.

Q. Where do I get access the the lockScript program?



A. The binary for lockScript Clapton Pilot Program has been placed on the FTP server at ftpeng.cisco.com. To obtain this binary, go to the /skynyrd and find the lockScript binary. Try the FTP get command and be certain to set the transfer mode to binary. If you perform the FTP on a Solaris platform, use the unzip command and not the gunzip command. WinZip works properly on a Microsoft Windows NT platform.


Related Information



Updated: Feb 02, 2006 Document ID: 17762