https://vcc.live/wp-content/uploads/2022/03/vcclive_main_logo.svg
  • Product
    Back to all pages
    https://vcc.live/wp-content/uploads/2023/09/omnichannel-test-3.svg
    Omnichannel

    Instantly switch between your customer's preferred channels and handle multiple conversations at once.

    Key channels VCC Live supports

    Voice SMS Email Live chat software Instant messaging apps Social media

    Email, social and more for SYKES and Huawei

    https://vcc.live/wp-content/uploads/2023/09/sykes-topnav-menu.svg
    WhatsApp > Messenger > Case studies >
    https://vcc.live/wp-content/uploads/2023/10/ai-topnav-icon-2.svg
    AI and automation

    Drive intelligent productivity and efficiency with VCC Live's suite of AI and automation tools.

    https://vcc.live/wp-content/uploads/2023/09/call-cetner-software-test-7.svg
    Call center

    Explore our call center software for driving productivity, fueling automation, and delivering exceptional CX.

    Powering Decathlon's call center

    https://vcc.live/wp-content/uploads/2022/09/Decathlon_Austria_Thumbnail.jpg
    Why VCC Brochure Security
    https://vcc.live/wp-content/uploads/2023/09/outbound-test-3.svg
    Outbound

    Handle more live calls, boost talk time, and automate outreach with a feature-filled outbound solution.

    Features to boost outbound activities

    Automatic dialing Voicemail detection Outbound IVR Over-the-phone payments

    Fueling your outbound sales

    https://vcc.live/wp-content/uploads/2023/09/boosting-sales-thumbnail-image.jpg
    Sales teams > Case studies > Collections >
    https://vcc.live/wp-content/uploads/2023/09/inbound-icon-3.svg
    Inbound

    Swiftly resolve issues, empower omnichannel, and handle volume with ease with our CX-focused solution.

    VCC live for inbound contact centers

    IVR systems Distributing calls (ACD) Call center scripting KPI dashboard

    Transforming customer service for tbi bank

    https://vcc.live/wp-content/uploads/2023/05/tbi-interview-banking.jpg
    Customer service > Case studies > Multichannel >
    vcc live 360 webagent menu icon
    VCC Live 360 Agent

    It's faster without installation! VCC Live works from your agents' browser wherever they are, powered by the latest AI technology.

    https://vcc.live/wp-content/uploads/2023/09/integrations-test-4.svg
    Integrations

    Connect VCC Live with any of your trusted business tools, including CRMs, payment tools, and much more.

    Selected integrations for VCC Live users

    Salesforce Hubspot Looker (Data Studio) Docusign Dialogflow Zapier

    Handle calls without leaving Salesforce

    https://vcc.live/wp-content/uploads/2023/06/salesforce-video-1.jpg
    Looker case study > Release center > Security >
  • Solutions
    Back to all pages
    https://vcc.live/wp-content/uploads/2023/08/sales-call-center-icon.svg
    Sales teams

    Connect and sell more than ever before with an automation-led solution for driving sales success.

    Powerful BI for next-level sales

    https://vcc.live/wp-content/uploads/2023/09/effective-communicatio-case-study-topnav.png
    https://vcc.live/wp-content/uploads/2023/08/customer-service-call-center-icon.svg
    Customer service

    Orchestrate a high-volume handling and resolution-focused approach that delights customers.

    92% of calls within SLA

    https://vcc.live/wp-content/uploads/2023/09/decathlon-case-study-topnav-2.png
    https://vcc.live/wp-content/uploads/2023/08/debt-collection-call-center-icon.svg
    Debt collection

    Make collections faster and simpler to speed up repayments and recover like never before.

    94% voicemail detection rate

    https://vcc.live/wp-content/uploads/2023/09/delfin-group-case-study-topnav.png
  • Industries
    Back to all pages
    https://vcc.live/wp-content/uploads/2025/11/bpo-call-center-icon2.svg
    BPO

    Deliver consistent, high-quality customer interactions at scale with a flexible, automation-ready contact center platform.

    2,000+ hours of active monthly talk time

    https://vcc.live/wp-content/uploads/2023/09/effective-communicatio-case-study-topnav.png
    https://vcc.live/wp-content/uploads/2025/11/retail-call-center-icon2.svg
    Retail

    Create seamless omnichannel shopping experiences and resolve customer inquiries faster across every touchpoint.

    92% of calls handled within SLA

    https://vcc.live/wp-content/uploads/2023/09/decathlon-case-study-topnav-2.png
    https://vcc.live/wp-content/uploads/2025/11/banking-call-center-icon2.svg
    Banking

    Support secure, compliant customer communications while speeding up loan processing, onboarding, and resolution workflows.

    Over 50% increase in efficiency

    https://vcc.live/wp-content/uploads/2025/11/tbi-bank-2.png
    https://vcc.live/wp-content/uploads/2025/11/insurance-call-center-icon2.svg
    Insurance

    Enhance policyholder engagement with efficient claims handling, smooth onboarding, and proactive communication.

    20% of workforce saved with automation

    https://vcc.live/wp-content/uploads/2025/11/waberer_topnav.png
    https://vcc.live/wp-content/uploads/2025/11/consumer-lending-call-center-icon2.svg
    Consumer Lending

    Accelerate loan servicing and repayments, and ensure reliable outreach with automated, compliant workflows.

    Higher efficiency and 30% more calls handled

    https://vcc.live/wp-content/uploads/2025/11/4finance_2.png
    https://vcc.live/wp-content/uploads/2025/11/healthcare-call-center-icon2.svg
    Healthcare

    Strengthen patient experience with secure, timely communication and streamlined scheduling, reminders, and support workflows.

    Improved CX and CSAT scores

    https://vcc.live/wp-content/uploads/2025/11/healthcare-teladoc-2.png
  • Packages
  • Resources
    Back to all pages
    Blog Case Studies Ebooks KPI library Webinars Call Center Courses Customer Interviews Information Security Telco Services Learning Center Developers Release Center Download here
  • Company
    Back to all pages

    Explore more

    About us Why VCC Live Careers News Partners

    Check out our history

    https://vcc.live/wp-content/uploads/2023/09/20yrs-anniversary-thumbnail.jpg
  • Partners
  • Become a partner
  • Email us
