예제 #1
0
 function index()
 {
     $data = $this->init_view_data();
     $data = array_merge($data, array('site_title' => 'OpenVBX', 'iframe_url' => site_url('/messages'), 'users' => $this->get_users(), 'twilio_js' => $this->twilio_js_baseurl . '/libs/twiliojs/1.0/' . $this->twilio_js_file, 'client_capability' => null));
     // if the 'last_known_url' cookie is set then we've been redirected IN to frames mode
     if (!empty($_COOKIE['last_known_url'])) {
         $data['iframe_url'] = $_COOKIE['last_known_url'];
         set_last_known_url('', time() - 3600);
     }
     if (!empty($this->application_sid)) {
         $user_id = intval($this->session->userdata('user_id'));
         $user = VBX_user::get(array('id' => $user_id));
         $data['client_capability'] = generate_capability_token();
     }
     // internal dev haxies
     if (function_exists('twilio_dev_mods')) {
         $data = twilio_dev_mods($data);
     }
     $data['browserphone'] = $this->init_browserphone_data($data['callerid_numbers']);
     $this->load->view('iframe', $data);
 }
예제 #2
0
 function index()
 {
     $data = $this->init_view_data();
     $twilio_js = sprintf('%s://static.twilio.com/libs/twiliojs/%s/twilio%s.js', 'http' . (is_ssl() ? 's' : ''), $this->twilio_js_version, $this->config->item('use_unminimized_js') ? '' : '.min');
     $data = array_merge($data, array('site_title' => 'OpenVBX', 'iframe_url' => site_url('/messages'), 'users' => $this->get_users(), 'twilio_js' => $twilio_js, 'client_capability' => null));
     // if the 'last_known_url' cookie is set then we've been redirected IN to frames mode
     if (!empty($_COOKIE['last_known_url'])) {
         $data['iframe_url'] = $_COOKIE['last_known_url'];
         set_last_known_url('', time() - 3600);
     }
     if (!empty($this->application_sid)) {
         $user_id = intval($this->session->userdata('user_id'));
         $user = VBX_user::get(array('id' => $user_id));
         $data['client_capability'] = generate_capability_token();
     }
     // internal dev haxies
     if (function_exists('twilio_dev_mods')) {
         $data = twilio_dev_mods($data);
     }
     $data['site_rev'] = $this->config->item('site_rev');
     $data['browserphone'] = $this->init_browserphone_data($data['callerid_numbers']);
     $this->load->view('iframe', $data);
 }