Configuring Dynamic Prompts, Customizing Accounting Templates, and Directing AAA Requests for Voice Gateways
Cisco IOS Configuration

Table of Contents

Cisco IOS Configuration
Retrieving System Time and Date using TCL Clock Commands
Playing Information through Dynamic Prompts
Directing AAA Requests to a RADIUS Server
Enabling and Disabling Accounting for any Call Leg
Customizing Accounting Packets

Cisco IOS Configuration


The configuration tasks for each feature are in the following sections:

Retrieving System Time and Date using TCL Clock Commands

Refer to the TCL IVR API Version 2.0 Programmer's Guide for information about creating and implementing Tool Command Language (TCL) IVR scripts.

To retrieve the system time and date, use the following clock commands:


Step 1   To retrieve the system time and date, enter the clock format TCL verb.

clock format clock value ? -format string ?? -gmt boolean ?

Arguments:

  • clock value
  • format string
  • gmt boolean

This command converts an integer time value returned by clock seconds, clock scan, or the atime, mtime, or ctime options of the file command, to human-readable form. If the -format argument is present, the next argument is a string that describes how the date and time are to be formatted. Field descriptors consist of a % followed by a field descriptor character. All other characters are copied into the result. Valid field descriptors are:

%% Insert a %.

%a Abbreviated weekday name (Mon, Tue, etc.).

%A Full weekday name (Monday, Tuesday, etc.).

%b Abbreviated month name (Jan, Feb, etc.).

%B Full month name.

%c Locale specific date and time.

%d Day of month (01 - 31).

%H Hour in 24-hour format (00 - 23).

%I Hour in 12-hour format (00 - 12).

%j Day of year (001 - 366).

%m Month number (01 - 12).

%M Minute (00 - 59).

%p AM/PM indicator.

%S Seconds (00 - 59).

%U Week of year (01 - 52), Sunday is the first day of the week.

%w Weekday number (Sunday = 0).

%W Week of year (01 - 52), Monday is the first day of the week.

%x Locale specific date format.

%X Locale specific time format.

%y Year without century (00 - 99).

%Y Year with century (for example, 1990)

%Z Time zone name.

The following field descriptors may not be supported on all operating systems. For example, they may be supported on UNIX and not be supported on Microsoft Windows systems. Cisco IOS software supports the following field descriptors:

%D Date as %m/%d/%y.

%e Day of month (1 - 31), no leading zeros.

%h Abbreviated month name.

%n Insert a newline.

%r Time as %I:%M:%S %p.

%R Time as %H:%M.

%t Insert a tab.

%T Time as %H:%M:%S.

If the -format argument is not specified, the format string %a %b %d %H:%M:%S %Z %Y is used. If the -gmt argument is specified, the next argument must be a boolean. If the argument is true, it specifies that the time will be formatted as Greenwich Mean Time. If the argument is false, the local time-zone will be used as defined by the operating environment.

Step 2   To return the current date and time as a system-dependent integer value, enter the clock seconds TCL verb.

clock seconds

The unit of the integer value is seconds, allowing it to be used for relative time calculations. The integer value is defined as total elapsed time from an epoch. An epoch is not specified in this command.





Playing Information through Dynamic Prompts

This section describes the TCL commands used to retrieve information on a voice gateway and then play them out using dynamic prompts.

To play the new dynamic prompts mentioned in the section "Playing System Time and Date using the Media Play Command" below, first download the multi-language script and enable it using the following command:


Note   Only the English version of the multi-language script is supported. To download multi-language scripts, refer to Enhanced Multi-Language Support for Cisco IOS Interactive Voice Response.


Step 1   Enter the call language voice command in global configuration mode. Enter en for the argument language. URL is the address where you store the multi-language script.

Router(config)# call language voice language url
Example:
call language voice en tftp://highway/mjs/scripts/multi-lang/en_translate.tcl




Playing System Time and Date using the Media Play Command

To play a specific dynamic prompt, use the following TCL verb:


Step 1   Enter the media play TCL verb. Assign an incoming or outgoing leg ID, or an information tag.

media play {[legID|info-tag][url-list]}

Arguments:

  • @C string - takes a string of printable ASCII characters and plays out the characters sequentially. The syntax is "@C `$string'". @C indicates playout for a character string. A single space must separate @C and the ASCII string, where the ASCII string is enclosed within single quotation marks. For a single quote to play out in the ASCII string, enter two single consecutive quotes in the input. The system treats two consecutive single quotes as a single quote during processing. For example, for "@C `danny''s  example'" the output is danny's example played out as:

