import java.io.*; import java.net.*; public class Echoclient { public static void main(String[] args) throws IOException { Socket echoSocket = null; PrintWriter out = null; BufferedReader in = null; BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in)); String userInput; try { echoSocket = new Socket("192.168.1.85", 5038); out = new PrintWriter(echoSocket.getOutputStream(), true); in = new BufferedReader(new InputStreamReader(echoSocket.getInputStream())); } catch (UnknownHostException e) { System.err.println("Don't know about host: 127.0.0.1."); System.exit(1); } catch (IOException e) { System.err.println("Couldn't get I/O for " + "the connection to: taranis."); System.exit(1); } // out.print(); out.print("Action: login \r\n"); out.print("Username: admin \r\n"); out.print("Secret: amp111 \r\n\r\n"); //out.print("Action: Originate"); //out.print("Channel: SIP/NBE/9500034055"); //out.print("Context: from-internal"); //out.print("Exten: 333"); //out.print("Priority: 1"); //out.print("Callerid: 9500034055"); //out.print("Timeout: 30000 \n\n"); int i=0; while (i==0) { System.out.println(in.readLine()); } out.close(); in.close(); stdIn.close(); echoSocket.close(); } }