public static void main(String[] args) {  
	//загрузка настроек для интерфейса
	  try {
			getConfig();
		} catch (IOException e) {
			e.printStackTrace();
		}
		//установка скина для приложения
	  java.awt.EventQueue.invokeLater(new Runnable() {
		    public void run() {
		            try {
		            	SubstanceLookAndFeel laf = new SubstanceMarinerLookAndFeel();
		                UIManager.setLookAndFeel(laf);
		                String skinClassName = "org.pushingpixels.substance.api.skin."+skin+"Skin";
		                SubstanceLookAndFeel.setSkin(skinClassName);
		                JDialog.setDefaultLookAndFeelDecorated(true);
		                
		            } catch (UnsupportedLookAndFeelException e) {
		                throw new RuntimeException(e);
		            }
		    }
		    });
	  //главная функция программы
	  java.awt.EventQueue.invokeLater(new Runnable() {
		    @SuppressWarnings("static-access")
			public void run() {
	               frame = new MainFrame(); 
                   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
                   frame.setVisible(true); 
	             
                   try{
	                  @SuppressWarnings("resource")
					Socket telnet = new Socket(Phone.AsteriskIp, 5038);
	                  telnet.setKeepAlive(true);
                      telnetWriter = new PrintWriter(telnet.getOutputStream());
                      telnetReader = new BufferedReader(new InputStreamReader(telnet.getInputStream()));
                  
                      telnetWriter.print("Action: login\r\n");
                      telnetWriter.print("UserName: "+Phone.ReadUser+"\r\n");
                      telnetWriter.print("Secret: "+Phone.ReadUserPassword+"\r\n\r\n");           
                      telnetWriter.flush();     
                      
                      } 
                  catch (SocketException e1) {
                      e1.printStackTrace();}
                  catch (IOException e1) {
                      e1.printStackTrace();}

                   AsteriskThread = new AsteriskThread();
                   AsteriskThread.start();
		    	}

	    });

  }