"d" "a" "n" "n" "y" single-quote "s" space "e" "x" "a" "m" "p" "l" "e"

  • The maximum number of characters in a media play command is 50 characters to prevent high performance impact. The supported characters are ASCII 0x20 to 0x7E. English letters in the set are not case sensitive.
  • %Ttime_of_day - accepts an ISO standard time format and plays out the time. Supported formats are hhmmss, hhmm, or hh, where hh is hour, mm is minute, and ss is second. Hour is in 24-hour format.

Examples:

%T131501 will play one fifteen pm and one second.
%T0001 will play twelve O one am.
%T14 will play two pm.
  • %Ddate - accepts an ISO standard date format and plays out the date. Supported formats are CCYYMMDD, CCYYMM, CCYY, --MMDD, --MM or ---DD. CC is century, YY is year, MM is month, and DD is day of month.

Examples:

%D20000914 will play year two thousand september fourteenth.
%D199910 will play year nineteen ninety nine october.
%D2001 will play year two thousand one.
%D--0102 will play January second.
%D--12 will play december.
%D---31 will play thirty first.
  • %Wday_of_week -- day of week. 1=Monday, 2=Tuesday, ..., 7=Sunday. Take the input and play out the name of the day of the week.

Example:

%W1 will play Monday.

The prompt names for playable characters are shown in "ASCII Table"





Directing AAA Requests to a RADIUS Server

You can use TCL scripts or the CLI to direct AAA requests to a specific RADIUS server based on:

  • User account number
  • Called party number
  • Trunk group

You must perform the following prerequisite tasks before you start directing AAA requests to a RADIUS server:


Step 1   Define a RADIUS server by entering the following command:

Router(config)# radius server host ipaddress auth-port port-number acct-port port-number

Example:

radius server host 1.5.35.10 auth-port 2001 acct-port 2002

Step 2   Use the RADIUS server defined in Step 1 above to define a AAA group.

a. To define a group name, enter the following command in global configuration mode:

Router(config)# aaa group server radius group-name

Note    For the argument group-name in the command, enter the name of the specific RADIUS server (for example server1) you want to authenticate, or enter the argument radius if you want to authenticate all RADIUS servers .

b. To configure the IP address of the RADIUS server for the group server, enter the following command in group server configuration mode:

Router(config-sg-radius)# server ip-address auth-port port-number acct-port port-number

Step 3   Use the AAA group defined in Step 2 above to define an AAA method list.

a. For voice authentication, enter the aaa authentication login command in global configuration mode.

Router(config)# aaa authentication login list-name method1 [method2...]

Examples:

aaa authentication login h323 group server2
aaa authentication login MIS-access group radius

b. For voice authorization, enter the aaa authorization command in global configuration mode.

Router(config)# aaa authorization exec list-name method1 [method2...]

Examples:

aaa authorization exec h323 group server2
aaa authorization exec MIS-access group radius

c. For voice accounting, enter the aaa accounting command in global cofiguration mode.

Router(config)# aaa accounting connection list-name start-stop method1 [method2..]

Example:

aaa accounting connection h323 start-stop group server1




Directing AAA Requests using Account Numbers

It is easier to use TCL scripts instead of the CLI to direct AAA requests using account numbers.

To use TCL scripts for directing AAA requests using account numbers, follow the steps below:


Step 1   Before you start using TCL scripts to direct AAA requests using account numbers, you must define and apply the interactive voice response (IVR) application on the dial peer.

Step 2   Use the authentication, authorization, and accounting TCL verbs to customize your TCL scripts. Refer to the Accounting Template in "An Overview of Dynamic Prompts, Accounting Templates, and Directing AAA Requests" for an example of a TCL script.

The authentication, accounting, and authorization TCL verbs are:

a. Authentication: Use the following TCL verb:

aaa authenticate account password [-a avlistSend][-s servertag]

b. Authorization: Use the following TCL verb:

aaa authorize account password ani destination {legID|info-tag} [-s servertag]

c. Accounting: Use the following TCL verbs to start or update accounting messages:

aaa accounting start {legID|info-tag} [-s servertag]

Step 3   (Optional). If you use the accounting TCL verb, then use the accounting suppress command to suppress accounting on the same dial peer on which you have specified your application.

Follow the steps below to suppress accounting on the dial peer:

a. Enter the voice class aaa command in global configuration mode.

Router(config)# voice-class aaa tag

