Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
piphone-front
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
piphone
piphone-front
Commits
01ca13e3
Commit
01ca13e3
authored
Mar 27, 2017
by
okhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding the issued at claims, and remove 5 seconds to the not before (in case we have a clock skew)
parent
81d9122f
Pipeline
#921
passed with stage
in 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/Main.php
app/Main.php
+1
-1
app/SIP.php
app/SIP.php
+1
-1
No files found.
app/Main.php
View file @
01ca13e3
...
...
@@ -70,7 +70,7 @@ class Main extends Controller {
elseif
(
$f3
->
get
(
'VERB'
)
==
'POST'
){
// Create the call
// Generate a jwt token
$token
=
JWT
::
encode
(
array
(
'api'
=>
JWT_TOKEN
,
'nbf'
=>
time
()
,
'exp'
=>
time
()
+
10
*
60
),
JWT_KEY
);
$token
=
JWT
::
encode
(
array
(
'api'
=>
JWT_TOKEN
,
'nbf'
=>
time
()
-
5
,
'exp'
=>
time
()
+
10
*
60
,
'iat'
=>
time
()
),
JWT_KEY
);
// To get the callee, we have the callee_id in the form. Using that
// to load the callee and retrieve its number.
$contact
=
Api
::
get_contact
(
$args
[
'id'
]);
...
...
app/SIP.php
View file @
01ca13e3
...
...
@@ -25,7 +25,7 @@ class SIP extends Controller {
);
$client
=
new
GuzzleHttp\Client
([
'base_uri'
=>
SIP_API
]);
try
{
$token
=
JWT
::
encode
(
array
(
'api'
=>
JWT_TOKEN
),
JWT_KEY
);
$token
=
JWT
::
encode
(
array
(
'api'
=>
JWT_TOKEN
,
'nbf'
=>
time
()
-
5
,
'exp'
=>
time
()
+
10
*
60
,
'iat'
=>
time
()
),
JWT_KEY
);
$res
=
$client
->
get
(
"calls/
$call_id
"
,
[
'query'
=>
$data
]);
$f3
->
set
(
'response'
,
(
GuzzleHttp\Psr7\copy_to_string
(
$res
->
getBody
())));
}
catch
(
RequestException
$e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment