/**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $log = PhoneLog::find($id);
     $geo = GeoAPI::getByIP($log->ip);
     //"77.66.238.201"
     $detail = null;
     if (!empty($log->call_id)) {
         $detail = MttAPI::getCallBackFollowmeCallInfo($log->call_id);
     }
     return view('callback.logs.show')->with(compact('log', 'geo', 'detail'));
 }
Exemple #2
0
 public static function makeCall($client, $phone, PhoneLog $phoneLog = null)
 {
     $mtt = new self();
     $res = $mtt->getCallBackFollowme();
     if ($res !== false) {
         $mtt->deleteCallBackFollowme();
     }
     $phones = trim($client->settings->phones);
     $phones = empty($phones) ? [$client->settings->defaultPhone] : json_decode($client->settings->phones);
     $res = $mtt->setCallBackFollowme($client->settings->defaultPhone, $phones, $client->settings->textA, $client->settings->textB, !empty($client->settings->audioIdA) ? $client->settings->audioIdA : false, !empty($client->settings->audioIdB) ? $client->settings->audioIdB : false);
     $resCall = $mtt->makeCallBackCallFollowme($phone, $client->settings->defaultPhone, $client->settings->record);
     $res = $mtt->deleteCallBackFollowme();
     $result = [];
     if (!empty($resCall->result->callBackCall_id)) {
         $phoneLog->setAttribute('call_id', $resCall->result->callBackCall_id);
         $phoneLog->save();
         $result = $resCall;
         //$result["success"]="y";
         //$result["call_id"]=$resCall->result->callBackCall_id;
     } else {
         $result["success"] = "n";
     }
     return $result;
 }