Cisco Unity Connection Provisioning Interface (CUPI) API -- Assigning a Schedule to a Call Handler

From DocWiki

Revision as of 09:10, 28 February 2012 by Anilve (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Links to Other API pages: Cisco_Unity_Connection_APIs

CUPI Guide Contents
API Overview
Index of All CUPI Documentation


Contents


Introduction

In order to assign a schedule to a call handler, such as the Opening Greeting Call Handler, an administrator should first create a ScheduleSet and its supporting objects, and then change the Call Handler to point to that new ScheduleSet.


Creating a Schedule

Schedules are relatively complicated objects in Cisco Unity Connection. They are comprised of 4 different types of objects, and the top level object is called a ScheduleSet. For a more detailed explanation of how the schedules work in Unity Connection, check Schedules Overview

When a schedule has been created, the administrator will need the ScheduleSet's ObjectId in order to associate it with a call handler.


Associating a ScheduleSet with a Call Handler

Retrieving the List of Call Handlers

In order to retrieve the list of call handlers, an administrator makes a GET request to the call handler resource:

GET /vmrest/handlers/callhandlers

This will return a list of all call handlers on the system. A portion of that list is shown here:

200
OK

<?xml version="1.0" encoding="UTF-8"?>
<Callhandlers total="5">
  <Callhandler>
    <URI>/vmrest/handlers/callhandlers/03991ce8-0eaa-40cc-86a9-c0c88d9066ad</URI>
    <CreationTime>2010-05-25T18:38:51Z</CreationTime>
    <Language>1033</Language>
    <Undeletable>true</Undeletable>
    <VoiceName>0164efab-5c35-42bd-8284-018746edc64b.wav</VoiceName>
    <VoiceFileURI>/vmrest/voicefiles/0164efab-5c35-42bd-8284-018746edc64b.wav</VoiceFileURI>
    <LocationObjectId>6919b242-ed60-4f3a-95fa-40967171485e</LocationObjectId>
    <LocationURI>/vmrest/locations/connectionlocations/6919b242-ed60-4f3a-95fa-40967171485e</LocationURI>
    <EditMsg>true</EditMsg>
    <IsPrimary>false</IsPrimary>
    <OneKeyDelay>1500</OneKeyDelay>
    <ScheduleSetObjectId>a7e21c61-296d-46f1-9860-50966bbfbb8e</ScheduleSetObjectId>
    <ScheduleSetURI>/vmrest/schedulesets/a7e21c61-296d-46f1-9860-50966bbfbb8e</ScheduleSetURI>
    <SendUrgentMsg>0</SendUrgentMsg>
    <MaxMsgLen>300</MaxMsgLen>
    <IsTemplate>false</IsTemplate>
    <ObjectId>03991ce8-0eaa-40cc-86a9-c0c88d9066ad</ObjectId>
    <RecipientDistributionListObjectId>7082dace-606c-4f2c-8af1-764d149e4500</RecipientDistributionListObjectId>
    <RecipientDistributionListURI>/vmrest/distributionlists/7082dace-606c-4f2c-8af1-764d149e4500</RecipientDistributionListURI>
    <DisplayName>Opening Greeting</DisplayName>
    <AfterMessageAction>2</AfterMessageAction>
    <AfterMessageTargetConversation>PHGreeting</AfterMessageTargetConversation>
    <AfterMessageTargetHandlerObjectId>3910fd6b-8d56-4b83-89a6-d5c825d69916</AfterMessageTargetHandlerObjectId>
    <TimeZone>4</TimeZone>
    <UseDefaultLanguage>true</UseDefaultLanguage>
    <UseDefaultTimeZone>true</UseDefaultTimeZone>
    <MediaSwitchObjectId>2d4be643-a206-4705-92a9-261d191f2df4</MediaSwitchObjectId>
    <PhoneSystemURI>/vmrest/phonesystems/2d4be643-a206-4705-92a9-261d191f2df4</PhoneSystemURI>
    <UseCallLanguage>true</UseCallLanguage>
    <SendSecureMsg>false</SendSecureMsg>
    <EnablePrependDigits>false</EnablePrependDigits>
    <DispatchDelivery>false</DispatchDelivery>
    <CallSearchSpaceObjectId>44228e57-f458-4d56-809a-8d33fbdecb56</CallSearchSpaceObjectId>
    <CallSearchSpaceURI>/vmrest/searchspaces/44228e57-f458-4d56-809a-8d33fbdecb56</CallSearchSpaceURI>
    <InheritSearchSpaceFromCall>true</InheritSearchSpaceFromCall>
    <PartitionObjectId>5d61a103-87a8-41c6-ba0b-90e1c72eda7c</PartitionObjectId>
    <PartitionURI>/vmrest/partitions/5d61a103-87a8-41c6-ba0b-90e1c72eda7c</PartitionURI>
    <GreetingsURI>/vmrest/handlers/callhandlers/03991ce8-0eaa-40cc-86a9-c0c88d9066ad/greetings</GreetingsURI>
    <TransferOptionsURI>/vmrest/handlers/callhandlers/03991ce8-0eaa-40cc-86a9-c0c88d9066ad/transferoptions</TransferOptionsURI>
    <MenuEntriesURI>/vmrest/handlers/callhandlers/03991ce8-0eaa-40cc-86a9-c0c88d9066ad/menuentries</MenuEntriesURI>
  </Callhandler>
  <Callhandler>
    ...
  </Callhandler>
  ...
</Callhandlers>

Selecting the Call Handler

From the list of call handlers obtained by doing the previous step, the administrator should choose one, usually based on DisplayName. In program code, this can be done by loading the returned XML document into an XML parser, and then finding the node with the requested DisplayName.

In this example, let's choose the Opening Greeting Call Handler, meaning the call handler with the DisplayName "Opening Greeting." The URI field tells the administrator which URI to use in order to retrieve, modify, or delete the call handler. In this example, the URI is /vmrest/handlers/callhandlers/03991ce8-0eaa-40cc-86a9-c0c88d9066ad.


Modifying the Call Handler

In order the change the schedule associated with a call handler, the administrator makes a PUT to the call handler resource, requesting a modification to the ScheduleSetObjectId field. Let's say that 9dd6c1d5-249e-4715-8953-396ce2f26314 is the ObjectId for the ScheduleSet that the administrator created earlier.

PUT /vmrest/handlers/callhandlers/03991ce8-0eaa-40cc-86a9-c0c88d9066ad

<Callhandler>
  <ScheduleSetObjectId>9dd6c1d5-249e-4715-8953-396ce2f26314</ScheduleSetObjectId>
</Callhandler>

At this point, the call handler will now be active during the time periods described by the ScheduleSet.


Finding Which Schedule Is Assigned to a Call Handler

In order to find out which schedule is currently assigned to a call handler, an administrator makes a GET request to the call handler resource, as described earlier. After selecting a call handler from the list, the ScheduleSetURI field provides a link to the ScheduleSet that is associated with the call handler. The administrator can then make a GET request to that URI to retrieve the ScheduleSet:

GET /vmrest/schedulesets/9dd6c1d5-249e-4715-8953-396ce2f26314

That will return the ScheduleSet. From that ScheduleSet object, the administrator can retrieve the ScheduleSetMembers, Schedules, and ScheduleDetails that comprise the entire Schedule.

Rating: 0.0/5 (0 votes cast)

Personal tools