This topic describes the models behind each interface within the API set. In a full installation of Softdial Contact Center™ (SCC), different line-of-business services fulfil each of these APIs.
Through the agent API, an agent logs in on to the system, makes ad-hoc calls or goes ASD available to receive ASD calls and perform first-party interactions with the call (transfers, end call, recording/ message playback).
The Agent lifetime methods are Agent Login [AL] and Log Out [LO]. The Agent Name (AN) parameter uniquely identifies an agent endpoint. Agent names are unique within a tenant.
In SCC, prior to 10.7, the agent model delivered the API for agent interaction with the system. In version 10.7 of SCC the agent model has been extended to cater for multisession support as the underpinnings for the ASD. SCC provides core platform support for multimedia and multisession agents, and does so in a way that makes it easy for third parties to integrate either a simple first-party agent dialog, or a complete multisession desktop.
The agent model from SCC 10.6 continues to be supported, although the agent endpoint is part of a larger multimedia turret. This means that when an agent endpoint logs on, it does so as part of a turret. There is an additional Turret ID (QI) parameter that is passed as part of agent logon.
In order to provide backwards compatibility for the many CRM client integrations, Softdial CallGem™ still accepts the old form of agent logon request without the Turret ID (QI) parameter. When using the old form of logon, CallGem models this internally as an ASD turret with a single agent endpoint. In this way reporting and other subscribers behave consistently whether there is a 10.6-style integration or new agent API.
CallGem’s internal model is such that an agent endpoint can exist in one of the following states:
State | Description | State Code (DS param) |
---|---|---|
Not Logged In | Not logged in to the system | 0 |
Waiting Nailup | Logon request in progress; the media layer is registering media, which for voice may involve a station nailup. | 1 |
Not Ready | Agent is logged in but has not gone available on the ASD. From this state an agent may make an ad-hoc call, may receive an inbound PBX type call, or may go ASD available | 2 |
Waiting | The agent is in a state waiting for the ASD to deliver a call | 3 |
Previewing | The Agent is previewing an ASD call prior to the call being dialled | 4 |
Breather | The agent is in a breather period between preview calls. | 5 |
Talking | The agent is connected to a customer | 6 |
In Wrap | The agent has finished talking to a customer and is in post call work | 7 |
In follow-up | The agent has launched a follow-up call to an ASD call | 8 |
In transfer | The agent is in a transfer offering or conferencing state | 9 |
Offering | The agent is being offered a call (typically inbound on-hook) | 10 |
Monitoring | The agent is a supervisor and is monitoring another agent’s session | 11 |
Waiting (Reserved) | The agent is in a state waiting for the ASD to deliver a call. The ASD has reserved the agent to answer a specific call (preview, progressive, agent-specific callback, abandon retry) | 12 |
On Hold | The agent is in session with a customer but is currently on hold | 13 |
Agents transition between states either in response to requests or as a result of events in the ASD.
The user model, introduced with 10.7, provides the means to have oversight and control of the user session, which may encompass several agent endpoints. Softdial Agent Desktop™ integrates with the user model. Individual agent endpoint sessions are managed either through Softdial Scripter™, or by a third-party integration with the agent model.
This allows agent endpoint sessions to undertake first-party call (media) control actions and have any media control actions reflect in the user state. This allows the SCC agent desktop to represent user state and handle UI update to reflect endpoint session states.
The user session lifetime methods are Add User [AT] to add a user and Delete Turret [DT] to log a user out of the SCC desktop.
The user model also incorporates the notion of Focus. At any point in time a user may have multiple agent endpoint sessions in progress. However an agent may only be active on one of these at a particular instant in time. Focus can and should be set by the agent desktop application in response to user activity in the UI. The Change Focus [FT] method is used to set focus to an agent endpoint. On change of focus the agent endpoints that have gained and lost focus will receive a Focus Switched [FW] event.
The user model has a few user-specific methods and events, and also supports the full set of methods and events that the Agent endpoint model supports. The Agent endpoint methods supported by the user model are interpreted as ‘apply the method action to the endpoint in focus’, so for example, if the StartWrap method is invoked for a user it means, start wrap for the user’s current endpoint in focus.
The Campaign Model is CallGem’s representation of a contact center campaign.
The campaign model is used to feed customer records to CallGem for outbound dialing and to attach records to inbound sessions. Through the campaign API queues are provisioned and agent endpoints associated with queues.
Queue configuration is normally sent to CallGem by the CallGem controller which subscribes to Softdial Repository™, but by exposing APIs this gives rise to the possibility for integrators to use their own configuration schemes.
In a full installation of SCC, Softdial Campaign Manager™ fulfils the data side of the Campaign API, delivering records for outbound dial and performing data lookups to attach customer data to inbound sessions. By exposing the Campaign API this enables third parties who have their own inventory management solutions to plug these in to CallGem directly.
A campaign has lifetime. The campaign session lifetime methods are:
The Campaign Name (CN) parameter is used to identify the campaign. Campaign names must be unique within the scope of a tenant.
The campaign is the basic unit for agent accounting. An agent endpoint can be logged in and active on one and only campaign at a given point in time. If the campaign is an inbound campaign, the agent will be offered calls from a queue that is owned by that campaign. This constraint ensures that an agent’s time can be accounted for accurately and makes for proper measurement of resource availability necessary for ASD and blending functions to work properly.
Agents can be moved between campaigns, either as a result of supervisor action, or automatically by the system for callbacks and blending.
The 10.7 Campaign Model is fully compatible with version 10.6. As SCC core services are accessible via a single protocol that is routable at an application level, it is possible to address messages to Campaign Manager Service where it uses its API in order to drive all operations and documents the XML schemas used within its API.
Softdial Campaign Manager™ manages a series of property sets that tie data in a database to a dialer campaign. Each instance of Campaign Manager Server manages campaign data on behalf of one tenant.
Campaigns are indexed by integer ID within a tenant. Translating from a name to an integer ID can be done by getting the set of campaigns through the Status Request [SR] / Status Broadcast [SB] message pair. This delivers an XML document containing outline statistics for each campaign including data to cross-reference names to IDs. The Campaign Manager API supports reference of campaigns either by name (CN parameter) or by integer id (CY parameter).
The API is intended to be context-free and deal with many client connections so can deal with client connection failures.
The requirement to Lock / Unlock access to a campaign before performing updates to the campaign properties and associated Lock Campaign [LC] / Unlock Campaign [UC] API has been removed from V10.6.403. This is a breaking change - any customers using this will need to reorganise their code.
The first thing any application driving Campaign Manager Server should do is register for a list of configured campaigns. This is achieved by calling the CampaignManagerClass method Status Request [SR], passing the Tenant Descriptor (TD), Originator Identifier (OI) and a user-generated Transaction ID (TX) parameter.
This will yield an event Status Broadcast [SB]. The EventStatusBroadcast event will identify the Tenant and Transaction, and will contain the a Data (DT) parameter containing an XML document
Using the Dialer Chat application we can see the format of this Status Broadcast [SB] message:
CM:DE:SB\TDdefault\TX1\DT<CampaignStatus Time="2012-05-22T08:01:58Z"><Campaign ID="1" Name="TestCampaign" State="2" Type="0" Cache="200" LinkMaster="" IsLocked="false" LockTag="" LockTime="" Agents="0" CallsMade="20" ListRemaining="9979" ListTotal="10000" RunoutEstimate="9780" RetriesRemaining="12" PPState="2"/></CampaignStatus>\TS41051.334708
EventStatusBroadcast is sent every 10 seconds until method Stop Status Request [SS] is invoked for the same Transaction ID (TX). Applications can choose to take a one-shot request for information by invoking StatusRequest followed by StopStatusRequest. If the StatusRequest transaction is left open the driving application can take a running object table approach which will involve updating the table on receipt of every EventStatusBroadcast event.
While an Originator Identifier (OI) parameter is not required for all SDMP2 messages, it is recommended to make a habit of always adding this parameter to avoid issues where it is required.
The XML document is delivered in the Data (DT) parameter to the EventStatusBroadcast event is a text string with no whitespace or carriage returns. In order to transmit XML via the SDMP API, backslash characters in XML element and attribute data are translated to the relevant XML escape sequence.
When the EventStatusBroadcast event Data (DT) parameter is formatted it can be seen to contain a collection of Campaign type elements for each campaign configured in CM server.
The same approach is valid when using Softdial HTTP Proxy.
For a more information about Campaign Manager integration, please refer to the SCC User and Integration Guide and API Message Reference.
See also SDMP Message Protocol.
The SCC telephony model is used in SCC 10.7 to deliver both telephony and packet media communication.
A media layer is considered a landlord resource, to be used by tenants. CallGem provides control and limits for media per tenant through the Tenant Parameters [P1] method.
A media layer advertises its presence and capability through the Trunks Open [TO] method. This indicates the number of channels the media layer can support, its identity, its default media type and whether or not the media layer is part of a cluster.
Media servers that register with CallGem (notably Softdial Telephony Gateway™) can be clustered to achieve scale and redundancy. A single media server handling voice media can typically manage to handle 1000 concurrent channels of audio assuming the host that the media server is deployed on has enough resources. Since each active user of SCC will account for between 2 and 4 channels typically, Customers should provision 1 media server per 250 agents plus 1 redundant spare, configured as a cluster.
Clustering behaviour is managed through CallGem and CallGem optimises clusters to minimise the need to bridge media between media servers. This is configurable through a script in situations where customers have challenging topologies.
The operations of the telephony model are origination and termination of media (usually calls) and performing switching and media processing activities on this media. Most Sytel partners work with Sytel’s media server components, which fully and seamlessly support the telephony model.
The non-telephony media server component provided in SCC is Workflow Server. Workflow Server connects to CallGem and fulfils the telephony model. It also provides a plugin interface that allows integrators to develop their own packet media integrations cleanly. This is also used as the basis for the SCC Chat server solution.
The plugin API is exposed through an abstract base class WorkflowBase in WorkflowBase.dll. WorkflowBase.dll is part of the developer kit and has full intellisense documentation.
For further information about third party non-telephony media integration like chat servers, CRMs, ERPs, etc, and specific guidance about how to develop it using SCC Workflow Server,
The management APIs enable supervisor control of the user/ agent dialog and provide publish-subscribe (pub-sub) APIs to deliver state change events and session digests to reporting and other Extract Transform Load (ETL)-type services. There are additional management APIs for configuration of the ASD (e.g. Incoming route setup)
The supervisor control functions offered by the management API are:
Method | Description |
---|---|
Close All [CL] | Close all campaigns on a tenant |
Kill Agent [KA] | End a user’s session forcibly (with different levels of urgency) |
Kill Campaign [KC] | End a campaign forcibly (with different levels of urgency) |
Move Agent [MA] | Move an agent from one campaign to another in transacted fashion. |
Agent Swap [AS] | Swap campaigns for 2 different agents in waiting states. |
As CallGem has evolved, a family of messages was developed to enable third-party services to get a real-time view of the state of the contact center and subscribe to a stream of events.
These messages form the bulk of CallGem’s management API; they are multi-purpose, providing the following types of functionality to third parties:
The mechanisms for doing this are not immediately obvious from the basic message documentation on the API site. This document seeks to provide ‘how to’ information to enable partners to model their data integration in the best way possible.
This document uses 2 character message codes as per SDMP 1.0 for the sake of brevity. All pub-sub messages form part of CallGem’s management interface, so where you might see a message code [EA] the full message code [CG:MA:EA] is implied.
Sytel encourages all partners using a socket interface to use SDMP 2.0 conventions for messaging. In SCC 10.7, Clients using SDMP can be configured to use HTTP (or HTTP over SSL) as the underlying application protocol without the need for application code changes if using the Sytel.Mdn2 library or Sytel’s mediation services. This enables reliability improvements in public network environments, WAN-based deployment without the need for VPNs and message queuing and routing for the upcoming SCC cloud service bus.
Not all of the subscriber messages work in the same way. There is a fairly consistent pattern but one size does not fit all. Some of the messages have evolved to meet specific application needs.
The complete set of pub-sub messages is as follows:
Each of these subscribe requests is uniquely identified by its Transaction Tag (TX) parameter. Best practice for traceability and avoiding name clashes is to use some short application tag concatenated with a UUID as the Transaction Tag.
The subset of these messages that deliver an initial digest of resources (and their current states) is
Subscribe Message to CallGem | Publish message from CallGem |
---|---|
Enumerate Tenants [E1] | TenantData [Z1] |
Enumerate Agents [EA] | Agent Data [AZ] |
Enumerate Campaigns [EC] | Campaign Data [CZ] |
Enumerate Groups [EG] | Group Data [GZ] |
Enumerate Switches [ES] | Switch Data [SZ] |
And in 10.7… | |
Enumerate Turrets [QE] | Turret Data [TZ] |
Enumerate Status [ES] | Status Data [SD] |
After an initial feed of current resource states the transaction then delivers events for changes to state of one of these resources. These queries are useful for clients needing to get a snapshot of resources for directory-type services.
Most of the messages act as a simple feed for state change events. This applies to:
These messages generally report resource state change events as and when they occur, with a couple of exceptions. The Enumerate Sessions [EI] and Enumerate Notifications [EN] allow a ‘start time’ to be set with the TS parameter, enabling historical notifications to be retrieved for up to 1 hour in the past.
Ending subscription is achieved through sending Enumerate End [EE]. Closing the socket connection will achieve the same end, although this may not be desirable.
SDMP sessions are denoted by an authenticated TCP socket connection to CallGem. In a reliable network environment not under extremes of load a socket connection will stay active as long as the application connecting to CallGem keeps running.
On socket disconnect or permanent write failure, CallGem performs housekeeping, assuming that whatever resources were ‘owned’ by the session are to be terminated, and relevant state updates propagated to the other connected applications.
This also applies to publish-subscribe requests. On connection failure, transactions originating from the closed socket connection are deemed to be complete and are cleaned up.
For digest-type requests this is not a problem; the application connects and re-issues the subscribe request, and a new digest is delivered, enabling the application to be stateless.
For ETL applications this is not ideal behaviour. An ETL service needs to gather a full set of events, sometimes in time order, in order to aggregate events into meaningful KPIs and session data.
The Persist Token mechanism was introduced to try to resolve this.
By appending a Persist Token (PS) parameter to a subscribe message, CallGem is advised that the subscribe request is to persist beyond the lifetime of the socket connection that sent the subscribe message. In the event of a connection failure, the application can reconnect and issue a new subscribe message with the same persist token parameter. CallGem will then ‘roll forward’, delivering the messages it has cached against this persist token, before carrying on with reporting new events.
There are 3 important consequences of this behaviour:
CallGem will cache (subject to memory constraints) up to one hours’ worth of transaction data for the persist tag. CallGem is a real-time service running an ASD and predictive dialing engine. Both of these functions are clock-sensitive and so as a matter of policy CallGem limits its I/O to socket I/O and writing log files. The logging mechanism relies on worker threads implementing message queues and performing blocking I/O to avoid interference with real-time processing.
This also means that CallGem cannot use file-based storage to persist subscriber data, hence the 1 hour limit. Subscriber services either need to be designed to be stateless and demand-started-and-stopped, or stateful and long-running.
A stateless subscriber would need to be started and run on a regular schedule, to avoid problems associated with CallGem aging out and discarding old subscriber events. Our advice for such a service would be to schedule it to run every 5 minutes.
If a stateful, long running service is needed it should be written to mitigate network glitches. The following pattern of behaviour is recommended is using sockets as a transport:
Alternatively, using the HTTP proxy to communicate with CallGem, or using the Sytel.Mdn2 library SoftdialConnection class to establish a HTTP session with CallGem, will provide a reliable session without the need to handle socket closure/write failure. This will double the network bandwidth required for the session but this is only a consideration for installations with many hundreds of agents.
This means that a subscriber would be a simple extract service that receives event messages and writes them to a database without further ado.
CallGem does not implement flow control in its messaging protocols, for the simple reason that if a subscriber service is unable to handle reasonable volumes of traffic at all times then problems will ensue. A flow control protocol would enable a subscriber to force the memory cache in CallGem to build up to the point where it would be forced to discard events.
Instead, in order to prevent overload, the API supports flow rate limiting. Subscriber messages support an optional parameter Calls-per-Second (CS) which is the number of event messages per second that the subscriber can handle during rollforward after re-subscribing. This defaults to 100 messages per second (per persist tag) but can be set at anything between 1 and 1 million messages per second by the subscriber. Sytel recommends leaving this at 100 unless you have a tenant with several hundred active agents, in which case you may need to set this slightly higher. Looking at the CallGem transaction log files for your peak hour should give some idea of event load. The flow rate for recovery should be set at not less than twice the peak event load.
While a subscriber request is dormant because of disconnect, CallGem caches messages in time sequence against the persist tag. On reconnect and resubscribe, the messages are rolled forward at the rate discussed in (2) above. The cached messages are marked with the original transaction tag, not the new one set up by resubscribe. In fact if the subscriber attempted to persist the original transaction tag and re-use, it would fail validation because the original tag still belongs to an existent transaction. The subscriber application will need to be aware that rollforward messages will have a different transaction tag.
On completion of rollforward, the original transaction is re-registered with new transaction tag if the registry value ReplacePersistantTxOnReconnect is set to a nonzero value. By default it is.
A stateless service that performs simple ‘extract to database’ operations will have no need of this. A stateful service that performs aggregation may depend on messages for different enumerations arriving on the same socket in time order.
In order to support this there is a limited mechanism that allows multiple enumerate messages to share a common persist tag. This is used by Sytel’s own ETL services. This preserves message sequence across multiple subscribe requests. There are a number of limitations though:
Each persist tag can support only one instance of each of the different types of subscriber messages. This means that the following set of subscriber messages sent on a single connection is valid:
CG:MA:EA\TXfoo1234\PSmytoken
CG:MA:EC\TXfoo5678\PSmytoken
CG:MA:EI\TXfoo90AB\PSmytoken
But this set is not valid:
CG:MA:EA\TXfootenant1\TDtenant1\PSmytoken
CG:MA:EA\TXfootenant2\TDtenant2\PSmytoken
CG:MA:EI\TXfoo90AB\PSmytoken
as it has 2 separate Enumerate Agents [EA] transactions.
When multiple subscribe messages are bound together with the same persist token, the first enumerate message received on re-subscribe reactivates all subscriptions. This has the side-effect of the first subscribe message being accepted by CallGem and subsequent messages for the same persist tag being rejected. CallGem will still have re-activated all the original subscriptions.
If this strategy does not fit a customers’ application there is an alternative approach which requires a little work, but would be reliable. Having individual enumerations have their own persist tag preserves sequence only in respect of that persist tag. While a service is catching up with roll forward messaging, it would be possible for the service to enqueue these messages in time order, time given by the TS parameter on the event message. The messages could then be dequeued in time order once catch-up is complete or well under way.