Saturday, September 10, 2011

TCL Example: B-ACD Based TCL

I thought to elaborate more on TCL side since VXML complexity is centerlized at server level (from gateway side nothing is required that pointing to VXML server). For this purpose I thought about explaining B-ACD based TCL in details.


B-ACD application is used to provide call queuing with IVR capabilities. Each B-ACD application is made of two TCL scripts: Auto-Attendant script and Call Queue script. Call queuing is provided by the combining call queue script and ephone-hunt groups (Voice Hunt Groups can’t be used with B-ACD. You can still forward from ephone-hunt to voice hunt-group but voice hunt-group pilot can’t be assigned to call queue script).

Before going into application details, below is the flow chart to understand how it works:


Following the TCL implmentation steps mentioned in the previous blog:

1. Upload the scripts (both AA & Call queue) into gateway flash (Completed)
2. Upload the associated audio files into gateway flash (Completed)

3. Initialize local and global parameters. 

This is the major part of B-ACD application. As mentioned  B-ACD application is made of two scripts (AA & Call Queue). Therefore, the parameters for both scripts should be initialized.


a.       AA-IVR pilot DN under aa-script (param aa-pilot number). Secondary number can be configured (param aa-pilot2 number).
b.      Welcome prompt and other audio files under aa-script. Customized prompts can be uploaded using the same default prompt name (overrite) or using different names.
c.       Language and language codes under aa-script (global parameter). Default language used is English and code is en. Other supported lanaguages are Chinese (ch) and Spanish (sp). Also, all three lanaguages can be enabled simultenously (aa)
d.      Map menu options under aa-script. AA-script contain the following menu options:
a.       3 hunt groups (range from 1-3)
b.      1 operator (0)
c.       1 dial-by-extension (param dial-by-extension-option menu-number)
Therefore the max number of hunt-groups to be configured in aa-script is 3 since operator and dial-by-extension are not counted in aa-script as hunt-groups (param numer-of-hunt-grps number).

The hunt-groups and operator in aa-script are mapped to ephone-hunt pilots through queue script as follow:

param aa-huntmenu-number ephone-hunt-pilot

*** The highest configured menu number will be used for operator when 0 is pressed. It can point to ephone directly instead of hunt pilot. ONLY EPHONES NOT DIAL-PEERS***

param number-of-hunt-grps number

***This varies from (1-10). BUT, Why the max number of hunt-groups can be 10 if only 3 hunt groups can be supported in aa-script ????

The main reason is that one queue script can be shared between multiple aa-scripts. Assume aa-script-1 has 3 hunt-groups and 1 operator, aa-script-2/3/4/5 have drop-through-option to different ephone-hunt groups, and all of those aa-scripts are using same queue script.

In this case the number of hunt-groups under queue script should be 3 (aa-script1) + 1 (aa-script-1 operator) + 4 (aa-script-2/3/4/5) = 8***

Important Note: dial-by-extension menu-number shouldn’t match any of hunt-group menu numbers in queue script. Example: If dial-by-extension menu-number is 1, then options 2, 3, 4 will be available in aa-script. Accrodingly aa—huntmenu-number in queue-script should have numbers 2, 3, 4 (and shouldn’t have number 1).

e.      AA-script can be used in drop-through mode. In this case AA will send the call directly to call-queue script without playing any prompt to caller (as if the caller is dialing the hunt group directly).  If an agent is avialalbe the caller will hear a ringback however, if all agents are busy the caller will hear MOH. To set drop-through-option parameter:

param drop-though-option ephone-hunt-group-number
param drop-though-prompt audio-file-name     !!... In case prompt is required

f.        Call queue exit option in aa-script. Upto 3 hunt groups can be configured for call queue exit option using the command param queue-exit-optionephone_hunt_group_number menu_number. The prompt used for call queue exit is the second greeting stored under the name en_bacd_allagentbusy.au. Optionally the call queue can point to extension directly using the command param queue-exit-extensionoption_number extension_number

g.       Voice Mail pilot number in aa-script. In case the call isn’t answered it can be forwarded to voice mail pilot using param voice-mail number. This number can be a voice mail pilot, SCCP/SIP extension, or any other destination matching dial-peer.


