3bb592c9 by Manish Mihsra

Added kqueue table check, removed accesslog

1 parent 903d6aaf
......@@ -263,7 +263,8 @@ class CreateCall extends Command {
{
for($i=0;$i<$acalls;$i++)
{
$this->useChannelToDial($client, $availDialStr);
$this->createCrmCall($client, $availDialStr);
// $this->useChannelToDial($client, $availDialStr);
}
}
}
......@@ -293,7 +294,7 @@ class CreateCall extends Command {
return;
}
public function createCrmCall($client, $dialline)
public function createCrmCall($client, $availDialStr)
{
//TODO: Need to check whether callerid is required or not (in case of GSM Gateway)
$callerid="";
......@@ -314,9 +315,10 @@ class CreateCall extends Command {
// 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;
$dialline=Dialline::where('server','=', env('app_ip'))->where("status","=","Free")->where("enabled","=","1")->where("dialstr", "=", $availDialStr)->orderBy('updated_at','ASC')->first();
$dialline->status="AutoCall";
$dialline->regexstr=$users[0]["client"];
$dialline->regexstr=$client;
$dialline->number=$users[0]["mobile"];
$dialline->save();
......
......@@ -57,13 +57,14 @@ class PredictiveCallHangUp extends Command {
public function runHangUp()
{
try {
$breathingTime = 5;
$breathingTime = 4;
$avgringsec = 30;
$dStatus = "InHangUp";
$avgringsec = Cutoff::select(DB::Raw('avg(avg_ring) as avgringsec'))->first();
if($avgringsec)$avgringsec= intval($avgringsec->avgringsec);
$diallines = Dialline::whereIn("status", ["Auto","AutoCall"])->where("conf","=","")->select('call_id','src_channel','status','updated_at','channel','server')->get();
$diallines = Dialline::where('server', '=', env('app_ip'))->whereIn("status", ["Auto","AutoCall"])->where("conf","=","")->select('id','call_id','src_channel','status','updated_at','channel','server')->get();
foreach ($diallines as $dialline) {
......@@ -71,7 +72,10 @@ class PredictiveCallHangUp extends Command {
$lastUpdatedTime = strtotime(date("Y-m-d H:i:s")) - strtotime($dialline->updated_at);
$callId = $dialline->call_id;
if ($dialline->status == 'Auto' && $lastUpdatedTime > $breathingTime) {
if ($dialline->status == 'Auto' && $lastUpdatedTime > 29) {
$dialline->status=$dStatus;
$dialline->save();
$newqueue->hangupChannelS($dialline->channel,$dialline->server);
$this->updateCrmCallEntry($callId);
......
......@@ -24,7 +24,7 @@ class AfterFilter {
$response= $next($request);
Config::get('runtime.accesslog_obj')->stopLog();
// Config::get('runtime.accesslog_obj')->stopLog();
return $response;
}
......
......@@ -33,8 +33,8 @@ class BeforeFilter {
return redirect()->secure(Config::get("app.protocol").Config::get("app.domain").$request->getRequestUri());
}
$accesslog = new Accesslog();
Config::set('runtime.accesslog_obj',$accesslog->startLog());
//$accesslog = new Accesslog();
//Config::set('runtime.accesslog_obj',$accesslog->startLog());
$grparr=array();
$activegrps=Group::where('status','=','Active')->get(array('group'));
......
......@@ -1489,7 +1489,6 @@ class KPAMIListen implements IEventListener
foreach($sipids as $sipid)
{
$clientsarr=json_decode($sipid->clients,true);
if($crmcall->client=="")$first_a=$sipid;
else
......@@ -1527,7 +1526,7 @@ class KPAMIListen implements IEventListener
$userEntry = User::find($found->user);
if(!empty($userEntry)){
if($userEntry->current_dialmode != "Predictive" || $found->ready != 1) return;
if($userEntry->current_dialmode != "Predictive" || $found->ready != 1 || $dialline->regexstr != $userEntry->sel_campaign) return;
}
exec("/usr/sbin/asterisk -rx 'core show channel $dialline->channel'",$channelArr);
......
......@@ -6,6 +6,15 @@ class Kqueue extends Model{
protected $table = 'kqueues';
public function __construct() {
$tableIp = str_replace('.', '-', env("app_ip"));
$this->table = 'kqueues_' . $tableIp;
return $this;
}
//protected $fillable = array('status','data','log','group');
public function userToConf($sipid)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!