CFD get Agents list

Discussion in 'Call Flow Designer' started by Tomas Raska, Dec 11, 2017.

Thread Status:
Not open for further replies.
  1. Tomas Raska

    Joined:
    Aug 18, 2017
    Messages:
    58
    Likes Received:
    6
    Hello,
    can I get from 3cx PBX with CFD list of all Agents in Call Queueu?
    Same result as on Page Call Queues / Agents?
     
  2. NickD_3CX

    NickD_3CX Support Team
    Staff Member 3CX Support

    Joined:
    Jun 2, 2014
    Messages:
    1,338
    Likes Received:
    76
    The CFD primarely enables you to create Custom Voice Menus and apply logic to them and change the behavior depending on user input (e.g. phone banking voice menu).

    You ask if you can get the list of Agents, but first I think we need to understand, what do you want to do with it? Play it back to someone calling a Custom IVR (text-to-speech), or use it in code for some other purposes? If it is the latter, you may be wanting the 3CX Call Control API.
     
  3. Tomas Raska

    Joined:
    Aug 18, 2017
    Messages:
    58
    Likes Received:
    6
    Hello,
    now I have for every Call Queue one CFD with similar name. This CFD first check if caller (session.ani) is loged in in defined call queue, and if not, then is loged in to this queue, and if yes, then is loged out from this queue. Then I have on Phone for every Queue one Button. And with this Button I can defined Call Queue with CFD login or logout.

    Now I need allow this my CFD only for Agents in defined queue. Not for every extension.

    I can compare session.ani with my list in CFD, but when I change Agents in Call Queue, then I muss change too my list. If I can compare session.ani with Agents in Call Queue, is it more transparent.

    Example:

    If session.ani exist as agent in defined call queue then go to my CFD else end.

    This is my CFD:

    upload_2017-12-11_14-21-59.png
     
  4. NickD_3CX

    NickD_3CX Support Team
    Staff Member 3CX Support

    Joined:
    Jun 2, 2014
    Messages:
    1,338
    Likes Received:
    76
    You would need to combine the Call Control API with the CFD to get this information, but its possible. To use the API from the CFD you can check the example explained here, but form the looks of the CFD flow you have already figured that out.

    A Call Control API function/method you could create to return whether or not an Extension is part of a Queue or not could be like the following:

    Code:
    PhoneSystem ps = .......
    
    // -------------------------------------
    
    private bool isExtensionMemberOfQueue(string queueNumber, string extNumber)
    {
        foreach(Queue q in ps.GetQueues())
        {
            if(q.Number == queueNumber)
            {
                foreach(DN dn in q.Members)
                {
                    if(dn.Number == extNumber)
                    {
                        return true;
                    }
                }
            }
        }
    
        return false;
    }
    
     
  5. Tomas Raska

    Joined:
    Aug 18, 2017
    Messages:
    58
    Likes Received:
    6
    Thanks, just one thing.
    What can I here write?

    ps = ????

    PhoneSystem ps = .......
     
  6. NickD_3CX

    NickD_3CX Support Team
    Staff Member 3CX Support

    Joined:
    Jun 2, 2014
    Messages:
    1,338
    Likes Received:
    76
    ps = PhoneSystem.Root;

    I suppose you could do it like this as well....
    Code:
    private bool isExtensionMemberOfQueue(string queueNumber, string extNumber)
    {
        foreach(Queue q in PhoneSystem.Root.GetQueues())
        {
            if(q.Number == queueNumber)
            {
                foreach(DN dn in q.Members)
                {
                    if(dn.Number == extNumber)
                    {
                        return true;
                    }
                }
            }
        }
    
        return false;
    }
    
     
Thread Status:
Not open for further replies.