by 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