How I (kind of) made a Day/Night Mode button (for desk phones).

Status
Not open for further replies.

j0mbie

Free User
Joined
Dec 30, 2021
Messages
8
Reaction score
4
Just posting this here for anyone who wants it, and also so I have something to reference when I have to do this again.

The plus sides to this approach are:
  • Users can see the status of day/night mode at a glance from their desk phones, because the name of the dummy extension will change.
  • Users don't have to remember the dial codes for setting the system into day or night modes.
  • You can have multiple day/night modes on one system, for different departments or groups.
The cons to this approach are:
  • This is kind of a hack of an approach.
  • This completely bypasses the system day/night mode, so if you have your own company hours or holiday schedule, you'll have to figure something out.
  • I tried to do this using the system day/night mode, but once a call hits a Call Flow, it is not allowed to then forward to a dial code, for security reasons (I'm guessing). This is true even if you go Call Flow -> Extension -> Dial Code. See this thread for more backstory. This may not have been true in the past, but it seems to be true for v18.
  • Any user with access to the status of day/night mode, can also flip day/night mode. The only way around this would be to set up a "blacklist" of exceptions in the forwarding rules, for every single extension you want to restrict.
  • Since 3CX doesn't show the status of unregistered extensions, the extension will always show up as gray in the 3CX app, unless you make some sort of auto-login bot which is a hack on top of a hack.
  • Even if you do the above, 3CX also doesn't show the status of extensions in the BLF of desk phones for some unknown reason, despite every other PBX in the world doing this. Until that changes, the BLF light will remain unlit.
Now, on to the nitty-gritty.
  1. Create a dummy extension. I used 190 for mine, but if you use another number, you'll have to modify the call flow apps.
    1. GENERAL
      • Extension: 190
      • First Name: Day-Night Mode
      • Email Address: [email protected]
      • Web Authentication: Disabled
    2. VOICEMAIL: Disabled
    3. OPTIONS
      • Disable External Calls: Checked
      • Allow users to start and stop recording: Unchecked
      • Hide this extension from 3CX company phonebook and 3CX Apps: Checked
    4. RIGHTS
      • Group Membership: Same group as any extensions that want to monitor it.
      • Can see group members: Unchecked
      • Perform operations: Checked (I don't fully know if this is required.)
    5. CLICK2TALK/CLICK2MEET
      • Click2Meet: Unchecked
    6. FORWARDING RULES
      • Available ("Day Mode")
        • Internal calls: Forward to number "switchtonightmode.Main" after 1 second. (Both settings!) (The call flow is case sensitive. The first half is always all lowercase, the second half is usually "Main" with a capital "M".
        • External calls: Send this to your "Day Mode" destination, i.e. a Ring Group. (Both settings!)
        • Accept multiple calls: Checked
        • Accept Push Notifications: Unchecked
      • Away ("Night Mode")
        • Internal calls: Forward to number "switchtodaymode.Main" after 1 second
        • External calls: Send this to your "Night Mode" destination, i.e. a Digital Receptionist
        • Accept Push Notifications: Unchecked
      • DND, Lunch, Business Trip
        • Send everything to "End Call". (Lunch has 4 spots to change, the rest have 2.)
        • Accept Push Notifications: Unchecked
        • In theory, the extension should never be set to this status. Make these settings be whatever you want your "something went wrong" mode to be.
    7. KEEP EVERYTHING ELSE NOT LISTED ABOVE AS DEFAULT.
  2. Upload the call flow apps I included in this post. If you're not using extension 190 as your dummy extension, you'll have to modify the call flow app first, as follows:
    • The ChangeStatus step has to be changed to reflect your dummy extension.
    • The ChangeName C# code has to be modified to reflect your dummy extension.
    • Thanks to 9Chris6 for the code I modified from this post.
    • Interestingly, when dealing with C# code in 3CX, the "string" type has to be all lowercase, but the "Extension" type has to start with an uppercase E.
    • Included in the zip file are audio recordings made using text to speech. You can create better version of this if you'd like, but they will have to be 8000 Hz 16-bit mono WAV files. See here.
  3. Point your Inbound Rule(s) to your dummy extension, for both during and outside office hours.
  4. Add a BLF to your other phones, with type "Speed Dial" pointing to the dummy extension. (Note: Some model phones will require a type "BLF" instead, in order to dynamically update the label. Unfortunately, this will cause the BLF light on the phone to light up, and the light will never change color regardless of the extension status.)
  5. Test it like crazy!

Here's the code to change and extension's name, in case you don't want to download the full Call Flow apps. "Mode: Day" should be changed to "Mode: Night:" for the night mode version.

Code:
string ExtensionNumber = "190";
Extension DayNightExtension = PhoneSystem.Root.GetDNByNumber(ExtensionNumber) as Extension;
DayNightExtension.FirstName = "Mode: Day";
DayNightExtension.Save();

Hopefully, in the future, we just get a visual indicator on DESK phones of the system's day/night mode, tied to a button that flips the status when pressed. Until then, this works for my use case.

Thank you for coming to my Ted Talk.
 

Attachments

  • Like
Reactions: Evolute IT
Status
Not open for further replies.

Forum statistics

Threads
111,972
Messages
590,065
Members
164,887
Latest member
KrishnaMR