twlio s3 url changes

This commit is contained in:
bitbucket 2023-04-05 16:01:14 +05:30
parent 34e82a0700
commit 4609fea1e9
3 changed files with 24 additions and 17 deletions

View File

@ -119,6 +119,8 @@ defined('CAMUNDA_URL') OR define('CAMUNDA_URL','http://34.121.71.79:8080/engine-
defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic');
if(ENVIRONMENT == 'development')
{
defined('TWILIO_CONTENT_BUCKET_NAME') OR define('TWILIO_CONTENT_BUCKET_NAME','twilio-content');
defined('SATELLITE_IMAGE_LOCATION') OR define('SATELLITE_IMAGE_LOCATION','phantomsatellite_dev');
defined('DETAILED_SCORE_CARD_IMAGE_LOCATION') OR define('DETAILED_SCORE_CARD_IMAGE_LOCATION','phantom_dsc_dev');
defined('LENDER_BUCKET_NAME_PREFIX') OR define('LENDER_BUCKET_NAME_PREFIX','test-lender');
@ -147,6 +149,7 @@ defined('CET_CREDITPD_INTEGRATION_REINSERTIMG_URL') OR define('CET_CREDITPD_INTE
}
else if(ENVIRONMENT == 'testing')
{
defined('TWILIO_CONTENT_BUCKET_NAME') OR define('TWILIO_CONTENT_BUCKET_NAME','twilio-content');
defined('SATELLITE_IMAGE_LOCATION') OR define('SATELLITE_IMAGE_LOCATION','phantomsatellite_test');
defined('DETAILED_SCORE_CARD_IMAGE_LOCATION') OR define('DETAILED_SCORE_CARD_IMAGE_LOCATION','phantom_dsc_test');
defined('LENDER_BUCKET_NAME_PREFIX') OR define('LENDER_BUCKET_NAME_PREFIX','test-lender');
@ -175,6 +178,7 @@ else if(ENVIRONMENT == 'testing')
}
else if(ENVIRONMENT == 'production')
{
defined('TWILIO_CONTENT_BUCKET_NAME') OR define('TWILIO_CONTENT_BUCKET_NAME','twilio-content-live');
defined('SATELLITE_IMAGE_LOCATION') OR define('SATELLITE_IMAGE_LOCATION','phantomsatellite_test');
defined('DETAILED_SCORE_CARD_IMAGE_LOCATION') OR define('DETAILED_SCORE_CARD_IMAGE_LOCATION','phantom_dsc_test');
defined('LENDER_BUCKET_NAME_PREFIX') OR define('LENDER_BUCKET_NAME_PREFIX','pdgenie-lender');
@ -216,6 +220,7 @@ defined('TWLIO_SID') OR define('TWLIO_SID',getenv('TWLIO_SID'));
defined('TWLIO_AUTH_TOKEN') OR define('TWLIO_AUTH_TOKEN',getenv('TWLIO_AUTH_TOKEN'));
defined('TWILIO_API_KEY') OR define('TWILIO_API_KEY',getenv('TWILIO_API_KEY'));
defined('TWILIO_API_KEY_SECRET') OR define('TWILIO_API_KEY_SECRET',getenv('TWILIO_API_KEY_SECRET'));
/*************************END OF TWILO CONSTANTS************************************************************/

View File

@ -9237,23 +9237,23 @@ class PD_Controller extends REST_Controller
if ($value['composition_id'] && $value['vsp'] != 'google') {
$res = $this->twlio->getCompositionStatus($value['composition_id']);
if (count($res) && $res['status'] == 'completed') {
// if (count($res) && $res['status'] == 'completed') {
$is_copied = $this->copyMediaFromTwiloToS3($pd_master_details, $value, $pd_category); // copy media from twlio s3 to our s3
$fields_to_update = array('twilo_status' => 'completed');
if ($is_copied) {
$fields_to_update['s3_copied'] = 1;
}
$id = $this->PD_Model->updateRecords($fields_to_update, VIDEO_ROOM_INFO, array('video_room_info_id' => $value['video_room_info_id']));
// // $is_copied = $this->copyMediaFromTwiloToS3($pd_master_details, $value, $pd_category); // copy media from twlio s3 to our s3
// // $fields_to_update = array('twilo_status' => 'completed');
// // if ($is_copied) {
// // $fields_to_update['s3_copied'] = 1;
// // }
// $id = $this->PD_Model->updateRecords($fields_to_update, VIDEO_ROOM_INFO, array('video_room_info_id' => $value['video_room_info_id']));
if ($id) {
if ($room_id) {
$result_data = $is_copied;
} else {
$result_data++;
}
}
}
// if ($id) {
// if ($room_id) {
// $result_data = $is_copied;
// } else {
// $result_data++;
// }
// }
// }
} else {
$room_status = $this->twlio->getRoomDataByRoomID($value['room_id']);
if ($room_status == 'completed') {

View File

@ -21,7 +21,8 @@ class video_grabber_helper
if($pd_category == '1'){
$pd_master_details = $CI->PD_Model->getPDMasterDetails($pd_id,$random_string);}
}
$bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id'];
// $bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id'];
$bucket_name = TWILIO_CONTENT_BUCKET_NAME;
$result_data = array();
$query = "SELECT * FROM ".VIDEO_ROOM_INFO." where fk_pd_id = $pdid and isactive = 1 and pd_category = $pd_category";
@ -41,7 +42,8 @@ class video_grabber_helper
if($value['s3_copied'])
{
$final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$file_name;
// $final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$file_name;
$final_key = $file_name;
$singed_uri = $CI->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+7 days');
$shortURL = VIDEO_SHORT_URL . substr($video_name,0,6);