CONTACT US VIEW DEMO
Developer GuidesScript SDKFunctionssetTimeout
  • Overview
    • About Script SDK
    • Examples
  • Constants
    • CONTROLLER_HELPERS
    • DISPOSITION_ASSESMENTS
    • FIELD_QUOTAS
    • FIELD_TYPES
  • Variables
    • fields
    • isAgent
    • isInbound
    • isTest
    • ticketId
    • ticketRelations
  • Functions
    • addVoicefileTag
    • alert
    • callCustomerApi
    • clearDtmf
    • confirm
    • contains
    • dump
    • getChannelVariable
    • getCommission
    • getController
    • getCurrentPage
    • getFieldNames
    • getFieldProp
    • getFieldValue
    • getFieldValues
    • getGoogleAccessToken
    • getMicrosoftAccessToken
    • getPages
    • getPrice
    • getQuotaFieldData
    • getScriptVariable
    • getTabs
    • goNext
    • goTab
    • httpRequest
    • inArray
    • isSelected
    • isVoiceRecordingActive
    • openURLInDefaultBrowser
    • runApplication
    • salesforce.getAccessToken
    • searchObject
    • setDisposition
    • setDispositionPrefUserId
    • setEventListener
    • setFieldValue
    • setTimeout
    • startVoiceRecording
    • stopVoiceRecording
    • toggleVoiceRecording
    • transfer
  • Events
    • controller.afterSetData
    • controller.onLoadData
    • global.beforeSetDisposition
    • global.beforeValidation
    • global.beforeSaveTicket
    • global.onCall
    • global.onLoad
    • global.onHangup
    • page.checkBeforeLoad
    • page.onLoad
    • page.onNext
    • ticketpage.onLoad
  • Objects
    • CONTROLLER_OBJECT
    • DISPOSITION_OBJECT
    • FIELD_PROPERTY_OBJECT
    • FIELD_VALUE_OBJECT
    • QUOTA_DATA_OBJECT
Back to Support and Learning Center
English Hungarian

setTimeout

The vcc.setTimeout() function is used within the VCC Live Contact Center Script module to execute a specified piece of code or function after a defined delay. Unlike the standard browser window.setTimeout(), which returns a numeric ID, vcc.setTimeout() returns a specialized timeout object. This object includes a .clear() method that can be used to cancel the scheduled execution.

Description

let timeoutObj = vcc.setTimeout(callbackFunction, delayInMilliseconds);

It allows users to execute callbacks after a period expressed in milliseconds.

Note: This function works similarly to the setTimeout() function in JavaScript; you can read about it here.

Parameters

function: function
The reference to the callback function

delay: integer
The time, in milliseconds, the timer should wait before executing the callback function..

Return values

None

Use cases with explanation

Use case 1. Creating a Recurring Interval (Polling / Looping)

Because the VCC environment might not fully support standard setInterval securely in all script modules, vcc.setTimeout() is frequently used recursively. By calling vcc.setTimeout() inside its own callback, you can capture inputs (like DTMF) or poll a status repeatedly until a condition is met.

// Example: Polling for exactly 4 DTMF digits every 1 second
let checkInterval;

function startFormatCheck() {
  // Clear any existing loop before starting a new one
  if (checkInterval) {
    checkInterval.clear();
  }
  checkDigitsLoop();
}

function checkDigitsLoop() {
  let dtmf = vcc.getScriptVariable("global.dtmf");
  
  if (dtmf.length === 4) {
    // We have our 4 digits, stop looping and enable submit
    vcc.getController("payment_form", "btn_submit").disabled = false;
  } else if (dtmf.length > 4) {
    // Too many digits, clear DTMF and keep polling
    vcc.clearDtmf();
    checkInterval = vcc.setTimeout(checkDigitsLoop, 1000);
  } else {
    // Keep waiting by scheduling the next check
    checkInterval = vcc.setTimeout(checkDigitsLoop, 1000);
  }
}

