Page 1 of 1
Calculate Hold (Park) time during the call
Posted:
Tue Mar 30, 2010 12:53 am
by shariq
How can i calculate the hold time in agent activity report in which agent hold or parked the customer during the call.
Is there any report of Park time of the calls.
Or any mysql table log, where i can see the park time of every call.
VERSION: 2.2.0-234
BUILD: 100116-0718
Asterisk 1.4
Posted:
Tue Mar 30, 2010 11:46 am
by mflorell
this is not logged, there are no reports for this currently.
Posted:
Tue Mar 30, 2010 12:34 pm
by shariq
Matt,
Can you give me any hint to log this into the new table also. It will only log when the Park Call event fire (in the new table)? then after i can generate the report easily.
Posted:
Tue Mar 30, 2010 1:03 pm
by mflorell
The manager_send.php script initiates the park and retrieves the call, so that would be a place to start to log that.
Posted:
Tue Mar 30, 2010 1:27 pm
by shariq
It is better if i add 2 more fields park_epoch and park_sec in the same table vicidial_agent_log and update the record the last records of the same call by adding a query in manager_send.php??
What do you suggest.
Posted:
Tue Mar 30, 2010 9:48 pm
by mflorell
I suppose that could work, just make sure you account for an agent putting the call on hold more than once.
a different approach
Posted:
Mon Jun 07, 2010 7:57 am
by vasix
Hi guys
I needed the same hold duration and choosed a different method.
I created another table, parked_calls, and modified manage_send.php to insert uniqueid/server_ip/channel/starttime/stoptime for every parked call in $ACTION=="RedirectToPark"
On every call grabbed from park I will update the stoptime field in $ACTION=="RedirectFromPark"
This way I will have more same uniqueid records with different start/stops if the agent will park the customer more than once.
Hope this helps.
Best regards,
Vasix
Posted:
Mon Jun 07, 2010 8:21 am
by mflorell
Sounds good!
Could you post your patches to the issue tracker?
Posted:
Mon Jun 07, 2010 8:44 am
by vasix
sure, will post to new features if it's OK
duplicate records in parked_calls
Posted:
Fri Jul 30, 2010 10:15 am
by shakti
Hi
when we make manual calls it add a duplicate records for every park and work fine with ratio dialing , any suggestion
VICI VERSION: 2.2.0-234
Asterisk VERSION: 1.2.30.4
Posted:
Fri Jul 30, 2010 11:16 am
by mflorell
Details, Details please...
Posted:
Sat Jul 31, 2010 3:33 am
by shakti
sorry for late reply
I created a table in mysql, as parked_calls:
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| uniqueid | varchar(100) | YES | | NULL | |
| extension | varchar(50) | YES | | NULL | |
| park_start | datetime | YES | | NULL | |
| park_stop | datetime | YES | | NULL | |
| server_ip | varchar(100) | YES | | NULL | |
| channel | varchar(100) | YES | | NULL | |
+------------+--------------+------+-----+---------+-------+
and modified manager_send.php as below
(in $ACTION=="RedirectToPark" check):
#added park logging
$stmt="SELECT uniqueid from vicidial_auto_calls where callerid='$CalLCID' order by call_time limit 1;";
$rslt=mysql_query($stmt, $link);
$vvv = mysql_num_rows($rslt);
if ($vvv > 0)
{
$row=mysql_fetch_row($rslt);
$vuniqueid = $row[0];
}
if(!$vuniqueid)
{
$vuniqueid = 'NONE';
}
$stmt = "INSERT INTO parked_calls values('$vuniqueid','$parkedby','$NOW_TIME',0,'$server_ip','$channel');";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);}
#ended park logging
In $ACTION=="RedirectFromPark" check I added the update to the parked call(s):
if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;}
$stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);}
#park logging update
$stmt = "UPDATE parked_calls set park_stop = '$NOW_TIME' where server_ip='$server_ip' and channel='$channel';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);}
#ended park logging update
Now Scenario I
Outbound campaing , Dial method is manual
if agent parks a call once , will get two same record in parked_calls as below
+-------------------+-----------+---------------------+---------------------+-------------+----------+
| uniqueid | extension | park_start | park_stop | server_ip | channel |
+-------------------+-----------+---------------------+---------------------+-------------+----------+
| 1280479508.745918 | SIP/4001 | 2010-07-30 14:15:20 | 2010-07-30 14:16:22 | 172.20.24.1 | Zap/31-1 |
| 1280479508.745918 | SIP/4001 | 2010-07-30 14:15:20 | 2010-07-30 14:16:22 | 172.20.24.1 | Zap/31-1 |
Scenario II
Outbound Campaign , dial method is Ratio
entry for single park is as below
| 1280501650.754214 | SIP/4001 | 2010-07-30 20:24:32 | 2010-07-30 20:24:57 | 172.20.24.1 | Zap/31-1 |
VICI VERSION: 2.2.0-234
Asterisk : 1.2.30.4
BR
Posted:
Sat Jul 31, 2010 9:56 pm
by mflorell
This is really something that needs to be handled in the Issue Tracker instead of the Support forum. Please post proper patch files there and we can discuss further.
Re: Calculate Hold (Park) time during the call
Posted:
Thu Dec 27, 2012 6:36 am
by ganapathi
Hello Mr.shakti ,
Your Code is useful.But That is not perfect one. Because Whenever Uniqueid is Primary field in the database.So Duplicate is not allowed.Suppose if we allow ,then also that is not good thing.Uniqueid is unique only.so Better try to Calculate the Total hold time and save it on same record itself ,if suppose more than one call hold for the same number. I am also working on that only.