Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smsManager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
smsManager
Commits
504f619e
Commit
504f619e
authored
Jul 17, 2019
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prueba
parent
866cbbdf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
74 deletions
+68
-74
src/BackendBundle/Controller/EnvioSmsController.php
src/BackendBundle/Controller/EnvioSmsController.php
+68
-74
No files found.
src/BackendBundle/Controller/EnvioSmsController.php
View file @
504f619e
...
@@ -6,23 +6,20 @@ use FOS\RestBundle\Controller\FOSRestController;
...
@@ -6,23 +6,20 @@ use FOS\RestBundle\Controller\FOSRestController;
use
AppBundle\Lib\Utiles
;
use
AppBundle\Lib\Utiles
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpFoundation\Response
;
use
Sensio\Bundle\FrameworkExtraBundle\Configuration\Route
;
use
Sensio\Bundle\FrameworkExtraBundle\Configuration\Route
;
//use Symfony\Component\Routing\Annotation\Route;
//use Symfony\Component\Routing\Annotation\Route;
use
AppBundle\Model\NotificaQuery
;
use
AppBundle\Model\NotificaQuery
;
use
AppBundle\Model\Notifica
;
use
AppBundle\Model\Notifica
;
use
AppBundle\Model\RespuestasSmsQuery
;
use
AppBundle\Model\RespuestasSmsQuery
;
use
AppBundle\Model\RespuestasSms
;
use
AppBundle\Model\RespuestasSms
;
require_once
__DIR__
.
'/../../../vendor/autoload.php'
;
require_once
__DIR__
.
'/../../../vendor/autoload.php'
;
use
FOS\RestBundle\View\View
;
use
FOS\RestBundle\View\View
;
//use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
//use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
class
EnvioSmsController
extends
FOSRestController
{
class
EnvioSmsController
extends
FOSRestController
{
//* @Route("/enviar")
//* @Route("/enviar")
public
function
indexAction
(
$id
)
{
public
function
indexAction
(
$id
)
{
...
@@ -31,7 +28,6 @@ class EnvioSmsController extends FOSRestController {
...
@@ -31,7 +28,6 @@ class EnvioSmsController extends FOSRestController {
return
$this
->
handleView
(
$view
);
return
$this
->
handleView
(
$view
);
}
}
// * @Route("/enviar")
// * @Route("/enviar")
// * @Method({"POST"})
// * @Method({"POST"})
...
@@ -63,7 +59,6 @@ class EnvioSmsController extends FOSRestController {
...
@@ -63,7 +59,6 @@ class EnvioSmsController extends FOSRestController {
return
$this
->
enviarMensaje
(
$campana
,
$telefono
,
$mensaje
,
$usuario
,
$password
,
$url
,
$from
,
$idmetodo
);
return
$this
->
enviarMensaje
(
$campana
,
$telefono
,
$mensaje
,
$usuario
,
$password
,
$url
,
$from
,
$idmetodo
);
}
else
{
//teltech
}
else
{
//teltech
if
(
$idmetodo
==
2
)
{
if
(
$idmetodo
==
2
)
{
$log
->
debug
(
'Selecciona Teltech'
);
$log
->
debug
(
'Selecciona Teltech'
);
...
@@ -79,7 +74,7 @@ class EnvioSmsController extends FOSRestController {
...
@@ -79,7 +74,7 @@ class EnvioSmsController extends FOSRestController {
}
}
private
function
enviarMensaje
(
$campana
,
$movil
,
$mensaje
,
$usuario
,
$password
,
$url
,
$from
,
$proveedor
)
{
private
function
enviarMensaje
(
$campana
,
$movil
,
$mensaje
,
$usuario
,
$password
,
$url
,
$from
,
$proveedor
)
{
try
{
$log
=
Utiles
::
setLog
(
'BackendBundle'
,
'backend/backend'
);
$log
=
Utiles
::
setLog
(
'BackendBundle'
,
'backend/backend'
);
...
@@ -145,6 +140,7 @@ class EnvioSmsController extends FOSRestController {
...
@@ -145,6 +140,7 @@ class EnvioSmsController extends FOSRestController {
}
}
}
}
$log
->
debug
(
'Grabar en respuestaSms'
);
$log
->
debug
(
'Grabar en respuestaSms'
);
try
{
$respuestaSms
=
new
RespuestasSms
();
$respuestaSms
=
new
RespuestasSms
();
$respuestaSms
->
setResCampana
(
$campana
);
$respuestaSms
->
setResCampana
(
$campana
);
$respuestaSms
->
setResProveedorSms
(
$proveedor
);
$respuestaSms
->
setResProveedorSms
(
$proveedor
);
...
@@ -156,8 +152,7 @@ class EnvioSmsController extends FOSRestController {
...
@@ -156,8 +152,7 @@ class EnvioSmsController extends FOSRestController {
return
$resp
;
return
$resp
;
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$log
=
Utiles
::
setLog
(
'exception'
);
$log
->
debug
(
'exception: '
.
print_r
(
$e
,
true
));
$log
->
debug
(
'exception: '
.
$e
);
}
}
}
}
...
@@ -181,7 +176,6 @@ class EnvioSmsController extends FOSRestController {
...
@@ -181,7 +176,6 @@ class EnvioSmsController extends FOSRestController {
return
$messageId
;
return
$messageId
;
}
}
// * @Route("/buscarstatus")
// * @Route("/buscarstatus")
// * @Method({"POST"})
// * @Method({"POST"})
public
function
buscarStatusAction
()
{
public
function
buscarStatusAction
()
{
...
@@ -218,8 +212,8 @@ class EnvioSmsController extends FOSRestController {
...
@@ -218,8 +212,8 @@ class EnvioSmsController extends FOSRestController {
if
(
$result
[
'events'
])
{
if
(
$result
[
'events'
])
{
$status
=
json_decode
(
$result
[
'events'
][
0
][
'message'
],
true
);
$status
=
json_decode
(
$result
[
'events'
][
0
][
'message'
],
true
);
$telefono
=
$status
[
'delivery'
][
'destination'
];
$telefono
=
$status
[
'delivery'
][
'destination'
];
$estado
=
$status
[
'status'
];
$estado
=
$status
[
'status'
];
$notifica
=
new
Notifica
();
$notifica
=
new
Notifica
();
...
@@ -241,8 +235,8 @@ class EnvioSmsController extends FOSRestController {
...
@@ -241,8 +235,8 @@ class EnvioSmsController extends FOSRestController {
$telefono
=
''
;
$telefono
=
''
;
if
(
$result
[
'events'
])
{
if
(
$result
[
'events'
])
{
$status
=
json_decode
(
$result
[
'events'
][
0
][
'message'
],
true
);
$status
=
json_decode
(
$result
[
'events'
][
0
][
'message'
],
true
);
$telefono
=
$status
[
'delivery'
][
'destination'
];
$telefono
=
$status
[
'delivery'
][
'destination'
];
$estado
=
$status
[
'status'
];
$estado
=
$status
[
'status'
];
$notifica
=
new
Notifica
();
$notifica
=
new
Notifica
();
...
@@ -263,7 +257,6 @@ class EnvioSmsController extends FOSRestController {
...
@@ -263,7 +257,6 @@ class EnvioSmsController extends FOSRestController {
}
}
}
}
// * @Route("/notifica/{idenvio}/{tel}/{estado}")
// * @Route("/notifica/{idenvio}/{tel}/{estado}")
public
function
notificaAction
(
$idenvio
,
$tel
,
$estado
)
{
public
function
notificaAction
(
$idenvio
,
$tel
,
$estado
)
{
...
@@ -274,4 +267,5 @@ class EnvioSmsController extends FOSRestController {
...
@@ -274,4 +267,5 @@ class EnvioSmsController extends FOSRestController {
$notifica
->
save
();
$notifica
->
save
();
}
}
}
}
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