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.

Is it possible to find last agent servicing a call from queue with CFD?

Discussion in 'Call Flow Designer' started by Edi Kojsi, Mar 5, 2018.

Thread Status:
Not open for further replies.
  1. Edi Kojsi

    Joined:
    Nov 28, 2017
    Messages:
    30
    Likes Received:
    2
    A customer wants the following functionality:

    If a client is calling the PBX again, i.e. a queue, the call to be routed to the same agent (if available), who serviced the call previous time, otherwise new call to be serviced by random agent.

    I'm wondering is it possible to realize such feature using CFD and reading for example the CDR log file?
    I guess reading a PBX database will be more difficult and not well documented.

    Also "last" agent should be limited probably by time -- may be one or several days back only.
     
  2. voiptoys

    voiptoys Active Member

    Joined:
    Feb 13, 2013
    Messages:
    893
    Likes Received:
    154
    Yes, this could be done with a CFD and a custom call history database. Inbound calls would first be forwarded to the CFD, then the CFD would determine where to route the call, either to the agent, or the standard queue.

    This does, however, get a little more complicated. You also need to see if the original agent is "available" before routing the call to a specific agent. To simplify the CFD, you could create a "personal queue" for each agent and send callers to the queue, then if the call doesn't get picked up from the agent's personal queue, have the queue fail over to the standard queue. That would allow the agent to handle multiple calls sequentially. You could make the personal queue a priority queue, and assign the agent to both the standard and priority queues.

    To determine who the last agent was, you could have 3CX generate the CDR text files and automatically process these files and put the data in a database. You could then query the database. Our "3CX Exporter" add-on can automatically parse the CDR files and put the data in a database that could be used by the CFD application. 3CX gets very concerned when you access the PostgreSQL database directly. That should be your last resort option.

    Of course, you could write a service that watches the call events in real-time (using the Call Control API) and have the service write to a database, but that's getting even more complicated. Nevertheless, if you want to do it, it absolutely can be done.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Cedomir Milivojevic likes this.
  3. Edi Kojsi

    Joined:
    Nov 28, 2017
    Messages:
    30
    Likes Received:
    2
    Thanks, this is my expectation too.
     
  4. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,611
    Likes Received:
    126
    Hello @Edi Kojsi,

    The solution has been very well explained by Matt. It is recommended that you don't use the 3CX database to get the call history, you should export the data from CDRs to an external database, and then consume the information from there. I would like to share an article (in russian, but you can translate it), which shows how to implement this call stickiness feature:
    https://www.3cx.ru/blog/how-to-call-stickiness-3cx-phone-system/

    Kind regards.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Cedomir Milivojevic likes this.
  5. Edi Kojsi

    Joined:
    Nov 28, 2017
    Messages:
    30
    Likes Received:
    2
    Thank you Edossantos
    I will try to make it working with v.15.5
     
Thread Status:
Not open for further replies.