Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

Availability appears incorrect in Call Control API

Discussion in '3CX Phone System - General' started by pinney, Sep 2, 2014.

Thread Status:
Not open for further replies.
  1. pinney

    Aug 26, 2014
    Likes Received:
    I am querying the Call Control API and finding the availability of Extensions is not consistent with what I understand it to be from the 3CXPhone client. For instance, in the 3CXPhone client, I see that extension number XXXX displays the status of "out of office," but the UserStatusType returned by the API for this Extension is "Available." (UserStatus in the API has only two possible values: Away and Available.)

    In fact, I've pulled all the data on this Extension that I can think of pulling, and none of it indicates that the user is unavailable:

        "ActiveConnections": [],
        "BusyDetection": 2,
        "Enabled": true,
        "HidePresence": false,
        "IsRegistered": true,
        "Name": "<omitted>",
        "Number": "<omitted>",
        "Properties": [
            "VOICEMAILPINAUTH=1(String) [Specifies that the extension can read voice mail without pin authentication.Set to 0 will access the VM menu directly]",
            "MOBILENUMBER=(String) [The mobile number specified for extension]",
            "PHONESYSUSER_ACCESS=0(String) [Management Console Access 0=unchecked 1=checked]",
            "REPORTER_ACCESS=0(String) [Specifies if the extension has access to the 3CX Web Reporter]",
            "WALLBOARD_ACCESS=0(String) [Specifies if the extension has access to the 3CX Wallboard]",
            "TURNOFFMYPHONE=0(String) [Specifies that the extension does not have acces to MyPhone]",
            "HIDEFORWARDRULESTAB=0(String) [Hide extension forwarding rules tab in 3cx My Phone]",
            "SEERECORDING=1(String) [The 'see' recording rights for corresponding extension]",
            "DELETERECORDING=0(String) [The 'delete' recording rights for corresponding extension]",
            "REBOUNDSCREENING=0(String) [Specifies the call screening]",
            "EMAILMISSEDCALL=0(String) [Send email on missed call to this extension]",
            "ALLOW_LAN_ONLY=0(String) [Blocks an extension from being registered outside the network]",
            "PINPROTECTED=0(String) [Pin protect feature for extension]",
            "USETUNNEL=0(String) [Enables Tunnel Connection ]",
            "STARTUPSCREEN=0(String) [Default startup (0 -Dial Pad  1 - Presence)]",
            "HOTELMODULE_ACCESS=0(String) [Specifies if the extension has access to the 3CX Hotel Module]",
            "DESKPHONE_PASSWORD=(String) [Password for Web access to the device]",
            "EXTGUID=<omitted>(String) [Unique identifier for 3CX phone provisioning]",
            "PROVPATH=<omitted>(String) [The path to provision file for the current extension]",
            "BLOCKREMOTETUNNEL=0(String) [Block Remote extensions registering to the 3CX Phone System using tunnel connections]",
            "CHATSTATUS=4(String) [0-Online, 1-Away, 2-Do Not Disturb, 3-Invisible, 4-Offline]",
            "SHARED_BLFS=<PhoneDevice><BLFS /></PhoneDevice>(String) [Shared BLFs for this extension (used for all phones belong to this extension)]",
            "LOGGED_IN_QUEUES=(String) []",
            "REPORTER_ADMIN=0(String) [Allow admin operations in Web Reporter]",
            "REPORTER_SEE_RECORDINGS=0(String) [Allow to download any recording from web reporter]",
            "SERVICES_ACCESS_PASSWORD=<omitted>(String) []",
            "EXT_MC_ACCESS_TYPE=4(String) []",
            "EXT_MC_ACCESS_GATEWAYS=0(String) [Voip Trunk Administrator]",
            "EXT_MC_ACCESS_SYSTEM=0(String) [System Administrator]",
            "DONT_SHOW_EXT_IN_PHBK=0(String) [Do not show extension in 3CX company phonebook]",
            "OFFICEHOURSPROPERTIES=1(String) [Represents the options for office hours on the current extension]",
            "PBXIP=<omitted>(String) [Pbx ip for 3CX Phone provisioning]"
        "QueueStatus": 1,
        "Status": 0
    So do we need to configure something through the 3CX management portal to indicate that certain statuses (e.g. "out of office") should be associated with "Away," not "Available?" Else, what fields/objects should I access through the API to determine whether an extension is truly available to take a call (i.e. status is not out of office and user is not currently on a call)? I know that I can query all ActiveConnections for a given Extension, but I don't see how to ascertain whether the user is out of office.
  2. pinney

    Aug 26, 2014
    Likes Received:
    I ended up using a combination of UserStatus, CHATSTATUS, and ActiveConnections, as follows:

    TCX.Configuration.Extension ext = (TCX.Configuration.Extension)PhoneSystem.Root.GetDNByNumber(number);
    bool available = ext.UserStatus.Equals(UserStatusType.Available) && ext.GetPropertyByName("CHATSTATUS").Value.Equals("0") && ext.GetActiveConnections().Length == 0;
Thread Status:
Not open for further replies.