last_call_finish NOT UPDATED

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

last_call_finish NOT UPDATED

Postby jletinevez » Fri Apr 07, 2017 4:49 am

Hi all,

(my confguration is in my signature)
We noticed that algorithm which is supposed to dispatch calls is not working as expected.
Indeed:
the parameter next_agent_call of vicidial_campaigns and vicidial_inbound_groups is based on last_call_finish column of vicidial_live_agents table.
We set next_agent_call to oldest_call_finish and/or longest_wait_time

- oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall.
- longest_wait_time: orders by the amount of time agent has been actively waiting for a call.

expecting that the agent who is waiting for a call for the longest time will receive the next call.
But in reality, some agents receive a lot of calls, and some are waiting for many minutes.

We noticed that the column last_call_finish of vicidial_live_agents table is not updated when the agent finishes his call with a customer, only last_call_time is updated :

Before receving call
Code: Select all
MariaDB [asterisk]> SELECT live_agent_id,user,conf_exten,extension,status,lead_id,last_call_finish,last_update_time,last_call_time,ring_callerid FROM vicidial_live_agents ORDER BY last_call_finish;                             
+---------------+------+------------+-----------+--------+---------+---------------------+---------------------+---------------------+---------------+
| live_agent_id | user | conf_exten | extension | status | lead_id | last_call_finish    | last_update_time    | last_call_time      | ring_callerid |
+---------------+------+------------+-----------+--------+---------+---------------------+---------------------+---------------------+---------------+
|          3129 | 203  | 8600052    | SIP/203   | PAUSED |  367274 | 2017-04-07 08:25:08 | 2017-04-07 08:26:44 | 2017-04-07 08:26:11 |               |
|          3131 | 202  | 8600051    | SIP/202   | READY  |       0 | 2017-04-07 09:03:26 | 2017-04-07 09:15:22 | 2017-04-07 09:11:10 |               |
+---------------+------+------------+-----------+--------+---------+---------------------+---------------------+---------------------+---------------+
2 rows in set (0.00 sec)


After hanging up
Code: Select all
MariaDB [asterisk]> SELECT live_agent_id,user,conf_exten,extension,status,lead_id,last_call_finish,last_update_time,last_call_time FROM vicidial_live_agents ORDER BY last_call_finish;
+---------------+------+------------+-----------+--------+---------+---------------------+---------------------+---------------------+
| live_agent_id | user | conf_exten | extension | status | lead_id | last_call_finish    | last_update_time    | last_call_time      |
+---------------+------+------------+-----------+--------+---------+---------------------+---------------------+---------------------+
|          3129 | 203  | 8600052    | SIP/203   | PAUSED |  367274 | 2017-04-07 08:25:08 | 2017-04-07 08:26:44 | 2017-04-07 08:26:11 |
|          3131 | 202  | 8600051    | SIP/202   | READY  |       0 | 2017-04-07 09:03:26 | 2017-04-07 09:17:44 | 2017-04-07 09:17:07 |
+---------------+------+------------+-----------+--------+---------+---------------------+---------------------+---------------------+
2 rows in set (0.00 sec)


last_call_finish seems to be updated only when I log on vicidial and join the meetme conference.

Is it a bug or a misunderstood from my part ?

Thanks in advance for your help!
Julie
ViciBox v.7.0.1-160223 | VERSION: 2.12-560a BUILD: 160617-1427 | Asterisk 11.21.0-vici | Single Server | No Digium/Sangoma Hardware | No Extra Software After Installation
jletinevez
 
Posts: 3
Joined: Fri Jun 10, 2016 7:10 am

Re: last_call_finish NOT UPDATED

Postby mflorell » Fri Apr 07, 2017 5:41 am

Are these inbound calls or outbound calls that the agents are handling?

Your version is over a year old, have you planned to upgrade to the latest svn/trunk version any time soon?
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: last_call_finish NOT UPDATED

Postby jletinevez » Tue Apr 11, 2017 3:51 am

Hi,
I upgraded svn/trunk with the latest version (2017-04-10) and did the test again :
One agent, 3 lead_id in hopper ==> that is outbound and inbound calls both (1 outbound, 2 inbounds calls by queuing in inbound group)