b. Enter the accounting suppress command in voice class mode.

Router(config-class)# accounting suppress

c. Enter the voice class aaa command in dial peer mode.

Router(config)# dial-peer
Router(config-dial-peer)# voice class aaa tag




Directing AAA Requests using Called Party Number

You can use the called party number to direct AAA requests in dial peer mode as follows:


Step 1   Define dial peer.

a. Enter dial peer configuration mode using the dial peer voice command. The argument number defines a particular dial peer.

Router(config)# dial-peer voice tag {pots|voip}

b. Specify the incoming called number using the incoming called number command in dial peer configuration mode. The argument string is a series of digits that specifies the incoming called number.

Router(config-dial-peer)# incoming called number string

Step 2   Define the voice class.

a. Enter the voice class aaa command in global configuration mode. The argument tag identifies the dial peer.

Router(config)# voice class aaa tag

b. Define authentication, authorization, and accounting methods. Enter the authentication, authorization and accounting commands in voice class mode. The argument methodListName is used to name the list of authentication, authorization or accounting methods applicable to each command.

Router(config-class)# authentication method methodListName
Router(config-class)# accounting method methodListName
Router(config-class)# authorization method methodListName

c. Define voice class in dial peer mode. Enter dial peer configuration mode and then define the voice class in that mode. The argument tag identifes the same dial peer as in step a above.

Router(config)# dial-peer voice tag {pots|voip}
Router(config-dial-peer)# voice-class aaa tag




Directing AAA Requests using Trunk Groups

To direct AAA requests using trunk groups, a trunk group must first associate with a dial peer. To use this method, group all the interfaces using one trunk group and define only one dial peer instead of individual ports for the interfaces using that trunk group.

You can direct AAA requests using trunk groups in dial peer mode as follows:


Step 1   Define the trunk group by entering the trunk group command in global configuration mode. The argument tag is a number.

Router(config)# trunk group tag

Step 2   Use the trunk group tag in Step 1 to group the interfaces.

a. Enter the interface serial command in global configuration mode to specify a serial interface on the channelized T1 or E1 controller. The argument slot/port denotes the slot and port number where the channelized T1 or E1 controller is located. The argument timeslot denotes the ISDN D channel timeslot which is 15 for channelized E1 and 23 for channelized T1.

Router(config)# interface serial slot/port: timeslot

b. Enter the trunk group command.

Router(config-inter-serial)# trunk group tag

Step 3   Use the tag defined in Step 2-b above in dial peer mode.

a. Enter the voice class aaa command in global configuration mode.

Router(config)# voice-class aaa tag

b. Define authentication, accounting, and authorization methods. Enter the authentication method, accounting method, and authorization method commands in voice class mode. The argument methodListName is used to name the list of authentication, accounting, or authorization methods applicable to each command.

Router(config-class)# authentication method methodListName
Router(config-class)# accounting method methodListName
Router(config-class)# authorization method methodListName

c. Enter dial peer configuration mode using the dial peer voice command.

Router(config)# dial-peer voice tag pots

d. Define the voice class in dial peer mode. The argument tag identifes the same dial peer as in Step a above.

Router(config-dial-peer)# voice-class aaa tag

e. Define the trunk group in dial peer mode. The argument tag is the the same number as in Step 2-b above.

Router(config-dial-peer)# trunk group tag




Enabling and Disabling Accounting for any Call Leg

Enabling voice accounting by using the gw-accounting aaa command will send only the default list of VSAs to the accounting server.

Global Configuration Mode

To enable and disable accounting for any call leg in global configuration mode, follow these steps:


Step 1   To enable accounting for any call leg, enter the gw-accounting aaa command in global configuration mode. Use the no form of the command to disable accounting.

Router (config)# gw-accounting aaa
Router (config)# no gw-accounting aaa

To disable accounting based on the type of dial peer, use the following command:

Step 2   To disable accounting based on the type of dial peer, use the following commands:

a. Enter the gw-accounting aaa command.

Router(config)# gw-accounting aaa

b. Enter the suppress command.

Router(config-gw-accounting-aaa)# suppress

You have a choice of entering pots or voip, based on the type of dial peer.

c. Enter the suppress pots or suppress voip command.

Router(config-gw-accounting-aaa)# suppress pots

or

Router(config-gw-accounting-aaa)# suppress voip




Dial Peer Mode

To disable accounting in dial peer mode, follow these steps:


Step 1   Enter the voice class aaa command in global configuration mode.

