Example of CPL Scripts
The following example from the CPL RFC 3880 shows a CPL script imple-
menting a call-forward, no-answer, and busy to voicemail.
<?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 “>
<subaction id=”voicemail”>
<location url=”sip:[email protected]”>
<redirect />
</location>
</subaction>
<incoming>
<location url=”sip:[email protected]”>
<proxy timeout=”8”>
<busy>
<sub ref=”voicemail” />
</busy>
<noanswer>
<address-switch field=”origin”>
<address is=”sip:[email protected]”>
<location url=”tel:+19175551212”>
<proxy />
</location>
</address>
<otherwise>
<sub ref=”voicemail” />
</otherwise>
</address-switch>
</noanswer>
</proxy>
</location>
</incoming>
</cpl>
In this script, two subactions are defined at the start. The first defines the
voicemail voicemailsubaction, in which the server redirects the call to the
voicemail server with the Request-URI sip:[email protected]
.com.
The script operation begins with the <incoming>tag. The <address-
switch>tag checks to see if the caller is part of the example.comdomain or
a different domain. If the caller is internal to the example.comdomain, the
call is proxied to the URI sip:[email protected]. If the result of that proxy
is busy, failure, or no answer, the call is then processed by the voice mail-
internalsubaction, which proxies the call to voicemail. For external callers,
the call is immediately sent to voicemail.
146 Chapter 7