==> Same behavior : last_call_finish is never updated.

First outbound call
Code: Select all
MariaDB [asterisk]> SELECT live_agent_id,user,conf_exten,extension,status,lead_id,uniqueid,callerid,channel,last_call_finish,last_update_time,last_call_time,ring_callerid FROM vicidial_live_agents;
+---------------+------+------------+-----------+--------+---------+---------------+----------------------+-------------------+---------------------+---------------------+---------------------+---------------+
| live_agent_id | user | conf_exten | extension | status | lead_id | uniqueid      | callerid             | channel           | last_call_finish    | last_update_time    | last_call_time      | ring_callerid |
+---------------+------+------------+-----------+--------+---------+---------------+----------------------+-------------------+---------------------+---------------------+---------------------+---------------+
|          3196 | 202  | 8600052    | SIP/202   | PAUSED |      33 | 1491898982.25 | V4110823020000000033 | IAX2/qgpred-19003 | 2017-04-11 08:19:14 | 2017-04-11 08:23:40 | 2017-04-11 08:23:09 |               |
+---------------+------+------------+-----------+--------+---------+---------------+----------------------+-------------------+---------------------+---------------------+---------------------+---------------+
1 row in set (0.00 sec)


Fisrt call queued /inbound
Code: Select all
MariaDB [asterisk]> SELECT live_agent_id,user,conf_exten,extension,status,lead_id,uniqueid,callerid,channel,last_call_finish,last_update_time,last_call_time,ring_callerid FROM vicidial_live_agents;
+---------------+------+------------+-----------+--------+---------+---------------+----------------------+-------------------+---------------------+---------------------+---------------------+---------------+
| live_agent_id | user | conf_exten | extension | status | lead_id | uniqueid      | callerid             | channel           | last_call_finish    | last_update_time    | last_call_time      | ring_callerid |
+---------------+------+------------+-----------+--------+---------+---------------+----------------------+-------------------+---------------------+---------------------+---------------------+---------------+
|          3196 | 202  | 8600052    | SIP/202   | INCALL |  367274 | 1491898999.37 | Y4110823190000367274 | IAX2/ASTloop-1460 | 2017-04-11 08:19:14 | 2017-04-11 08:24:09 | 2017-04-11 08:24:09 |               |
+---------------+------+------------+-----------+--------+---------+---------------+----------------------+-------------------+---------------------+---------------------+---------------------+---------------+
1 row in set (0.00 sec)


Second call queued /inbound
Code: Select all
MariaDB [asterisk]> SELECT live_agent_id,user,conf_exten,extension,status,lead_id,uniqueid,callerid,channel,last_call_finish,last_update_time,last_call_time,ring_callerid FROM vicidial_live_agents;
+---------------+------+------------+-----------+--------+---------+---------------+----------------------+------------------+---------------------+---------------------+---------------------+---------------+
| live_agent_id | user | conf_exten | extension | status | lead_id | uniqueid      | callerid             | channel          | last_call_finish    | last_update_time    | last_call_time      | ring_callerid |
+---------------+------+------------+-----------+--------+---------+---------------+----------------------+------------------+---------------------+---------------------+---------------------+---------------+
|          3196 | 202  | 8600052    | SIP/202   | INCALL |  367275 | 1491899003.39 | Y4110823230000367275 | IAX2/ASTloop-921 | 2017-04-11 08:19:14 | 2017-04-11 08:24:48 | 2017-04-11 08:24:48 |               |
+---------------+------+------------+-----------+--------+---------+---------------+----------------------+------------------+---------------------+---------------------+---------------------+---------------+
1 row in set (0.00 sec)


