AWS LINK SHORT IMPLEMENTED
This commit is contained in:
parent
d4c7e12540
commit
5c19b79f16
@ -89,7 +89,7 @@ $autoload['drivers'] = array();
|
|||||||
|
|
|
|
||||||
| $autoload['helper'] = array('url', 'file');
|
| $autoload['helper'] = array('url', 'file');
|
||||||
*/
|
*/
|
||||||
$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup','assessedincome','rentalform','external_dir_check','applicantname_grabber','vendor_form');
|
$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup','assessedincome','rentalform','external_dir_check','applicantname_grabber','vendor_form','custom_encryption');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
| -------------------------------------------------------------------
|
| -------------------------------------------------------------------
|
||||||
|
|||||||
@ -158,7 +158,7 @@ $config['composer_autoload'] = TRUE;
|
|||||||
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
|
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-=';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
@ -50,7 +50,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||||||
| my-controller/my-method -> my_controller/my_method
|
| my-controller/my-method -> my_controller/my_method
|
||||||
*/
|
*/
|
||||||
$route['default_controller'] = 'welcome';
|
$route['default_controller'] = 'welcome';
|
||||||
$route['(short/:any)'] = 'welcome/short';
|
$route['vdo'] = 'welcome/short';
|
||||||
$route['autenticadors'] = 'autenticador/index';
|
$route['autenticadors'] = 'autenticador/index';
|
||||||
$route['404_override'] = '';
|
$route['404_override'] = '';
|
||||||
$route['translate_uri_dashes'] = FALSE;
|
$route['translate_uri_dashes'] = FALSE;
|
||||||
|
|||||||
@ -9696,7 +9696,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
|||||||
{
|
{
|
||||||
$pd_id = $this->post('pd_id');
|
$pd_id = $this->post('pd_id');
|
||||||
$random_string = $this->post('random_string');
|
$random_string = $this->post('random_string');
|
||||||
$this->load->library('twlio');
|
//$this->load->library('twlio');
|
||||||
$result_data = array();
|
$result_data = array();
|
||||||
$pd_master_details = $this->PD_Model->getPDMasterDetails($pd_id,$random_string);
|
$pd_master_details = $this->PD_Model->getPDMasterDetails($pd_id,$random_string);
|
||||||
|
|
||||||
@ -9788,17 +9788,21 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$composition_result_data = $this->twlio->startComposistion($value['room_id']);
|
$room_status = $this->twlio->getRoomDataByRoomID($value['room_id']);
|
||||||
// $composition_result_data = $this->twlio->startComposistion('RM23b8d502434e46e696d1fbd5d64c59c8');
|
if($room_status == 'completed')
|
||||||
// print_r($composition_result_data);
|
{
|
||||||
$composition_result_data_json = json_encode($composition_result_data);
|
$composition_result_data = $this->twlio->startComposistion($value['room_id']);
|
||||||
// print_r($composition_result_data_json);
|
// $composition_result_data = $this->twlio->startComposistion('RM23b8d502434e46e696d1fbd5d64c59c8');
|
||||||
$records['res_json'] = $composition_result_data_json;
|
// print_r($composition_result_data);
|
||||||
$records['twilo_status'] = $composition_result_data['status'];
|
$composition_result_data_json = json_encode($composition_result_data);
|
||||||
$records['composition_id'] = $composition_result_data['compositionId'];
|
// print_r($composition_result_data_json);
|
||||||
$records['is_call_ended'] = 1;
|
$records['res_json'] = $composition_result_data_json;
|
||||||
$where_condition_array = array('fk_pd_id' => $pd_id); if($room_id){ $where_condition_array['room_id'] = $room_id; }
|
$records['twilo_status'] = $composition_result_data['status'];
|
||||||
$id = $this->PD_Model->updateRecords($records,VIDEO_ROOM_INFO,$where_condition_array);
|
$records['composition_id'] = $composition_result_data['compositionId'];
|
||||||
|
$records['is_call_ended'] = 1;
|
||||||
|
$where_condition_array = array('fk_pd_id' => $pd_id); if($room_id){ $where_condition_array['room_id'] = $room_id; }
|
||||||
|
$id = $this->PD_Model->updateRecords($records,VIDEO_ROOM_INFO,$where_condition_array);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,24 +25,44 @@ class Welcome extends CI_Controller {
|
|||||||
|
|
||||||
public function short()
|
public function short()
|
||||||
{
|
{
|
||||||
$uri = $this->uri->segment(2);
|
$data = $this->input->get('dat');
|
||||||
//echo $uri;
|
//echo $data;
|
||||||
$this->load->model('PD_Model');
|
|
||||||
$this->load->library('AWS_S3');
|
$redirect_url = 'https://demo.pdgenie.com/error/404.html';
|
||||||
$room_info = $this->PD_Model->selectCustomRecords(array('*'),array('composition_id' => $uri),VIDEO_ROOM_INFO);
|
if($data)
|
||||||
if(count($room_info))
|
|
||||||
{
|
{
|
||||||
$pd_master_details = $this->PD_Model->getPDMasterDetails($room_info[0]['fk_pd_id']);
|
|
||||||
$bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id'];
|
// $uri = custom_encryption::encode($data);die();
|
||||||
$final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$uri.'.mp4';
|
$uri = custom_encryption::decode($data);
|
||||||
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+1 hour');
|
// echo $uri;
|
||||||
// echo 'sdj';
|
$uri = explode('/',$uri);
|
||||||
// die();
|
$video_name = $uri[0];
|
||||||
header("Location: $singed_uri");
|
$date = $uri[1];
|
||||||
}
|
$is_expired = MYUTIL::isDateExpired($date,7);
|
||||||
else
|
if(!$is_expired)
|
||||||
{
|
{
|
||||||
header('Location: https://google.com');
|
|
||||||
|
$this->load->model('PD_Model');
|
||||||
|
$this->load->library('AWS_S3');
|
||||||
|
$room_info = $this->PD_Model->selectCustomRecords(array('*'),array('composition_id' => $video_name),VIDEO_ROOM_INFO);
|
||||||
|
//print_r($room_info);die();
|
||||||
|
if(count($room_info))
|
||||||
|
{
|
||||||
|
$pd_master_details = $this->PD_Model->getPDMasterDetails($room_info[0]['fk_pd_id']);
|
||||||
|
$bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id'];
|
||||||
|
$final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$video_name.'.mp4';
|
||||||
|
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+2 hour');
|
||||||
|
$redirect_url = $singed_uri;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$redirect_url = 'https://demo.pdgenie.com/error/exp.html';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//echo $redirect_url;
|
||||||
|
header("Location: $redirect_url");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -259,6 +259,24 @@ class MYUTIL
|
|||||||
}
|
}
|
||||||
return $ordered_fy_data;
|
return $ordered_fy_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function isDateExpired($received_date,$days_to_compare)
|
||||||
|
{
|
||||||
|
$converted_real_date = strtotime($received_date);
|
||||||
|
$converted_real_date = date('Y-m-d',$converted_real_date);
|
||||||
|
|
||||||
|
// $format = "Y-m-d";
|
||||||
|
// $received_date = DateTime::createFromFormat($format, $converted_real_date);
|
||||||
|
// $today = DateTime::createFromFormat($format, date('Y-m-d'));
|
||||||
|
|
||||||
|
$received_date=date_create($converted_real_date);
|
||||||
|
$today=date_create(date('Y-m-d'));
|
||||||
|
$diff=date_diff($received_date,$today);
|
||||||
|
// echo $diff->format("%R%a days");
|
||||||
|
$different = $diff->format("%a");
|
||||||
|
//echo $different;
|
||||||
|
return ($different >= $days_to_compare);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -134,11 +134,11 @@ class Twlio
|
|||||||
// print_r($rooms);
|
// print_r($rooms);
|
||||||
$room = $twilio->video->v1->rooms($roomID)
|
$room = $twilio->video->v1->rooms($roomID)
|
||||||
->fetch();
|
->fetch();
|
||||||
print($room->uniqueName);
|
// print($room->uniqueName);
|
||||||
print($room->accountSid);
|
// print($room->accountSid);
|
||||||
print($room->type);
|
//print($room->type);
|
||||||
print($room->status);
|
// print($room->status);
|
||||||
print($room->status);
|
return ($room->status);
|
||||||
|
|
||||||
// foreach ($rooms as $record) {
|
// foreach ($rooms as $record) {
|
||||||
// print($record->sid);
|
// print($record->sid);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user