Autodiallerby Viegli
Technical architecture

A thin orchestration layer on top of Mitel

Mitel CX and Mitel Workflow Studio do the telephony. Viegli's autodialler decides when each patient can be called, based on live agent presence, and tracks every outcome.

Viegli

Autodialler

Containerised Python service. Reads patient lists, paces calls to agent presence, triggers Workflow Studio and records outcomes.

Mitel cloud

Mitel Workflow Studio

One workflow per campaign. Places the outbound call, plays the campaign's message and transfers the patient to the queue, via Mitel CloudLink.

Customer

Mitel CX

The customer's contact centre (formerly MiContact Center Business): queues, agent groups, agent presence and the call server.

System overview

Every connection to the customer is outbound, on port 443

The autodialler runs in Viegli's data centre and reaches Mitel CX through the customer's existing Mitel Border Gateway. Nothing is installed on the customer's servers.

CUSTOMER NETWORK VIEGLI DATA CENTRE MITEL CLOUD Staff browser uploads lists · watches campaigns Mitel Border Gateway web proxy Mitel CX contact centre · call server Nurse Patient nginx TLS termination · reverse proxy Autodialler pacing engine campaign runner outcome tracking Campaign data persistent volume Mitel Workflow Studio dials · plays message · transfers Mitel CloudLink secure link to the customer's Mitel A B C D E F G H I
LinkFrom → toProtocolPurpose
AStaff browser → AutodiallerHTTPSWeb interface: log in, upload lists, follow campaigns, view stats
BAutodialler → Mitel Border GatewayHTTPS + WSSOAuth 2.0 login and a persistent real-time feed of agent state
CMitel Border Gateway → Mitel CXHTTPS + WSSWeb proxy forwards the published Mitel CX SDK paths
DAutodialler → Workflow StudioHTTPSStart call: one webhook per patient, to that campaign's workflow
EWorkflow Studio → AutodiallerHTTPSOutcome callback for every call, authenticated with a shared secret
FWorkflow Studio → CloudLinkMitel cloudWorkflow actions: queue state, make call, play prompt, transfer
GCloudLink → Mitel CXMitel CloudLinkCall control on the customer's Mitel platform
HMitel CX → NurseContact centrePatient delivered to the queue and answered by the free nurse
IMitel CX → PatientPSTNOutbound call to the patient's mobile or landline
Life of a call

From spreadsheet row to connected patient

  1. Autodialler

    Parse the list. The header row is located automatically, names and NHS number are read, and the first available of mobile, home and work number is chosen.

  2. Autodialler

    Wait for capacity. The pacing engine blocks until at least one nurse in the campaign's agent group is idle and not already promised to another patient.

  3. Autodialler → Workflow Studio

    Hand off. A slot is reserved for that nurse and the campaign's webhook is called with the patient's details and the job reference.

  4. Workflow Studio

    Check and dial. The workflow confirms the queue still has an idle agent, then rings the patient for up to 20 seconds.

  5. Workflow Studio

    Inform. The campaign's recorded message plays, then the workflow checks the patient is still on the line.

  6. Workflow Studio → Mitel CX

    Transfer. The patient is transferred into the Mitel CX queue, where the free nurse answers.

  7. Workflow Studio → Autodialler

    Report. The outcome is posted back, the reservation is released and the next patient is considered.

Pacing engine

Calls are paced on real agent presence, not queue statistics

Queue-level counters don't reliably show agents joining or leaving an agent group. The autodialler subscribes to each agent's own state over the Mitel CX real-time API and counts only agents who are idle and present in the campaign's agent group.

free nurses = idle agents present in the group
− patients handed off, not yet connected

A handoff holds its slot from the webhook until the outcome callback arrives, which covers the ring, the message and the transfer. Holds are shared by every running campaign, so concurrent campaigns never promise the same nurse twice.

Outcome eventMeaning
CALL_ENDEDTransferred to the nurse queue
NO_ANSWERPatient didn't answer within 20 seconds
PATIENT_HUNG_UPHung up during the message
CALL_ABANDONEDHung up while being transferred
TRANSFER_FAILEDTransfer to the queue failed
TRANSFER_TIMEOUTTransfer didn't complete in time
NO_AGENTS_IDLEWorkflow found no idle agent, so no call was placed
Resilience

When in doubt, it pauses rather than guesses

  • Self-healing connectionEvery reconnect renegotiates with a fresh OAuth token, backing off from 1 to 30 seconds. Keep-alive pings detect a dead link within about 40 seconds.
  • No dialling on stale dataCached agent state is discarded the moment the feed drops. Calling resumes only when a fresh snapshot arrives.
  • Snapshot refreshAfter 60 seconds without an agent event, the autodialler requests a fresh snapshot instead of trusting its cache.
  • Bounded handoffsA held slot is released by its outcome callback, with a 3-second settle for the presence feed. A 90-second cap covers a lost callback.
  • Row-level isolationA failed webhook or bad row is logged against that patient. The rest of the list carries on.
  • No stuck campaignsA call with no outcome after 180 seconds is closed out and logged, so every campaign reaches a final state.
  • Automated test suite46 tests cover pacing, reconnection, callbacks, job lifecycle, statistics and spreadsheet parsing, with no live systems needed.
  • Persistent recordsCampaigns and outcomes are stored on a host volume, so they survive restarts and redeployments.
Security

Outbound-only to the customer, authenticated at every hop

  • TLS everywhereThe web interface and callbacks are served over HTTPS by nginx with Let's Encrypt certificates. All Mitel connections use HTTPS or secure WebSockets.
  • No inbound access to the customerThe autodialler connects out to the customer's Mitel Border Gateway. No VPN, firewall opening into the customer or software on the Mitel CX server is required.
  • OAuth 2.0 to Mitel CXA dedicated API client with client-credentials login, issued and revocable by the customer.
  • Authenticated callbacksWorkflow Studio's outcome callbacks must carry a shared secret, and webhooks into Workflow Studio carry one too.
  • Locked-down serviceThe application listens only on localhost behind nginx. Secrets live in the environment, never in the container image.
  • Data minimisationOnly name, phone number and NHS number are processed, to place each call and record its outcome. Session cookies are secure and HTTP-only.
Network requirements

What the customer's IT team needs to allow

Everything below is published through the Mitel Border Gateway web proxy. The autodialler can connect from a fixed IP address for allow-listing.

Path on the MBGProtocolUsed forWhen
/authorizationserver/tokenHTTPS 443OAuth 2.0 client-credentials loginEvery connect
/MiccSdk/signalr/*HTTPS + WebSocket 443Real-time agent state. Needs WebSocket upgrade and an idle timeout above 60 sContinuous
/MiccSdk/api/v1/*HTTPS 443Reading agent group membershipSetup only

Mitel Workflow Studio uses the customer's existing CloudLink connection for call control; the autodialler adds no requirements there.

Technology

Built from proven, supportable parts

  • Mitel CX
  • Mitel Workflow Studio
  • Mitel CloudLink
  • Mitel Border Gateway
  • Python 3.12
  • Flask
  • gunicorn
  • SignalR over WebSocket
  • OAuth 2.0
  • SQLite
  • Docker
  • nginx
  • Let's Encrypt

Running Mitel CX? Let's talk about your calls.

Viegli can walk your IT and telephony teams through the integration in detail.

Talk to Viegli