A customer asks me to disable the ability to put a group of users in do not disturb mode on 3CX V20 latest build central?
Thanks
Call Processing Scripts can't run in the background. They handle a call, always.It's not possible to prevent the use of Do Not Disturb mode, but with a Call Processing Script, it would be quite simple to identify the department to monitor and, for example, every 5 minutes, change the status of the department's extensions to available if they aren't already.
If you give me a little time, I can even do it for you, if it would help. In return, you'll need to help someone else on the forum, as the saying goes: "Pay it forward"
![]()
The api c# solution was contemplated, I have a list of users, I check if we are in office hours if yes and they are in do not disturb I make them available.
https://www.3cx.com/docs/call-api-linux/
Should I find documentation here for creating and deploying the right script?




{
// Initialisation de PhoneSystem
PhoneSystem ps = PhoneSystem.Root;
// Normalize the group name to make the comparison case-insensitive and ignore spaces
string normalizedGroupName = groupName.Replace(" ", "").ToLowerInvariant();
// Get the tenant and then the group
Tenant tenant = ps.GetTenant();
Group group = tenant.Groups.FirstOrDefault(g => g.Name.Replace(" ", "").Equals(normalizedGroupName, StringComparison.OrdinalIgnoreCase));
if (group == null)
{
return null; // Group not found
}
// Split and normalize the profile names
var profileNamesArray = profileNames.Split(',')
.Select(p => p.Trim().ToLowerInvariant())
.ToArray();
// Get all extensions in the group and filter based on the current profile name
var matchingExtensions = group.GroupMembers
.Select(gm => gm.DN as Extension)
.Where(ext => ext != null && profileNamesArray.Contains(ext.CurrentProfile.Name.ToLowerInvariant()))
.Select(ext => ext.Number)
.ToList();
// Prepare the result
if (matchingExtensions.Count == 0)
{
return null; // No matching extensions found
}
// First line is the count, followed by the extension numbers
string result = $"{matchingExtensions.Count}\n{string.Join("\n", matchingExtensions)}";
return result;
}
{
// Check if the content is null or empty
if (string.IsNullOrEmpty(content))
{
return 0; // Return 0 if there's no content
}
// Split the content by line breaks and return the first line
string[] lines = content.Split(new[] { "\r\n", "\n" }, StringSplitOptions.None);
return lines.Length > 0 ? lines[0] : string.Empty; // Return the first line if available
}
{
// Split the content into individual lines, ignoring any empty lines
string[] allLines = textContent.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries);
// Check if the specified line number is within the valid range
if (targetLine > 0 && targetLine < allLines.Length)
{
// Return the line at the specified position (ignoring the first line)
return allLines[targetLine];
}
else
{
// Return an empty string if the specified line number is out of range
return string.Empty;
}
}
| Another alternative, if it's urgent, is to opt for a ready-to-use service. The PBXMONITOR solution ( @BrenttG ) already integrates monitoring of the number of simultaneous calls... ( Stats Chart by PBXMONITOR ) and if features are missing, Brentt is generally open to adding functionalities for free if they can be useful to other clients. All this without needing to install an software in 3CX. The costs are negligible... The time and resources you'll need to develop a similar service will show you that, in the end, it’s not expensive at all. There’s no contract, so you can cancel whenever you want. If you're still not convinced... Subscribe for one month, I believe they still offer the possibility of getting a trial version... This will give you time to explore everything that can be done. You’ll come back later to thank me for referring you! |
Founded in 2005, when VoIP was an emerging technology, 3CX has gone on to establish itself as a global leader in business communications.