Router(config)# voice class aaa tag

Step 2   Enter the accounting suppress command in voice class aaa mode.

Router(config-class)# accounting suppress [in-bound|out-bound]

Step 3   Enter the voice class aaa command in dial peer mode.

Router(config)# dial-peer
Router(config-dial-peer)# voice-class aaa tag




Customizing Accounting Packets

This section contains the following sub-sections:

Configuration Overview

Accounting packets for voice calls consist of non voice-specific and voice-specific attributes. This document focuses only on voice-specific attributes. With the introduction of the TCL accounting verb, you can now add some application level attributes through the TCL script and fine-tune the attribute list created by the system to create an accounting template that is customized to your accounting needs.

To customize your accounting packets, you must first create accounting templates. If you do not want to customize your accounting packets, enable voice accounting by using the gw-accounting aaa command to generate accounting packets. A specific set of attributes, which include both non voice-specific and voice-specific attributes, is automatically sent by the gateway to the RADIUS server.

To view the current list of these VSAs, refer to the RADIUS Vendor Specific Attributes Voice Implementation Guide. For example, in the Accounting Template of "An Overview of Dynamic Prompts, Accounting Templates, and Directing AAA Requests", the default attributes are:

h323-gw-id

 

h323-call-origin

 

h323-call-type

 

h323-setup-time

 

h323-connect-time

 

h323-disconnect-time

 

h323-disconnect-cause

 

h323-remote-address

 

h323-voice-quality

ICPIF

subscriber

 

In addition to these default VSAs, a new set of voice-specific VSAs is introduced in Cisco IOS Release 12.2(2) XU. Refer to the RADIUS Vendor Specific Attributes Voice Implementation Guide for the current list of VSAs. The Accounting Template in "An Overview of Dynamic Prompts, Accounting Templates, and Directing AAA Requests" lists these new voice-specific VSAs, reproduced here below:

Attribute Name Usage and Restrictions

h323-gw-id

 

h323-call-origin

 

h323-call-type

 

h323-setup-time

 

h323-connect-time

 

h323-disconnect-time

 

h323-disconnect-cause

 

h323-remote-address

 

h323-voice-quality-subscriber

ICPIF

Detail CallHistory

 

acom-level

Pots leg only

noise-level

Pots leg only

img-pages-count

Pots leg only

voice-tx-duration

Pots leg only

tx-duration

Pots leg only

charged-units

 

disconnect-text

 

info-type

 

peer-address

 

peer-id

 

peer-if-index

 

logical-if-index

 

codec-type-rate

 

codec-bytes

IP leg only

session-protocol

IP leg only

vad-enable

IP leg only

remote-udp-port

IP leg only

hiwater-playout-display

IP leg only

lowater-playout-display

IP leg only

receive-delay

IP leg only

round-trip-delay

IP leg only

ontime-rv-playout

IP leg only

gapfill-with-silence

IP leg only

gapfill-with-prediction

IP leg only

gapfill-with-interpolation

IP leg only

gapfill-with-redundancy

IP leg only

lost-packets

IP leg only

early-packets

IP leg only

late-packets

IP leg only

To send all the VSAs to the accounting server use the template callhistory-detail command in global configuration mode. The list of VSAs includes both the default attributes and the new attributes introduced in Cisco IOS Release 12.2(2) XU. The Accounting Template in "An Overview of Dynamic Prompts, Accounting Templates, and Directing AAA Requests" includes the default and new VSAs. Refer to the "Using Callhistory-detail to Send All VSAs" section for configuration details.

For the latest list of VSAs, refer to RADIUS Vendor-Specific Attributes Voice Implementation Guide .

To fine-tune your accounting packets based on your billing needs, you must create accounting templates using specific VSAs that are applicable to your accounting needs. For example, to target different accounting servers for incoming calls from different trunks, you must define multiple accounting templates and associate them with different sets of incoming dial peers. To create a template, remove the attributes that are not applicable by adding the # sign in front of each of those attributes.

To fine-tune your accounting packets, remove attributes that do not apply to your billing needs. Deleting these attributes creates a custom accounting template that acts as a filter, allowing only the defined attributes to be sent to the accounting server. To apply your customized template, first define the template using the call accounting template voice command in global configuration mode, and then apply it using either TCL scripts or the CLI. If you are using the CLI, you can apply the template either in global configuration or dial peer mode. Refer to the "Defining and Applying Customized Accounting Templates" section for configuraion details.