Agent is no READY for next calls :
Code: Select all
MariaDB [asterisk]> SELECT live_agent_id,user,conf_exten,extension,status,lead_id,uniqueid,callerid,channel,last_call_finish,last_update_time,last_call_time,ring_callerid FROM vicidial_live_agents;
+---------------+------+------------+-----------+--------+---------+----------+----------+---------+---------------------+---------------------+---------------------+---------------+
| live_agent_id | user | conf_exten | extension | status | lead_id | uniqueid | callerid | channel | last_call_finish    | last_update_time    | last_call_time      | ring_callerid |
+---------------+------+------------+-----------+--------+---------+----------+----------+---------+---------------------+---------------------+---------------------+---------------+
|          3196 | 202  | 8600052    | SIP/202   | READY  |       0 | 0        |          |         | 2017-04-11 08:19:14 | 2017-04-11 08:25:19 | 2017-04-11 08:24:48 |               |
+---------------+------+------------+-----------+--------+---------+----------+----------+---------+---------------------+---------------------+---------------------+---------------+
1 row in set (0.00 sec)


3 lead_id called
Code: Select all
MariaDB [asterisk]> select lead_id,status,modify_date from vicidial_list WHERE  modify_date LIKE '2017-04-11 08:2%' ;   
+---------+--------+---------------------+
| lead_id | status | modify_date         |
+---------+--------+---------------------+
|      33 | CBHOLD | 2017-04-11 08:24:04 |
|  367274 | CBHOLD | 2017-04-11 08:24:40 |
|  367275 | CBHOLD | 2017-04-11 08:25:08 |
+---------+--------+---------------------+
3 rows in set (0.19 sec)


2 inbound calls which were queued
Code: Select all
MariaDB [asterisk]> select lead_id,list_id,campaign_id,call_date,length_in_sec,status,phone_number,user,queue_seconds,term_reason,queue_position,called_count from vicidial_closer_log where call_date LIKE '2017-04-11%'; 
select lead_id,campaign_id,call_date,phone_number,closer from vicidial_xfer_log where call_date LIKE '2017-04-11%';  +---------+---------+-------------+---------------------+---------------+--------+--------------+------+---------------+-------------+----------------+--------------+
| lead_id | list_id | campaign_id | call_date           | length_in_sec | status | phone_number | user | queue_seconds | term_reason | queue_position | called_count |
+---------+---------+-------------+---------------------+---------------+--------+--------------+------+---------------+-------------+----------------+--------------+
|  367274 |     883 | CP_883_IN   | 2017-04-11 08:23:19 |            82 | INCALL | 172717186    | 202  |         48.00 | CALLER      |              1 |            1 |
|  367275 |     883 | CP_883_IN   | 2017-04-11 08:23:23 |           106 | INCALL | 172717190    | 202  |         84.00 | CALLER      |              2 |            1 |
+---------+---------+-------------+---------------------+---------------+--------+--------------+------+---------------+-------------+----------------+--------------+
2 rows in set (0.02 sec)


2 inbound calls which were queued
Code: Select all
MariaDB [asterisk]> select lead_id,campaign_id,call_date,phone_number,closer from vicidial_xfer_log where call_date LIKE '2017-04-11%'; 
+---------+-------------+---------------------+--------------+--------+
| lead_id | campaign_id | call_date           | phone_number | closer |
+---------+-------------+---------------------+--------------+--------+
|  367274 | CP_883_IN   | 2017-04-11 08:23:19 | 172717186    | 202    |
|  367275 | CP_883_IN   | 2017-04-11 08:23:23 | 172717190    | 202    |
+---------+-------------+---------------------+--------------+--------+
2 rows in set (0.03 sec)

MariaDB [asterisk]>



We'd like to know what is supposed to happen when agent or customer hangup the phone.
Which part of code is executed ?
ViciBox v.7.0.1-160223 | VERSION: 2.12-560a BUILD: 160617-1427 | Asterisk 11.21.0-vici | Single Server | No Digium/Sangoma Hardware | No Extra Software After Installation
jletinevez
 
Posts: 3
Joined: Fri Jun 10, 2016 7:10 am

Re: last_call_finish NOT UPDATED

Postby mflorell » Tue Apr 11, 2017 5:40 am

I've tested for this on two systems and cannot replicate the issue.

The next thing to check for is if there are any MySQL errors showing up in any of the perl scripts, and if you have your DB Schema properly updated.
mflorell
Site Admin
 
Posts: 18386
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: No registered users and 127 guests

cron