public MainForm() { InitializeComponent(); // Se carga la configuración por default de la interface datosConexion = new Dictionary <DatosConexion, string>(); datosConexion.Add(DatosConexion.mainIPCC, "172.17.102.1"); datosConexion.Add(DatosConexion.backupIPCC, "172.17.102.1"); datosConexion.Add(DatosConexion.timeOut, "5000"); datosConexion.Add(DatosConexion.webServiceURL, "https://172.17.102.2:8643/eds/services/ECUWebService"); datosConexion.Add(DatosConexion.backupServiceURL, "https://172.17.102.2:8643/eds/services/ECUWebService"); datosConexion.Add(DatosConexion.accessCode1, "90001"); datosConexion.Add(DatosConexion.accessCode2, "90002"); datosConexion.Add(DatosConexion.transferCode, "30007"); datosConexion.Add(DatosConexion.outboundPrefix, ""); datosConexion.Add(DatosConexion.extensionPrefix, ""); datosConexion.Add(DatosConexion.extensionLenght, "8"); // Se cargan los datos de conexión con el WS de Promad datosConexion.Add(DatosConexion.urlPromad, "http://192.168.56.1:8080/ModuloIPCC/spring-ws/EventosTelefonia.wsdl"); datosConexion.Add(DatosConexion.timeOutPromad, "5000"); // Se intenta cargar los dato de configuración conf = new ArchivoConfiguracion(System.IO.Path.GetDirectoryName(Application.ExecutablePath)); conf.LeerArchivoConfiguracion(datosConexion); // Se genera el dialogo de configuración configuracion = new ConfiguracionForm(datosConexion, conf); // Se genera la interface de conexión cliente = new InterfaceHuawei(); cliente.inicializarDatosConexion( datosConexion[DatosConexion.mainIPCC], datosConexion[DatosConexion.backupIPCC], Int16.Parse(datosConexion[DatosConexion.timeOut]), datosConexion[DatosConexion.webServiceURL], datosConexion[DatosConexion.backupServiceURL], datosConexion[DatosConexion.accessCode1], datosConexion[DatosConexion.accessCode2], datosConexion[DatosConexion.outboundPrefix], datosConexion[DatosConexion.extensionPrefix], Int16.Parse(datosConexion[DatosConexion.extensionLenght]), datosConexion[DatosConexion.transferCode], this); textIDAgente.Text = "106"; textExtension.Text = "10006"; toolStripStatusConexion.Text = "Sin inicializar"; // Se inicializa la interface de comunicaciones servidor = new SocketServer(cliente, datosConexion[DatosConexion.urlPromad], Int16.Parse(datosConexion[DatosConexion.timeOutPromad])); servidor.AbrirPuerto("0.0.0.0", 8889); }
public OperacionesTelefonia(Socket socket, InterfaceHuawei cliente) : base(socket) { try { clienteHuawey = cliente; } catch (Exception err) { // Se detecto un error en el procedimiento errMsg = "EXCEPCION: " + err.Message; logger.Error("Error en la generación del objeto. " + err.Message); } }
public SocketServer(InterfaceHuawei cliente, string urlPromad, int timeOutPromad) { try { errMsg = ""; activo = false; this.clienteHuawei = cliente; this.urlPromad = urlPromad; this.timeOutPromad = timeOutPromad; } catch (Exception err) { // Se detecto un error en el procedimiento errMsg = "EXCEPCION: " + err.Message; logger.Error("Error en la construcción del objeto. {0}", err.Message, err); } }