Specific VSAs that cannot be controlled by the accounting template are sent as attribute-value (AV) pairs through the avlistSend argument of the TCL verbs used in the script, and they are:

  • h323-ivr-out
  • h323-ivr-in
  • h323-credit-amount
  • h323-return-code
  • h323-prompt-id
  • h323-time-and-delay
  • h323-redirect-number
  • h323-preferred-lang
  • h323-redirect-ip-addr
  • h323-billing-model
  • h323-currency

Configuration Tasks for Customizing Accounting Packets

Use the "Configuration Overview" section to plan your customizing needs before you begin the applicable configuration tasks below.

Generate Accounting Packets by Enabling Voice Accounting

To automatically generate accounting packets by enabling voice accounting, enter the gw-accounting aaa command in global configuration mode.

Router(config)# gw-accounting aaa
Router(gw-accounting aaa)# exit

Using Callhistory-detail to Send All VSAs

To send all VSAs (default and new) to the accounting server:


Step 1   Enter the gw-accounting aaa command to enter gw accounting aaa mode.

Router(config)# gw-accounting aaa

Step 2   Enter the acct-template callhistory-detail command in gw accounting aaa mode.

Router(config-gw-accounting-aaa)# acct-template callhistory-detail
Router(config-gw-accounting-aaa)#




Defining and Applying Customized Accounting Templates

Defining a Customized Accounting Template

To define an accounting template:


Step 1   Enter the call accounting-template voice command in global configuration mode. Enter the template name for acctTempName. The url is the address where you store the template. Always assign a .cdr extension to the filename in the URL.

Router(config)# call accounting-template voice acctTempName url

Example:

call accounting-template voice cdr1 tftp://highway/mjs/templates/cdr1.cdr

Note   After bootup, if the template file fails to load from the TFTP server, the system tries to automatically reload the file at five minute intervals.





Applying a Customized Accounting Template through the CLI in Global Configuration Mode

You can use an accounting template through the CLI (in global configuration or dial peer mode), or by using TCL verbs.

To use an accounting template through the CLI in global configuration mode, use the following commands:


Step 1   Enter the gw-accounting aaa command to enter gw accounting aaa mode.

Router(config)# gw-accounting aaa

Step 2   Enter the acct-template command. Assign your template name to acctTempName.

Router (config-gw-accounting-aaa)# acct-template acctTempName




Applying a Customized Accounting Template through the CLI in Dial Peer Mode:

To apply a customized accounting template through the CLI in dial peer mode, follow these steps:


Step 1   Enter the call accounting-template voice command in global configuration mode. Assign your template name to acctTempName and your template address (usually your tftp address) to url.

Router(config)# call accounting-template voice acctTempName url

Step 2   Enter the voice class aaa command in global configuration mode. Assign a numerical value to tag.

Router(config)# voice class aaa tag

Step 3   Enter the accounting-template command in voice class aaa mode. Assign your template name to acctTempName.

Router(config-class)# accounting-template acctTempName

Step 4   Change configuration mode from global to dial peer and using the dial peer voice command, enter the voice class aaa command in dial peer mode. The numerical value of tag is the same value of tag in Step 2 above.

Router(config)# dial peer voice number [pots|voip]
Router(config-dial-peer)# voice class aaa tag




Applying a Customized Acounting Template through a TCL Script

You can use the accounting template through TCL verbs as follows:


Step 1   Use the aaa accounting start TCL verb. Assign an incoming or outgoing call leg, or assign an information tag. Assign your template name to acctTempName.

aaa accounting start {legID|info-tag} -t acctTempName




Adding Attributes to Accounting Packets through TCL scripts

To add attributes to accounting packets through TCL scripts, follow these steps:


Step 1   Use the avlistSend argument in the TCL verbs to send the following attributes:

  • h323-ivr-out
  • h323-ivr-in
  • h323-credit-amount
  • h323-return-code
  • h323-prompt-id
  • h323-time-and-delay
  • h323-redirect-number
  • h323-preferred-lang
  • h323-redirect-ip-addr
  • h323-billing-model
  • h323-currency

Step 2   Use TCL verbs for authentication, authorization, and accounting.

a. For authentication, use the aaa authenticate TCL verb.

aaa authenticate account password [-a avlistSend]

b. For authorization, use the aaa authorize TCL verb.

aaa authorize account password ani destination {legID | info-tag} [-a avlistSend]

c. For accounting, use the aaa accounting start TCL verb.

aaa accounting start {legID | info-tag} [-a avlistSend]