added clientcode, calltime, agent_id
Showing
1 changed file
with
11 additions
and
0 deletions
| ... | @@ -23,6 +23,7 @@ class SmsController extends Controller | ... | @@ -23,6 +23,7 @@ class SmsController extends Controller |
| 23 | } | 23 | } |
| 24 | public function sendSmsRequest($kstychCall, $msgText) | 24 | public function sendSmsRequest($kstychCall, $msgText) |
| 25 | { | 25 | { |
| 26 | $wakka = new KHRMSLib(); | ||
| 26 | $url = $this->smsUrl; | 27 | $url = $this->smsUrl; |
| 27 | Log::info($kstychCall['callnumber']); | 28 | Log::info($kstychCall['callnumber']); |
| 28 | $inputArray = [ | 29 | $inputArray = [ |
| ... | @@ -48,6 +49,16 @@ class SmsController extends Controller | ... | @@ -48,6 +49,16 @@ class SmsController extends Controller |
| 48 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | 49 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 49 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,3); | 50 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,3); |
| 50 | $response = curl_exec($ch); | 51 | $response = curl_exec($ch); |
| 52 | $number=$kstychCall['callnumber']; | ||
| 53 | $callid=intval($kstychCall['callid'])+0; | ||
| 54 | $crmcall=CRMCall::find($callid); | ||
| 55 | $serverip=env(app_ip); | ||
| 56 | $agentid=Auth::user()->id; | ||
| 57 | $agentname=Auth::user()->fullname; | ||
| 58 | $subdispo=$kstychCall["usersubstatus"]; | ||
| 59 | $user=$wakka->getPerson($crmcall->crm_id); | ||
| 60 | $clientcode=$user['peopledata']['clientcode']; | ||
| 61 | DB::insert(DB::raw("insert into sms_log set server_ip='$serverip',call_id='$callid',call_date='$crmcall->created_at',agent_name='$agentname',agent_id='$agentid',subdispo='$subdispo',number='$number',message='$msgText',response='$response',clientcode='$clientcode'")); | ||
| 51 | Log::useFiles(storage_path().'/logs/SMS_Messages'.date("Y-m-d").'.log'); | 62 | Log::useFiles(storage_path().'/logs/SMS_Messages'.date("Y-m-d").'.log'); |
| 52 | Log::info("|".date('Y-m-d H:i:s', strtotime('+5 hours 30 minutes'))."|".Auth::user()->fullname."|".$kstychCall['callnumber']."|".$msgText."|".$response); | 63 | Log::info("|".date('Y-m-d H:i:s', strtotime('+5 hours 30 minutes'))."|".Auth::user()->fullname."|".$kstychCall['callnumber']."|".$msgText."|".$response); |
| 53 | //Log::info($response); | 64 | //Log::info($response); | ... | ... |
-
Please register or sign in to post a comment