Configuring Holiday Prompts

Introduction

3CX includes the ability to trigger custom scripts for incoming calls on SIP trunks. This guide demonstrates how to create a script that cross checks the date against your configured holidays. If a holiday is detected, a specific audio prompt will play before routing the call.

Configuration

Step 1: Create a Holiday

  1. Navigate to Office Hours in your Admin Console.
  2. Select the relevant department and click on the Office Holidays tab.
  3. Add a new holiday with a unique name (example; National Day).

Step 2: Prepare the Holiday Prompt

  1. Record or create an audio file (.wav format) for the holiday prompt. (Example: nationalday.wav) and upload it.

Step 3: Create a Call Processing Script in 3CX

  1. Login to your Admin Console, go to Integrations > Call Scripts.
  2. Click Add from Store.

  1. Select “holiday.cs”.
  2. Enter a name for the Call script (should contain lowercase characters only with no spaces).
  3. Select how you want this script to be launched via the "Run this script" option. In this example we will choose Upon receiving a call on a trunk.  
  4. Assign the script to the desired SIP trunk.
  5. Select a Department of your choice.

  1. Click OK to proceed. This will redirect you to the code editor page which will automatically compile the script.
  2. The contents of the C# code will be loaded in the code editor.
  3. Press "Save" to save the script and compile the code.

  1. When compilation is successful, the script will be launched when an incoming call is detected on any DID of the trunk Emaar-Sales

How it Works

  1. When a call comes in on the assigned SIP trunk, the script is triggered.
  2. The script checks if the current date matches any of the holidays you’ve defined.
  3. If a match is found, the script plays the holiday audio prompt you created in Step 2.
  4. If the day falls on a holiday, the call is routed to the holiday destination.

See Also

Last Updated

This document was last updated on 7 July 2025

https://www.3cx.com/docs/holiday-script/