TWLIO API RELATED 1
This commit is contained in:
parent
57b98a2676
commit
88c036dbae
@ -644,6 +644,7 @@ defined('VENDORFORMSTATUS') OR define('VENDORFORMSTATUS','t_vendor_form_status')
|
||||
defined('SMC_CREDIT_PD') OR define('SMC_CREDIT_PD','t_smc_credit_pd');
|
||||
defined('SMC_CREDIT_PD_DOCS') OR define('SMC_CREDIT_PD_DOCS','t_smc_credit_pd_docs');
|
||||
defined('SMC_CREDIT_PD_SECTION_DATA') OR define('SMC_CREDIT_PD_SECTION_DATA','t_smc_credit_pd_section_data');
|
||||
defined('VIDEO_ROOM_INFO') OR define('VIDEO_ROOM_INFO','t_video_room_info');
|
||||
|
||||
|
||||
|
||||
|
||||
@ -234,6 +234,7 @@ $route['(getListVendorPDOfficers/:num)'] = 'PD_Controller/getListVendorPDOfficer
|
||||
$route['duplicatePD'] = 'PD_Controller/duplicatePD';
|
||||
$route['saveApplicantImgFromVendorForm'] = 'PD_Controller/saveApplicantImgFromVendorForm';
|
||||
$route['loadCreditPDTemplate'] = 'PD_Controller/loadCreditPDTemplate';
|
||||
$route['saveRoomInfo'] = 'PD_Controller/saveRoomInfo';
|
||||
// $route['getPDFormDetailsJSON'] = 'PD_Controller/getPDFormDetailsJSON';
|
||||
|
||||
$route['smartyTestFunction'] = 'PD_Controller/smartyTestFunction';
|
||||
|
||||
@ -1238,7 +1238,7 @@ class Common_Masters_Controller extends REST_Controller {
|
||||
$user_type = $this->post('user_type');
|
||||
|
||||
//echo $pd_id,$random_key,$user_type;
|
||||
//$this->load->library('Twlio');
|
||||
$this->load->library('Twlio');
|
||||
// $this->twlio->listOfRoomsByRoomName($roomName = 'Vp9F4o3thl2ZA9361233');
|
||||
// $this->twlio->getRoomDataByRoomID($roomID = 'RM23b8d502434e46e696d1fbd5d64c59c8');
|
||||
//$this->twlio->startComposistion($roomID = 'RM23b8d502434e46e696d1fbd5d64c59c8');
|
||||
|
||||
@ -10764,6 +10764,49 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
}
|
||||
|
||||
public function saveRoomInfo_post()
|
||||
{
|
||||
// $this->load->library('twlio');
|
||||
|
||||
// $this->twlio->getCompositionStatus('CJaaea12da88661de0e49612e5eb6130b3');die();
|
||||
$records = $this->post('records');
|
||||
$id = null;
|
||||
//print_r($records);
|
||||
if(!$records['is_call_ended'])// != '' || $records['video_room_info_id'] != null)
|
||||
{
|
||||
$id = $this->PD_Model->saveRecords($records,VIDEO_ROOM_INFO);
|
||||
// print_r($this->db->last_query());
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->library('twlio');
|
||||
$composition_result_data = $this->twlio->startComposistion($records['room_id']);
|
||||
// $composition_result_data = $this->twlio->startComposistion('RM23b8d502434e46e696d1fbd5d64c59c8');
|
||||
// print_r($composition_result_data);
|
||||
$composition_result_data_json = json_encode($composition_result_data);
|
||||
// print_r($composition_result_data_json);
|
||||
$records['res_json'] = $composition_result_data_json;
|
||||
$records['twilo_status'] = $composition_result_data['status'];
|
||||
$id = $this->PD_Model->updateRecords($records,VIDEO_ROOM_INFO,array('room_id' => $records['room_id'],'fk_pd_id' => $records['fk_pd_id']));
|
||||
|
||||
}
|
||||
if($id)
|
||||
{
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = $id;
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['dataStatus'] = false;
|
||||
$data['status'] = REST_Controller::HTTP_NOT_FOUND;
|
||||
$data['msg'] = 'Something went wrong!';
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -178,8 +178,39 @@ class Twlio
|
||||
// 'statusCallback' => 'http://my.server.org/callbacks',
|
||||
'format' => 'mp4'
|
||||
]);
|
||||
print($composition);
|
||||
//print($composition);
|
||||
$result_array['compositionId'] = $composition->sid;
|
||||
$result_array['accountSid'] = $composition->accountSid;
|
||||
$result_array['status'] = $composition->status;
|
||||
$result_array['dateCreated'] = $composition->dateCreated;
|
||||
$result_array['dateCompleted'] = $composition->dateCompleted;
|
||||
$result_array['roomSid'] = $composition->roomSid;
|
||||
$result_array['dateDeleted'] = $composition->dateDeleted;
|
||||
$result_array['audioSources'] = $composition->audioSources;
|
||||
$result_array['audioSourcesExcluded'] = $composition->audioSourcesExcluded;
|
||||
$result_array['videoLayout'] = $composition->videoLayout;
|
||||
$result_array['resolution'] = $composition->resolution;
|
||||
$result_array['trim'] = $composition->trim;
|
||||
$result_array['format'] = $composition->format;
|
||||
$result_array['bitrate'] = $composition->bitrate;
|
||||
$result_array['size'] = $composition->size;
|
||||
$result_array['duration'] = $composition->duration;
|
||||
$result_array['url'] = $composition->url;
|
||||
$result_array['links'] = $composition->links;
|
||||
return $result_array;
|
||||
}
|
||||
|
||||
function getCompositionStatus($composition_id)
|
||||
{
|
||||
$apiKeySid = TWILIO_API_KEY;
|
||||
$apiKeySecret = TWILIO_API_KEY_SECRET;
|
||||
$client = new Client($apiKeySid, $apiKeySecret);
|
||||
|
||||
$composition = $client->video->compositions($composition_id)
|
||||
->fetch();
|
||||
|
||||
echo $composition->sid;
|
||||
print($composition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -24,7 +24,8 @@ class Common_Masters_Model extends SPARQ_Model {
|
||||
if($table_constant == 'PDLOCATIONAPPROACH' || $table_constant == 'PDOFFICERRECOMMENDATIONS')
|
||||
{
|
||||
$order = $master_tables_pkid[$table_constant];
|
||||
$master_data = $this->db->SELECT('*')->FROM(constant($table_constant))->WHERE('isactive',1)->ORDER_BY('is_others')->ORDER_BY($order)->GET()->result_array();
|
||||
$master_data = $this->db->SELECT('*')->FROM(constant($table_constant))->ORDER_BY('is_others')->ORDER_BY($order)->GET()->result_array();
|
||||
|
||||
return $master_data;
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user