Internet Communications Using SIP : Delivering VoIP and Multimedia Services With Session Initiation Protocol {2Nd Ed.}

(Steven Felgate) #1

closes the tag. There are, however, some important differences between XML
and HTML. In XML, there are strict parsing rules that are defined by the
document type definition (DTD) (in this case, cpl.dtd) defined in the
<!DOCTYPE>header. Any discrepancies between the script and the schema
must produce an error. In HTML, parsing rules are forgiving. Unknown tags
may be silently ignored, while missing required tags may be added. In HTML,
some tags do not need to be closed, while in XML every opened tag must be
closed.
CPL defines behavior for SIP URIs, tel URIs, and also H.323 URIs. Each
action has a specific result for each of these signaling protocols. CPL, like SIP,
is a text-based protocol.
Some tags have attributes, in which case they are written as <tag
attribute=”value”>.Tags also can have multiple attributes. Tags without
any attributes, or nested tags, can be opened and closed in a single tag using


, which is equivalent to .
An example CPL script from the RFC 3880 to screen calls from anonymous
callers is shown here:
<?xml version=”1.0” encoding=”UTF-8”?>
<cpl xmlns=”urn:ietf:params:xml:ns:cpl”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”urn:ietf:params:xml:ns:cpl cpl.xsd “>
<incoming>
<address-switch field=”origin” subfield=”user”>
<address is=”anonymous”>
<reject status=”reject” reason=”I reject anonymous calls”/>
</address>
</address-switch>
</incoming>
</cpl>

In this example, the first tag indicates the version of XML. The second tag
begins the CPL script, lists XML namespace (urn:ietf:params:xml:ns:
cpl), and defines the schema, which supplies the parsing rules for the docu-
ment. Everything until the tag is the CPL script itself. The next tag


indicates that this defines behavior for incoming calls, not out-
going ones. The next tag is ,which is a type of switch or
decision point. This switch specifies that the username part of the origin
address (Fromheader) is the value being tested. The
tag with the
attribute is=”anonymous”means that the username portion is anonymous.
The tag with the attributes statusand reasonindicates that a
call that matches this switch (user = “anonymous”) should be rejected by the
server. The rest of the tags simply close the opened tags. The complete set of
CPL tags is listed in Table 7.2.
SIP Service Creation 143
Free download pdf