Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
message-service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 0eb94787
authored
2024-04-24 12:06:22 -0300
by
juan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Agrego logica de inicio de nabegador en telefono defecto
1 parent
ca581992
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
Wpp1State.py
config.py
deploy.py
Wpp1State.py
View file @
0eb9478
...
@@ -17,11 +17,13 @@ class StatePhoneWs():
...
@@ -17,11 +17,13 @@ class StatePhoneWs():
return
(
j
)
return
(
j
)
def
Suspensor
(
self
,
data
):
def
Suspensor
(
self
,
data
,
telefono
):
"""Envia a señal al server de chrome para levantar el navegador"""
"""Envia a señal al server de chrome para levantar el navegador"""
url
=
data
[
'chrome_service'
]
url
=
data
[
'chrome_service'
]
if
url
in
[
False
,
None
,
""
,
" "
,
"none"
,
"None"
]:
if
url
in
[
False
,
None
,
""
,
" "
,
"none"
,
"None"
]:
return
()
if
not
telefono
in
config
.
WsClientesBrowser
.
keys
():
return
()
#Si no tengo el telefono en la lista salgo
url
=
config
.
WsClientesBrowser
[
telefono
]
try
:
try
:
print
(
"#"
)
print
(
"#"
)
r
=
requests
.
get
(
url
)
r
=
requests
.
get
(
url
)
...
@@ -37,8 +39,12 @@ class StatePhoneWs():
...
@@ -37,8 +39,12 @@ class StatePhoneWs():
disponible no se almasena y la proxima respuesta debera hacerse contra el server
disponible no se almasena y la proxima respuesta debera hacerse contra el server
remoto para asegurarme de q se solucione el problema"""
remoto para asegurarme de q se solucione el problema"""
if
data
:
if
data
:
self
.
Suspensor
(
data
)
self
.
Suspensor
(
data
,
telefono
)
test
=
self
.
revisarCache
(
telefono
)
test
=
self
.
revisarCache
(
telefono
)
if
telefono
in
config
.
WsClientesBrowser
.
keys
()
and
data
==
False
:
print
(
"salto prueba de telefono defecto queda en cola pero lanzador de inicio de browser"
)
self
.
Suspensor
({
"chrome_service"
:
None
},
telefono
)
#Para iniciar el telefono defecto
return
config
.
resp_defect_int
if
not
test
==
False
:
if
not
test
==
False
:
return
(
test
)
return
(
test
)
W
=
self
.
chequear_stado_WB
(
telefono
)
W
=
self
.
chequear_stado_WB
(
telefono
)
...
...
config.py
View file @
0eb9478
WS_URL
=
"https://www.waboxapp.com/api/send/"
WS_URL
=
"https://www.waboxapp.com/api/send/"
WS_Status
=
"https://www.waboxapp.com/api/status/"
WS_Status
=
"https://www.waboxapp.com/api/status/"
WS_token
=
"fd378337aebead91c2eb25209aa51a7d5ce9754ea1718"
WS_token
=
"fd378337aebead91c2eb25209aa51a7d5ce9754ea1718"
WS_uid
=
"5493412641022"
#Telefono de salida
FILE_server
=
"https://img.hgtsa.com.ar/"
FILE_server
=
"https://img.hgtsa.com.ar/"
SMTP_username
=
"anac.avisos@gmail.com"
SMTP_username
=
"anac.avisos@gmail.com"
SMTP_password
=
"
xvc7733455
"
SMTP_password
=
"
alfk ozgs yita irur
"
SMTP_HOST
=
"smtp.gmail.com"
SMTP_HOST
=
"smtp.gmail.com"
SMTP_PORT
=
587
SMTP_PORT
=
587
SMS_URL
=
"http://192.168.15.120:8080/v1/sms/send/"
SMS_URL
=
"http://192.168.15.120:8080/v1/sms/send/"
...
@@ -13,3 +12,9 @@ db = "/dev/shm/messages.db"
...
@@ -13,3 +12,9 @@ db = "/dev/shm/messages.db"
TimeQueqe
=
30
TimeQueqe
=
30
LimiteDiario
=
200
LimiteDiario
=
200
ArchivoLimitesHosts
=
"limites.json"
ArchivoLimitesHosts
=
"limites.json"
WS_uid
=
"5493412671594"
#Telefono de salida
WsClientesBrowser
=
{
"5493412671594"
:
"http://192.168.15.246:13434/"
,
5493412671594
:
"http://192.168.15.246:13434/"
}
resp_defect_int
=
{
'success'
:
True
,
'uid'
:
WS_uid
,
'hook_url'
:
None
,
'alias'
:
'HGT SA Notificaciones'
,
'platform'
:
'android'
,
'battery'
:
None
,
'plugged'
:
None
,
'locale'
:
'-'
}
deploy.py
View file @
0eb9478
...
@@ -46,7 +46,7 @@ def key():
...
@@ -46,7 +46,7 @@ def key():
@app.route
(
"/state/<tel>"
,
methods
=
[
'GET'
,
'POST'
])
@app.route
(
"/state/<tel>"
,
methods
=
[
'GET'
,
'POST'
])
def
estadoWabox
(
tel
):
def
estadoWabox
(
tel
):
print
(
tel
)
print
(
tel
)
if
tel
==
"default"
:
if
tel
==
"default"
:
#El telefono defecto se manda a iniciar pero no se chequea aca
xi
=
TelState
.
ChequearTelefono
(
config
.
WS_uid
)
xi
=
TelState
.
ChequearTelefono
(
config
.
WS_uid
)
else
:
else
:
xi
=
TelState
.
ChequearTelefono
(
tel
)
xi
=
TelState
.
ChequearTelefono
(
tel
)
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment