Commit d0b79eec authored by nico's avatar nico Committed by okhin

Generate a token for piphone-sip api

Add a requirement on firebase/php-jwt for that purpose
parent b9ade59b
app/config.php app/config.php
tests/tmp tests/tmp
*~ *~
vendor vendor/
composer.lock composer.lock
tmp/
<?php <?php
use \Firebase\JWT\JWT;
class Main extends Controller { class Main extends Controller {
/* /*
* Home page * Home page
...@@ -30,6 +32,9 @@ class Main extends Controller { ...@@ -30,6 +32,9 @@ class Main extends Controller {
$contact_id = $f3->get('POST.contact_id'); $contact_id = $f3->get('POST.contact_id');
$f3->set("contact_id", $contact_id); $f3->set("contact_id", $contact_id);
// Generate a jwt token
$token = JWT::encode(array('api' => JWT_TOKEN), JWT_KEY);
//TODO: create call //TODO: create call
//TODO: start call //TODO: start call
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
define("CAMPAIGN_ID","1"); define("CAMPAIGN_ID","1");
define("API_BASE","http://localhost/restapi/"); define("API_BASE","http://localhost/restapi/");
define("API_TIMEOUT","1"); define("API_TIMEOUT","1");
define("JWT_KEY", "YOUR_KEY");
define("JWT_TOKEN", "YOUR_TOKEN");
/* TODO : remove this in production ;) */ /* TODO : remove this in production ;) */
error_reporting(E_ALL|E_WARNING); error_reporting(E_ALL|E_WARNING);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="col-md-8"> <div class="col-md-8">
<!-- titre --> <!-- titre -->
<div> <div>
<h1 class="text-center" id="name">{{ @contact.first_name }} <br class="visible-xs-block">{{ @contact.last_name }}</h2> <h1 class="text-center" id="name">{{ @contact.first_name }} <br class="visible-xs-block">{{ @contact.last_name }}</h1>
<!-- actions --> <!-- actions -->
<div class="text-center row"> <div class="text-center row">
<p class="lead text-center"> <p class="lead text-center">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment