• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

Call Control API QueueStatus

Status
Not open for further replies.

Casper Søndergaard

Free User
Joined
Aug 10, 2017
Messages
7
Reaction score
3
Hey
I'm currently working with the 3CX api, and trying to get information about different agents in different queues.
Under every queue there is QueueAgent wich have the property QueueStatus, however this always return logged in. In the documentation it say "For future use", when do you expect to implement this property?

Is there any workaround for this atm? eg only getting the people who are currently logged into a specific queue?
How do you manage to get it in the webclient?

Regards Casper Søndergaard
 
  • Like
Reactions: jed and mortenjorge
Found and old forum post that fixed this issue, still have the question about when you are gonna implement the paramter.

If anyone is interrested this is the code i used to do it.
Code:
 private void AgentQueueLoginChecker(Queue q)
        {

            // Iterate through every Agent in the specific queue.
            foreach (var item in q.QueueAgents)
            {
                try
                {
                    Extension ext = item.DN as Extension;
                    if(ext != null)
                    {
                        var active = GetQueueStatus(ext, q.Number);                       
                    }
                }
                catch
                {
                    
                }
            }
        }

And the method from the old forum post.
Code:
  private bool GetQueueStatus(Extension ext, string qNum)
        {
            //Here we need to veryfy queue status which should be applied by system
            //we need to care about:
            //ext.IsOverrideActiveNow, ext.CurrentProfileOverride.ForceQueueStatus, ext.CurrentProfile.ForceQueueStatus
            //so:
            var status = ext.QueueStatus; // default value
            try
            {
                //currently active profile can force queue status
                //so if profile specifies something not equal -1 (means use global status) then we need to show status specified by profile.
                int profilequeuestatus = ext.IsOverrideActiveNow ? ext.CurrentProfileOverride.ForceQueueStatus : ext.CurrentProfile.ForceQueueStatus;
                if (profilequeuestatus != -1) //means overriden
                {
                    status = (QueueStatusType)profilequeuestatus;
                }
            }
            catch
            {
                //status left as global
            }
            if (status == QueueStatusType.LoggedOut)
                return false;
            var prop = ext.GetPropertyValue("LOGGED_IN_QUEUES");
            if (prop == null)
                return true;
            if (string.IsNullOrEmpty(prop))
                return false;
            string[] strs = prop.Split(',');
            return strs.Contains(qNum);
        }
 
  • Like
Reactions: jed
Status
Not open for further replies.
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.