Calculate Hold (Park) time during the call

All installation and configuration problems and questions

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

Calculate Hold (Park) time during the call

Postby shariq » Tue Mar 30, 2010 12:53 am

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
shariq
 
Posts: 53
Joined: Fri Jul 18, 2008 6:49 am
Location: Pakistan - Karachi

Postby mflorell » Tue Mar 30, 2010 11:46 am

this is not logged, there are no reports for this currently.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby shariq » Tue Mar 30, 2010 12:34 pm

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.
shariq
 
Posts: 53
Joined: Fri Jul 18, 2008 6:49 am
Location: Pakistan - Karachi

Postby mflorell » Tue Mar 30, 2010 1:03 pm

The manager_send.php script initiates the park and retrieves the call, so that would be a place to start to log that.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby shariq » Tue Mar 30, 2010 1:27 pm

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.
shariq
 
Posts: 53
Joined: Fri Jul 18, 2008 6:49 am
Location: Pakistan - Karachi

Postby mflorell » Tue Mar 30, 2010 9:48 pm

I suppose that could work, just make sure you account for an agent putting the call on hold more than once.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

a different approach

Postby vasix » Mon Jun 07, 2010 7:57 am

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
vasix
 
Posts: 16
Joined: Mon Jun 07, 2010 7:34 am

Postby mflorell » Mon Jun 07, 2010 8:21 am

Sounds good!

Could you post your patches to the issue tracker?
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby vasix » Mon Jun 07, 2010 8:44 am

sure, will post to new features if it's OK
vasix
 
Posts: 16
Joined: Mon Jun 07, 2010 7:34 am

duplicate records in parked_calls

Postby shakti » Fri Jul 30, 2010 10:15 am

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
shakti
 
Posts: 5
Joined: Tue Nov 03, 2009 5:37 am

Postby mflorell » Fri Jul 30, 2010 11:16 am

Details, Details please...
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby shakti » Sat Jul 31, 2010 3:33 am

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
shakti
 
Posts: 5
Joined: Tue Nov 03, 2009 5:37 am

Postby mflorell » Sat Jul 31, 2010 9:56 pm

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.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Calculate Hold (Park) time during the call

Postby ganapathi » Thu Dec 27, 2012 6:36 am

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.
ganapathi
 
Posts: 2
Joined: Thu Dec 27, 2012 6:29 am


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 103 guests