Activated all users and Log generation
Showing
1 changed file
with
8 additions
and
6 deletions
| ... | @@ -7,18 +7,18 @@ use Log; | ... | @@ -7,18 +7,18 @@ use Log; |
| 7 | class SmsController extends Controller | 7 | class SmsController extends Controller |
| 8 | { | 8 | { |
| 9 | public $smsUrl = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?'; | 9 | public $smsUrl = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?'; |
| 10 | public $userarray = array("A21568","admin"); | 10 | //public $userarray = array("A21568","admin"); |
| 11 | public function sendSmsBasedOnSubDisposition($kstychCall) | 11 | public function sendSmsBasedOnSubDisposition($kstychCall) |
| 12 | { | 12 | { |
| 13 | $users = $this->userarray; | 13 | //$users = $this->userarray; |
| 14 | if(in_array(Auth::user()->username , $users)){ | 14 | //if(in_array(Auth::user()->username , $users)){ |
| 15 | $msgText = $this->getSmsTemplate($kstychCall); | 15 | $msgText = $this->getSmsTemplate($kstychCall); |
| 16 | if( !empty($msgText) ) { | 16 | if( !empty($msgText) ) { |
| 17 | $msgText = $this->fillValuesInTemplate($msgText); | 17 | $msgText = $this->fillValuesInTemplate($msgText); |
| 18 | Log::info($msgText); | 18 | //Log::info($msgText); |
| 19 | $this->sendSmsRequest($kstychCall, $msgText); | 19 | $this->sendSmsRequest($kstychCall, $msgText); |
| 20 | } | 20 | } |
| 21 | } | 21 | //} |
| 22 | return; | 22 | return; |
| 23 | } | 23 | } |
| 24 | public function sendSmsRequest($kstychCall, $msgText) | 24 | public function sendSmsRequest($kstychCall, $msgText) |
| ... | @@ -47,7 +47,9 @@ class SmsController extends Controller | ... | @@ -47,7 +47,9 @@ class SmsController extends Controller |
| 47 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | 47 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); |
| 48 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | 48 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 49 | $response = curl_exec($ch); | 49 | $response = curl_exec($ch); |
| 50 | Log::info($response); | 50 | Log::useFiles(storage_path().'/logs/SMS_Messages.log'); |
| 51 | Log::info("|".date('Y-m-d H:i:s', strtotime('+5 hours 30 minutes'))."|".$kstychCall['callnumber']."|".$msgText."|".$response); | ||
| 52 | //Log::info($response); | ||
| 51 | curl_close($ch); | 53 | curl_close($ch); |
| 52 | } catch(Exception $e) { | 54 | } catch(Exception $e) { |
| 53 | Log::info($e->getMessage()); | 55 | Log::info($e->getMessage()); | ... | ... |
-
Please register or sign in to post a comment