GatewayStatusNotification statusNotification = new GatewayStatusNotification();
OutboundMessage msg;
System.out.println("Example: Send message through Kannel HTTP Interface.");
System.out.println(Library.getLibraryDescription());
System.out.println("Version: " + Library.getLibraryVersion());
KannelHTTPGateway gateway = new KannelHTTPGateway("mysmsc", "http://localhost:13013/cgi-bin/sendsms", "simple", "elpmis");
// Uncomment in order gateway to start and stop SMSC automatically on Kannel
//gateway.setAutoStartSmsc(true);
//gateway.setAutoStopSmsc(true);
// Set Kannel's Admin URL and password to be used starting, stopping and checking SMSC status
gateway.setAdminUrl("http://localhost:13000");
gateway.setAdminPassword("bar");
gateway.setOutbound(true);
Service.getInstance().addGateway(gateway);
Service.getInstance().setGatewayStatusNotification(statusNotification);
Service.getInstance().startService();
// Send a message.
msg = new OutboundMessage("+967712831950", "Hello from SMSLib (Kannel handler)");