Commit 30ca4130 authored by Ana's avatar Ana

correccion , se toma el keycard del cliente

parent 7c1a2802
...@@ -28,7 +28,6 @@ class Sms extends BaseSms ...@@ -28,7 +28,6 @@ class Sms extends BaseSms
//$FROM_EMAIL = 'no-reply@seguridadtotalmcafee.cl'; //$FROM_EMAIL = 'no-reply@seguridadtotalmcafee.cl';
//$FROM_EMAIL = 'fcastro@gearlabs.cl'; //$FROM_EMAIL = 'fcastro@gearlabs.cl';
$envioEmail = null; $envioEmail = null;
$tag = '[enviarSms]'; $tag = '[enviarSms]';
$log->debug($tag."entrando... tipoSms:$tipoSms | campana:$campana | movil:$movil | umcId:".$usuarioMcafee->getUmcId()); $log->debug($tag."entrando... tipoSms:$tipoSms | campana:$campana | movil:$movil | umcId:".$usuarioMcafee->getUmcId());
try{ try{
...@@ -49,27 +48,19 @@ class Sms extends BaseSms ...@@ -49,27 +48,19 @@ class Sms extends BaseSms
$sms->setSmsTransIdCliente ($transIdCliente); $sms->setSmsTransIdCliente ($transIdCliente);
$sms->setSmsEliminado(EnvioEmail::ELIMINADO_FALSE); $sms->setSmsEliminado(EnvioEmail::ELIMINADO_FALSE);
$sms->save(); $sms->save();
$urlDescarga = Sms::acortarUrl($url);
$url = str_replace('#CAMPANA', $campana,$url); // $urlDescarga = Sms::acortar_url($url);
$url = str_replace('#STRUSUARIO', $usuarioMcafee->getUmcParametroEncriptado(),$url);
$url = str_replace('#SMSID', $sms->getSmsId(),$url);
$url = str_replace('#PROCEDENCIA', Tracking::PROCEDENCIA_SMS,$url);
$urlAperturaTrack = str_replace('#ROUTING', 'SMStrack',$url);
$urlAperturaWeb = str_replace('#ROUTING', 'SMStracktemplate',$url);
$urlDescarga = str_replace('#ROUTING', 'descargar',$url);
//$urlDescarga = Sms::acortarUrl($urlDescarga); //$urlDescarga = $url;
$urlDescarga = Sms::acortar_url($urlDescarga);
$mensaje=$mensaje . $urlDescarga; $mensaje=$mensaje . $urlDescarga;
$post['to'] = array($movil); $post['to'] = array($movil);
$post['text'] = $mensaje; $post['text'] = $mensaje;
$post['from'] = 'McAfee'; $post['from'] = 'McAfee';
$user ='GearLabs'; $user ='GearLabs';
...@@ -93,11 +84,9 @@ class Sms extends BaseSms ...@@ -93,11 +84,9 @@ class Sms extends BaseSms
$log->debug($tag.'enviando mensaje...'. $urlDescarga); $log->debug($tag.'enviando mensaje...'. $urlDescarga);
/***************************************/ /***************************************/
/* $request = '{
/* $request = '{
"api_key":"9df2cfda7cc871680ede6ec24b4a479d", "api_key":"9df2cfda7cc871680ede6ec24b4a479d",
"report_url":"http://servidoctor.com/callback/script", "report_url":"http://servidoctor.com/callback/script",
"concat":1, "concat":1,
...@@ -105,11 +94,12 @@ class Sms extends BaseSms ...@@ -105,11 +94,12 @@ class Sms extends BaseSms
{ {
"from":"McAfee", "from":"McAfee",
"to":"584165388803", "to":"584165388803",
"text": "Descarga y participa por un SMART TV DE 50 pulgadas: http://bit.ly/2wHyOwK", "text": "Descarga y participa por un SMART TV DE 50 pulgadas: https://cutt.ly/0i41nK",
"send_at":"2018-02-18 17:30:00" "send_at":"2018-02-18 17:30:00"
} }
] ]
}'; }';
$headers = array('Content-Type: application/json'); $headers = array('Content-Type: application/json');
...@@ -161,12 +151,12 @@ class Sms extends BaseSms ...@@ -161,12 +151,12 @@ class Sms extends BaseSms
} }
public static function acortar_url($url) { /* public static function acortar_url($url) {
$usuario = "gearlabs"; $usuario = "gearlabs";
$apikey = "R_8bf0031b8f644fec93997b7b23568b76"; $apikey = "R_8bf0031b8f644fec93997b7b23568b76";
$temp = "http://api.bit.ly/v3/shorten?login=".$usuario."&apiKey=".$apikey."&uri=".$url."&format=txt"; $temp = "http://api.bit.ly/v3/shorten?login=".$usuario."&apiKey=".$apikey."&uri=".$url."&format=txt";
return file_get_contents($temp); return file_get_contents($temp);
} }*/
public static function acortarUrl($data){ public static function acortarUrl($data){
$url = "http://url.gearlabs.cl/acortar"; $url = "http://url.gearlabs.cl/acortar";
......
...@@ -37,6 +37,8 @@ class McafeeEnviarSmsCommand extends ContainerAwareCommand ...@@ -37,6 +37,8 @@ class McafeeEnviarSmsCommand extends ContainerAwareCommand
$tt = new TiempoTranscurrido(); $tt = new TiempoTranscurrido();
$fp = fopen("C:\ana3\movistarChile\prueba.csv", "r"); $fp = fopen("C:\ana3\movistarChile\prueba.csv", "r");
//$fp = fopen("/opt/sdp/intelsecuritymovistar/etc/sms/3_36460.csv", "r");
if (!$fp) { if (!$fp) {
$log->warning('Error al intentar abrir el archivo'); $log->warning('Error al intentar abrir el archivo');
...@@ -47,7 +49,7 @@ class McafeeEnviarSmsCommand extends ContainerAwareCommand ...@@ -47,7 +49,7 @@ class McafeeEnviarSmsCommand extends ContainerAwareCommand
$urlBase = 'https://www.seguridadtotalmcafee.cl'; $urlBase = 'https://www.seguridadtotalmcafee.cl';
$urlDescarga = $urlBase.'/#ROUTING/#CAMPANA/#STRUSUARIO/#PROCEDENCIA/#SMSID'; //$urlDescarga = $urlBase.'/#ROUTING/#CAMPANA/#STRUSUARIO/#PROCEDENCIA/#SMSID';
$tDesOK = 0; $tDesOK = 0;
...@@ -123,7 +125,7 @@ class McafeeEnviarSmsCommand extends ContainerAwareCommand ...@@ -123,7 +125,7 @@ class McafeeEnviarSmsCommand extends ContainerAwareCommand
$mensaje="Descarga y participa por un SMART TV DE 50: "; $mensaje="Descarga y participa por un SMART TV DE 50: ";
$urlDescarga = $usuarioMcafee->getUmcMcafeeKeycard();
$sms = Sms::enviarSms($urlDescarga, $movil, $usuarioMcafee, $batchsms, $campana, $mensaje, Sms::TIPO_MASIVO,null,$log, $this->getContainer()); $sms = Sms::enviarSms($urlDescarga, $movil, $usuarioMcafee, $batchsms, $campana, $mensaje, Sms::TIPO_MASIVO,null,$log, $this->getContainer());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment