5523f66a by Manish Mihsra

Added diallines condition before start calling

1 parent 862aa821
...@@ -305,6 +305,15 @@ class CreateCall extends Command { ...@@ -305,6 +305,15 @@ class CreateCall extends Command {
305 305
306 if(sizeof($users)>=1) 306 if(sizeof($users)>=1)
307 { 307 {
308 $dialline=Dialline::where('server','=', env('app_ip'))->where("status","=","Free")->where("enabled","=","1")->where("dialstr", "=", $availDialStr)->orderBy('updated_at','ASC')->first();
309
310 if(!empty($dialline))
311 {
312 $dialline->status="AutoCall";
313 $dialline->regexstr=$client;
314 $dialline->number=$users[0]["mobile"];
315 $dialline->save();
316
308 DB::table('records_'.$client)->where('id',$users[0]['id'])->update(['filter_condition'=>'2','modified'=>date("Y-m-d H:i:s")]); 317 DB::table('records_'.$client)->where('id',$users[0]['id'])->update(['filter_condition'=>'2','modified'=>date("Y-m-d H:i:s")]);
309 318
310 $record=$wakka->getPerson($users[0]['id'],$client); 319 $record=$wakka->getPerson($users[0]['id'],$client);
...@@ -312,16 +321,8 @@ class CreateCall extends Command { ...@@ -312,16 +321,8 @@ class CreateCall extends Command {
312 { 321 {
313 $record["peopledata"]["status"]="AutoCall"; 322 $record["peopledata"]["status"]="AutoCall";
314 $wakka->setPerson($users[0]['id'],$record,$client); 323 $wakka->setPerson($users[0]['id'],$record,$client);
315 // DB::table('records_'.$client)->where('id',$users[0]['id'])->update(['filter_condition'=>'2','modified'=>date("Y-m-d H:i:s")]);
316 } 324 }
317 325
318 $dialline=Dialline::where('server','=', env('app_ip'))->where("status","=","Free")->where("enabled","=","1")->where("dialstr", "=", $availDialStr)->orderBy('updated_at','ASC')->first();
319
320 $dialline->status="AutoCall";
321 $dialline->regexstr=$client;
322 $dialline->number=$users[0]["mobile"];
323 $dialline->save();
324
325 $nowts=microtime(true)*1000; 326 $nowts=microtime(true)*1000;
326 327
327 //start the call log 328 //start the call log
...@@ -355,6 +356,7 @@ class CreateCall extends Command { ...@@ -355,6 +356,7 @@ class CreateCall extends Command {
355 356
356 return 1; 357 return 1;
357 } 358 }
359 }
358 return 0; 360 return 0;
359 } 361 }
360 362
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!