Disable "Music on Hold" during "anouncement play" for queue calls

Rogé

Customer
Joined
Mar 22, 2024
Messages
18
Reaction score
13
What i want to achieve is that when a call is comming in during opening times, the cal should placed in the queue. In case of holiday, break or office closed, the caler should hear an announcement.

When a caller accesses the queue, i like to play different announcementin these situations:
- Office closed > Office closed announcement
- Break > Break announcement
- Holiday > play the announcementwhich is configured to the concerning holiday

I route incoming calls direct to via the trunk settings.

In the queue settings configured the "office closed" and "break" announcementvia the "General" tab. What i dont like is that the "music during hold" is played while the anouncement is playing. Is there a way to disable this? I only want to play the "hold music" after the "intro prompt", not during announcements.

Also the holiday anouncements are not played. I can configure "When on holiday route to" setting in the queue to play a anouncement but in this case its always the same announcement and not the holiday specific announcement what is played. How can i achieve that the holiday specific anouncements are played?

I got this all working under V18 with a complete callflow designed in the call flow designer but i want to simplify the callflow from the call flow designer and rely more on the 3CX user interface so customers are more in controll them selves.
 
You cannot change the fact that the queue intro prompt plays over the top of the on-hold music. If you want to separate the intro prompt from the hold music, you could route the inbound call to an IVR with the desired announcement for the prompt, then have the IVR forward the call to the queue. If you want a different prompt for holidays, closed, break, etc. Handle that via routing to different IVRs with different prompts.
 
Hey Matthew,
Thanks, I was able to configure it that an incoming call is routed to an IVR (digital receptionist). This one handles "office closed", "break" and has a "default prompt" which is played when the office is open (no holiday or break). This works perfect and the prompt is not played over the "hold music". When the office is open, the call is routed to the queue after the "default prompt" is finished.

The only thing I cannot get working now is to play the holiday specific prompt. I can configure the "When on holiday route to" action in the digital receptionist which can play a specific prompt for all holidays. I want to play the prompt which is configured to the holiday. How can i achieve this? If i got this working I have everything working like i want.

Thanks in advance.
 
I'm sure there are smarter people than me who can offer some suggestions. As a programmer, my mind always leans toward a programming solution. You could, for example, write a Call Flow Designer that handles all of these scenarios with one IVR. It could look up the current situation -- holiday, business hours, break, etc. and choose the correct prompt to play. My mind was considering routing calls to a dummy extension, and then have the presence status of that dummy extension control where the call is routed, but that's more for ad-hoc meetings rather than a schedule. Let's see if anyone else has a better suggestion.
 
PROBLEM SOLVED!

What i did is:
1. Limit the trunk to the department (trunk settings, options tab) where the holidays are configured on (Default in my case).
2. Add the "holiday.cx" call script from the store (integrations > call scripts > add from store"
3. Route incomming calls to the digital receptionist which handles the welcome message, break and office closed
- Prompt = welcome message/announcement
- When office is closed route to = "End Call" and "Play announcement"
- When on break route to = "End Call" and "Play announcement"
- When on holiday route to = "End Call" (doesnt play announcement). This setting will be ignored as its handles by the call script from step 2
4. Configure holidays for the department where trunk is limited too in "office hours > office holidays"

I did not know about step 1 but now it works for this scenario/ customer situation.

I can think of situation where this does not work though. If you have one trunk with 2 DID's, each for antoher department. In this case you cannot limit the trunk to a specific department which will break the holiday feature (call script). For my current customer not a big deal but for another customer i will serve soon it may be an issue as they need the department funtionality with different opening times for each department. Does anyone have a solution for this scenario? The only thing i can think of is to split the DIDs of the departments over 2 trunks but that would be nasty when having a number range.
 
Last edited:
This - When on holiday route to = "End Call" (doesnt play announcement). This setting will be ignored as its handles by the call script from step 2 seems not to be true.

The "When on holiday route to" function of the digital receptionist is triggered after te holiday message is played. This means it should be configured to "End Call" and also play the "empty" announcement to avoid that the message "this call is not allowed by your system administrator" is played after the holiday message.
 
It seems that the call flow is not terminated after the holiday announcement is played. This seems to be a missing line in the 3CX holiday script from the shop. I added MyCall.Terminate(); to the script to solve this.

This is the script i use now:
Code:
/*
 * Play Holiday Prompts - Use code with caution!
 * Requires holidays and prompts to be configured on department office hours
 * Requires trunk to be part of the department and holidays configured at department level
 * Based on the entered PIN, the call is routed to a predefined destination.
 * Script intercepts inbound calls on a trunk and checks if it is a holiday in Office hours - Department - Office holidays
 * If the day is set as a holiday and a prompt is configured, the prompt will be played and call wil be routed to the holiday routing destination
 * If there is no prompt, the prompt will be skipped
*/


#nullable disable
using CallFlow;
using CallFlow.CFD;
using TCX.Configuration;
using System.Threading.Tasks;
using TCX.PBXAPI;
namespace dummy
{
    public class PlayHolidayPromptBeforeRouting : ScriptBase<PlayHolidayPromptBeforeRouting>
    {
        string GetRealPromptFileName(OfficeHoliday holiday)
        {
            return holiday?.HolidayPrompt;
        }
      
        public override async Task<bool> StartAsync()
        {
          
            PhoneSystem ps = (PhoneSystem)MyCall.PS;
            if (MyCall.Caller.DN is ExternalLine externalLine)
            {
                var trunkTimeBasedroute = MyCall.Caller.DN.GetTimeBasedRoutingInfo();
                if (
                    trunkTimeBasedroute.reason == CallControlAPI.DivertReason.Holiday
                    && GetRealPromptFileName(trunkTimeBasedroute.holiday) is string thePath
                    && !string.IsNullOrWhiteSpace(thePath)
                    )
                {
                    await MyCall.AssureMedia()
                    .ContinueWith(x => MyCall.PlayPrompt(null, new[] { thePath }, PlayPromptOptions.Blocked))
                                .Unwrap();
                    MyCall.Terminate();
                }
            }
            return false;
        }
    }
}
 

Members Online Now

Forum statistics

Threads
111,832
Messages
589,284
Members
164,662
Latest member
DejanMDS