Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
piphone
piphone-sip
Commits
4841ab42
Commit
4841ab42
authored
Jan 18, 2017
by
okhin
Browse files
COrrectling cathing the Hangup event
parent
0675c446
Pipeline
#766
passed with stage
in 4 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
piphone.py
View file @
4841ab42
...
@@ -216,7 +216,7 @@ class Call(object):
...
@@ -216,7 +216,7 @@ class Call(object):
actions
=
{
'Created'
:
'call_caller'
actions
=
{
'Created'
:
'call_caller'
,
'ChannelStateChange'
:
'change'
,
'ChannelStateChange'
:
'change'
,
'ChannelDtmfReceived'
:
'dtmf'
,
'ChannelDtmfReceived'
:
'dtmf'
,
'
Hangup
'
:
'hangup'
}
,
'
ChannelHangupRequest
'
:
'hangup'
}
def
__init__
(
self
,
caller
,
callee
,
owner
,
callid
=
None
,
db
=
None
):
def
__init__
(
self
,
caller
,
callee
,
owner
,
callid
=
None
,
db
=
None
):
try
:
try
:
...
@@ -472,7 +472,6 @@ def originate(db, callid=None):
...
@@ -472,7 +472,6 @@ def originate(db, callid=None):
bottle_logger
.
exception
(
e
)
bottle_logger
.
exception
(
e
)
abort
(
400
,
"Missing or incorrect fields, the call cannot be processed"
)
abort
(
400
,
"Missing or incorrect fields, the call cannot be processed"
)
@
app
.
get
(
'/static/<filepath:path>'
)
@
app
.
get
(
'/static/<filepath:path>'
)
def
static_files
(
filepath
):
def
static_files
(
filepath
):
"""
"""
...
@@ -481,14 +480,19 @@ def static_files(filepath):
...
@@ -481,14 +480,19 @@ def static_files(filepath):
"""
"""
return
static_file
(
filepath
,
root
=
'./views'
)
return
static_file
(
filepath
,
root
=
'./views'
)
@
app
.
get
(
'/admin'
)
@
app
.
get
(
'/admin'
)
@
authenticated
def
little_admin
(
db
):
def
little_admin
(
db
):
# We need to check if we're admin
requests
=
db
.
execute
(
'SELECT admin FROM users WHERE api = ?'
,
(
request
.
params
[
'api'
]));
admin
=
admin
.
fetchall
()
if
admin
[
0
]
is
not
True
:
abort
(
403
,
"You need to have an admin access"
)
users
=
db
.
execute
(
'SELECT api, token, admin FROM users'
).
fetchall
()
users
=
db
.
execute
(
'SELECT api, token, admin FROM users'
).
fetchall
()
return
template
(
'index'
,
users
=
users
)
return
template
(
'index'
,
users
=
users
)
@
app
.
post
(
'/admin'
)
@
app
.
post
(
'/admin'
)
@
authenticated
def
medium_admin
(
db
):
def
medium_admin
(
db
):
api
=
request
.
forms
.
get
(
'api'
)
api
=
request
.
forms
.
get
(
'api'
)
token
=
request
.
forms
.
get
(
'token'
)
token
=
request
.
forms
.
get
(
'token'
)
...
...
Write
Preview
Supports
Markdown
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