Saturday, 10 September 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


1 comment: