9c31f85c by Manish Mihsra

Removed unwanted code from dialer controller, changed patching logic and applied…

… changes in call log report
1 parent 8531fe49
......@@ -66,6 +66,8 @@ class CreateCall extends Command {
$availChannel = $cntAndStrArr['cnt'];
$availDialStr = $cntAndStrArr['dialstr'];
//$availDialStr = "SIP/GATEWAY1/";
if(count($usrArrs)){
//Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log");
......@@ -302,12 +304,14 @@ class CreateCall extends Command {
if(sizeof($users)>=1)
{
DB::table('records_'.$client)->where('id',$users[0]['id'])->update(['filter_condition'=>'2','modified'=>date("Y-m-d H:i:s")]);
$record=$wakka->getPerson($users[0]['id'],$client);
if($record)
{
$record["peopledata"]["status"]="AutoCall";
$wakka->setPerson($users[0]['id'],$record,$client);
DB::table('records_'.$client)->where('id',$users[0]['id'])->update(['filter_condition'=>'2','modified'=>date("Y-m-d H:i:s")]);
// DB::table('records_'.$client)->where('id',$users[0]['id'])->update(['filter_condition'=>'2','modified'=>date("Y-m-d H:i:s")]);
}
$dialline->user_id=$user_id;
......
......@@ -267,7 +267,7 @@ class KPAMIListen implements IEventListener
$callerid=$event->getKey("CallerIDName");
//echo "$accountcode:NewextenEvent : $context:$eventname $channelstate:$channelstatedesc $uniqueid $phonenumber $exten:$priority $channel\n";
if($context=="kstychDialerINB"&&$exten!="s"&&$priority=="1")
if($context=="kstychDialerINB"&&$exten!="s"&&$priority=="1"&&$phonenumber!='<unknown>')
{
if(strtolower(substr($channel,0,4))=="sip/")
{
......@@ -314,7 +314,7 @@ class KPAMIListen implements IEventListener
$crmcall->data=json_encode($tdata);
$crmcall->save();
$userStatus=User::where("updated_at",">",date("Y-m-d"))->where("exten","like","%".substr($exten,-4)."%")->where("usertype","!=","Admin")->where('presence', '=', '1')->select('*')->get();
/*$userStatus=User::where("updated_at",">",date("Y-m-d"))->where("exten","like","%".substr($exten,-4)."%")->where("usertype","!=","Admin")->where('presence', '=', '1')->select('*')->get();
if($userStatus=="[]")
{
......@@ -330,8 +330,7 @@ class KPAMIListen implements IEventListener
$newqueue=new Kqueue();
$newqueue->playbusyfile($dialline->channel,$dialline->server);
}
}*/
}
}
}
......@@ -432,6 +431,11 @@ class KPAMIListen implements IEventListener
$cause=$event->getKey("Cause");
$causetxt=$event->getKey("Cause-txt");
//Log::info("<<<<<<<<<<<<<<<<<<=====Start");
//Log::info("eventname");
//Log::info("eventname=====".$eventname);
//Log::info("exten=====".$exten);
//Log::info("context=====".$context);
if($accountcode!="")
{
......@@ -465,7 +469,7 @@ class KPAMIListen implements IEventListener
$dialline=Dialline::find($crmcall->dialline_id);
if($dialline)
if($dialline && $dialline->status != "Auto" && $dialline->status != "AutoCall")
{
$dialline->user_id=0;
$dialline->status="Free";
......@@ -564,7 +568,8 @@ class KPAMIListen implements IEventListener
}
$dialline=Dialline::find($crmcall->dialline_id);
if($dialline && ($dialline->channel==$channel || $dialline->status== "AutoCall"))
if($dialline && ($dialline->channel==$channel || $dialline->status== "AutoCall") )
{
$dialline->status="Free";
$dialline->conf="";
......@@ -1149,7 +1154,7 @@ class KPAMIListen implements IEventListener
$dialline->save();
}
$crmcall->addEventLog($nowts,"$accountcode:Unknown : $eventname $dchannelstate:$dchannelstatedesc $duniqueid $dexten:$dpriority $dchannel $dialstatus");
$crmcall->addEventLog($nowts,"$accountcode:$accountcodearr[1] : $eventname $dchannelstate:$dchannelstatedesc $duniqueid $dexten:$dpriority $dchannel $dialstatus");
$crmcall->type="Auto";
$crmcall->save();
......@@ -1425,7 +1430,7 @@ class KPAMIListen implements IEventListener
{
$lastUpdatedTime = strtotime(date("Y-m-d H:i:s")) - strtotime($dialline->updated_at);
if($lastUpdatedTime < 3) continue;
if($lastUpdatedTime < 8) continue;
exec("/usr/sbin/asterisk -rx 'core show channels'",$allChnnlsArr);
$cnt = 0;
......@@ -1702,6 +1707,7 @@ class KPAMIListen implements IEventListener
private function sendAMICommands()
{
$queues=Kqueue::where("type","=","SIP_".$this->sipip)->where("status","=","New")->take(5)->get();
if(!$queues->isEmpty())foreach($queues as $i=>$tqueue)
{
$data=json_decode($tqueue->data,true);
......@@ -1731,9 +1737,11 @@ class KPAMIListen implements IEventListener
}
else if($tqueue->key=="hangupchannel")
{
if(isset($data["channel"])){
$hangup = new HangupAction($data['channel']);
$res=$this->_client->send($hangup);
}
}
else if($tqueue->key=="recordchannel")
{
$mixmonitor=new MixMonitorAction($data['channel']);
......
......@@ -376,9 +376,15 @@ foreach($alist as $aline)
$username="";if(isset($userarr[$aline->user_id]))$username=$userarr[$aline->user_id]->username;
$recstr='';
if($dashboarduser->moduleACL("Dialer",false,false,true))
$finalTalkTime = round($talktime/1000,2);
if($dashboarduser->moduleACL("Dialer",false,false,true) && $finalTalkTime>=1)
{
if(isset($tpostdata['recFolder']))$recstr="<a href=# onclick='getCallRec(".$aline->id.");return false;' title='Size : ".round($aline->recsize/1024,0)." KB'><i class='fa fa-play-circle'></i> &nbsp;</a> <a href='dialer/playrecfile?calllog=$aline->id&out=wav' title=''><i class='fa fa-download'></i> &nbsp;</a><span id='recspan_".$aline->id."'</span>";
$recordingSize = round($aline->recsize/1024,0);
if(isset($tpostdata['recFolder']) && $recordingSize>0) {
$recstr="<a href=# onclick='getCallRec(".$aline->id.");return false;' title='Size : ".$recordingSize." KB'><i class='fa fa-play-circle'></i> &nbsp;</a> <a href='dialer/playrecfile?calllog=$aline->id&out=wav' title=''><i class='fa fa-download'></i> &nbsp;</a><span id='recspan_".$aline->id."'</span>";
}
}
$outstr.="<tr><td>".$i."</td>
......@@ -413,7 +419,7 @@ foreach($alist as $aline)
<td>".$aline->did."</td>
<td>".gmdate("H:i:s",round($aline->waitSec/1000,2))."</td>
<td>".gmdate("H:i:s",round($aline->callSec/1000,2))."</td>
<td>".gmdate("H:i:s",round($talktime/1000,2))."</td>
<td>".gmdate("H:i:s",$finalTalkTime)."</td>
<td>".gmdate("H:i:s",round($aline->dispoSec/1000,2))."</td>
<td>$recstr</td>
</tr>";
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!