5523f66a by Manish Mihsra

Added diallines condition before start calling

1 parent 862aa821
......@@ -305,6 +305,15 @@ class CreateCall extends Command {
if(sizeof($users)>=1)
{
$dialline=Dialline::where('server','=', env('app_ip'))->where("status","=","Free")->where("enabled","=","1")->where("dialstr", "=", $availDialStr)->orderBy('updated_at','ASC')->first();
if(!empty($dialline))
{
$dialline->status="AutoCall";
$dialline->regexstr=$client;
$dialline->number=$users[0]["mobile"];
$dialline->save();
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);
......@@ -312,16 +321,8 @@ class CreateCall extends Command {
{
$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")]);
}
$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=$client;
$dialline->number=$users[0]["mobile"];
$dialline->save();
$nowts=microtime(true)*1000;
//start the call log
......@@ -355,6 +356,7 @@ class CreateCall extends Command {
return 1;
}
}
return 0;
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!