Use case 2. Auto-Closing or Clearing Temporary Messages

Often, you want to show a success or error message to the agent and have it automatically vanish after a few seconds without requiring the agent to click anything.

// Example: Showing a temporary success message to the agent
function showTemporaryStatus(messageText) {
  // Display the message
  vcc.setFieldValue("status_alert", messageText);
  vcc.getController("main_page", "status_alert").refresh();
  
  // Clear the message after 3 seconds (3000 ms)
  vcc.setTimeout(function() {
    vcc.setFieldValue("status_alert", "");
    vcc.getController("main_page", "status_alert").refresh();
  }, 3000);
}

Use case 3. Delays Before Automatic Call Transfers

If a customer makes a choice that requires transferring the call (e.g., to a specific payment or language queue), it is good practice to play a prompt, wait a few seconds, and then execute the transfer.

// Example: Delaying a transfer to give the caller time to hear an automated warning
$("menu_page", "btn_transfer_billing").afterSetData = function() {
  let transferTimeout;
  
  // Update UI to let agent know transfer is pending
  vcc.setFieldValue("transfer_status", "Transferring to bilingual billing agent in 3 seconds...");
  vcc.getController("menu_page", "transfer_status").refresh();
  
  // Delay the actual transfer invocation by 3000ms
  transferTimeout = vcc.setTimeout(function() {
    vcc.transfer("6543", true); // Transfer to queue 6543
  }, 3000);
  
  // Optionally, if the agent clicks "Cancel Transfer" before 3 seconds, call transferTimeout.clear()
};

Notes

  • Clearing Timeouts: Always track the returned object if there is a possibility that the timeout needs to be canceled. For instance, if the call drops or the agent navigates away, you should use .clear() to avoid null pointer exceptions or unintended script executions.
  • Reference Management: When passing the callback to vcc.setTimeout(), ensure that variables used inside the callback are appropriately scoped. Since it executes later, closures will capture the state of variables as they exist when the callback runs.
vcc.setTimeout(function () {
        dump('test');
    }, 1000);
Back to Support and Learning Center

Comments

Can’t find what you need? Use the comment section below to connect with others, get answers from our experts, or share your ideas with us.


There are no comments yet.

Click here to cancel reply.

Please note that by clicking on the Submit button, you agree to a member of VCC Live team contacting you with business offers. You can find detailed information on how we can establish contact with you in our Privacy Policy

illustration

Product

  • Call center
  • Omnichannel
  • Outbound
  • Inbound
  • Channels
  • Integrations
  • More on VCC

Main Features

  • IVR system
  • Auto dialer
  • Call queuing software
  • Automatic Call Distribution
  • Call center scripting tool
  • Outbound IVR
  • Predictive dialer
  • Voicemail detection
  • Contact center dashboard

Solutions

  • Customer Service
  • AI and Automation
  • Sales Teams
  • Debt Collection
  • BPO
  • Retail
  • Financial Services
  • Banking
  • Insurance
  • Consumer Lending
  • Healthcare

Resources

  • Blog
  • Case Studies
  • Ebooks
  • Call Center Courses
  • Information Security
  • Learning Center
  • Download
  • Telco services
  • Call center KPI library

Company

  • About us
  • Why VCC Live
  • Careers
  • News
  • Partners
https://vcc.live/wp-content/uploads/2022/03/iso-cert-1-min.png https://vcc.live/wp-content/uploads/2022/03/iso-cert-2-min.png https://vcc.live/wp-content/uploads/2022/03/iso-cert-3-min.png https://vcc.live/wp-content/uploads/2025/04/SOC2-website-e1745483442463.png

Social Media

https://vcc.live/wp-content/uploads/2022/03/linkedin-footer.svg https://vcc.live/wp-content/uploads/2022/03/twitter-footer.svg https://vcc.live/wp-content/uploads/2022/03/facebook-footer.svg https://vcc.live/wp-content/uploads/2022/03/instagram-footer.svg

Call us

https://vcc.live/wp-content/uploads/2022/03/flag-hu.png Hungary
+36 19996400
https://vcc.live/wp-content/uploads/2022/03/flag-en.png UK
+44 2086380169
https://vcc.live/wp-content/uploads/2022/03/flag-de.png Germany
+49 3021782516
https://vcc.live/wp-content/uploads/2022/03/flag-pl.png Poland
+48 123950886
https://vcc.live/wp-content/uploads/2022/03/flag-ro.png Romania
+40 31706167
https://vcc.live/wp-content/uploads/2022/03/flag-usa.png USA
+1 3024988337
  • Privacy Policy
  • Cookie Policy
  • Legal Statement
  • General Terms of Agreement
  • Magyar nyelvű jogi dokumentumok
illustration