R A Scripting language for a call routing engine Final Report COMS W4115 Programming Languages and Translators Rajiv S Kumar rk2268 columbia edu R A Scripting language for a call routing engine 1 Introduction 5 Example Scripts 5 Date time example 5 A caller language preference example 6 Features 6 Implementation 6 Real Life Scenario 7 Language Tutorial 9 A simple example 9 More Example Scripts 10 A Date time example 10 A caller language preference example 11 User Functions 12 Scope Rules 14 Type conversion 15 Arrays 15 Loops 17 Language Manual 19 Lexical Conventions 19 White Space 19 Comments 19 Identifiers 19 Keywords 19 Constants 19 Types 20 Program Structure 20 Declarations 21 Statements 21 Expression Statement 21 Operator Precedence 22 Compound Statement 22 Selection Statement 22 Iteration Statement 22 Jump Statement 22 Functions 23 Inbuilt Functions 23 User Defined Functions 23 Project Plan 24 Process 24 Programming style guide 24 Project timeline 25 Roles and responsibilities 25 Software development environment 26 Project log 26 Architectural Design 27 The Lexer 27 The Parser 28 The Tree Walker 28 R interpreter code 28 REngine 29 RInterpreter 29 RContext 29 RSymbolTable 29 RFunctions 29 RUserFunction 30 RFactory 30 RType 30 RBool 30 RInt 30 RDouble 30 RString 31 RArray 31 RException 31 Class Diagrams 31 Class Diagram Data Types 31 Class Diagram REngine 32 Class Diagram Tree Walker 33 Test Plan 34 Automated testing 34 Lessons Learned 36 Appendix 37 Code listing 37 ANTLR Grammar r g file 37 RArray java 43 RBool java 45 RContext java 46 RDouble java 49 REngine java 50 RException java 52 RFactory java 52 RFunctions java 53 RInt java 59 RInterpreter java 60 RString java 63 RSymbolTable java 64 RType java 65 RUserFunc java 67 Test Scripts 68 testExpr r 68 testArrays r 71 scope r 71 loops r 72 typeConvert r 73 testRecursion r 73 StringCompares r 74 inbuiltFuncs r 74 testUserFuncs r 75 testDateTime r 76 CallerLang r 76 serviceLevel r 77 estimatedWaitTime r 77 error1 r 78 error2 r 78 error3 r 78 error4 r 78 error5 r 79 error6 r 79 error7 r 79 error8 r 79 error9 r 79 error10 r 79 error11 r 80 error12 r 80 error13 r 80 error14 r 80 error15 r 80 error16 r 81 error17 r 81 error18 r 81 error19 r 81 error20 r 82 error21 r 82 error22 r 82 error23 r 82 error24 r 82 error25 r 83 error26 r 83 error27 r 83 error28 r 83 error29 r 83 error30 r 83 Introduction Most call centers today use ACD Automatic call distribution technology to send incoming customer phone calls to Agents Agents in a call center typically login to a Queue and wait for calls The telephony switch used in the call center has ACD capabilities to keep incoming calls in queue and play messages to the caller until an agent becomes available When agents are available the call is sent to the agent who has been available for the longest time Most ACDs have limited scripting capabilities to customize call routing behavior However most ACDs do have the concept of a Route Point where a call can be parked to let a third party application determine where to send the call This third party application called a Routing Engine is typically custom coded in a high level language such as C or Java Very few general purpose routing engines exist in the market and they tend to be proprietary and extremely expensive R is a scripting language for a general purpose call routing engine called R Engine R has the basic features used in most call centers to let system administrators quickly customize their call routing behavior R is a strongly typed interpreted language that uses the classical syntax of languages such as Java and C The R Script would be triggered by a call landing at a Route Point The ultimate purpose of every R Script is to specify a target where R Engine should send the call The REngine has a library of inbuilt functions to provide access to things like Date Time Call properties and Call Center Statistics The R scripts work on the data returned by these inbuilt functions and specify a target The following examples should make the concept clear Example Scripts Date time example This is a sample R program that sends calls to agents during office hours Mon Fri 9 AM to 5 PM and sends calls to voice mail during after hours R Get hour in 24 hr format int hour e getDateTime 11 e print Hour now is hour Get day of week with Sunday 1 int dayOfWeek e getDateTime 7 e print Day of week is dayOfWeek target 5601 voicemail number if dayOfWeek 2 dayOfWeek 6 hour 9 hour 17 target 8000 Office hours number e print target A caller language preference example This is a sample R program that sends calls to queue 78001 for english speaking callers and sends calls to 79001 for spanish speaking callers R e print e callProperty callerLang if e callProperty callerLang English target 78001 else if e callProperty callerLang Spanish target 79001 Call is now transferred to the number specified by target Features R has the basic features of a scripting language such as the ability to declare variables arrays loops conditional statements user defined functions and the ability to call REngine inbuilt functions The real power of such a scripting language comes from the ability to harness the R Engine inbuilt functions to build sophisticated call routing logic that is tailor made to suit the call center s needs Implementation R is implemented as an interpreted language The ANTLR generated lexer parser and tree walker are part of the R Engine itself so that the scripts can be directly fed to the REngine for execution The R Engine has been developed in Java Real Life Scenario Since the main purpose of this project is to develop a scripting language a few inbuilt functions have been developed for demonstration purposes The R scripts part of the demo only print the target to the console after executing the script When used in real life the R Engine would be part of a conglomerate of software components that control call routing behavior as shown below The typical sequence of operations would be as follows 1 Customer calls a toll free number 2 The PSTN public switch telephony network sends the call to the switch at the call center 3 The switch ACD parks the call at a route point and tells the ACD Controller that there is a new call at the route point Prior to this the switch or an IVR might ask the caller for the caller information such as language preference and account number and store all this information in the ACD controller 4 ACD controller asks the R Engine to execute
View Full Document
Unlocking...