Network Working Group X. Wu Internet-Draft H. Schulzrinne Expires: August 18, 2005 Columbia University February 14, 2005 LESS: Language for End System Services in Internet Telephony draft-wu-iptel-less-00 Status of this Memo This document is an Internet-Draft and is subject to all provisions of Section 3 of RFC 3667. By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she become aware will be disclosed, in accordance with RFC 3668. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on August 18, 2005. Copyright Notice Copyright (C) The Internet Society (2005). Abstract In Internet telephony, end systems can take a large role in providing services, especially in networks without pre-configured infra-structure, such as peer-to-peer networks. Since we believe that end system services differ in their requirements from network services, we define a new service creation scripting language called the Language for End System Services (LESS). LESS inherits many Wu & Schulzrinne Expires August 18, 2005 [Page 1] Internet-Draft LESS February 2005 characteristics from the Call Processing Language (CPL). It contains commands and events for direct user interaction and the control of media applications. This document defines the basic elements of LESS and several commonly used LESS extensions. Table of Contents 1 Introduction ........................................ 7 1.1 Conventions of This Document ........................ 7 2 LESS design decisions ............................... 8 2.1 High-level Structure ................................ 8 2.2 Simplicity .......................................... 9 2.2.1 Familiarity ......................................... 9 2.2.2 Generality .......................................... 10 2.2.3 Uniformity .......................................... 10 2.2.4 Analyzability ....................................... 11 2.3 Safety .............................................. 11 2.3.1 Type safety ......................................... 11 2.3.2 Control flow safety ................................. 12 2.3.3 Memory access ....................................... 12 2.3.4 LESS engine safety .................................. 13 2.3.5 Using third-party created or auto-generated service scripts ..................................... 13 3 LESS elements ....................................... 13 4 Variables ........................................... 15 4.1 System information .................................. 15 4.2 User information .................................... 15 4.3 Agent information ................................... 15 4.4 Trigger information ................................. 16 4.5 Action information .................................. 16 5 Basic LESS elements ................................. 16 5.1 Triggers ............................................ 16 5.1.1 "incoming" trigger .................................. 16 5.1.2 "timer" trigger ..................................... 16 5.2 Switches ............................................ 17 5.2.1 "time-switch" ....................................... 17 5.2.2 "address-switch" .................................... 17 5.2.3 "priority-switch" ................................... 17 5.2.4 "string-switch" ..................................... 17 5.2.5 "language-switch" ................................... 18 5.2.6 "status-switch" ..................................... 18 5.3 Modifiers ........................................... 19 5.3.1 "location" Modifier ................................. 19 5.3.2 Location Lookup ..................................... 19 5.3.3 Location Removal .................................... 19 5.4 Actions ............................................. 19 5.4.1 "accept" ............................................ 19 5.4.2 "reject" ............................................ 20 Wu & Schulzrinne Expires August 18, 2005 [Page 1] Internet Draft LESS February, 2005 5.4.3 "redirect" .......................................... 20 5.4.4 "authenticate" ...................................... 20 5.4.5 "call" .............................................. 21 5.4.6 "terminate" ......................................... 21 5.4.7 "mail" .............................................. 22 5.4.8 "log" ............................................... 22 5.4.9 "wait" .............................................. 23 6 Subactions and Ancillary Information ................ 23 7 Security Considerations ............................. 23 8 IANA Considerations ................................. 23 8.1 URN Sub-Namespace Registration for urn:ietf:params:xml:ns:less ......................... 24 8.2 Schema registration ................................. 24 8.3 MIME Registration ................................... 24 9 LESS Extensions ..................................... 25 10 Media handling extension ............................ 26 10.1 Modifiers ........................................... 26 10.1.1 "Media:media" Modifier .............................. 26 10.2 Actions ............................................. 27 10.2.1 "Media:mediaupdate" Action .......................... 27 10.3 IANA Considerations ................................. 27 10.3.1 URN Sub-Namespace Registration for urn:ietf:params:xml:ns:less:media ................... 28 10.3.2 Schema registration ................................. 28 10.3.3 MIME Registration ................................... 28 11 Mid-call Handling extension ......................... 29 11.1 Actions ............................................. 29 11.1.1 "Midcall:transfer" Action ........................... 29 11.1.2 "Midcall:merge" Action .............................. 30 11.2 IANA Considerations ................................. 30 11.2.1 URN Sub-Namespace Registration for urn:ietf:params:xml:ns:less:midcall ................. 30 11.2.2 Schema registration ................................. 31 11.2.3 MIME Registration ................................... 31 12 User Interaction extension .......................... 31 12.1 Triggers ............................................ 31 12.1.1 "UI:command" Trigger ................................ 31 12.2 Actions ............................................. 32 12.2.1 "UI:alert" Action ................................... 32 12.2.2 "UI:getinput" Action ................................ 33 12.3 IANA Considerations ................................. 33 12.3.1 URN Sub-Namespace Registration for urn:ietf:params:xml:ns:less:ui ...................... 33 12.3.2 Schema registration ................................. 34 12.3.3 MIME Registration ................................... 34 13 Instant Messaging extension ......................... 34 13.1 Triggers ............................................ 34 13.1.1 "IM:message" Trigger ................................ 34 Wu & Schulzrinne Expires August 18, 2005 [Page 2] Internet Draft LESS February, 2005 13.2 Actions ............................................. 35 13.2.1 "IM:sendmsg" Action ................................. 35 13.3 IANA Considerations ................................. 35 13.3.1 URN Sub-Namespace Registration for urn:ietf:params:xml:ns:less:im ...................... 36 13.3.2 Schema registration ................................. 36 13.3.3 MIME Registration ................................... 37 14 Event Handling extension ............................ 37 14.1 Triggers ............................................ 37 14.1.1 "Event:subscription" Trigger ........................ 37 14.1.2 "Event:notification" Trigger ........................ 37 14.2 Switches ............................................ 37 14.2.1 "Event:event-switch" Switch ......................... 37 14.3 Actions ............................................. 38 14.3.1 "Event:approve" Action .............................. 38 14.3.2 "Event:deny" Action ................................. 38 14.3.3 "Event:defer" Action ................................ 39 14.3.4 "Event:subscribe" Action ............................ 39 14.3.5 "Event:notify" Action ............................... 40 14.4 IANA Considerations ................................. 41 14.4.1 URN Sub-Namespace Registration for urn:ietf:params:xml:ns:less:event ................... 41 14.4.2 Schema registration ................................. 42 14.4.3 MIME Registration ................................... 42 15 Location-based service extension .................... 42 15.1 Switches ............................................ 42 15.1.1 "Location:where-switch" Switch ...................... 43 15.1.2 "Location:where-relation-switch" .................... 45 15.2 IANA Considerations ................................. 47 15.2.1 URN Sub-Namespace Registration for urn:ietf:params:xml:ns:less:location ................ 47 15.2.2 Schema registration ................................. 47 15.2.3 MIME Registration ................................... 48 16 Queue handling extension ............................ 48 16.1 Actions ............................................. 48 16.1.1 "Queue:enqueue" Action .............................. 48 16.1.2 "Queue:dequeue" Action .............................. 48 17 Examples ............................................ 49 17.1 Q.1211 services ..................................... 49 17.1.1 Abbreviated dialing (ABD) ........................... 49 17.1.2 Attendant (ATT) ..................................... 50 17.1.3 Authentication (AUTC) ............................... 50 17.1.4 Authorization code (AUTZ) ........................... 51 17.1.5 Automatic call back (ACB) ........................... 51 17.1.6 Call distribution (CD) .............................. 52 17.1.7 Call forwarding (CF) ................................ 52 17.1.8 Call forwarding on busy/don't answer (CFC) .......... 52 17.1.9 Call gapping (GAP) .................................. 53 Wu & Schulzrinne Expires August 18, 2005 [Page 3] Internet Draft LESS February, 2005 17.1.10 Call hold with announcement (CHA) ................... 53 17.1.11 Call limiter (LIM) .................................. 54 17.1.12 Call logging (LOG) .................................. 55 17.1.13 Call queueing (QUE) ................................. 55 17.1.14 Call transfer (TRA) ................................. 56 17.1.15 Call waiting (CW) ................................... 56 17.1.16 Closed user group (CUG) ............................. 57 17.1.17 Consultation calling (COC) .......................... 57 17.1.18 Customer profile management (CPM) ................... 57 17.1.19 Customer recorded announcement (CRA) ................ 57 17.1.20 Customized ringing (CRG) ............................ 58 17.1.21 Destination user prompter (DUP) ..................... 59 17.1.22 Follow-me diversion (FMD) ........................... 59 17.1.23 Mass calling (MAS) .................................. 59 17.1.24 Meet-me conference (MMC) ............................ 59 17.1.25 Multi-way calling (MWC) ............................. 60 17.1.26 Off-net access (OFA) ................................ 60 17.1.27 Off-net calling (ONC) ............................... 60 17.1.28 One number (ONE) .................................... 61 17.1.29 Origin dependent routing (ODR) ...................... 61 17.1.30 Originating call screening (OCS) .................... 62 17.1.31 Originating user prompter (OUP) ..................... 62 17.1.32 Personal numbering (PN) ............................. 62 17.1.33 Premium charging (PRMC) ............................. 62 17.1.34 Private numbering plan (PNP) ........................ 63 17.1.35 Reverse charging (REVC) ............................. 63 17.1.36 Split charging (SPLC) ............................... 63 17.1.37 Terminating call screening (TCS) .................... 63 17.1.38 Time dependent routing (TDR) ........................ 64 17.2 5ESS services ....................................... 64 17.2.1 Attendant call transfer (also known as Call splitting) .......................................... 64 17.2.2 Attendant camp-on ................................... 65 17.2.3 Attendant conference ................................ 66 17.2.4 Authorization code .................................. 67 17.2.5 Automatic recall .................................... 67 17.2.6 Call forwarding busy line (CFBL) .................... 68 17.2.7 Call forwarding busy line--incoming only ............ 69 17.2.8 Call forwarding--don't answer ....................... 69 17.2.9 Unconditional call forwarding ....................... 70 17.2.10 Call hold ........................................... 70 17.2.11 Call transfer--individual--all calls ................ 70 17.2.12 Call waiting and cancel call waiting ................ 71 17.2.13 Circle hunting ...................................... 72 17.2.14 Conference calling .................................. 72 17.2.15 Customer-changeable speed calling ................... 72 17.2.16 Direct connect ...................................... 73 17.2.17 Distinctive ringing ................................. 73 Wu & Schulzrinne Expires August 18, 2005 [Page 4] Internet Draft LESS February, 2005 17.2.18 Four- and eight-party ............................... 74 17.2.19 Recorded telephone dictation ........................ 74 17.2.20 Time-of-Day features ................................ 75 17.2.21 Message services .................................... 75 17.2.22 Multibutton key telephone system (MBKS) ............. 76 17.2.23 Group alerting ...................................... 76 17.3 Services defined in CSTA Phase III .................. 77 17.3.1 Accept call ......................................... 78 17.3.2 Alternate call ...................................... 78 17.3.3 Answer call ......................................... 78 17.3.4 Call back call-related .............................. 78 17.3.5 Call back message call-related ...................... 78 17.3.6 Camp on call ........................................ 79 17.3.7 Clear call .......................................... 79 17.3.8 Clear connection .................................... 79 17.3.9 Conference call ..................................... 80 17.3.10 Consultation call ................................... 80 17.3.11 Deflect call ........................................ 80 17.3.12 Dial digits ......................................... 80 17.3.13 Directed pickup call ................................ 80 17.3.14 Group pickup call ................................... 80 17.3.15 Hold call ........................................... 80 17.3.16 Intrude call ........................................ 81 17.3.17 Join call ........................................... 81 17.3.18 Make call ........................................... 81 17.3.19 Make predictive call ................................ 81 17.3.20 Park call ........................................... 82 17.3.21 Reconnect call ...................................... 82 17.3.22 Retrieve call ....................................... 82 17.3.23 Send message ........................................ 82 17.3.24 Single step conference call ......................... 82 17.3.25 Single step transfer call ........................... 82 17.3.26 Transfer call ....................................... 83 17.4 New services ........................................ 83 17.4.1 Email ............................................... 83 17.4.2 Web ................................................. 83 17.4.3 Instant messaging ................................... 84 17.4.4 Event subscription and notification ................. 84 17.4.5 Event notification and event-based services ......... 85 17.4.6 Location-based services ............................. 85 18 Feature Interaction Handling Algorithm for LESS Scripts ............................................. 86 18.1 Tree merging algorithm .............................. 86 19 The XML Schema for LESS and Commonly Used Extensions .......................................... 89 19.1 XML Schema for LESS ................................. 89 19.2 XML Schema for LESS Media Extension ................. 104 19.3 XML Schema for LESS Mid-call handling Extension ..... 119 Wu & Schulzrinne Expires August 18, 2005 [Page 5] Internet Draft LESS February, 2005 19.4 XML Schema for LESS User Interaction Extension ...... 121 19.5 XML Schema for LESS Instant Messaging Extension ..... 123 19.6 XML Schema for LESS Event Handling Extension ........ 124 19.7 XML Schema for LESS Location-based Services Extension ........................................... 128 19.8 XML Schema for LESS Queue Handling Extension ........ 134 20 References .......................................... 136 20.1 Normative References ................................ 136 20.2 Informative References .............................. 137 Authors' Addresses .................................... 137 Intellectual Property and Copyright Statements ........ 139 Wu & Schulzrinne Expires August 18, 2005 [Page 6] Internet Draft LESS February, 2005 1 Introduction One of the key promises of Internet telephony lies in the ability of developing and deploying innovative services rapidly and efficiently. Internet telephony services are not limited to those performed in servers operated by service providers; end systems can play a much larger role in providing services than in traditional telephone networks. We define end systems as the systems that are located at the end of a session signaling routing path and can initiate or accept session setup messages. By this definition, end systems are not limited to the user-operated systems, instead, they can also be conference servers. Accordingly, we define network servers as the entities that perform session message routing. We believe it is necessary to define a service creation language specifically for end systems because end system services are different from network services. There are services that are clearly implementable only in end systems or in network, but most can be moved to either location, or split between the two. Providing services in user-operated end systems has the advantage that on-the-spot interaction with users is much easier. Network services can only interact via protocol messages and possibly media content, rather than GUIs. It might be possible to incorporate user interaction into scripts running in servers, but it is likely to be far more cumbersome and subject to network delays. In Internet telephony, usually end systems are the only entities where signaling and media flows converge. This is different from the legacy PSTN. Thus, any service that requires interaction with user media is likely to be easier to implement in end systems. The more detailed analysis on the differences between end system services and network services can be found in our articles [11] [12]. Because of the differences between end system services and network services, we define the Language for End System Services specifically for end system service creation. Section 2 introduces the design decisions for LESS. Section 3 briefly describe the categories of elements in LESS, we then provide more detailed description of the elements in each category in the following sections. Extensibility is very important for a service creation language. Section 9 defines how to write LESS extensions. Several commonly used extensions are defined in the following sections. Section 17 provides service examples written in LESS. Section 19 shows the XML schema of the language. 1.1 Conventions of This Document Wu & Schulzrinne Expires August 18, 2005 [Page 7] Internet Draft LESS February, 2005 In this document, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in RFC 2119 [1] and indicate requirement levels for compliant LESS implementations. Some paragraphs are indented, like this; they give motivations of design choices, advice to implementors, or thoughts on future development of or extensions to LESS. They are not essential to the specification of the language, and are non-normative. 2 LESS design decisions The goal of the language is to allow end users to program their own communication services with little training in a graphical service creation environment. To achieve the goal, the language must represent a high-level abstraction of communication behaviors. The elements in the language must have semantic meanings. The language has to be simple and safe. The Call Processing Language (CPL) [2] has all the above features. However, CPL is originally designed for network servers, such as SIP proxy servers. It lacks of the functions for end system services, e.g., accepting calls, making outgoing calls, and interacting with users. CPL does not have variables, which is very important for call decision making and user interactions. We have LESS inherit the basic structure and many elements from CPL and enhance it with more elements for end system services. In this section, we first provide the high-level structure of LESS. We then analyze the simplicity and safety of the design rules. 2.1 High-level Structure As shown in Figure 1, we consider that every service starts with a trigger invoked, such as an incoming call, an event notification, a user interaction event, or a timer event. The service will then check its current context, such as user status, device status, and the status related to the trigger. We name the check points as switches, which can branch call decisions. Once a service gets its matching condition, it will perform pre-defined actions, e.g., accepting an incoming call, holding an existing call, or sending an instant message. We use modifiers to provide parameters to actions, e.g., media modifier to define media information of a call action. Additional actions may get performed based on the result of an action. Wu & Schulzrinne Expires August 18, 2005 [Page 8] Internet Draft LESS February, 2005 +--------+ | +-------+ |modifier| | | |<------+ * +---+----+ * * | * * V ========= * * +------+ ( trigger )---* switch*------|action|---+ ========= * * +--+---+ | * * | * *<--------------------+ * Figure 1: The high-level structure of LESS The above high-level abstraction makes LESS having a tree-like structure, as shown in Figure 2. The tree-like structure makes LESS easy to analyze and safe for service programming. 2.2 Simplicity "The fewer concepts to understand in a language the better" [13], though, in some cases two smaller concepts might be simpler and more flexible than one more powerful but complicated concept. For example, separating commonly used action arguments, such as people's contact locations, as modifiers is better than putting the arguments into every action. "Simplicity enters in four disguises: uniformity (rules are few and simple), generality (a small number of general functions provide as special cases of more specialized functions), familiarity (familiar symbols and usages are adopted whenever possible), and brevity (economy of expression is sought)" [14]. For LESS, we consider analyzability is more important than brevity because LESS is an XML- based language designed for communication services and has people without programming experience as its target users. In communication service creation, users may encounter feature interaction [15] problems, how to analyze and solve feature interactions is essential for users to create usable services. We discuss the familiarity, generality, uniformity, and analyzability of LESS below. 2.2.1 Familiarity Wu & Schulzrinne Expires August 18, 2005 [Page 9] Internet Draft LESS February, 2005 +----------+ | incoming | (trigger) +-----+----+ | | +----------+------------+ |Is the sender's address| (switch) | sip:bob@example.com? | +----------**-----------+ / | YES NO / | +------* +---*-----------------------+ |accept| |Is the priority of the call| (switch) +------+ | greater than 'normal'? | (action) +--------**-----------------+ / | YES NO / | +---*-+ +--*------------------+ |alert| |redirect to voicemail| +-----+ +---------------------+ (action) (action) Figure 2: Sample decision tree The familiarity requires a language not to violate common use of notation. We choose to use the Extensible Markup Language (XML) [3] to define LESS, uses the datatypes defined in XML schema. By this way, the elements defined in LESS all have semantic meaning and easy for users to understand and remember. 2.2.2 Generality The generality requires a language to have a small number of general elements. The special elements of the language can be introduced by specializing the general elements. As illustrated in Section 2.1, LESS has only four kinds of elements, namely triggers, switches, actions, and modifiers. Every new element defined in LESS extensions must fall in one kind of the elements. In another words, in LESS's XML schema, LESS will have four basic abstract elements, namely 'trigger', every element must be a substitutionGroup of one of the four abstract elements. 2.2.3 Uniformity Wu & Schulzrinne Expires August 18, 2005 [Page 10] Internet Draft LESS February, 2005 The uniformity requires a language with few and simple rules. There are only four rules in LESS. The rules can be summarized below: Trigger rule: A LESS script gets invoked if and only if one of its triggers get matched. A trigger must be the root of a decision tree. Two triggers with the same name and attributes cannot appear in the same script. Switch rule: Only switches can branch call decisions. One switch have no more than two branches. A switch must be a child of a trigger or another switch in a decision tree. Action rule: Only actions can change call status and call context and only actions can be LESS decision tree leaves. There can be subsequent actions after one action. No triggers can follow an action. Modifier rule: A modifier can only be used as the parent element of actions to enforce the actions. 2.2.4 Analyzability Another aspect of language simplicity is how easy to analyze a program written by the language. For LESS, we are more interested in how LESS handling feature interaction problems in communication services. As discussed in our technical report "Feature Interactions in Internet Telephony End Systems" [15], we can handle feature interaction problems among LESS scripts by the action conflict tables and the tree merging algorithm defined in the technical report. The process is straight-forward, and can also help to solve detected interactions. 2.3 Safety Since LESS will be used by people without programming experience, we may expect errors that seem naive by experienced programmers. We should also expect that people may use third-party created malicious service scripts. The language design should help people to prevent errors and protect people from malicious scripts. The error prevention mechanisms for LESS fall into two categories, one is to put restrictions on the language itself, the other is to put restrictions on LESS engines. We are more interested in the restrictions on the language itself since that is directly related to the language design. The restrictions on LESS engines may cause service portability problem so we should try to prevent errors in the language design whenever possible. 2.3.1 Type safety Wu & Schulzrinne Expires August 18, 2005 [Page 11] Internet Draft LESS February, 2005 Type checking is a very effective way in catching programming errors, from the trivial errors, such as misspelled identifiers, to the fairly deep errors, such as violations of data structure invariants. LESS is an XML-based language and uses XML schema [4] to define its elements. "The strong typing mechanism in XML Schema, along with the large set of intrinsic types and the ability to create user-defined types, provides for a high level of type safety in instance documents. This feature can be used to express more strict data type constraints, such as those of attribute values, when using XML Schema for validation." [4] In LESS, there are no user defined variables so only static type checking is needed. There are many advantages to have a statically type-checked language. Static type checking can provide earlier, and usually more accurate information on programmer errors. It can eliminate the need for run-time checks, which may slow program execution. Statically type-checked language may be less expressive than dynamically type-checked language, however, since LESS is not designed to handle all communication services and targets to end users, safety is more important than expressiveness. 2.3.2 Control flow safety LESS has a tree-like structure for call decision making. LESS does not allow a tree node to back-reference to its ancestors or itself. This means there is no loop or recursion in LESS scripts, and will exclude the possibility of non-terminating or non-decidable LESS scripts. However, LESS still provides some mechanisms for repeated events handling. The timer trigger can get invoked periodically. The lookup modifier implies that follow-up actions are applied to every location in the result set. Run-time feature interactions may confuse users. The LESS trigger rule ensures that a specific trigger can appear no more than once in a LESS script thus helps to avoid run-time feature interactions in the LESS script. The LESS service creation environment should help users to merge multiple service scripts into one as illustrated in the technical report on feature interaction handling in LESS [15]. 2.3.3 Memory access A language can be described as unsafe in that the language allows some means to access memory directly. In LESS, there are no pointers, no direct memory accesses, and even no user-defined variables. LESS has maximum string length defined in its XML schema for every element with string type to prevent buffer overflow attack. If a user put a very long string in a service script, the service script will be Wu & Schulzrinne Expires August 18, 2005 [Page 12] Internet Draft LESS February, 2005 considered invalid when checking against the LESS XML schema. 2.3.4 LESS engine safety LESS engine developers can do several things to enhance the safety of LESS scripts. The developers must make sure that every trigger has default behaviors defined. If a trigger gets invoked in a LESS engine, but there is no actions defined for the matching context, the LESS engine must perform the default actions for that trigger. This ensures every LESS script is decidable. LESS is different from CPL [2] when dealing with user trustiness. CPL is designed for running on signaling servers, such as SIP proxy servers. The safety consideration for CPL ensures that semi-trusted users cannot create malicious or incompetent service scripts to interrupt other users' services, including crashing the server, revealing security-sensitive information, and causing denial of service. While LESS is used on users' end devices, usually, it does not need to handle the interference of other users. LESS engine need to ensure safe resource usages, such as CPU usage. It needs to define how deep a decision tree can be, what is the minimum interval for timer trigger, and whether it can control multimedia devices. 2.3.5 Using third-party created or auto-generated service scripts Sometimes, end users may not be aware of a new service or they may not know how to create a service, the service scripts auto-generated by feature learning, or created by third-parties, may bring great conveniences to users. However, end users have to check the safety of the third-party created or auto-generated scripts, for example, to make sure that the scripts will not crash their systems or forward their calls to unwanted parties. The safety consideration discussed in previous sections can be applied to third-party or auto-generated service scripts. In addition, the simplicity and the tree-like structure of LESS make it viable to convert any valid LESS scripts into graphical representation of decision trees. This is a big advantage of LESS for end users to do safety checking. Users do not have to check LESS programs line by line, instead, they can watch the graphical representation and easily find out what actions a service script will perform. 3 LESS elements As we discussed earlier, LESS has four kinds of elements, namely triggers, switches, actions, and modifiers. Wu & Schulzrinne Expires August 18, 2005 [Page 13] Internet Draft LESS February, 2005 A trigger is an entry point to every service. It is the same as the toplevelactions defined in CPL. The basic LESS definition has two triggers, "incoming" (Section 5.1.1) and "timer" (Section 5.1.2). Note that we do not have "outgoing" trigger, which is defined in CPL. Because in end systems, an outgoing call is usually triggered by some user interactions, e.g., pressing a call button. This is different from that in an outbound server, in which "outgoing" triggered by receiving an outgoing call signaling message. We defined user interaction extension, which has one trigger, "UI:command" (Section 12.1.1). The event handling extension has two triggers, "Event:notification" (Section 14.1.2) and , "Event:subscription" (Section 14.1.1). The instant messaging extension has one trigger, "Message:message" (Section 13.1.1). Switches branch call decisions. This is the same as CPL switches. The basic LESS definition has six switches, namely "time-switch" (Section 5.2.1), "address-switch" (Section 5.2.2), "language-switch" (Section 5.2.5), "priority-switch" (Section 5.2.3), "string-switch" (Section 5.2.4), and "status-switch" (Section 5.2.6). The location- based service extension has two switches, "where-switch" (Section 15.1.1) and "where-relation-switch" (Section 15.1.2). The event handling extension has one switch, "event-switch" (Section 14.2.1). Actions represent users' decision for trigger handling. This is similar to CPL actions, but we allow multiple actions be executed in parallel and in sequential. Each action has a "next" output. Actions in an action's "next" output will be executed after the action. If multiple actions have the same parent tag, they are executed in parallel. The basic LESS definition has six signaling actions, namely "accept" (Section 5.4.1), "reject" (Section 5.4.2), "redirect" (Section 5.4.3), "authenticate" (Section 5.4.4), "call" (Section 5.4.5), and "terminate" (Section 5.4.6). It also has three non-signaling actions, "mail" (Section 5.4.7) "log" (Section 5.4.8), and "wait" (Section 5.4.9). We defined a mid-call handling extension. It has two actions, "Midcall:transfer" (Section 11.1.1), and "Midcall:merge" (Section 11.1.2). The user interaction extension has two actions, "UI:alert" (Section 12.2.1). "UI:getinput" (Section 12.2.2). The instant messaging extension has one action, "IM:sendmsg" (Section 13.2.1). The event handling extension has five actions, "Event:subscribe" (Section 14.3.4), "Event:notify" (Section 14.3.5), "Event:approve" (Section 14.3.1), "Event:deny" (Section 14.3.2), and "Event:defer" (Section 14.3.3). The queue handling extension has two actions, "Queue:enqueue" (Section 16.1.1), and "Queue:dequeue" (Section 16.1.2). Wu & Schulzrinne Expires August 18, 2005 [Page 14] Internet Draft LESS February, 2005 Modifiers provide action parameters. We have three modifiers defined in basic LESS definition, namely "location" (Section 5.3.1), "lookup" (Section 5.3.2), and "remove-location" (Section 5.3.3). In media handling extension, we defined "media" (Section 10.1.1) modifier. 4 Variables LESS does not allow user-defined variables, however, it allows several pre-defined variables to retrieve system information, user information, agent information, trigger information, and action information. The variables can be used in descriptive messages, such as the reason parameter of a reject message. We use the format 'variable-name' to represent a variable in a LESS script. For example, in a "reject" action, we can provide its reason parameter as below.