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
a2c99ff6
Commit
a2c99ff6
authored
Jan 11, 2017
by
okhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Populating the feedback SIP function and mapping it
parent
54a04408
Pipeline
#737
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
app/Main.php
app/Main.php
+17
-1
app/routes.ini
app/routes.ini
+1
-1
No files found.
app/Main.php
View file @
a2c99ff6
...
...
@@ -55,9 +55,25 @@ class Main extends Controller {
/*
* Feedback SIP function
* Get a feedback from the SIP system - status of a call for instance
* GET: get the call back
*/
function
feedbacksip
(
$f3
,
$args
)
{
//GET
$token
=
JWT
::
encode
(
array
(
'api'
=>
JWT_TOKEN
),
JWT_KEY
);
$call_id
=
$args
[
'callid'
];
// Create the call
$data
=
array
(
'api'
=>
'piphone'
,
'token'
=>
$token
);
$client
=
new
GuzzleHttp\Client
([
'base_uri'
=>
SIP_API
]);
try
{
$res
=
$client
->
get
(
"calls/
$call_id
"
,
[
'query'
=>
$data
]);
return
(
$res
->
getBody
());
}
catch
(
RequestException
$e
)
{
echo
Psr7\str
(
$e
->
getRequest
());
if
(
$e
->
hasResponse
())
{
echo
Psr7\str
(
$e
->
getResponse
());
}
}
}
/*
...
...
app/routes.ini
View file @
a2c99ff6
...
...
@@ -4,7 +4,7 @@ GET @home:/=Main->home
GET|POST
@feedback:/
feedback
=
Main->feedbackform
GET|POST
@call:/call/@
id
=
Main->call
GET
@contactslist:/
contactslist
=
Main->contactslist
POST
@feedbacksip:/
feedbacksip
=
Main->feedbacksip
GET
@feedbacksip:/feedbacksip/@
callid
=
Main->feedbacksip
GET
@argumentation:/
argumentation
=
Main->argumentation
; Fake REST API
...
...
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