Академический Документы
Профессиональный Документы
Культура Документы
Application Composition
Eric Cheung and K. Hal Purdy, Members, IEEE
I. DESIGN CONSIDERATIONS
Several criteria were of importance when designing the
DFC-AR.
A. Simplicity
Simplicity was a major design goal for the DFC-AR. This
implementation has been proposed as the default application
router implementation for SSAPI-1.1. As such, it is important
that the design be simple and easily implemented on the
Figure 1. Application composition in SSAPI and DFC variety of platforms that support SIP servlet containers.
Further, it is hoped that this implementation shall be suitable
A. Distributed Feature Composition Architecture for application developers who are experimenting with
DFC is a virtual architecture designed for structured feature composing SIP servlet applications. To ease understanding
composition and the analysis and management of feature SIP servlet application composition, it is desirable that the
interaction. It is a pipe-and-filter software architecture in which application router implementation be easy for a developer to
multiple feature boxes are linked by internal featureless calls, understand.
thus forming a (not necessarily linear) chain of feature boxes. The design is simplified by having the AR configuration be
By nature, a communication episode has a caller and a callee, static and entirely contained within a single XML file. There
thus DFC defines the source and target regions, and each call are no dependencies on external databases or other data stores.
is set up with a source address and a target address. Feature The static nature of the DFC-AR configuration means that it
subscription is based entirely on these addresses, and the need not be complicated with considerations of exercising its
feature boxes subscribed to by the source address are invoked routing algorithm in the presence of a dynamically changing
first, followed by those subscribed to by the target address. configuration. Simplicity is further achieved by “hard coding”
The ordering of the features within each region is extremely the addressing information in an initial SIP request. A more
important, as the feature closer to its subscriber has higher flexible yet complicated design would allow for dynamic
precedence. A DFC system is provisioned with (a) the list of configuration of what information in SIP messages would be
addresses, (b) the list of feature boxes, (c) the precedence order used by the DFC-AR for matching subscriptions. Further, by
of the feature boxes in each region, and (d) the list of feature fixing the address information to be only URIs, it becomes
boxes each address subscribes to in each region. A logical much easier to compare two addresses for inequality, a
entity, the router, follows a well-defined routing algorithm to capability that the DFC-AR is required to have for its
select the next feature box to invoke based on the source and algorithm to work properly. As a design goal, simplicity is
target address of the call setup and the system provisioning. chosen even over compliance with the original DFC router
Figure 1(b) illustrates a typical arrangement of feature boxes. specification, as will be seen in the description of how the
Comparing Figures 1(a) and 1(b), it is easy to see the DFC-AR handles the REVERSE directive.
similarities between application composition in SIP servlet A. Flexibility
environment and the DFC architecture. For this reason, and
A design goal second only to that of simplicity is
also based on our extensive and positive experience with using
flexibility. As noted, it is hoped that developers can use the
DFC in real-world telecommunication services, the authors
DFC-AR while experimenting and learning SIP servlet
have introduced most of the DFC concepts to SSAPI-1.1 and
application composition. The goal of encouraging good
are the main contributors in the expert group. We presented
software design through composition is not achieved if
this work in an earlier paper[6]. SSAPI-1.1 is general and
developers and deployers are unable to achieve flexible
flexible and does not dictate the use of the DFC routing
configurations involving multiple SIP servlet applications.
algorithm, and deployers of SIP servlet applications may
Flexibility in the DFC-AR design is achieved mostly by
choose any routing algorithm or strategy by providing their
leveraging the power of regular expressions as a mechanism
own application router implementation. At the time of writing
for defining application subscriptions. As users of DFC
the authors are aware of several groups developing application
routing based on regular expressions for some time now, we
router implementations.
have found that the use of regular expressions in evaluating
In this paper, we present a simple but powerful SIP servlet
the contents of SIP messages is a powerful mechanism for
application router that implements the DFC routing
supporting the ability of an application router to choose which
algorithm. This application router, the DFC-AR, has been
applications need to be invoked for a communication session.
used with SSAPI-1.0 containers successfully. The next section
discusses the considerations in its design and adaptation to the
I. DFC APPLICATION ROUTER IMPLEMENTATION
SIP servlet environment. Section III describes the
implementation of the DFC-AR, followed by section IV with Like the original DFC router specification, the DFC-AR
3
implementation uses precedence relationships between the SIP servlet container. The state information comprises:
applications and subscriptions to determine the applications to 1. the address that caused the last application to be invoked.
invoke for a particular SIP initial request. This is needed so that the DFC-AR can determine if the
application has changed the address when relaying the
A. Configuration Data
request thereby requiring computation of a new route list.
The DFC-AR uses a static XML configuration file to 1 . the route list. This is the remaining ordered list of
populate the precedence relationships and subscriptions that applications to be invoked if the relevant address in the
together constitute the information it needs to route SIP SIP request has not been changed. The first application in
requests to SIP servlet applications. the route list is the one that was most recently invoked to
1) Precedence handle the initial SIP request. This information is
For each routing region, originating or terminating, the required when an application issues a REVERSE directive
configuration file allows the deployer to establish a partial and the remaining applications to be invoked to handle
order among the applications. Within an ordering element in the reversed SIP request must be calculated. Note also
the XML file, the deployer lists application names. The higher that the inclusion of the remaining route list in the state
an application name appears in the list, the higher precedence information is an optimization. Given knowledge of the
it has. Because proximity to subscribers confers priority, a last application invoked, the route list could be calculated
higher precedence application appears closer to the endpoints anew on each invocation of the DFC-AR. In this case, the
when invoked. That is, a higher priority originating region AR would simply calculate the whole route list, find the
application is invoked before a lesser priority application last invoked application in it, and invoke the next
while a higher priority terminating region application is application named in the route list. For performance and
invoked after a lower priority application. robustness reasons in the face of dynamically changing
Not all deployed applications must be named in an ordering subscriptions, this optimization is warranted.
list within the precedence section of the XML configuration
file. This is because it is perfectly acceptable that some A. The Workings of the DFC Application Router
applications do not have any precedence relationship with When the SIP servlet container receives an initial request, it
other applications. For example, a call logging application calls the AR providing it with the request, the routing
simply needs to be invoked somewhere among all the invoked directive, the routing region, and any stored state information
applications. Therefore the precedence order among from the previous invocation. After the AR performs the
applications in a region is a partial not total ordering. application selection, it returns to the container the next
1) Subscriptions application’s name, the updated routing region, the subscriber
DFC-AR subscriptions are described in the same XML address and the updated state information. This function of the
configuration file in one or more mapping sections. A DFC-AR is described below.
subscription consists of one or more Java regular expressions 1) Determining the Routing Region
combined with one or more application names. The regular Since subscriptions are defined by routing region, either
expressions in a subscription are evaluated by the DFC-AR originating or terminating, the DFC-AR must first determine
against the address fields extracted from the initial SIP in which routing region it is currently operating. If the initial
requests. The originating address is the From header value request has not been seen before by the DFC-AR, then the
including the display-name portion of the value. The DFC-AR commences in the originating region as
terminating address is the Request-URI of the initial SIP recommended by SSAPI-1.1. If the routing region parameter
request. passed to the DFC-AR from the container is set to originating
The choice of applications to be invoked to handle a given but the DFC-AR determines that all originating region
SIP request is governed by the subscriptions that match the applications have already been invoked, then the DFC-AR
SIP initial request. Because multiple subscriptions may be advances to the terminating region. The DFC-AR does not
listed in the XML configuration file and because multiple currently make use of the neutral routing region.
application names may be associated with one regular 1) Examining the Routing Directive
expression in a mapping element, it is clear that when Once the region has been determined the DFC-AR
subscription regular expressions match an address in an initial examines the routing directive indicated by the last SIP servlet
SIP request, the result may be multiple applications that are to application invoked. This directive may have one of three
be invoked to handle the request. The fact that multiple values: {NEW, CONTINUE, REVERSE}. When the directive
applications may be invoked to handle a request is central to is NEW, the DFC-AR must perform the core subscription
the support for application composition in SSAPI-1.1 and matching algorithm to build a new route list. If the resulting
therefore the subscription mechanism in the DFC-AR is one route list is not empty, the first application name found in the
of its most important aspects. route list is returned to the container. If the route list is empty
then either the DFC-AR advances to the terminating region
A. Stored State Information
(when in the originating region) or it simply returns a null
The DFC-AR needs to carry certain state information from application name value to the container signaling that there are
one invocation to the next invocation for the same episode. It no further applications to be invoked for this request (when in
keeps it in a character string and delegates its persistence to the terminating region).
4
If the routing directive is CONTINUE, the last application 1. Sort the route set. Using the resulting route set, use the
is indicating that it wishes the application routing to proceed partial ordering established in the precedence section of
within the current routing region. For this case, the DFC-AR the XML file configuration to sort the route set into an
must determine whether a new route list must be constructed. ordered route list compatible with the partial ordering.
If the address in the SIP request was not changed by the last The resultant route list specifies the complete list of
application, then the previously computed route list is still applications to be invoked for the address extracted in step 1.
valid and the next element specifies the application to be The first element of this route list specifies the next
invoked. If the address in the SIP request was changed by the application to be invoked to handle the SIP request.
last application then the DFC-AR must build a new route list
using the new address. I. EXAMPLES
Determining whether the address has changed or not is This section presents three example to illustrate the
accomplished by the DFC-AR by comparing the current operation of the DFC-AR. Consider a system in which all
address in the SIP request with the SIP address stored in the addresses subscribe to Outbound Call Screening (OCS) in the
state information object from the last DFC-AR invocation. originating region, Call Forwarding (CF) in the terminating
For the purposes of comparing addresses in this way, the region, and Call Waiting (CW), 3-way Call (3WC) in both
DFC-AR is currently written to ignore certain SIP URI regions. The precedence among these applications is fully
parameters such as “transport” and “tag”. A nice feature of a specified. The XML configuration file will contain:
future version of the DFC-AR or of other similar AR Precedence:
implementations would be to allow the set of URI parameters Originating: (highest) CW, 3WC, OCS (lowest)
excluded when comparing URIs to be a configuration setting. Terminating: (highest) CW, 3WC, CF (lowest)
The last directive, REVERSE, signals the DFC-AR that it Subscriptions:
must reverse the direction of the call in an application chain Originating: .*sip:.* subscribes to OCS, CW, 3WC
that extends from and includes the last invoked application. Terminating: sip:.* subscribes to CW, 3WC, CF
To reverse a request, the DFC-AR first switches the routing
region (i.e. from originating to terminating or vice versa). A. No Address Change
Using the appropriate address for the new routing region, the In this example, A calls B and all applications simply relay
DFC-AR then builds a new route list using the core the request without changing the From header or the Request-
algorithm. However, the semantics of the REVERSE directive URI. The SIP INVITE from A to the container, the INVITE
dictate that only those applications appearing after the last requests between applications, and the outgoing INVITE
invoked application should be invoked to handle the reversed requests all have the form:
request. Thus, the DFC-AR computes the suffix of the route INVITE sip:B@example2.com
list that includes only those application names appearing in From: “Alice” sip:A@example1.com
the route list after the last invoked application (the last This results in the application chain below:
invoked application is the first entry in the stored route list in
the state information.) While the original DFC specification of
REVERSE handling dictated some additional constraints on
subscriptions to guarantee that the last invoked application In step 1, container calls the AR with the INVITE request
name would appear in the route list, the DFC-AR and NEW directive. AR sets originating region, sets
implementation is simplified and does not impose these subscriber address to the From header (i.e. “Alice”
additional constraints. Hence, it is possible that the name of sip:A@example1.com), and finds matching subscription and
the last invoked application does not appear in the computed sets route list to CW,3WC,OCS. It then returns CW as the
route list. The DFC-AR handles this case by simply not next application to the container. In step 2, the container calls
computing the aforementioned route list suffix and using the AR with the request that CWA sends, CONTINUE directive,
computed route list as is. originating region, and the previous state information.
1) The Core Algorithm: Building a Route List Comparing the subscriber address in the stored state and the
When the DFC-AR recognizes that it must build a route request, AR determines there is no change in originating
list that gives the list of applications to be invoked for a address and simply obtains the route list from the stored state
particular initial request it proceeds as follows: and removes the first entry, and returns 3WC to the container.
1. Based on the routing region, extract the address from the Step 3 is similar. In step 4, AR determines no change in
SIP request. originating address, and after removing OCS the route list is
1 . Examine sequentially each subscription for the current empty. It advances to terminating region, sets subscriber
routing region. If the extracted address from the SIP address to the Request-URI (i.e. sip:B@example2.com) and
request matches the regular expression in the subscription,
finds matching subscriptions, sets route list to CF,3WC,CW
add all the application names in the subscription to the
and returns CF to container. Steps 5 and 6 are similar. In step
route set of candidate application names.
7, after removing CW the route list is empty. The AR then
1 . Eliminate duplicates. If any application name appears
returns no application to container, and container sends the
multiple times in the route set, eliminate the duplicates.
request externally to B.
5