Adding to above parameters, following are some restrictions to be considered when deploying B-ACD:

1.       MoH source should be configured either in telephony service ro call-manager-fallback. Else, the application will throw error and drop the call.
2.       The codec used for voip calls should be G711 only. Even, if XCODE is available, B-ACD won’t trigger it.

Here is a full configuration example including all TCL implementation steps in the previous blog:

voice register dn  1
 number 3005
 name br2 phn 3
!        
voice register dn  2
 number 3006
 name br2 phn 4
!
voice hunt-group 1 parallel
!!!... Forward to voice-mail (5015) if no answer
 final 5015
 list 3001,3005,3006
 timeout 89
 pilot 3210
 !
application
 service aa flash:app-b-acd-aa-3.0.0.2.tcl
!!!... Define the language used by the script
  paramspace english index 1
!!!... Define language prefix
  paramspace english language en
!!!... Define audio files location for this language
  paramspace english location flash:
  param number-of-hunt-grps 2
!!!... Define welcome prompt audio file. Note that en prefix is removed from file name (_bacd_welcome.au). The reason is that we defined language as English (en), thus prefix will be added to prompt name making the full audio file name as en_bacd_welcome.au which is matching the file name in flash (location of English audio files).
  param welcome-prompt _bacd_welcome.au
  param aa-pilot2 3500
  param handoff-string aa
!!!... Define the maximum timer to set call in queue before sending it to voice mail
  param max-time-call-retry 90
  param voice-mail 5015
!!!... Assocaite call queue script with aa script
  param service-name queue
  param aa-pilot 32143500
 !
 service aa-drop flash:app-b-acd-aa-3.0.0.2.tcl
  param voice-mail 5015
  param max-time-call-retry 90
  param handoff-string aa-drop
  paramspace english index 1
  paramspace english language en
  param aa-pilot 32143501
  param service-name queue
  paramspace english location flash:
  param number-of-hunt-grps 1
  param drop-through-option 2
  param aa-pilot2 3501
 !
 service queue flash:app-b-acd-3.0.0.2.tcl
  param aa-hunt3 3001
!!!... Call queue length
  param queue-len 10
  param aa-hunt2 3211
!!!... To enable call queue traces
  param queue-manager-debugs 1
  param number-of-hunt-grps 2
 !
 dial-peer voice 12 pots
 description *** PSTN ---> AA ***
 service aa
 incoming called-number 32143500
 direct-inward-dial
 port 0/2/0:23
!
!!!... This dial-peer is a dummy one used for allow ephones to call B-ACD application. As mentioned earlier, we can’t assigned application to ephones directly. The workaround is to create and outbound dial-peer for B-ACD application pilot having session-target as gateway loopback interface, i.e. gateway calling it self.
dial-peer voice 13 voip
 description *** BR2 ---> AA ***
 service aa
 destination-pattern 3500
 voice-class codec 1
 session target ipv4:142.5.65.254
 incoming called-number 3500
!
dial-peer voice 14 pots
 description *** PSTN ---> AA-DROP ***
 service aa-drop
 incoming called-number 32143501
 direct-inward-dial
 port 0/2/0:23
!
dial-peer voice 15 voip
 description *** BR2 ---> AA-DROP ***
 service aa-drop
 destination-pattern 3501
 voice-class codec 1
 session target ipv4:142.5.65.254
 incoming called-number 3501
 !
 telephony-service
 moh en_bacd_music_on_hold.au
!
ephone-dn  1  octo-line
 number 3001 no-reg primary
 description 32143001
 name br2 phn1
!
ephone-hunt 1 sequential
 pilot 3211
 list 3001
 final 3210
!!!... To enable call queue statistics reporting
 statistics-collect
 max-timeout 90
 timeout 1

Verification and troubleshooting commands:

-          debug voice application
-          debug  voice application error
-          show call application ?
-          show ephone-hunt


TCL vs. VXML Applications

TCL and VoiceXML are two different approaches to provide automated functions on voice gateway such as IVR, B-ACD, CAC, Calling Routing Maniplution, etc.

