Explorar el Código

FD3-471 config default para profile

Guillermo Espinoza hace 7 años
padre
commit
7bd60f4c99
Se han modificado 2 ficheros con 87 adiciones y 3 borrados
  1. 63 0
      app/config/profile.yml
  2. 24 3
      src/CablemodemBundle/Entity/Profile.php

+ 63 - 0
app/config/profile.yml

@@ -0,0 +1,63 @@
+downstream : 256000
+upstream : 256000
+docsis_key : "cmts-default"
+sipDevProxyServer : "10.10.0.1"
+sipDevRegistrar   : "10.10.0.1"
+ServerVoIP_IP	  : "10.10.0.1"
+ServerProv_IP     : "10.10.0.1"
+tel_prefijo : 4 
+
+max_cpe: 3
+ServerProv_IP : "10.10.0.1"
+
+#IP y MASCARA PARTICULAR #1 a excluir del ancho de banda asignado al cablemodem: asociada a plantilla models y perfiles (donde se asigna 1Mb si la velocidad del CM es menor a 1Mb)
+#Descomentar/Comentadar las lineas para activar/desactivar dicha exclusion
+#Red1_a_excluir_ip            :       200.45.173.112
+#Red1_a_excluir_mascara               :       255.255.255.248
+
+
+#IP y MASCARA PARTICULAR #2 a excluir del ancho de banda asignado al cablemodem: asociada a plantilla models y perfiles (donde se asigna 1Mb si la velocidad del CM es menor a 1Mb)
+#Descomentar/Comentadar las lineas para activar/desactivar dicha exclusion
+#Red2_a_excluir_ip            :       200.45.173.112
+#Red2_a_excluir_mascara               :       255.255.255.248
+
+#IP y MASCARA de RED VOIP a excluir del ancho de banda asignado al cablemodem (en casos como MGCP el flujo de datos en una llamada MTA a MTA podria no pasar por el ServerVoIP: asociada a plantilla models y perfiles (donde se asigna 1Mb si la velocidad del CM es menor a 1Mb)
+#Descomentar/Comentadar las lineas para activar/desactivar dicha exclusion
+#RedVOIP_ip           :       10.70.0.1
+#RedVOIP_mascara              :       255.255.0.0
+
+#Ancho de banda para redes especiales antes comentadoas: Particular 1 y 2, ServerProv, ServerVoip, etc. De no definirse estas variables, se tomara en su lugar 1Mbps.
+#Descomentar/Comentadar las lineas para activar/desactivar el ancho de banda particular. Expresado en bps.
+DS_MaxRateSustained  :       1000000
+US_MaxRateSustained  :       1000000
+
+#Parametros para redireccionar la acciones de correo a webservices en otro servidor
+emailalias_wsdl :  http://localhost/wsdl/emailalias.php?class=EmailAliasServiceManager&wsdl
+email_wsdl :  http://localhost/wsdl/email.php?class=EmailServiceManager&wsdl
+
+radius_wsdl :  http://localhost/wsdl/radius.php?class=AccessServiceManager&wsdl
+
+#Direccion del WS donde se actualizara la zona DNS MTA (mta.hostname) (de no definir dicha variable Fldt Net utiliza localhost)
+dns_soap_wsdl : http://localhost/wsdl/dns.php?class=DNSServiceManager&wsdl
+voip_wsdl : http://localhost/wsdl/voip.php?wsdl
+#Direccion del WS donde se actualizara MGCP  (de no definir dicha variable Fldt Net utiliza localhost)
+## mgcp_soap_wsdl : http://voip.cablenettv.com.ar/ServerVoip/MgcpSoap?wsdl
+#Direccion del WS donde se actualizara SIP  (de no definir dicha variable Fldt Net utiliza localhost)
+## sip_soap_wsdl  : http://voip.cablenettv.com.ar/ServerVoip/VoipSoap?wsdl
+
+
+#Shared Secret para todos los binarios docsis
+docsis_key          :   cmts-default
+
+#SNMP Filter 1 - Flowdat: Descomentar las sgtes lineas para modificar la config. del filtro SNMP en los CMs. De mantenerlas comentadas, se utilizaran los valores indicados por default. Este filtro SNMP permitira solo respuestas SNMP por la interface HFC del CM.
+#SnmpCfgAccess1_ip            :       200.50.175.128              #default $ServerProv_IP
+#SnmpCfgAccess1_netmask       :       255.255.255.224        #default 255.255.255.255
+#SnmpCfgAccess1_community     :       public                 #default public
+#
+##SNMP Filder 2 - Optional: Descomentar las sgtes lineas para habilitar un segundo filtro SNMP en los CMs. (utilizado en casos de que el cliente desee realizar consultas SNMP desde otro Server/IP). Este filtro SNMP permitira solo respuestas SNMP por la interface HFC del CM.
+#SnmpCfgAccess2_ip            :       200.50.175.29  #sin default
+#SnmpCfgAccess2_netmask       :       255.255.255.255 #sin default
+#SnmpCfgAccess2_community     :       public          #sin default
+COPS:
+   Upstream:
+       

+ 24 - 3
src/CablemodemBundle/Entity/Profile.php

@@ -8,6 +8,7 @@ use Doctrine\ORM\Mapping as ORM;
 use ExtraDataBundle\Entity\Traits\ExtraDataTrait;
 use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
 use Symfony\Component\Validator\Constraints as Assert;
+use Symfony\Component\Yaml\Yaml;
 
 /**
  * @ORM\Entity
@@ -111,7 +112,7 @@ class Profile  implements TenancyIdTraitInterface
      */
     public function getDownstream()
     {
-        return $this->downstream;
+        return $this->downstream ? $this->downstream : $this->getDefault('downstream');
     }
 
     /**
@@ -119,7 +120,7 @@ class Profile  implements TenancyIdTraitInterface
      */
     public function getUpstream()
     {
-        return $this->upstream;
+        return $this->upstream ? $this->upstream : $this->getDefault('upstream');
     }
 
     /**
@@ -143,7 +144,7 @@ class Profile  implements TenancyIdTraitInterface
      */
     public function getMaxCpe()
     {
-        return $this->maxCpe;
+        return $this->maxCpe ? $this->maxCpe : $this->getDefault('max_cpe');
     }
 
     /**
@@ -218,4 +219,24 @@ class Profile  implements TenancyIdTraitInterface
         return $this;
     }
 
+
+    /**
+     * @param string $name
+     *
+     * @return mixed
+     */
+    public function getDefault($name = null)
+    {
+        global $kernel;
+        $dir = $kernel->getProjectDir();
+        $values = Yaml::parse(file_get_contents("{$dir}/app/config/profile.yml"));
+
+        $value = null;
+        if (!is_null($name) && isset($values[$name])) {
+            $value = $values[$name];
+        }
+
+        return $value;
+    }
+
 }