01ec3695 by G Manojkumar

userarray creation

1 parent 508f6466
......@@ -721,14 +721,12 @@ if($action=="closecall")
$userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first();
$userlog->getLastTs($crmcall->sipid_id,$nowts);
$userlog->save();
if(Auth::user()->username=='S32732' && $kstychCall['callnumber']=='9324046534'){
try{
$smscontroller = new SmsController();
$smscontroller->sendSmsBasedOnSubDisposition($kstychCall);
} catch(Exception $e) {
Log::info($e->getMessage());
}
}
}
return Response::make("");
......
......@@ -7,14 +7,18 @@ use Log;
class SmsController extends Controller
{
public $smsUrl = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?';
public function sendSmsBasedOnSubDisposition($kstychCall)
{
$msgText = $this->getSmsTemplate($kstychCall);
if( !empty($msgText) ) {
$msgText = $this->fillValuesInTemplate($msgText);
Log::info($msgText);
$this->sendSmsRequest($kstychCall, $msgText);
}
public $userarray = array("A21568","admin");
public function sendSmsBasedOnSubDisposition($kstychCall)
{
$users = $this->userarray;
if(in_array(Auth::user()->username , $users)){
$msgText = $this->getSmsTemplate($kstychCall);
if( !empty($msgText) ) {
$msgText = $this->fillValuesInTemplate($msgText);
Log::info($msgText);
$this->sendSmsRequest($kstychCall, $msgText);
}
}
return;
}
public function sendSmsRequest($kstychCall, $msgText)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!