8bd22406 by G Manojkumar

Calllogupdate, userlogtest and rmconnect updates

1 parent 8f391294
......@@ -70,10 +70,24 @@ class Calllogupdate extends Command {
$server_id="0".$server_id;
}
$alist=DB::connection("conn")->select(DB::raw("select crmcall_id,dispo,subdispo from $calllog_report where created_at>'".date("Y-m-d",$logdate)."' and server='$server_id'"));
$alistupdate=DB::select(DB::raw("SELECT * from crmcalls where call_flag='Z' and created_at <= '".date("Y-m-d H:i:s",$logdate-(05*60))."'"));
$alistupdate=DB::select(DB::raw("SELECT id,userstatus,usersubstatus from crmcalls where created_at>'".date("Y-m-d",$logdate)."'"));
foreach ($alist as $aline) {
foreach($alistupdate as $cline)
{
if( $aline->crmcall_id == $cline->id ){
if( $aline->dispo != $cline->userstatus){
echo " ^ DISPo".$aline->dispo." ^ ".$cline->userstatus." ^ ".$aline->crmcall_id." ^ ".$cline->id;
}else{
echo " ^ ElseDISPo".$aline->dispo." ^ ".$cline->userstatus." ^ ".$aline->crmcall_id." ^ ".$cline->id;
}
}
}
}
exit;
try{
foreach ($alistupdate as $aline) {
$clientcode="";$currentstatus="";$legalstatus="";$record_id="";
if($aline->crm_id>0)
......@@ -139,9 +153,14 @@ class Calllogupdate extends Command {
}
}
catch(Exception $e){
echo $e->getMessage(),"\n";
}finally {
echo "\n".date('Y-m-d H:i:s')."\n";
DB::connection("conn")->disconnect();
}
}
}
......
......@@ -1197,7 +1197,13 @@ class KPAMIListen implements IEventListener
foreach($allsipids as $tsip)
{
$newqueue=new Kqueue();
$newqueue->sipNotify($tsip,"popupalert"," Incoming Calls",$crmcall->number."|".$crmcall->client,"");
include( app_path() . '/Hacks/DisabledDIDs.php');
if( in_array(substr($crmcall->number,-10),$DisableNumbersArray) ){
$newqueue->sipNotify($tsip,"popupalert"," Incoming Calls","RM-Connect |".$crmcall->client,"");
}else{
$newqueue->sipNotify($tsip,"popupalert"," Incoming Calls",$crmcall->number."|".$crmcall->client,"");
}
//$newqueue->sipNotify($tsip,"popupalert"," Incoming Calls",$crmcall->number."|".$crmcall->client,"");
}
}
else
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!