The main difference between Tcl and VoiceXML is that the router executes a Tcl scripts by it self (the script can be stored locally or remote location), whereas a VoiceXML script is a client-server model. If the gateway associates a call with a VoiceXML application, the application loads the appropriate VoiceXML document that can call for the gateway to interact with various web applications. This document might play audio prompts and collect digits. You can load additional VoiceXML documents based on the caller input.

Note: MGCP is not supported with Tcl or VoiceXML applications. To support applications, the gateway 

Deploying TCL Scripts and VoiceXML

For TCL scripts below are the required steps:
1.       Load the script to flash memory or the TFTP server
HQ#dir
Directory of flash:/

   47  -rw-       30421  Jan 24 2010 00:37:46 +00:00  app-b-acd-3.0.0.2.tcl
   48  -rw-     1016832  Jan 24 2010 00:37:36 +00:00  app-b-acd-3.0.0.2-ReadMe.txt
   49  -rw-       55599  Jan 24 2010 00:38:06 +00:00  app-b-acd-aa-3.0.0.2.tcl
2.       Load the associated audio prompts to flash memory or the RTSP server
HQ#dir
Directory of flash:/

    7  -rw-       75650  Jan 24 2010 00:38:30 +00:00  en_bacd_allagentsbusy.au
    8  -rw-       83291  Jan 24 2010 00:38:58 +00:00  en_bacd_disconnect.au
    9  -rw-       63055  Jan 24 2010 00:39:20 +00:00  en_bacd_enter_dest.au
   10  -rw-       37952  Jan 24 2010 00:39:34 +00:00  en_bacd_invalidoption.au
   11  -rw-      496521  Jan 24 2010 00:42:08 +00:00  en_bacd_music_on_hold.au
   12  -rw-      123446  Jan 24 2010 00:42:48 +00:00  en_bacd_options_menu.au
   13  -rw-       42978  Jan 24 2010 00:43:04 +00:00  en_bacd_welcome.au
3.       Initialize the application

application
   service application-name location

4.       Specify the initial local parameter values

application
   service application-name
   param parameter-name value

5.       Configure the dial peers to use the script or ephone-dn/voice register pool.

dial-peer voice ID [voip|pots]
   service application-name

or

ephone-dn ID
   application application-name

or

voice register pool ID
   application application-name

TCL/VoiceXML services are applied to inbound dial-peers (inbound calls only). To apply them to outbound calls,

dial-peer voice ID [voip|pots]
   service application-name outbound

6.       TCL scriptes can call packages. Packages are C subrouties or functions which can be called by the main script (program). Packages should be uploaded to flash or TFTP server and defined as below:

package package-name location

Then the package can be called using its name in the TCL script. To check all available packeges use the command show call application voice summary

7.       Specify the initial global parameter values
Parameters have two types: local and global. Local parameters are defined per script (you can have two local parameters sharing same name in two different scripts. Each will be initialized individually) while global parameters are shared between all scripts.

Global parameters initialization is applied in one location and will impact the same parameter in all scriptes sharing it. An example of global paramters are package parameters.

Below command can be used to initialize global parameters:

paramspace parameter-namespace parameter-name parameter-value

This can be applied per dial-peer,  service level (global), per-package with precendece order from high (dial-peer) to low (package) in case same initialization applied at differnet locations.

Note: If you change a parameter value, you must reload the script for the changes to take effect.

For VXML deployments:
1.       Initialize the application

application
   service application-name location

Note: The location of the VXML should point to VXML server, e.g. Mobile Voice Access
2.       Configure the dial peers to use the application or ephone-dn/voice register pool.

dial-peer voice ID [voip|pots]
   service application-name

or

ephone-dn ID
   application application-name

or

voice register pool ID
   application application-name

TCL/VoiceXML services are applied to inbound dial-peers (inbound calls only). To apply them to outbound calls,

dial-peer voice ID [voip|pots]
   service application-name outbound
3.       Configure an outbound dial peer (SIP/H323) pointing to VXML server.

Note: Inbound dial-peers providing TCL/VXML applications can’t be used for other purposes, e.g. normal inbound PSTN calls.

DNS Performance Troubleshooting

When you are troubleshooting internet performance, there are different parts of the connection should be verified:   ·         DNS Pe...