VideoChatAccessKey Changes : ps
This commit is contained in:
parent
ef6336349d
commit
3d049a9fe6
@ -1263,11 +1263,29 @@ class Common_Masters_Controller extends REST_Controller {
|
|||||||
// if($apiKeySecret && is_array($apiKeySecret))
|
// if($apiKeySecret && is_array($apiKeySecret))
|
||||||
// {
|
// {
|
||||||
|
|
||||||
$roomName = $random_key.$pd_id;
|
$roomName = $random_key.$pd_id;
|
||||||
$officerName = $user_type == 'PDOFFICER' ? 'PDOFFICER' : 'CUSTOMER';
|
$temp = 0;
|
||||||
$videoAccessToken = $this->twlio->getVideoAccessJWTToken(TWILIO_API_KEY,TWILIO_API_KEY_SECRET,$roomName,$officerName);
|
|
||||||
|
if (is_numeric($user_type)){
|
||||||
|
// echo 'B4 '.gettype($user_type);
|
||||||
|
$this->load->model('User_Management_Model');
|
||||||
|
$user_type = (int)$user_type;
|
||||||
|
$userDetails = $this->User_Management_Model->getUserDetails($user_type);
|
||||||
|
$creditManagerRoleId = (ENVIRONMENT == 'production' ? 26 : 26);
|
||||||
|
$userRoleId = $userDetails["data"][0]['user_role'];
|
||||||
|
$name = $userDetails["data"][0]['user_first_name'].$userDetails["data"][0]['user_last_name'];
|
||||||
|
$officerName = strtoupper(preg_replace('/\s+/', '', $name));
|
||||||
|
$temp = ($userRoleId == $creditManagerRoleId) ? 0 : 1;
|
||||||
|
}else{
|
||||||
|
$officerName = $user_type == 'PDOFFICER' ? 'PDOFFICER' : 'CUSTOMER';
|
||||||
|
$temp = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if($videoAccessToken)
|
if($temp == 1){
|
||||||
|
$videoAccessToken = $this->twlio->getVideoAccessJWTToken(TWILIO_API_KEY,TWILIO_API_KEY_SECRET,$roomName,$officerName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!empty($videoAccessToken))
|
||||||
{
|
{
|
||||||
$data['dataStatus'] = true;
|
$data['dataStatus'] = true;
|
||||||
$data['status'] = REST_Controller::HTTP_OK;
|
$data['status'] = REST_Controller::HTTP_OK;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user